logic_auto/logic_relay/logic_timer: add some QUAKED comments
This commit is contained in:
parent
a4693ff0f8
commit
3ea74c3c3d
3 changed files with 74 additions and 6 deletions
|
@ -14,7 +14,9 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*!QUAKED logic_auto (1 0 0) (-8 -8 -8) (8 8 8) TA_USEONCE
|
||||
#define LOGICAUTO_USEONCE 1
|
||||
|
||||
/*!QUAKED logic_auto (1 0 0) (-8 -8 -8) (8 8 8) USE_ONCE
|
||||
# OVERVIEW
|
||||
Will automatically trigger its outputs when the level has spawned.
|
||||
This is Source's variant of trigger_auto. If you want to talk to old-styled
|
||||
|
@ -24,7 +26,7 @@ targets instead, use that instead.
|
|||
- "targetname" : Name
|
||||
- "globalstate" : The env_global state to read before firing.
|
||||
|
||||
# INPUTS
|
||||
# OUTPUTS
|
||||
- "OnMapSpawn" : Triggered when the map is loaded for any reason.
|
||||
- "OnNewGame" : Triggered only when a new game starts on this level.
|
||||
- "OnLoadGame" : Triggered when the map is loaded via save game.
|
||||
|
@ -34,7 +36,7 @@ targets instead, use that instead.
|
|||
- "OnMultiNewRound" : Triggered only during round restarts in multiplayer.
|
||||
|
||||
# SPAWNFLAGS
|
||||
- TA_USEONCE (1) : Remove itself from the level permanently when activated.
|
||||
- USE_ONCE (1) : Remove itself from the level permanently when activated.
|
||||
|
||||
# NOTES
|
||||
When a logic_auto is removed via TA_USEONCE it won't survive match respawns.
|
||||
|
@ -47,7 +49,6 @@ not get called upon map start.
|
|||
# TRIVIA
|
||||
This entity was introduced in Half-Life 2 (2004).
|
||||
*/
|
||||
|
||||
class
|
||||
logic_auto:NSPointTrigger
|
||||
{
|
||||
|
@ -197,6 +198,8 @@ logic_auto::Spawned(void)
|
|||
void
|
||||
logic_auto::Respawn(void)
|
||||
{
|
||||
|
||||
m_iFromSaveGame = 1;
|
||||
ScheduleThink(Processing, 0.2f);
|
||||
}
|
||||
|
||||
|
@ -231,7 +234,7 @@ logic_auto::Processing(void)
|
|||
if (serverkeyfloat("background") == 1)
|
||||
UseOutput(this, m_strOnBackgroundMap);
|
||||
|
||||
if (HasSpawnFlags(1)) {
|
||||
if (HasSpawnFlags(LOGICAUTO_USEONCE)) {
|
||||
NSLog("^2logic_auto::^3Processing ^7: %s triggerer removed self", target);
|
||||
Destroy();
|
||||
}
|
||||
|
|
|
@ -20,6 +20,36 @@ enumflags
|
|||
LOGICRELAY_FAST
|
||||
};
|
||||
|
||||
/*!QUAKED logic_relay (1 0 0) (-8 -8 -8) (8 8 8) ONCE FAST
|
||||
# OVERVIEW
|
||||
Triggers outputs within an I/O system chain, which can be enabled/disabled at will.
|
||||
|
||||
# KEYS
|
||||
- "targetname" : Name
|
||||
- "StartDisabled" : Whether the entity starts disabled.
|
||||
|
||||
# INPUTS
|
||||
- "Enable" : Enable the logic_relay. Allowing it to be triggered.
|
||||
- "Disable" : Disable the logic_relay. Prevent it from being triggered.
|
||||
- "Trigger" : Trigger the logic_relay. Will fire the OnTrigger output.
|
||||
- "Toggle" : Toggle between Enabled/Disabled.
|
||||
- "CancelPending" : Not yet implemented. Will cancel any outputs currently scheduled to trigger.
|
||||
- "EnableRefire" : Not yet implemented. Will be called on itself automatically after all outputs finish their job.
|
||||
|
||||
# OUTPUTS
|
||||
- "OnSpawn" : Triggered when the map is loaded for any reason.
|
||||
- "OnTrigger" : Triggered only when a new game starts on this level.
|
||||
|
||||
# SPAWNFLAGS
|
||||
- ONCE (1) : Remove itself from the level permanently when activated.
|
||||
- FAST (2) : Allow retriggering even when not all outputs are done firing.
|
||||
|
||||
# NOTES
|
||||
When a logic_relay is removed via spawnflag ONCE it won't survive match respawns.
|
||||
|
||||
# TRIVIA
|
||||
This entity was introduced in Half-Life 2 (2004).
|
||||
*/
|
||||
class
|
||||
logic_relay:NSPointTrigger
|
||||
{
|
||||
|
@ -47,7 +77,7 @@ void
|
|||
logic_relay::Respawn(void)
|
||||
{
|
||||
InitPointTrigger();
|
||||
m_bEnabled = m_bStartDisabled;
|
||||
m_bEnabled = (m_bStartDisabled) ? false : true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -19,6 +19,41 @@ enumflags
|
|||
LOGICTIMER_OSCILLATOR
|
||||
};
|
||||
|
||||
/*!QUAKED logic_timer (1 0 0) (-8 -8 -8) (8 8 8) OSCILLATOR
|
||||
# OVERVIEW
|
||||
Will trigger its outputs at fixed/random intervals, much like the entity random_trigger.
|
||||
|
||||
# KEYS
|
||||
- "targetname" : Name
|
||||
- "UseRandomTime" : Boolean value that determines whether it's random, or fixed.
|
||||
- "LowerRandomBound" : The lower limit of a random trigger timer.
|
||||
- "UpperRandomBound" : The upper limit of a random trigger timer.
|
||||
- "RefireTime" : Fixed time in seconds. Only when UseRandomTime is set to 0.
|
||||
- "StartDisabled" : Boolean value that determines whether we should not start triggering at level start.
|
||||
|
||||
# INPUTS
|
||||
- "Enable" - Enable the timer logic.
|
||||
- "Disable" - Disable the timer logic.
|
||||
- "Toggle" - Toggle between Enable/Disable.
|
||||
- "ResetTimer" - Resets the timer, and starts it.
|
||||
- "FireTimer" - Forcefully triggers the OnTimer outputs.
|
||||
- "RefireTime" - Sets a new firing time from the data field.
|
||||
- "LowerRandomBound" - Sets the lower limit of a random trigger timer from the data field.
|
||||
- "UpperRandomBound" - Sets the upper limit of a random trigger timer from the data field.
|
||||
- "AddToTimer" - Adds the number of seconds from the data field to the current timer.
|
||||
- "SubtractFromTimer" - Removes the number of seconds from the data field to the current timer.
|
||||
|
||||
# OUTPUTS
|
||||
- "OnTimer" : Triggered when the map is loaded for any reason.
|
||||
- "OnTimerHigh" : Triggered only when a new game starts on this level.
|
||||
- "OnTimerLow" : Triggered when the map is loaded via save game.
|
||||
|
||||
# SPAWNFLAGS
|
||||
- OSCILLATOR (1) : Instead of triggering the OnTimer output, will flip-flip between OnTimerHigh and OnTimerLow.
|
||||
|
||||
# TRIVIA
|
||||
This entity was introduced in Half-Life 2 (2004).
|
||||
*/
|
||||
class
|
||||
logic_timer:NSPointTrigger
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue