Random Action System

Edy

You can change this now in User CP.
Reaction score
0
I need little help to create a trigger that per % - do random action
 

Edy

You can change this now in User CP.
Reaction score
0
You need to be waaaaay more specific.

I will can try to explain an example trigger i want to create

Events
Unit - A unit enters 'Zone1'
Conditions
((Entering unit) has buff 'ICE') Equal to True
Actions
Action - Has 10% change to increase its agility by 2
Action - Has 40% change for 12 enemy units to die
Action - Has 60% change to Create units in a 'Zone1'
Trigger - Turn off (This trigger)


Something similar like this, all kind of random actions if they are possible, and just 1 action must happen
 

Solu9

You can change this now in User CP.
Reaction score
216
From the top of my head you could do it like this:

Trigger:
  • Randomnizzle
    • Events
      • Unit - A unit enters Region 001 <gen>
    • Conditions
    • Actions
      • Set Integer_Random = (Random integer number between 1 and 10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Random Equal to 1
        • Then - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Random Equal to 2
        • Then - Actions
        • Else - Actions


Doing it this way is very ugly though and can possibly end in a HUGE trigger.

You could also do:

Trigger:
  • Randomnizzle
    • Events
      • Unit - A unit enters Region 001 <gen>
    • Conditions
    • Actions
      • Set Integer_Random = (Random integer number between 1 and 10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Random Equal to 1
        • Then - Actions
          • Run Trigger_Random [1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Random Equal to 2
        • Then - Actions
          • Run Trigger_Random [2]
        • Else - Actions


This way you create a trigger for each event you want, and run the trigger number in the Trigger_Random array corresponding to the outcome of Integer_Random.
It's neater and personally I can't find a better way to do it.
 

Edy

You can change this now in User CP.
Reaction score
0
From the top of my head you could do it like this:

Trigger:
  • Randomnizzle
    • Events
    • Unit - A unit enters Region 001 <gen>
    • Conditions
    • Actions
    • Set Integer_Random = (Random integer number between 1 and 10)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Integer_Random Equal to 1
    • Then - Actions
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Integer_Random Equal to 2
    • Then - Actions
    • Else - Actions


Doing it this way is very ugly though and can possibly end in a HUGE trigger.

You could also do:

Trigger:
  • Randomnizzle
    • Events
    • Unit - A unit enters Region 001 <gen>
    • Conditions
    • Actions
    • Set Integer_Random = (Random integer number between 1 and 10)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Integer_Random Equal to 1
    • Then - Actions
    • Run Trigger_Random [1]
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Integer_Random Equal to 2
    • Then - Actions
    • Run Trigger_Random [2]
    • Else - Actions


This way you create a trigger for each event you want, and run the trigger number in the Trigger_Random array corresponding to the outcome of Integer_Random.
It's neater and personally I can't find a better way to do it.

The first one is the best, i think, thx again
Exacly what i was searching for, i owe you mate
 

vypur85

Hibernate
Reaction score
803
To extend a lil from the above post,

> Integer_Random Equal to 1
This means the randomness is fixed at 10%.

> Integer_Random Less than or Equal to 6
This means the randomness is 60%.

> Integer_Random Less than or Equal to 4
This means the randomness is 40%.
 
  • Like
Reactions: Edy

Edy

You can change this now in User CP.
Reaction score
0
To extend a lil from the above post,

> Integer_Random Equal to 1
This means the randomness is fixed at 10%.

> Integer_Random Less than or Equal to 6
This means the randomness is 60%.

> Integer_Random Less than or Equal to 4
This means the randomness is 40%.

interesting, i could use this, thx
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top