======Vehicles====== ---- =====Overview===== A **vehicle** is a special type of [[object]], for example a ship or a car, that the [[player character]] can enter and use as a method of travel. This can enable the player to move around the [[map]] more quickly, or, when used with the [[terrain_types|terrain type]] functionality, it can even allow the player to reach areas of the [[map]] that would otherwise be inaccessible to them. =====Creating a Vehicle===== To create a vehicle, you'll first need to decide which [[terrain types]] the vehicle will be traversing. Can it move anywhere [[character|characters]] can normally, specifically across any [[tile|tiles]] that have walkable [[navigation_and_interaction|navigation paths]] connected between them? Or does it need to be restricted to or prohibited from certain types of terrain, for example a ship that's restricted to water or a car that's prohibited from water? If the latter is true, then [[terrain types]] must be assigned to any appropriate [[tile|tiles]] from the [[Voxel Editor]]. Taking the example of a ship, you'll need to assign an appropriate terrain type to any [[tile|tiles]] on which the ship could potentially traverse (river tiles, ocean tiles, etc.). The terrain type can be named whatever you'd like, but in this case "water" or something similar would make sense to use. Once you've added a particular [[terrain_types|terrain type]] to a [[tile]], that type will then be selectable from the list when assigning it to any subsequent [[tile|tiles]]. {{:assign_tile_terrain_type.gif?nolink|}} You'll also need to create an [[object]] model to represent the vehicle. Refer to the table below for the predefined [[animation]] names that are applicable to [[object|objects]] being used as vehicles. ^Animation Name^Description^ |default|Plays whenever the vehicle is stationary.| |move|Plays whenever the [[player character]] is moving the vehicle.| {{:ship_vehicle_example.png?nolink|}} Once you've created a model for your vehicle, add the [[object]] to the [[map]] in the [[Map Editor]] where you'd like it to be initially located. After it's placed, select it and enable the "Vehicle" toggle setting from the [[Entity Properties]] panel. Refer to the table below for a description of each setting that can be adjusted for vehicles. ^Icon^Property^Description^ |{{:wiki:arrow_speed.png?nolink|}}|Speed|Determines how fast the vehicle moves in voxels per second. This speed will override the [[character|character's]] normal speed.| |{{:wiki:terrain.png?nolink|}}|Terrain Types|Determines the types of terrain that the vehicle can or cannot traverse. See [[Terrain Types]] for more information.| |{{:wiki:script.png?nolink|}}|Embark Script|[[Script]] that will be triggered when the [[player character]] enters the vehicle.| |{{:wiki:script.png?nolink|}}|Disembark Script|[[Script]] that will be triggered when the [[player character]] exits the vehicle.| {{:add_vehicle_to_map.gif?nolink|}} Using the ship example, you'll want to choose "Restricted to..." for the "Terrain Types" option and then select "water" in the resulting dialog that pops up. {{:assign_vehicle_terrain_type.gif?nolink|}} Note that all [[tile|tiles]] must have [[navigation_and_interaction|navigation]] connected with a walkable path type, even between land and water tiles as in the ship example. The game will take care of determining whether or not a [[character]] or vehicle can move between [[terrain types]]. {{:vehicle_nav_paths_01.png?nolink|}} Because of [[navigation_and_interaction|navigation]] paths now being connected between land and water, however, you'll need to make sure to set the [[terrain types]] for your [[character|characters]] to prohibit them from entering the water [[tile|tiles]]. {{:assign_character_terrain_type.gif?nolink|}} If you want a vehicle to be able to interact with [[character|characters]] and [[object|objects]] on adjacent [[tile|tiles]] but not allow the player to exit onto those [[tile|tiles]], you can use the "Interact Only" path type. In the example setup below, the player will be able to disembark from the ship while along the ocean shore, but not while travelling down the river since the paths are now "Interact Only" (i.e. the orange lines). However, they'll still be able to interact with [[character|characters]] and [[object|objects]] along the river (for example, if a [[character]] is standing on the river's edge). {{:vehicle_nav_paths_02.png?nolink|}} =====Using Vehicles===== In-game, the player can enter a vehicle by interacting with it as they would normally interact with a scripted [[object]], i.e. left-clicking with the mouse or pressing Space while facing it from an adjacent [[tile]]. Ctrl + Left-Clicking on a valid adjacent [[tile]] with the mouse or pressing Ctrl + Arrow Key in the direction of a valid adjacent [[tile]] will cause the player to disembark from the vehicle onto that [[tile]]. {{:vehicle_movement.gif?nolink|}} ~~NOTOC~~