Nuclide
Software Development Kit for id Tech
func_mortar_field Class Reference

Server-Entity: Mortar Drop Zone. More...

Inheritance diagram for func_mortar_field:
NSBrushTrigger

Public Member Functions

void func_mortar_field (void)
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle. More...
 
virtual void Restore (string, string)
 Similar to NSIO::SpawnKey but for save-game fields. More...
 
virtual void Trigger (entity, triggermode_t)
 Called whenever we're legacy triggered by another object or function. 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...
 
nonvirtual void Fire (entity, vector)
 
nonvirtual void FireRandom (entity)
 
nonvirtual void FireTarget (entity)
 
nonvirtual void FireControlled (entity)
 

Detailed Description

Server-Entity: Mortar Drop Zone.

QUAKED func_mortar_field (0 .5 .8) ?

OVERVIEW

This brush volume acts as mortar drop area. When triggered, it'll drop mortar shells straight to the ground (with a bit of spread if specified).

KEYS

  • "targetname" : Name
  • "m_flSpread" : Maximum spread in game-units
  • "m_flCount" : Number of bombs dropped per strike
  • "m_flControl" : Targeting type. 0 = random, 1 = activator, 2 = controlled
  • "m_iszXController" : Name of the momentary_rot_button providing X-offset
  • "m_iszYController" : Name of the momentary_rot_button providing Y-offset

NOTES

It can be set to three different targeting modes, 0 will pick any random point in the volume as a drop position. 1 will target the person or entity activating it and 2 is a more complex mode which requires two momentary_rot_button entities to control the X and Y offset in the volume.

GoldSrc expects some hardcoded behaviour (sounds playing, hardcoded delay between mortar shell drops) that I haven't implemented yet. I'll turn those into map attribute keys so people can finally control sound, damage, delay and so on.

TRIVIA

This entity was introduced in Half-Life (1998).

Constructor & Destructor Documentation

◆ func_mortar_field()

void func_mortar_field::func_mortar_field ( void  )

Member Function Documentation

◆ Fire()

void func_mortar_field::Fire ( entity  firingEnt,
vector  vecOrg 
)

◆ FireControlled()

void func_mortar_field::FireControlled ( entity  act)

◆ FireRandom()

void func_mortar_field::FireRandom ( entity  act)

◆ FireTarget()

void func_mortar_field::FireTarget ( entity  act)

◆ Respawn()

void func_mortar_field::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 NSBrushTrigger.

◆ Restore()

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

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

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

Reimplemented from NSEntity.

◆ Save()

void func_mortar_field::Save ( float  handle)
virtual

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

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

Reimplemented from NSEntity.

◆ SpawnKey()

void func_mortar_field::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 NSEntity.

◆ Trigger()

void func_mortar_field::Trigger ( entity  act,
triggermode_t  state 
)
virtual

Called whenever we're legacy triggered by another object or function.

Reimplemented from NSTrigger.


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