User Tools

Site Tools


add_tile

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
add_tile [2017/07/29 19:00] – created justinadd_tile [2021/04/21 18:57] justin
Line 1: Line 1:
 ======Add Tile====== ======Add Tile======
 ---- ----
 +
 +Adds a [[tile|tile]] at the specified [[coordinate|coordinate]] within the [[map|map]] (if a [[tile|tile]] does not already exist at that [[coordinate|coordinate]]). The [[entity|entity]] ID is optional and will be assigned to the new [[tile|tile]] if supplied.
 +
 +====Signature:====
 +<code python>
 +add_tile(model_name, coordinate, entity_id)
 +</code>
 +
 +^Argument^Description^Type^Required^
 +|model_name|Model to use for the new [[tile|tile]].|[[string|String]]|Yes|
 +|coordinate|Position of the new [[tile|tile]].|[[coordinate|Coordinate]]|Yes|
 +|entity_id|Unique [[entity|entity]] ID that will be assigned.|[[string|String]]|No|
 +
 +<WRAP center round info 100%>
 +After adding a new [[tile|tile]], you can use the [[modify_navigation|Modify Navigation]] function to make the [[tile|tile]] walkable from any adjacent [[tile|tiles]]. For example, if you add a bridge [[tile|tile]] on top of a river, you'll need to update the [[navigation_and_interaction|navigation]] to allow the [[character|characters]] to walk across it.
 +</WRAP>
 +
 +====Example:====
 +<code bauxite>
 +add_tile("wooden_floor_02", coord[10, 0, -1], "bridge");
 +</code>
 +//Results:// A new [[tile|tile]], using model "wooden_floor_02", will be added to the [[map|map]] at [[coordinate|coordinate]] (10, 0, -1) and given an ID of "bridge".
 +
 +<WRAP center round tip 100%>
 +Use the **Add Tile** function to place a bridge across a river or chasm after the player performs a certain action, opening up a new area for them to explore.
 +</WRAP>
 +
 +----
 +
 +<WRAP group>
 +<WRAP half column>
 +====Editor Node:====
 +{{:add_tile_node.png?nolink|}}
 +</WRAP>
 +
 +<WRAP half column>
 +====Visual Demo:====
 +{{:add_tile_demo.gif?nolink|}}
 +</WRAP>
 +</WRAP>
  
 ~~NOTOC~~ ~~NOTOC~~
add_tile.txt · Last modified: 2023/01/02 21:13 by justin