• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Random not working

Status
Not open for further replies.
Level 13
Joined
Sep 14, 2008
Messages
1,408
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

  • Azazel's Hero Survival.w3x
    1.4 MB · Views: 43
Last edited:
Level 10
Joined
Jan 28, 2009
Messages
394
Already did that... and I started the map from warcraft (without the test function)
won't work either...

It always picks Hero 2 and 4

BTW: before using this i had "random number between 1 - 4"
There he always picked 2 and 3

Try random number between 0 - 5?
 
Level 4
Joined
Jun 8, 2007
Messages
89
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.
Top