• 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 Action?

Status
Not open for further replies.
Level 2
Joined
Jul 17, 2008
Messages
21
I'm trying to make a trigger that randomly does one of many actions. My current method of doing this is horrendous. I would post it here but I don't know how to get triggers to show on the forums (I'm new here).

Thanks in advance.
 
Level 14
Joined
Jan 15, 2007
Messages
349
You could make it like that:
  • Set someinteger = (Random integer number between 1 and 10)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Conditions
      • someinteger Equal To 1
    • 'THEN'-Actions
      • Your actions
    • 'ELSE'-Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Conditions
      • someinteger Equal To 2
    • 'THEN'-Actions
      • Your actions
    • 'ELSE'-Actions
Or you make a trigger array where every trigger got different actions and then just do this:
  • Trigger - Run sometrigger[(Random integer number between 1 and 10)] (checking conditions)
Btw you show triggers with [Trigger.][/Trigger.], just without the point.
 
Level 35
Joined
Oct 9, 2006
Messages
6,394
There is a button for it (the gear) just write your trigger down as it looks in the trigger menu in world editor (write it correctly) and then mark it all and click the gear button.

Btw
Introduce yourself to hive in the something else -> introduction tread.

btwbtw:

If you can't see the gear button you might have to change your user settings for message board or whatever its called. (see user cp -> settings)
 
Level 2
Joined
Jul 17, 2008
Messages
21
Thanks for the help, I got it working perfectly!

For laughs:

  • Test
  • Events
  • Time - Every 16.00 seconds of the game.
  • Actions
  • Unit - Set life of RandomizerFrog 0170 <gen> to 5.00
I had that for six frogs then I had a tigger to check if the health of each frog was below or above 15 to pick a action.
 
Level 35
Joined
Oct 9, 2006
Messages
6,394
Thanks for the help, I got it working perfectly!

For laughs:

  • Test
  • Events
  • Time - Every 16.00 seconds of the game.
  • Actions
  • Unit - Set life of RandomizerFrog 0170 <gen> to 5.00
I had that for six frogs then I had a tigger to check if the health of each frog was below or above 15 to pick a action.

Hehe, I did nearly the same with a victory condition once, just with rabbits instead. (And keep in mind that was for a real map)
 
Status
Not open for further replies.
Top