Skip to main content

Random activators selector

warning

ONLY for one type of activator.

Example, you have 3 PLAYER_ALL_CLICK activator and you want to activate only one.

  • So, first create your different activators ! (3 activator PLAYER_ALL_CLICK in my example)
  • Then go out the activators editor and return to the item editor.
  • Go in the Variables part.

  • Create a new variable. name: randActivator and with default value: 0

  • Okay now that you have have configured your variable, you will need to initialize it. So you need to create a new activator with the same option that the activators created in the step 1. for my example its a PLAYER_ALL_CLICK activator.
  • In the part of this activator, go in the Variables modification part.

  • Create a new variable Modification

  • Select the variable previously created randActivator

  • Set to type of modification on SET

  • and in modification set the placeholder %rand:1|X%but replace X by the amount of the activators that you will created in the random list

  • for my example %rand:1|3%

  • Save

  • Okay so now, each time the activator will be activated, the variable randActivator will take a value between 1 and 3 (includes).

  • Now we will associate 1 = first activator, 2 = run second activator...

  • So no for each activators created in the step 1, go in their editor, click on the conditions button and placeholders Conditions button.

  • Create a new placeholder cdt.
  • Type : PLAYER_NUMBER
  • First part: %var_randActivator_int%
  • Comparator: EQUALS
  • Second part: X (example with 3 activators, the first must have X replace by 1, the second X replace by 2 ....)
  • Don't touch to the others features, if you don't need it
  • Then save the condition
  • Repeat that obviously for all the other activator created in the step 1
danger

LAST STEP: you will probably need to open the file (.yml) of your item. because the activator that initialize the variable must be runned first. so in the list of the activator it must be the first !


If its not the case, place it correctly in the first position, save, and reload EI.

tip

FINISH ! I hope you understand now a bit how it works,

If the guide wasn't clear enough or there was a mistake, please contact me (Ssomar)

{% embed url="https://discord.com/invite/TRmSwJaYNv" %}