User Tools

Site Tools


door_scripting_tutorial

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
Next revisionBoth sides next revision
door_scripting_tutorial [2017/11/04 10:43] justindoor_scripting_tutorial [2017/11/04 10:47] justin
Line 6: Line 6:
  
 =====Creating the Model===== =====Creating the Model=====
-You'll first need to build a [[voxel]] model for your door. Create a new [[object]] in the [[Voxel Editor]] and build a door model similar to one of those shown in the examples below. For this tutorial, you'll want to have at least two separate frames, one for the door in its closed state and one in its open state. +You'll first need to build a [[voxel]] model for your door. Create a new [[object]] in the [[Voxel Editor]] and build a door model similar to one of those shown in the examples below. For this tutorial, you'll want to have at least two separate frames, one for the door in its closed state and one in its open state. Most of the examples in this tutorial will be be based on the first type of door shown.
  
 The style, orientation, and positioning all depend on what best matches the existing architecture of your game. For example, the top door in the images below is centered depth-wise since it's designed for a game where the walls take up the entire [[tile]] block. The bottom door is positioned flush with the grid edge since it's designed for a game where the walls are thinner and aligned with the [[tile]] edges. The style, orientation, and positioning all depend on what best matches the existing architecture of your game. For example, the top door in the images below is centered depth-wise since it's designed for a game where the walls take up the entire [[tile]] block. The bottom door is positioned flush with the grid edge since it's designed for a game where the walls are thinner and aligned with the [[tile]] edges.
Line 66: Line 66:
  
 ====Method 1: Replace Navigation==== ====Method 1: Replace Navigation====
 +The improved version of the [[script]] using the [[Replace Navigation]] method is fairly straightforward. We simply swap the navigation types between "Interact Only" and "Walk and Interact" as the door opens and closes.
 <code lua> <code lua>
 if self.property["open"] == true then if self.property["open"] == true then
door_scripting_tutorial.txt · Last modified: 2017/11/04 11:22 by justin