-
Notifications
You must be signed in to change notification settings - Fork 6
ExtendedShipAPI
This API is an extension of ShipAPI specifically for Command Computers by default and has inherited the original methods! It will appear listed as both "ship" and as the Ship's name at the time of startup!
Note: If enabled, this also exposes the physics_ticks event!
applyInvariantForce( vector )
applyInvariantForce( number, number, number )
This method applies an invariant force to a Ship!
local mass = ship.getMass()
ship.applyInvariantForce(0, 1000 * mass, 0)applyInvariantForceAtPos( vector, vector ) applyInvariantForceAtPos( number, number, number, number, number, number )`
This method applies an invariant force to a Ship at a position!
local pos = ...
local mass = ship.getMass()
ship.applyInvariantForceAtPos(0, 1000 * mass, 0, pos.x, pos.y, pos.z)applyInvariantTorque( vector ) applyInvariantTorque( number, number, number )`
This method This method applies invariant torque to a Ship!
local mass = ship.getMass()
ship.applyInvariantTorque(0, 1000 * mass, 0)aaplyRotDependentForce( vector )
applyRotDependentForce( number, number, number )
This method applies a rotation dependent force to a Ship!
local mass = ship.getMass()
ship.applyRotDependentForce(0, 1000 * mass, 0)aaplyRotDependentForceAtPos( vector, vector )
applyRotDependentForceAtPos( number, number, number, number, number, number )
This method applies a rotation dependent force to a Ship at a position!
local pos = ...
local mass = ship.getMass()
ship.applyRotDependentForceAtPos(0, 1000 * mass, 0, pos.x, pos.y, pos.z)aaplyRotDependentTorque( vector )
applyRotDependentTorque( number, number, number )
This method This method applies rotation dependent torque to a Ship!
local mass = ship.getMass()
ship.applyRotDependentTorque(0, 1000 * mass, 0)setStatic( boolean )
This method sets a Ship as static!
ship.setStatic(true)setScale( number )
This method changes the scale of a Ship!
ship.setScale(0.5)teleport( table )
This method teleports a Ship! This is disabled in configs by default!
while true do
local tp = {
["pos"] = {
["x"] = math.random(0, 32) - 8,
["y"] = -58,
["z"] = math.random(0, 32) - 8
}
}
ship.teleport(tp)
os.sleep()
end