This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
request_coordinate [2022/03/14 21:15] – justin | request_coordinate [2022/03/14 21:39] – justin | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- | ---- | ||
- | Prompts the player for a [[tile]] [[coordinate]] using a 3D selection cursor. The selected [[coordinate]] is returned by this function and can be stored into a property or variable for further action. While the selection cursor is active, the player can adjust it up and down using the move forward/ | + | Prompts the player for a [[tile]] [[coordinate]] using a 3D selection cursor. The selected [[coordinate]] is returned by this function and can be stored into a property or variable for further action. While the selection cursor is active, the player can adjust it up and down using the move forward/ |
====Signature: | ====Signature: | ||
Line 10: | Line 10: | ||
^Argument^Description^Type^Required^ | ^Argument^Description^Type^Required^ | ||
- | |start_z|Initial Z coordinate of the selection cursor.|[[Number]]|Yes| | + | |start_z|Initial Z [[coordinate]] of the selection cursor.|[[Number]]|Yes| |
- | |min_z|Minimum Z coordinate allowed.|[[Number]]|Yes| | + | |min_z|Minimum Z [[coordinate]] allowed.|[[Number]]|Yes| |
- | |max_z|Maximum Z coordinate allowed.|[[Number]]|Yes| | + | |max_z|Maximum Z [[coordinate]] allowed.|[[Number]]|Yes| |
- | |step_z|Amount to change the Z coordinate by when incrementing | + | |step_z|Amount to change the Z [[coordinate]] by when adjusting |
- | |validation_func|Name of custom function that is called to validate the coordinate at the current cursor location. | + | |validation_func|Name of custom function that is called to validate the [[coordinate]] at the current cursor location. |
====Example: | ====Example: | ||
<code bauxite> | <code bauxite> | ||
- | request_coordinate(0, | + | function validate_coord($selected) begin |
+ | if tile[$selected.x, | ||
+ | return false; | ||
+ | end; | ||
+ | $valid_coords = array[coord[7, | ||
+ | return $valid_coords contains $selected; | ||
+ | end; | ||
+ | $result = request_coordinate(0, | ||
</ | </ | ||
// | // | ||
- | Prompts the player for a [[tile]] [[coordinate]], | + | Prompts the player for a [[tile]] [[coordinate]], |
<WRAP center round tip 100%> | <WRAP center round tip 100%> |