Nuclide
Software Development Kit for id Tech
logic_achievement Class Reference

Shared-Entity: Achievement Manager. More...

Inheritance diagram for logic_achievement:
NSPointTrigger

Public Member Functions

void logic_achievement (void)
 
virtual void Save (float)
 overrides 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 Input (entity, string, string)
 Called when we are being prompted by another object/function with an input message. More...
 
virtual void Trigger (entity, triggermode_t)
 Called whenever we're legacy triggered by another object or function. More...
 
nonvirtual void CallEvent (entity)
 

Detailed Description

Shared-Entity: Achievement Manager.

QUAKED logic_achievement (0.3 0.1 0.6) (-8 -8 -8) (8 8 8)

OVERVIEW

Unlocks achievements or aids in the progression of them.

KEYS

  • "targetname" : Name
  • "AchievementEvent" : Identifier of the achievement.
  • "StartDisabled" : Entity will have to be enabled in order to work when set to 1.

INPUTS

  • "FireEvent" : Triggers the achievement.
  • "Enable" : Enable the entity.
  • "Disable" : Disable the entity.
  • "Toggle" : Toggles between enabled/disabled states.

OUTPUTS

  • "OnFired" : Triggered when the 'FireEvent' is received.

NOTES

Ensure to prefix the value of the AchievementEvent key with ACHIEVEMENT_EVENT_. For example, if you are using SteamWorks and have your achievement on there named FOOBAR then you want the value to be ACHIEVEMENT_EVENT_FOOBAR.

TRIVIA

This entity was introduced in The Orange Box (2007) for Xbox 360.

Constructor & Destructor Documentation

◆ logic_achievement()

void logic_achievement::logic_achievement ( void  )

Member Function Documentation

◆ CallEvent()

void logic_achievement::CallEvent ( entity  targetPlayer)

◆ Input()

void logic_achievement::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.

◆ Respawn()

void logic_achievement::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_achievement::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_achievement::Save ( float  handle)
virtual

overrides

Reimplemented from NSPointTrigger.

◆ Spawned()

void logic_achievement::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_achievement::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.

◆ Trigger()

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