Body
Noir.Classes.Body: NoirClass
Represents a body which is apart of a vehicle.
In Stormworks, this is actually a vehicle apart of a vehicle group.
Noir.Classes.Body:Init(ID, owner, loaded)
Initializes body class objects.
Parameters
ID
: anyowner
: NoirPlayer|nilloaded
: boolean
Noir.Classes.Body:_Serialize()
Serialize the body.
Used internally.
Returns
NoirSerializedBody
Noir.Classes.Body:_Deserialize(serializedBody, setParentVehicle)
Deserialize the body.
Used internally.
Parameters
serializedBody
: NoirSerializedBodysetParentVehicle
: boolean|nil
Returns
NoirBody
Noir.Classes.Body:GetName()
Returns the name of the body, or nil if there is none (relies on map icon component)
Returns
string|nil
Noir.Classes.Body:GetPosition(voxelX, voxelY, voxelZ)
Returns the position of this body.
Parameters
voxelX
: integer|nilvoxelY
: integer|nilvoxelZ
: integer|nil
Noir.Classes.Body:Damage(damageAmount, voxelX, voxelY, voxelZ, radius)
Damage this body at the provided voxel.
Parameters
damageAmount
: numbervoxelX
: integervoxelY
: integervoxelZ
: integerradius
: number
Noir.Classes.Body:SetInvulnerable(invulnerable)
Makes the body invulnerable/vulnerable to damage.
Parameters
invulnerable
: boolean
Noir.Classes.Body:SetEditable(editable)
Makes the body editable/non-editable (dictates whether or not the body can be brought back to the workbench).
Parameters
editable
: boolean
Noir.Classes.Body:Teleport(position)
Teleport the body to the specified position.
Parameters
position
: SWMatrix
Noir.Classes.Body:Move(position)
Move the body to the specified position. Essentially teleports the body without reloading it.
Rotation is ignored.
Parameters
position
: SWMatrix
Noir.Classes.Body:SetBattery(batteryName, amount)
Set a battery's charge (by name).
Parameters
batteryName
: stringamount
: number
Noir.Classes.Body:SetBatteryByVoxel(voxelX, voxelY, voxelZ, amount)
Set a battery's charge (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integeramount
: number
Noir.Classes.Body:SetHopper(hopperName, amount, resourceType)
Set a hopper's amount (by name).
Parameters
hopperName
: stringamount
: numberresourceType
: SWResourceTypeEnum
Noir.Classes.Body:SetHopperByVoxel(voxelX, voxelY, voxelZ, amount, resourceType)
Set a hopper's amount (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integeramount
: numberresourceType
: SWResourceTypeEnum
Noir.Classes.Body:SetKeypad(keypadName, value)
Set a keypad's value (by name).
Parameters
keypadName
: stringvalue
: number
Noir.Classes.Body:SetKeypadByVoxel(voxelX, voxelY, voxelZ, value)
Set a keypad's value (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integervalue
: number
Noir.Classes.Body:SetSeat(seatName, axisPitch, axisRoll, axisUpDown, axisYaw, button1, button2, button3, button4, button5, button6, trigger)
Set a seat's values (by name).
Parameters
seatName
: stringaxisPitch
: numberaxisRoll
: numberaxisUpDown
: numberaxisYaw
: numberbutton1
: booleanbutton2
: booleanbutton3
: booleanbutton4
: booleanbutton5
: booleanbutton6
: booleantrigger
: boolean
Noir.Classes.Body:SetSeatByVoxel(voxelX, voxelY, voxelZ, axisPitch, axisRoll, axisUpDown, axisYaw, button1, button2, button3, button4, button5, button6, trigger)
Set a seat's values (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integeraxisPitch
: numberaxisRoll
: numberaxisUpDown
: numberaxisYaw
: numberbutton1
: booleanbutton2
: booleanbutton3
: booleanbutton4
: booleanbutton5
: booleanbutton6
: booleantrigger
: boolean
Noir.Classes.Body:SetWeapon(weaponName, amount)
Set a weapon's ammo count (by name).
Parameters
weaponName
: stringamount
: number
Noir.Classes.Body:SetWeaponByVoxel(voxelX, voxelY, voxelZ, amount)
Set a weapon's ammo count (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integeramount
: number
Noir.Classes.Body:SetTransponder(isActive)
Set this body's transponder activity.
Parameters
isActive
: boolean
Noir.Classes.Body:SetTank(tankName, amount, fluidType)
Set a tank's contents (by name).
Parameters
tankName
: stringamount
: numberfluidType
: SWTankFluidTypeEnum
Noir.Classes.Body:SetTankByVoxel(voxelX, voxelY, voxelZ, amount, fluidType)
Set a tank's contents (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integeramount
: numberfluidType
: SWTankFluidTypeEnum
Noir.Classes.Body:SetShowOnMap(isShown)
Set whether or not this body is shown on the map.
Parameters
isShown
: boolean
Noir.Classes.Body:ResetState()
Reset this body's state.
Noir.Classes.Body:SetTooltip(tooltip)
Set this body's tooltip.
Parameters
tooltip
: string
Noir.Classes.Body:GetBattery(batteryName)
Get a battey's data (by name).
Parameters
batteryName
: string
Returns
SWVehicleBatteryData|nil
Noir.Classes.Body:GetBatteryByVoxel(voxelX, voxelY, voxelZ)
Get a battey's data (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integer
Returns
SWVehicleBatteryData|nil
Noir.Classes.Body:GetButton(buttonName)
Get a button's data (by name).
Parameters
buttonName
: string
Returns
SWVehicleButtonData|nil
Noir.Classes.Body:GetButtonByVoxel(voxelX, voxelY, voxelZ)
Get a button's data (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integer
Returns
SWVehicleButtonData|nil
Noir.Classes.Body:GetComponents()
Get this body's components.
Returns
SWLoadedVehicleData|nil
Noir.Classes.Body:GetData()
Get this body's data.
Returns
SWVehicleData|nil
Noir.Classes.Body:GetDial(dialName)
Get a dial's data (by name).
Parameters
dialName
: string
Returns
SWVehicleDialData|nil
Noir.Classes.Body:GetDialByVoxel(voxelX, voxelY, voxelZ)
Get a dial's data (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integer
Returns
SWVehicleDialData|nil
Noir.Classes.Body:GetFireCount()
Returns the number of surfaces that are on fire.
Returns
integer|nil
Noir.Classes.Body:GetHopper(hopperName)
Get a hopper's data (by name).
Parameters
hopperName
: string
Returns
SWVehicleHopperData|nil
Noir.Classes.Body:GetHopperByVoxel(voxelX, voxelY, voxelZ)
Get a hopper's data (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integer
Returns
SWVehicleHopperData|nil
Noir.Classes.Body:GetRopeHook(hookName)
Get a rope hook's data (by name).
Parameters
hookName
: string
Returns
SWVehicleRopeHookData|nil
Noir.Classes.Body:GetRopeHookByVoxel(voxelX, voxelY, voxelZ)
Get a rope hook's data (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integer
Returns
SWVehicleRopeHookData|nil
Noir.Classes.Body:GetSeat(seatName)
Get a seat's data (by name).
Parameters
seatName
: string
Returns
SWVehicleSeatData|nil
Noir.Classes.Body:GetSeatByVoxel(voxelX, voxelY, voxelZ)
Get a seat's data (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integer
Returns
SWVehicleSeatData|nil
Noir.Classes.Body:GetSign(signName)
Get a sign's data (by name).
Parameters
signName
: string
Returns
SWVehicleSignData|nil
Noir.Classes.Body:GetSignByVoxel(voxelX, voxelY, voxelZ)
Get a sign's data (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integer
Returns
SWVehicleSignData|nil
Noir.Classes.Body:GetTank(tankName)
Get a tank's data (by name).
Parameters
tankName
: string
Returns
SWVehicleTankData|nil
Noir.Classes.Body:GetTankByVoxel(voxelX, voxelY, voxelZ)
Get a tank's data (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integer
Returns
SWVehicleTankData|nil
Noir.Classes.Body:GetWeapon(weaponName)
Get a weapon's data (by name).
Parameters
weaponName
: string
Returns
SWVehicleWeaponData|nil
Noir.Classes.Body:GetWeaponByVoxel(voxelX, voxelY, voxelZ)
Get a weapon's data (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integer
Returns
SWVehicleWeaponData|nil
Noir.Classes.Body:PressButton(buttonName)
Presses a button on this body (by name).
Parameters
buttonName
: string
Noir.Classes.Body:PressButtonByVoxel(voxelX, voxelY, voxelZ)
Presses a button on this body (by voxel).
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integer
Noir.Classes.Body:SpawnRopeHook(voxelX, voxelY, voxelZ, targetBody, targetVoxelX, targetVoxelY, targetVoxelZ, length, ropeType)
Spawns a rope connected by a hook on this body to a hook on another (or this) body.
Parameters
voxelX
: integervoxelY
: integervoxelZ
: integertargetBody
: NoirBody|nil - nil = this bodytargetVoxelX
: integertargetVoxelY
: integertargetVoxelZ
: integerlength
: numberropeType
: SWRopeTypeEnum
Noir.Classes.Body:Despawn()
Despawn the body.
Noir.Classes.Body:Exists()
Returns whether or not the body exists.
Returns
boolean
Noir.Classes.Body:IsSimulating()
Returns whether or not the body is simulating.
Returns
boolean
Last updated