Nuclide
Software Development Kit for id Tech
NSItem Class Reference

id Tech 4 keys to support: More...

#include <NSItem.h>

Inheritance diagram for NSItem:
NSRenderableEntity NSWeapon

Public Member Functions

void NSItem (void)
 
virtual void Spawned (void)
 Called when the entity is fulled initialized. More...
 
virtual void Touch (entity)
 Called whenever we're touching another entity. More...
 
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. More...
 
virtual void SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle. More...
 
virtual void Restore (string, string)
 Similar to ::SpawnKey but for save-game fields. More...
 
nonvirtual void SetItem (int i)
 
nonvirtual int GetItem (void)
 
nonvirtual void SetFloating (int)
 
nonvirtual bool GetFloating (void)
 
nonvirtual void SetSpinning (bool)
 
nonvirtual bool GetSpinning (void)
 
nonvirtual void PickupRespawn (void)
 

Detailed Description

id Tech 4 keys to support:

This entity class represents non-player characters.

QUAKED NSMonster (0 0.8 0.8) (-16 -16 0) (16 16 72) WAITTILLSEEN GAG MONSTERCLIP x PRISONER x IGNOREPLAYER WAITFORSCRIPT PREDISASTER FADECORPSE MULTIPLAYER FALLING HORDE

OVERVIEW

Represents any item within the players' inventory. These can be used, or be dormant.

KEYS

  • "targetname" : Name
  • "model" : world model.
  • "model_view" : view model.
  • "model_world - same as 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_item" : item number. must be unique. - "weapon_scriptobject" : mapC progs with the weapon code within. - "ammoType" : name of the ammo type def entry which the gun uses - "ammoRequired" : set to 1 if we require ammo. - "clipSize" : maximum clip size - "mtr_flashShader" : muzzleflash material to Use. - "model_flash" : muzzleflash model/sprite to use. - "flashColor" : muzzleflash dlight color - "flashRadius" : muzzleflash dlight radius - "def_dropItem" : when this item is dropped from someones inventory, will spawn this entityDef item instead. - "snd_acquire" : pickup noise - "snd_respawn" : respawn noise - "snd_hum" : idle shader - "smoke_muzzle" : smoke particle effect name - "continuousSmoke" : whether the particle effect is continous - "clipSizeDefault" : CUSTOM: Default clip size on pickup.

Constructor & Destructor Documentation

◆ NSItem()

void NSItem::NSItem ( void  )

Member Function Documentation

◆ GetFloating()

bool NSItem::GetFloating ( void  )

◆ GetItem()

int NSItem::GetItem ( void  )

◆ GetSpinning()

bool NSItem::GetSpinning ( void  )

◆ PickupRespawn()

void NSItem::PickupRespawn ( void  )

◆ Respawn()

void NSItem::Respawn ( void  )
virtual

Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state.

Reimplemented from NSRenderableEntity.

◆ Restore()

void NSItem::Restore ( string  strKey,
string  strValue 
)
virtual

Similar to ::SpawnKey but for save-game fields.

Whatever you write into file handles within your ::Save() method needs to be read back in here.

Reimplemented from NSRenderableEntity.

Reimplemented in NSWeapon.

◆ Save()

void NSItem::Save ( float  handle)
virtual

Handles saving a copy of this entity to a given filehandle.

Within you want to use the ::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.

Reimplemented from NSRenderableEntity.

Reimplemented in NSWeapon.

◆ SetFloating()

void NSItem::SetFloating ( int  i)

◆ SetItem()

void NSItem::SetItem ( int  i)

◆ SetSpinning()

void NSItem::SetSpinning ( bool  value)

◆ Spawned()

void NSItem::Spawned ( void  )
virtual

Called when the entity is fulled initialized.

Any spawn key/value info pairs have already been dealt with. So now we can make full decisions on the entity. Always make sure to call super::Spawned(); inside your method when overriding.

Reimplemented from NSEntity.

◆ SpawnKey()

void NSItem::SpawnKey ( string  strKey,
string  strValue 
)
virtual

This method handles entity key/value pairs on map load.

You can easily convert the strValue parameter using the ReadFloat etc. methods that are part of NSIO.

Reimplemented from NSRenderableEntity.

◆ Touch()

void NSItem::Touch ( entity  eToucher)
virtual

Called whenever we're touching another entity.

Reimplemented from NSTrigger.


The documentation for this class was generated from the following files: