Nuclide
Software Development Kit for id Tech
func_button Class Reference

Server-Entity: Moving Button. More...

Inheritance diagram for func_button:
NSMoverEntity

Public Member Functions

void func_button (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 SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
virtual void Spawned (void)
 Called when the entity is fulled initialized. 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 Touch (entity)
 Called whenever we're touching another entity. More...
 
virtual void Blocked (entity)
 Called whenever out movement is being blocked by an entity. More...
 
virtual void Trigger (entity, triggermode_t)
 Called whenever we're legacy triggered by another object or function. More...
 
nonvirtual void DeathTrigger (entity, entity, int, vector, int)
 
virtual void PlayerUse (void)
 
virtual void MoverStartsMoving (void)
 Overridable: Called when the mover starts moving from its position to another. More...
 
virtual void MoverFinishesMoving (void)
 Overridable: Called when the mover completes its movement to a destination. More...
 

Detailed Description

Server-Entity: Moving Button.

QUAKED func_button (0 .5 .8) ? SF_BTT_NOMOVE x x x x SF_BTT_TOGGLE SF_BTT_SPARKS x SF_BTT_TOUCH_ONLY

OVERVIEW

A brush entity which can be used either by touching, interaction (via a games' use-key/button or other targetting methods. It will then travel, similar to a door to a specified direction. Once it's fully pushed in, it'll trigger its targets, then return back to its original position.

KEYS

  • "targetname" : Name
  • "target" : Target when triggered.
  • "killtarget" : Target to kill when triggered.
  • "speed" : Movement speed of the door in game-units per second.
  • "lip" : How many units remain visible when fully pushed in.
  • "snd_pressed" : The sound shader name to play when pressed down.
  • "snd_unpressed" : The sound shader name to play when the button becomes raised.
  • "wait" : Time to wait in seconds before the button becomes raised.
  • "delay" : Delay until the Target gets triggered.
  • "sounds" : Obsolete legacy key for HL/Q1 style buttons to decide which sounds to play.
  • "health" : Amount of damage this button takes before it triggers. Will reset.

OUTPUTS

  • "OnDamaged" : Fired when the button is damaged.
  • "OnPressed" : Fired when the button is pressed.
  • "OnUseLocked" : Fired when the button is used while locked.
  • "OnIn" : Fired when the button reaches the in/pressed position.
  • "OnOut" : Fired when the button reaches the out/released position.

SPAWNFLAGS

  • SF_BTT_NOMOVE (1) : Don't move when it's activated.
  • SF_BTT_TOGGLE (32) : Don't move back to the raised state automatically.
  • SF_BTT_SPARKS (64) : Spawn decorative sparks when used.
  • SF_BTT_TOUCH_ONLY (256) : Disable 'use' key/button. Only collision will activate it.

TRIVIA

This entity was introduced in Quake (1996).

Constructor & Destructor Documentation

◆ func_button()

void func_button::func_button ( void  )

Member Function Documentation

◆ Blocked()

void func_button::Blocked ( entity  eBlocker)
virtual

Called whenever out movement is being blocked by an entity.

This is currently only relevant on entities that are of MOVETYPE_PUSH.

Reimplemented from NSTrigger.

◆ DeathTrigger()

void func_button::DeathTrigger ( entity  inflictor,
entity  attacker,
int  damage,
vector  dir,
int  location 
)

◆ MoverFinishesMoving()

void func_button::MoverFinishesMoving ( void  )
virtual

Overridable: Called when the mover completes its movement to a destination.

Reimplemented from NSMoverEntity.

◆ MoverStartsMoving()

void func_button::MoverStartsMoving ( void  )
virtual

Overridable: Called when the mover starts moving from its position to another.

Reimplemented from NSMoverEntity.

◆ PlayerUse()

void func_button::PlayerUse ( void  )
virtual

◆ Respawn()

void func_button::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 NSSurfacePropEntity.

◆ Restore()

void func_button::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 NSMoverEntity.

◆ Save()

void func_button::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 NSMoverEntity.

◆ Spawned()

void func_button::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 NSSurfacePropEntity.

◆ SpawnKey()

void func_button::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 NSMoverEntity.

◆ Touch()

void func_button::Touch ( entity  eToucher)
virtual

Called whenever we're touching another entity.

Reimplemented from NSTrigger.

◆ Trigger()

void func_button::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: