User Tools

Site Tools


platforms

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
platforms [2019/12/16 19:07] justinplatforms [2021/04/21 20:14] (current) justin
Line 6: Line 6:
 {{:wiki:platform_example.gif?nolink|}} {{:wiki:platform_example.gif?nolink|}}
  
-To enable this functionality, select the desired [[tile]] in the [[Map Editor]] and toggle the "Moving Platform" setting to "On" from the [[Entity Properties]] panel. Once this option has been enabled, a section will appear with settings for configuring the behavior of the moving platform. The movement speed of platforms is measured in [[voxel]] units per second, similar to the movement speed of [[character|characters]].+To enable this functionality, select the desired [[tile]] in the [[Map Editor]] and toggle the "Moving Platform" option to "On" from the [[Entity Properties]] panel. Once this option has been enabled, a section will appear with settings for configuring the behavior of the moving platform. The movement speed of platforms is measured in [[voxel]] units per second, similar to the movement speed of [[character|characters]].
  
 {{:wiki:platform_settings.png?nolink|}} {{:wiki:platform_settings.png?nolink|}}
Line 15: Line 15:
 {{:wiki:platform_add_waypoint.png?nolink|}} {{:wiki:platform_add_waypoint.png?nolink|}}
  
-Whenever a platform leaves its current location, any current navigation paths will be disconnected. To minimize the need for scripting after a platform tile has moved to a new waypoint, you can define actions that will connect new  navigation paths by clicking the "Add" button ({{:wiki:add.png?nolink|}}) next to the "On Arrival" text (located below a waypoint's name). Once it reaches its destination waypoint, these "On Arrival" actions are used to connect navigation paths to any newly adjacent tiles (for example, to allow the player character to exit an elevator onto another floor, or step off a raft onto the other side of a wide river that was crossed).+Whenever a platform leaves its current location, any current navigation paths to/from that tile will be disconnected. To minimize the need for scripting after a platform tile has moved to a new waypoint, you can define actions that will connect new  navigation paths by clicking the "Add" button ({{:wiki:add.png?nolink|}}) next to the "On Arrival" text (located below a waypoint's name). Once it reaches its destination waypoint, these "On Arrival" actions are used to connect navigation paths to any newly adjacent tiles (for example, to allow the player character to exit an elevator onto another floor, or step off a raft onto the other side of a wide river that was crossed)
 + 
 +For example, when the platform defined below is moved to its "Upper Floor" waypoint, a navigation path will be automatically connected from its new tile coordinate (8, -3, 16) to the adjacent tile coordinate (8, -4, 16) upon arrival, allowing the player character to step from the platform onto the adjacent tile.
  
 {{:wiki:platform_add_on_arrival.gif?nolink|}} {{:wiki:platform_add_on_arrival.gif?nolink|}}
 +
 +As you can see below, the navigation paths are automatically disconnected when the lily pad and wooden platform depart from their original locations, and navigation paths are connected after arriving at their destination waypoints, based on their defined "On Arrival" actions.
 +
 +{{:wiki:platform_nav_changes.gif?nolink|}}
 +
 +<WRAP center round info 100%>
 +To enable the display of navigation paths in-game for testing purposes, you can enter "nav on" into the [[debug console]]. The command "nav off" will toggle the paths off.
 +</WRAP>
  
 =====Scripting=====  =====Scripting===== 
 To move a platform to a specific waypoint during game time, you can use the [[Move Platform]] scripting function. For example, the script below will move the platform tile (with entity ID of "elevator") to its "Floor 2" waypoint. To move a platform to a specific waypoint during game time, you can use the [[Move Platform]] scripting function. For example, the script below will move the platform tile (with entity ID of "elevator") to its "Floor 2" waypoint.
-<code python+ 
-move_platform(entity["elevator"], "Floor 2")+<code bauxite
 +move_platform(entity["elevator"], "Floor 2", false);
 </code> </code>
 +
 +The third argument, a [[Boolean]] value of true or false, instructs the game whether or not the current script should wait until the platform has reached its destination waypoint before proceeding further into the script. This argument is optional and defaults to false.
  
 ~~NOTOC~~ ~~NOTOC~~
  
platforms.1576552061.txt.gz · Last modified: 2019/12/16 19:07 by justin