D00Med / vehicles

minetest mod that adds vehicles. Written for minetest 0.4.??
Other
17 stars 27 forks source link

Vehicles

Adds various vehicles to Minetest.

How to drive/pilot/etc.

Basic controls

All vehicles are steered by looking around. You can use the forward button(same as you would use for walking), to move the vehicles, but only some will be able to reverse. For example, cars can reverse but planes cannot.

Boosts

Some vehicles can have a small boost when the 'use/aux1' key is held. It will only last for a limited time and it will not recharge whilst the key is still held down.

Weapons

Vehicles can also use weapons, for example the jet and tank, which will fire a missile when 'sneak' is pressed. They require a missile to be in the drivers inventory to do this. It is possible to have a second weapon, fired with 'use/aux1', but currently only the assault suit does this. It can use both bullets and missiles. The gun turret uses bullets.

Flight/Jumping/Hovering

Some vehicles can fly, for example the jet. The jet will move upward when the driver looks up, or when the driver presses 'jump'. Using the jump key does not work very well at the moment. The plane is a bit differrent; It will hold it's height when 'jump' is pressed.

It is also possible for vehicles to jump or hover for a small amount of time. Currently only the Assault suit does this.

Boats and Watercrafts

The speed boat can be used on water, but if it is driven onto land it will stop completely. If you are lucky you can move back into water, but be careful because this does not always work.

The Lightcycles

The Lightcycles can place light barriers when 'sneak' is pressed. If the barrier from one type hits the other type, the vehicle will explode

Other

Vehicles will explode if they touch lava, so be careful. Don't drive cars or planes etc. into water! they will sink.

If you do get a vehicle in a tricky spot, you can punch it whilst driving and it will be dropped.

The API

vehicles.object_drive is the function used for the movement of vehicles. It should be used in this format:

vehicles.object_drive(entity, dtime, {
    -- table keys here
})

In the above case, entity is used in place of an entity or object. If the function was to be used inside on_step for an entity, 'entity' would be replaced with 'self.object'

The table should contain the relevant variables listed below. The function is written so that these are all somewhat optional.