User Tools

Site Tools


pushing

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
pushing [2022/12/15 22:18] justinpushing [2022/12/18 17:18] (current) justin
Line 3: Line 3:
 The **pushing** mechanic allows [[character|characters]] to push and pull [[object|objects]] onto other [[tile|tiles]]. This is a great way to include puzzles in your game! For example, a room could be set up where the player needs to move one or more boxes onto specific [[tile|tiles]] in order to open a door. The **pushing** mechanic allows [[character|characters]] to push and pull [[object|objects]] onto other [[tile|tiles]]. This is a great way to include puzzles in your game! For example, a room could be set up where the player needs to move one or more boxes onto specific [[tile|tiles]] in order to open a door.
  
-=====Setting Up Pushable Objects=====+=====Setting Up Pushable Object=====
  
 Add the [[object]] that you want to be pushable to an open [[tile]] on your [[map]]. Add the [[object]] that you want to be pushable to an open [[tile]] on your [[map]].
Line 13: Line 13:
 {{:pushable_object_02.png?nolink|}} {{:pushable_object_02.png?nolink|}}
  
-Switch to Edit mode (F2), then double-click the [[object]] to open the [[Entity Properties]] panel. From the [[Entity Properties]] panel, enable the "Pushable" option. This will allow the player to grab onto the [[object]] from an adjacent [[tile]]. When an [[object]] is configured as pushable, you'll see a hand icon above it as shown.+Switch to Edit mode (F2), then double-click the [[object]] to open the [[Entity Properties]] panel. From the [[Entity Properties]] panel, enable the "Pushable" option. This will allow the player to grab onto the [[object]] from an adjacent [[tile]]. When an [[object]] is configured as pushable, you'll see a hand icon above it.
  
-Set the desired movement speed for the [[object]]. The movement speed is measured in [[voxel|voxels]] per second, similar to the movement speed of [[character|characters]]. This speed determines how the +Set the desired movement speed for the [[object]]. The movement speed is measured in [[voxel|voxels]] per second and determines how fast a [[character]] will move when pushing or pulling the [[object]].
  
 If the pushable [[object]] should be restricted to, or prohibited from, certain [[tile]] types, you can make use of the [[terrain types]] option to do so. If the default option of "All" is used, the pushable [[object]] will be able to be pushed/pulled onto any [[tile]] (assuming the appropriate [[navigation_and_interaction|navigation]] paths exist). If the pushable [[object]] should be restricted to, or prohibited from, certain [[tile]] types, you can make use of the [[terrain types]] option to do so. If the default option of "All" is used, the pushable [[object]] will be able to be pushed/pulled onto any [[tile]] (assuming the appropriate [[navigation_and_interaction|navigation]] paths exist).
Line 21: Line 21:
 {{:pushable_object_03.png?nolink|}} {{:pushable_object_03.png?nolink|}}
  
-As shown below, the game will automatically update the surrounding [[navigation_and_interaction|navigation]] paths whenever the player pushes or pulls the [[object]] to a new [[tile]].+Once the [[object]] is configured to be pushable, the player will be able to grab onto it from an adjacent [[tile]] and then push or pull it. As shown below, the game will automatically update any surrounding [[navigation_and_interaction|navigation]] paths whenever the player pushes or pulls the [[object]] onto a new [[tile]].
  
 {{:pushable_object_navigation.gif?nolink|}} {{:pushable_object_navigation.gif?nolink|}}
 +
 +=====Animation=====
 +When a [[character]] pushes or pulls an [[object]], the game will automatically attempt to play the "push" or "pull" [[animation]] for that [[character]]. If a "pull" [[animation]] isn't defined, the game will use the "push" [[animation]] for both pushing and pulling. See [[Predefined Animation Names]] for more information.
  
 =====Scripting===== =====Scripting=====
Line 29: Line 32:
  
 {{:pushable_object_example.gif?nolink|}} {{:pushable_object_example.gif?nolink|}}
 +
 +As an example, the [[script]] below could be assigned to the "Object stops on tile" trigger for a special [[tile]] that the player needs to push a box onto. The [[script]] plays an [[animation]] for the box and removes all [[navigation_and_interaction|navigation paths]] surrounding it in order to lock it into place and prevent further interaction. This could be extended to perform additional actions, like opening a door to the next room.
 +
 +<code bauxite>
 +replace_navigation(self, INTERACT_ONLY, NONE);
 +play_animation($object, "lock");
 +</code>
  
 =====Game Controls===== =====Game Controls=====
pushing.1671171491.txt.gz · Last modified: 2022/12/15 22:18 by justin