This entity class represents inventory items, weapons.
QUAKED ncItem (0 0.8 0.8) (-16 -16 0) (16 16 72)
OVERVIEW
Represents any item within the players' inventory. These can be used, or be dormant. Some configurations will simply increase your statistics upon touch.
KEYS
- "targetname" : Name
- "model" : world model.
- "model_view" : view model.
- "model_world" : same as model.
- "model_player" : (Optional) when equipped, will use this model.
- "inv_name" : Fancy title. Can be a localized string.
- "inv_weapon" : name of the weapon to give on pickup. can be the same as this entitydef.
- "inv_health" : How much health points to give on pick-up.
- "inv_armor" : How much armor points to give on pick-up.
- "no_touch" : If 1, will have to be triggered to be given to the activator.
- "inv_carry" : If 1, will not use the item instantly.
- "inv_icon" : Material for HUD graphics.
- "requires" : Name of the item that has to be present in the players inventory in order to be picked up.
- "frame" : Animation sequence to use when it's a pickup.
- "hidden_frame" : Animation sequence to use when it was picked up. Will not hide the entity when set.
- "physics" : This pickup uses physics to interact with the world.
- "mins" : Collision box mins (e.g. "-16 -16 -16") for the item.
- "maxs" : Collision box mins (e.g. "16 16 16") for the item.
- "snd_acquire" : Sound to play when picked up successfully.
- "snd_respawn" : Sound to play when it respawns.
- "spin" : Pickup will spin when set.
- "floating" : Item does not drop to floor.
- "body" : GoldSrc Body/Geomset to use.
- "respawn" : Time required for a map-placed version of this item to respawn.
INPUTS
- "SetRespawnTime" : Sets the time required for a map-placed version of this item to respawn.
EXAMPLES
Some basic items that most games will have some variety off:
HEALTH
{
"editor_usage" "Health Item"
"editor_usage2" ""
"editor_usage3" "Gives players 15 Health Points."
"spawnclass" "ncItem"
"model" "models/items/health.vvm"
"mins" "-16 -16 0"
"maxs" "16 16 16"
"inv_health" "15"
}
entityDefAPI_t entityDef
Access entityDefAPI_t functions using this variable.
Definition api.h:437
In the above example, changing inv_health to inv_armor will increment the armor value instead, as expected.
KEYCARD
{
"editor_usage" "Lab Keycard Item"
"editor_usage2" ""
"editor_usage3" "Resides in the inventory without much effect on its own."
"spawnclass" "ncItem"
"model" "models/items/keycard.vvm"
"mins" "-16 -16 0"
"maxs" "16 16 16"
"inv_carry" "1"
}
AMMO
{
"editor_usage" "Shotgun Shells"
"editor_usage2" ""
"editor_usage3" "Gives players 20 Shells Ammo."
"spawnclass" "ncItem"
"model" "models/ammo/shells.vvm"
"mins" "-16 -16 0"
"maxs" "16 16 16"
"inv_ammo_shells" "20"
}
|
| void | ncItem (void) |
| |
| virtual void | Spawned (void) |
| | Called when the entity is fulled initialized.
|
| |
| virtual bool | ItemBonusCheck (entity) |
| |
| virtual bool | ItemPickupCheck (entity) |
| |
| virtual void | GiveBonusItems (entity) |
| |
| virtual void | Touch (entity) |
| | Called whenever we're touching another entity.
|
| |
| virtual void | Respawn (void) |
| | Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state.
|
| |
| virtual void | SpawnKey (string, string) |
| | This method handles entity key/value pairs on map load.
|
| |
| virtual void | Input (entity, string, string) |
| | Called when we are being prompted by another object/function with an input message.
|
| |
| virtual void | Save (float) |
| | Handles saving a copy of this entity to a given filehandle.
|
| |
| virtual void | Restore (string, string) |
| | Similar to ncIO::SpawnKey() but for save-game fields.
|
| |
| virtual void | EvaluateEntity (void) |
| | Run each tic after physics are run to determine if we need to send updates over the network.
|
| |
| virtual float | SendEntity (entity, float) |
| | Called by the engine whenever we need to send a client an update about this entity.
|
| |
| nonvirtual void | SetFloating (int) |
| |
| nonvirtual bool | GetFloating (void) |
| |
| nonvirtual void | SetSpinning (bool) |
| |
| nonvirtual bool | GetSpinning (void) |
| |
| nonvirtual void | PickupRespawn (void) |
| |
| nonvirtual void | SetRespawnTime (float) |
| |
| virtual void | OnInventoryUse (void) |
| |
| virtual void | OnPickup (void) |
| | Overridable: Called when this item is picked up.
|
| |
| virtual void | OnUse (entity) |
| | Overridable: Called when this item is used.
|
| |
| virtual void | PrintDebugInfo (void) |
| |
| nonvirtual void | BecomePickup (void) |
| | Call to turn a weapon into a pickup.
|
| |
| virtual void | AddedToInventory (void) |
| | Called when an item was added to someones inventory.
|
| |
| virtual void | RemovedFromInventory (void) |
| | Called when an item was removed from someones inventory.
|
| |
| virtual void | ReceiveEntity (float, float) |
| | Client: Handles network updates from the server for the associated entity.
|
| |
| virtual void | ReceiveEvent (float) |
| |
| virtual void | PredictPreFrame (void) |
| |
| virtual void | PredictPostFrame (void) |
| |
| virtual bool | IsWeapon (void) |
| |
| virtual bool | InInventory (void) |
| |
| virtual void | OnRemoveEntity (void) |
| | Handles what happens before the entity gets removed from the client game.
|
| |