Skip to content

Proposal for Triggers

Razvan Deaconescu edited this page Aug 22, 2014 · 6 revisions

Triggers are actions that take place when a certain condition is met. There may be player triggers (when a player collects a certain type of resource, when a player reaches a certain level), general triggers (when a certain day in a game is reached) or game triggers (when a quest ends, when a challenge is run). A trigger is made of two components: a condition and an action. Triggers are the basis for gaining skills, badges and achievements, though they may be used for other items as well.

You may think of triggers as hooks in the code. When ever an event occurs, the hook/trigger is "triggered" and its effect is applied.

Actions on Triggers

Triggers are connected to effects. Triggers are the mapping of an effect to a specific situation/condition. One may consider the casting of a spell to be a trigger. Any running of an effect is caused by a trigger.

A trigger is implemented, similarly to a hook, in a certain area of code such that, when that area is reached, provided the trigger is active, its effect will be applied. The condition/code placing of the trigger is predefined in the implementation; it is identified by an identifier string. Initially there is no effect attached to it: the trigger is disabled.

In Control Panel the privileged user may enable a trigger by providing an effect to it. One may provide multiple effects to a trigger by enabling the trigger multiple times. For example, if the user wishes to enable a trigger that delivers gold to all users in a given day, one would:

  • select the on-day-any-player trigger
  • fill the trigger expression with the day
  • select the effect give-resource and fill its expression

At the beginning of the day the implementation would check the on-day-any-player triggers (there may be multiple such triggers). If that particular day is reached, the give-resource effect is run, delivered the given resource amount to all players.

Triggers may be enabled on a per-game basis, for example one could add specific triggers only for the quest game, or only for the challenge game.

Sample Triggers

This is an initial list of triggers that may be implemented inside wouso. Other triggers may be implemented as well. These are only conditions, effects are to be defined elsewhere.

Player Triggers

  1. on-level-any-player

    • Description: Run effect on player when reaching a given level.
    • Data to be filled: On what level will the effect take place: may be any, or may be specific level.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge)
  2. on-level-any-player-of-group

    • Description: Run effect on any player of a selected group when reaching a given level.
    • Data to be filled: On what level will the effect take place; what group must the player be part of in order for the effect to take place.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  3. on-resource-type-any-player

    • Description: Run effect on any player when reaching a given resource amount.
    • Data to be filled: What type of resource and what amount of that resource.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  4. on-any-day-any-player

    • Description: Run effect at the beginning of every day on each player.
    • Data to be filled: None
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  5. on-day-any-player

    • Description: Run effect at a specific day on each player.
    • Data to be filled: What day will the effect take place?
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).

Game Triggers

  1. on-quest-end-players-complete

    • Description: Run effect when quest ends on players who completed the test.
    • Data to be filled: None
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  2. on-quest-end-players-quest-level

    • Description: Run effect when quest ends on players who reached a given level inside the game.
    • Data to be filled: What level in the quest should players have reached?
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  3. on-quest-start-any-player

    • Description: Run effect on any player who starts the quest.
    • Data to be filled: None
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  4. on-quest-start-player-of-group

    • Description: Run effect on any player of a given group who starts the quest.
    • Data to be filled: What group must the player be part of in order for the effect to take place.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  5. on-challenge-run-players

    • Description: Run effect on players at the running of a challenge.
    • Data to be filled: None
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  6. on-challenge-end-winning-player

    • Description: Run effect on winning player of a challenge.
    • Data to be filled: None
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  7. on-challenge-end-losing-player

    • Description: Run effect on losing player of a challenge.
    • Data to be filled: None
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  8. on-challenge-end-draw

    • Description: Run effect on both players when challenge ends in a draw.
    • Data to be filled: None
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  9. on-number-of-challenges-run-any-player

    • Description: Run effect on player after running number of challenges.
    • Data to be filled: Number of challenges to be run in order to trigger the effect.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  10. on-number-of-challenges-run-in-a-day-any-player

    • Description: Run effect on player after running number of challenges.
    • Data to be filled: Number of challenges to be run in order to trigger the effect.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  11. on-number-of-challenges-won-any-player

    • Description: Run effect on player after winning number of challenges.
    • Data to be filled: Number of challenges to be won in order to trigger the effect.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  12. on-number-of-challenges-won-streak-player

    • Description: Run effect on player after winning number of challenges in a streak (continuously).
    • Data to be filled: Number of challenges to be won in a streak in order to trigger the effect.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  13. on-number-of-qotd-answered-any-player

    • Description: Run effect on player after answering number of questions of the day.
    • Data to be filled: Number of qotd answers required in order to trigger the effect.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  14. on-number-of-qotd-answered-streak-any-player

    • Description: Run effect on player after answering number of questions of the day in a streak (continuously).
    • Data to be filled: Number of qotd answers in a streak required in order to trigger the effect.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  15. on-number-of-qotd-correctly-answered-any-player

    • Description: Run effect on player after answering number of questions of the day correctly.
    • Data to be filled: Number of correct qotd answers required in order to trigger the effect.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
  16. on-number-of-qotd-correctly-answered-streak-any-player

    • Description: Run effect on player after answering number of questions of the day correctly in a streak (continuously).
    • Data to be filled: Number of correct qotd answers in a streak required in order to trigger the effect.
    • Effect: What is the effect when trigger is run (e.g. give resource, give artifact, give badge).
Clone this wiki locally