• 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.

Randomness...

Status
Not open for further replies.
Level 4
Joined
Dec 15, 2007
Messages
96
I need a simple way to make an action to happend randomly, like, an example here (Hmm); a cinematic of 2 sheeps. yellow and purple one, and then 1 of the sheeps dies, but random which one! get it? :wbored:

Mmkay, examples are welcome Ty.
 
Level 2
Joined
Dec 23, 2007
Messages
23
You could make several integer arrays. Like this

set integer[1] = random number between 1-2
set integer[2] = random number between 1-2
if integer[1] == 1
create 1 sheep at x
if integer[1] == 2
create 1 pig at x
if integer[2] == 1
order y to attack x
if integer[2] == 2
order y to move to x


just having a different integer for every unit, action, ect. and having it be random. it'll take time but it's the only way i know to do it.
 
Level 9
Joined
Jun 26, 2005
Messages
511
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing kill sheep as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 2) Equal to 1
        • Then - Actions
          • Unit - Kill (Yellow Sheep)
        • Else - Actions
          • Unit - Kill (Purple Sheep)
  • [trigger/]
  • you can have what ever event you want
 
Status
Not open for further replies.
Top