Vehicle

Noir.Classes.Vehicle: NoirClass

Represents a vehicle.

In Stormworks, this is actually a vehicle group.


Noir.Classes.Vehicle:Init(ID, owner, spawnPosition, cost)

Initializes vehicle class objects.

Parameters

  • ID: any

  • owner: NoirPlayer|nil

  • spawnPosition: SWMatrix

  • cost: number


Noir.Classes.Vehicle:_Serialize()

Serialize the vehicle.

Used internally.

Returns

  • NoirSerializedVehicle


Deserialize a serialized vehicle.

Parameters

  • serializedVehicle: NoirSerializedVehicle

  • addBodies: boolean|nil

Returns

  • NoirVehicle


Calculate the primary body.

Used internally.


Add a body to the vehicle.

Used internally.

Parameters

  • body: NoirBody


Remove a body from the vehicle.

Used internally.

Parameters

  • body: NoirBody


Return this vehicle's position.

Uses the vehicle's primary body internally.

Parameters

  • voxelX: integer|nil

  • voxelY: integer|nil

  • voxelZ: integer|nil

Returns

  • SWMatrix


Get a child body by its ID.

Parameters

  • ID: integer

Returns

  • NoirBody|nil


Teleport the vehicle to a new position.

Parameters

  • position: SWMatrix


Move the vehicle to a new position, essentially teleports without reloading the vehicle.

Note that rotation is ignored.

Parameters

  • position: SWMatrix


Despawn the vehicle.

Last updated