• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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

  • 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