Back to wiki
This post is unpublished.
Double check all the info, and if it's ready, click the "publish" button in the post summary.

Events 101

Author:
Zednosius

Category:
Events

Posted:
4 months ago

Revisions:
3 revisions

Last updated:
4 months ago

Events

Attached to every Rule is an Event. Events are the core components of every workshop game. They are what drives your workshop game's logic and makes things happen. There are currently seven different event types, they are as follows.

  • Ongoing - Global
  • Ongoing - Each Player
  • Player Earned Elimination
  • Player Dealt Final Blow
  • Player Dealt Damage
  • Player Took Damage
  • Player Died

Each event type has a default circumstance under which they trigger and execute their actions. These circumstances can be further restricted by setting Conditions on the event.

Ongoing Events

An Ongoing event will check if its Conditions has become True each server tick. If they have, the actions of the Event will be executed. This means that if the Conditions were True the previous tick and are still True in the current tick, nothing will happen. This means that if the Conditions never go back to False this particular Event instance will never trigger again.

Ongoing - Global

This event type continually checks if its Conditions has become True, if so the actions will be executed. An event of this type with no Conditions will trigger immediately upon server start.

Ongoing - Each Player

This event type continually checks if it's Conditions has become True in the context of Event Player, if so the actions will be executed. An event of this type with no Conditions will trigger immediately upon server start.

Contextual Value(s): Event Player

The difference between this event and the Ongoing - Global event is that for every update, one check per player is done. The actions will then be executed for each player that satisfies the Conditions. Event Player is a contextual Value that refers to the Current Player that is being checked by the rule. By referring to the Event Player in the conditions and actions, we can make a rule that can trigger for every player or some specific players if we want. Example: This event will heal every player the moment their health percentage falls under 10%. (Note: The player is not healed if they have a debuff negating healing or the damage was enough to kill them)

  • Event : Ongoing - Each Player
    • Conditions
      • Health Percent(Event Player) < 0.1
    • Actions
      • Heal(Event Player, Null, 1000)

Situation Driven Events

A situation driven Event is only checked whenever its situation occurs in game. For example, Player Died is only checked when a player dies. Situations are often represented from multiple perspectives, e.g. Player Dealt Damage and Player Took Damage are two perspectives on the same event. This means that you are free to create your rules from the perspective you think best fits the logic of it.

Since these events are situation driven they contain contextual values other than Event Player. The following are the current contextual values

  • Victim - The player on the other end of the stick.
  • Attacker - The player holding the stick.
  • Event Damage - The damage the that was inflicted upon the Victim.
  • Event Was Critical Hit - Whether the inflicted damage was a headshot.

Player Earned Elimination

This event type triggers for a player when they are credited for an elimination and the Conditions evaluate to True.

Contextual Value(s): Event Player, Victim, Attacker, Event Damage, Event Was Critical Hit

Victim is a reference to the player that died and Attacker refers to Event Player. Event Damage is the damage that killed the Victim.

Player Dealt Final Blow

This event type triggers for a player when the deal the final blow, killing another player, and the Conditions evaluate to True.

Contextual Value(s): Event Player, Victim, Attacker, Event Damage, Event Was Critical Hit

Victim is a reference to the player that died and Attacker refers to Event Player. Event Damage is the damage that killed the Victim.

Player Dealt Damage

This event type triggers for a player when they deal damage to another player and the Conditions evaluate to True.

Contextual Value(s): Event Player, Victim, Attacker, Event Damage, Event Was Critical Hit

Victim is a reference to the player that took damage and Attacker refers to the Event Player. Event Damage is the damage that the Event Player dealt.

Player Took Damage

This event type triggers for a player when they take damage from another player and the Conditions evaluate to True.

Contextual Value(s): Event Player, Victim, Attacker, Event Damage, Event Was Critical Hit

Victim is a reference to the Event Player and Attacker refers to the player that dealt the damage. Event Damage is the damage that the Event Player took.

Player Died

This event type triggers for a player when they die and the Conditions evaluate to True.

Contextual Value(s): Event Player, Victim, Attacker, Event Damage, Event Was Critical Hit

Victim is a reference to the Event Player and Attacker refers to the player that dealt the final blow, if there is one. Event Damage is the damage that killed the Event Player.