

VehiclesLib
A library to make it easy to add vehicles to the game using JSON modding.
Description
<p><strong>If you find a bug, have a suggestion or want to talk, feel free to join my <a href="https://discord.gg/EPPj2AzqEm">Discord server</a>! </strong></p> <p> </p> <p>VehiclesLib is a library that makes it easy to add vehicles to the game.</p> <p>This library supports boats, cars, motorcycles, helicopters, airships, flying brooms... You name it. Only thing not supported yet are airplanes.</p> <p> </p> <h3>How to use VehiclesLib?</h3> <p>VehiclesLib supports three types of fuel: gas, steam and temporal. There's also a "none" fuel for vehicles that don't need any fuel.</p> <p>Refueling a vehicle is simple:</p> <ul> <li>For gas, just right-click your vehicle with a bucket filled with a valid fuel (in vanilla, only Aqua Vitae can be used in a gas engine). You can pick the fuel back up by shift+right-clicking the vehicle with a bucket.</li> <li>For steam, fill it with water by right-clicking it with a water bucket, then add any combustible (wood, coal... With the exception of peat, which doesn't work right now) to it and wait for it to heat up.</li> <li>For temporal, just right-click the vehicle with a valid temporal fuel (in vanilla, that's temporal gears).</li> </ul> <p>To drive your vehicle, simply use WASD, and for flying vehicles, space and control.</p> <p>To pick up a vehicle, dismount it, hold CTRL and right-click it. Note that not all vehicles can be picked up! Also note that picking up a vehicle will lose its fuel.</p> <p>However, being a library, VehiclesLib adds nothing by itself. You'll need to install a mod that uses it to actually get something out of it.</p> <p>Here's a list of the mods that use VehiclesLib:</p> <p>- <a href="https://mods.vintagestory.at/jonascyclezero">Jonas Cycle Zero</a></p> <p> </p> <h3>For modders: how does it work?</h3> <p>VehiclesLib adds a relatively simple JSON API to create your vehicles, giving you full control over wheels, steering wheels, propellers and seats (up to 16 seats can be added to a single vehicle). A documentation is on its way, in the meantime feel free to check out the mods that use it for reference, or to ask me on discord (@moby_dick, or over on my discord server)</p> <p> </p> <p>Here's an overview of the JSON attributes you'll have to add to your entity (the entity's class should be EntityVehicle, or another class inheriting from that).</p> <p>The specified values are the default values (except for seats and animation parts, they're empty lists by default), if you don't want to change them, you don't have to add them to the file.</p> <p><code>"Attributes": {</code><br /><code> "VehicleProps": {</code><br /><code> "canBePickedUp": true, # Whether the vehicle can be picked up with ctrl+right click</code><br /><code> "density": 100.0, # Any density higher than 1000 will make the vehicle sink in water, lower will make it float</code><br /><code> "SwimmingYOffset": 0.45, # The vertical offset at which the vehicle will float, if it floats</code><br /><code> "topSpeed": 1.0, # The vehicle's top speed, not really in blocks/second somehow but pretty close</code><br /><code> "acceleration": 1.0, # The vehicle's acceleration. Higher values means it will reach its top speed faster</code><br /><code> "swivelAngle": 0.0, # The game's swivel angle. Apparently it's pitching up and down when moving?</code><br /><code> "groundMultiplier": 1.0, # The ground speed multiplier</code><br /><code> "waterMultiplier": 0, # The water speed multiplier</code><br /><code> "turnSpeed": 45.0, # The vehicle's turning speed, in degrees per second I think</code><br /><code> "movingTurnOnly": false, # Whether the vehicle can only turn when moving forwards and backwards (think wheels)</code><br /><code> "canStepUp": true, # Whether the vehicle can step up blocks<br /> "stepHeight": 1.1, # How high the vehicle can step up</code><br /><code> "canReverse": true, # Whether the vehicle can drive in reverse</code><br /><code> "canBrake": true, # Whether the vehicle can brake by pressing space. Recommended false for flying vehicles</code><br /><code> "seats": [ # The array of all seats</code><br /><code> {</code><br /><code> "isControllable": true, # Whether the seat can control the vehicle</code><br /><code> "angleMode": 1, # The angle mode of the seat. See values below.</code><br /><code> "lockBodyYaw": true, # Whether the player's yaw will be locked. Good for oriented seats</code><br /><code> "offset": { # The offset of the seat</code><br /><code> "x": 0,</code><br /><code> "y": 0,</code><br /><code> "z": 0</code><br /><code> </code><code>},</code><br /><code> "suggestedAnimation": "sneakidle", # The animation the player will play on the seat. See values below.</code><br /><code> "parentPart": "", # Not implemented</code><br /><code> "aimPart": "", # Not implemented</code><br /><code> "maxAimAngle": 0.0 # Not implemented</code><br /><code> </code><code>}</code><br /><code> ],</code><br /><code> "wheels": [ # The list of wheel parts for animation. Will rotate around their Z axis</code><br /><code> </code><code> </code><code>{</code><br /><code> "partName": "", # The model part name of the wheel</code><br /><code> "strength": 1.0, # The rotation speed of the wheel</code><br /><code> "enabled": true # Set to false to disable the a
Ratings & reviews
Sign in to leave a rating or comment.


