Nuclide
Software Development Kit for id Tech
logic_case Class Reference

Server-Entity: Comparison Trigger. More...

Inheritance diagram for logic_case:
NSPointTrigger

Public Member Functions

void logic_case (void)
 
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 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 Input (entity, string, string)
 Called when we are being prompted by another object/function with an input message. More...
 
nonvirtual void CompareCase (entity, string)
 
nonvirtual void PickRandom (entity)
 
nonvirtual void PickRandomShuffle (entity)
 

Detailed Description

Server-Entity: Comparison Trigger.

QUAKED logic_case (1 0 0) (-8 -8 -8) (8 8 8)

OVERVIEW

Compares an input value sent from another entity with one of the constant values defined within this entity. When it matches a given 'case', that same numbered output will get triggered. You can have 16 different cases to test against.

KEYS

  • "targetname" : Name
  • "Case01" : Constant value 1.
  • "Case02" : Constant value 2.
  • "Case03" : Constant value 3.
  • "Case04" : Constant value 4.
  • "Case05" : Constant value 5.
  • "Case06" : Constant value 6.
  • "Case07" : Constant value 7.
  • "Case08" : Constant value 8.
  • "Case09" : Constant value 9.
  • "Case10" : Constant value 10.
  • "Case11" : Constant value 11.
  • "Case12" : Constant value 12.
  • "Case13" : Constant value 13.
  • "Case14" : Constant value 14.
  • "Case15" : Constant value 15.
  • "Case16" : Constant value 16.

INPUTS

  • "InValue" : Compares the input in the data field with one of the constant values, then firing a matching output.
  • "PickRandom" : Triggers a random, valid output.
  • "PickRandomShuffle" : Triggers a random, valid output, but without repeats.

OUTPUTS

  • "OnCase01" - Triggered when Case01 matches the InValue input data.
  • "OnCase02" - Triggered when Case02 matches the InValue input data.
  • "OnCase03" - Triggered when Case03 matches the InValue input data.
  • "OnCase04" - Triggered when Case04 matches the InValue input data.
  • "OnCase05" - Triggered when Case05 matches the InValue input data.
  • "OnCase06" - Triggered when Case06 matches the InValue input data.
  • "OnCase07" - Triggered when Case07 matches the InValue input data.
  • "OnCase08" - Triggered when Case08 matches the InValue input data.
  • "OnCase09" - Triggered when Case09 matches the InValue input data.
  • "OnCase10" - Triggered when Case10 matches the InValue input data.
  • "OnCase11" - Triggered when Case11 matches the InValue input data.
  • "OnCase12" - Triggered when Case12 matches the InValue input data.
  • "OnCase13" - Triggered when Case13 matches the InValue input data.
  • "OnCase14" - Triggered when Case14 matches the InValue input data.
  • "OnCase15" - Triggered when Case15 matches the InValue input data.
  • "OnCase16" - Triggered when Case16 matches the InValue input data.

NOTES

Since we compare strings, case sensitivity and formatting needs to be identical between the InValue data and the entity defined constant values.

TRIVIA

This entity was introduced in Half-Life 2 (2004).

Constructor & Destructor Documentation

◆ logic_case()

void logic_case::logic_case ( void  )

Member Function Documentation

◆ CompareCase()

void logic_case::CompareCase ( entity  activatorEntity,
string  inputValue 
)

◆ Input()

void logic_case::Input ( entity  eAct,
string  strInput,
string  strData 
)
virtual

Called when we are being prompted by another object/function with an input message.

Reimplemented from NSEntity.

◆ PickRandom()

void logic_case::PickRandom ( entity  activatorEntity)

◆ PickRandomShuffle()

void logic_case::PickRandomShuffle ( entity  activatorEntity)

◆ Respawn()

void logic_case::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 NSPointTrigger.

◆ Restore()

void logic_case::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 NSPointTrigger.

◆ Save()

void logic_case::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 NSPointTrigger.

◆ Spawned()

void logic_case::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 logic_case::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 NSPointTrigger.


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