[Sandbox] Extend the Enlisted game triggers with AND gate, OR gate, and a randomizer

Introduction

Game triggers is a set of powerful templates that allow modders to create more complex mods without rewriing the game script.
It works by emitting game trigger events that are listened by other game trigger entities set to the same signal ID, and in turn allows some form of implementation of logic flow (i.e. if-then-else)

Currently, the set includes appearance and disappearance detection, box and sphere zone, and a timer for emitting game trigger signal.

What is being suggested

The follow items are candidates to be considered adding to the game

  1. AND gate:
  • Listens for a list of game trigger events and store a list of booleans as their trigger status.
  • Emits a signal with specified event name if and only if all game trigger events in the list of hashes has been emitted at least once.
  • Includes a field for listening to a separate event, which resets the trigger status list when it gets triggered. (Resets the gate)
  1. OR gate
  • Listens to all trigger events in a list of trigger names.
  • Emits a signal with specified event name when any of the gamr trigger events gets triggered.
  • Unlike the AND gate, this one doesn’t need resetting
  1. Randomizer
  • Stores a list of selectable event names, a list of weights, and listens to event name
  • When said event name gets triggered, randomly pick a event name from the list and emit it, with respect to the chances list generated by the weight list
  • Reference for the logic of the randomizer can be found by looking at the random_weapon_box logic

I must thank that one developer for adding Enlisted game triggers to the game script library in the first place. It was the one of the biggest addition to Enlisted modding in the past year.

It now just need some improvements…

… and as readers, please support by indicating your choice below~

  • Yes
  • No
0 voters
4 Likes

I don’t know what this is, but you have my full support

1 Like

No, that was a joke, I know your awesome work!

1 Like