Shipment entity
Entity defined in core/entities/entities/cw_shipment
Shared definition of the cw_shipment entity: a non-spawnable anim entity named Shipment with a networked item
Index and an ENT:GetItemTable accessor.
Summary
Methods
ShipmentEntityDraw hook returns false.Index integer holding the shipped item's index.Methods
Draws the shipment model unless the ShipmentEntityDraw hook returns false.
Plays a glass impact effect and a soft impact sound at the entity's position.
Parameters
- scale Number optional, defaults to
nilUnused; the effect scale is always 8
ENT:GetItemTable()
shared gamemodes/catwork/gamemode/core/entities/entities/cw_shipment/shared.lua:22Returns the item the shipment contains.
On the client it looks the item up by the networked index.
Returns
- Item The shipped item, or
nilif it is not set
ENT:HUDPaintTargetID(x, y, alpha)
client gamemodes/catwork/gamemode/core/entities/entities/cw_shipment/cl_init.lua:7Draws the shipment title and the name of the item it contains when looked at.
Parameters
- x
- y
- alpha
Sets up physics, simple use and 50 health for the shipment.
Drops the shipment's items into the world, unless the server is shutting down.
ENT:OnTakeDamage(damageInfo)
server gamemodes/catwork/gamemode/core/entities/entities/cw_shipment/init.lua:81Subtracts the damage from the shipment's health and destroys it at zero health.
Parameters
- damageInfo
ENT:SetItemTable(uniqueID, batch)
server gamemodes/catwork/gamemode/core/entities/entities/cw_shipment/init.lua:48Fills the shipment with new instances of an item and sets its model, weight and space.
Uses the item's shipmentModel, or the model_shipment option. Does nothing for an unknown item.
Parameters
- uniqueID String The unique ID of the item to ship
- batch Number How many instances to put in the shipment
ENT:SetupDataTables()
shared gamemodes/catwork/gamemode/core/entities/entities/cw_shipment/shared.lua:14Sets up the networked Index integer holding the shipped item's index.
Removes the shipment once a second check finds it outside the world.
ENT:UpdateTransmitState()
server gamemodes/catwork/gamemode/core/entities/entities/cw_shipment/init.lua:39Always transmits the shipment to every client.