This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
request_coordinate [2022/03/14 21:19] – justin | request_coordinate [2022/03/14 21:43] (current) – justin | ||
---|---|---|---|
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 adjusting up/ | + | |step_z|Amount to change the Z [[coordinate]] by when adjusting up/ |
- | |validation_func|Name of custom function that is called to validate the coordinate at the current cursor location. If supplied, this function should have one input argument, into which the current coordinate will be passed.|[[String]]|No| | + | |validation_func|Name of custom function that is called to validate the [[coordinate]] at the current cursor location. If supplied, this function should have one input argument, into which the current |
====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%> | ||
- | Use the **Request Coordinate** function as a way for the player to dynamically place tiles into the world, for example to build walls, bridges, or even houses! | + | Use the **Request Coordinate** function as a way for the player to dynamically place tiles into the world, for example to build walls, bridges, or even houses. |
</ | </ | ||