[Trigger] Random not working

Status
Not open for further replies.
Level 13
Joined
Sep 14, 2008
Messages
1,407
I run this trigger from another trigger but it won't work... it always selects the same heros...

  • Select Survivors
    • Event
    • Conditions
    • Actions
      • Set randomInt = (Random integer number between 0 and 5)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Condition
          • HeroSelected[randomInt] equal False
        • 'THEN'-Actions
          • Unitgroup - Add Heros[randomInt] to survivors
            • Set HeroSelected[randomInt] = True
            • Set counter = (counter + 1)
        • 'ELSE'-Actions
          • Trigger- Run (This trigger) (ignoring conditions)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Condition
          • counter Gleich numPlayerPlaying
        • 'THEN'-Actions
          • Trigger- Run Survivors <gen> (ignoring conditions)
        • 'ELSE'-Actions
          • Trigger - Run (This trigger) (ignoring conditions)
This is the heros Array..

  • Init variables
    • Event
      • Map initialization
    • Conditions
    • Actions
      • Set Heros[1] = Ambassador of the Moon Guild 0006 <gen>
      • Set Heros[2] = Ambassador of the Blood Guild 0008 <gen>
      • Set Heros[3] = Ambassador of the Shadow Guild 0009 <gen>
      • Set Heros[4] = Ambassador of the Arcane Guild 0007 <gen>

EDIT:

I added the map so you can try it for yourself...

PLEASE help me
 

Attachments

Last edited:
It seems odd to me that this wouldn't work. Have you tried restarting your computer/trying it on a different one? I'm not 100% sure how random numbers are generated, but I do know they involve the system somehow.
 
Status
Not open for further replies.
Back
Top