• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Need help with a trigger

Status
Not open for further replies.
Level 3
Joined
Feb 12, 2006
Messages
21
Ok this is whats happening in my map there are 4 supply depots but only 1 is real now heres the catch i want the real 1 to be random the real one will contain a Supply Captain now i want him to spawn in any four of these regions but only 1 of the four and im gonna have lot of regions in this map so i dont want the trigger to send the Supply Captain to any other regions but those specific 4.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
integer i ( global )

---YOUR TRIGGER'S ACTIONS---

Set i = Random Integer Between 1 and 4
if i = 1 then
Create 1 Supply Captain at ( your region )
else
if i = 2 then
Create 1 Supply Captain at ( your region )
else
if i = 3 then
Create 1 Supply Captain at ( your region )
else
Create 1 Supply Captain at ( your region )
 
Level 3
Joined
Feb 12, 2006
Messages
21
where is that action i only see

If/then/else
If/then/else multible actions

i dont see

if/else/else/else
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
kind of like Haloboy said, here is it indented

Code:
Set i = Random Integer Between 1 and 4 
if i = 1 then 
    Create 1 Supply Captain at ( your region ) 
else 
    if i = 2 then 
        Create 1 Supply Captain at ( your region ) 
    else 
        if i = 3 then 
            Create 1 Supply Captain at ( your region ) 
        else 
            Create 1 Supply Captain at ( your region )
 
Level 3
Joined
Feb 12, 2006
Messages
21
umm i think i have a problem
with the set action

Set Integer [index] = Random number between 1 and 4

what do i put for index??
 
Level 24
Joined
Jun 26, 2006
Messages
3,406
Well i have a long If/Else thing for death messages, so the same concept will work for you. for the Variable
Set DeathMessage = (Random integer number between 1 and 10)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(DeathMessage Equal to 1) or (DeathMessage Equal to 6)
Then - Actions
Game - Display to (All players) the text: Someone went and go...
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(DeathMessage Equal to 2) or (DeathMessage Equal to 7)
Then - Actions
Game - Display to (All players) the text: BAM HAHAHA...uh I m...
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(DeathMessage Equal to 3) or (DeathMessage Equal to 8)
Then - Actions
Game - Display to (All players) the text: We shall mourn the ...
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(DeathMessage Equal to 4) or (DeathMessage Equal to 9)
Then - Actions
Game - Display to (All players) the text: Damn dude ur hero d...
Else - Actions
Game - Display to (All players) the text: Oooh that one hurt....

So yeah it's long but it shows that you can do a lot with triggers. instead of using [Game - Display to (All players)] use [Unit - Create 1 (unit) for (player) at (Center of (locatino) <gen>)]

and you don't have to use just 1-4, you could do stuff like i did so that it's a little more random, or more complex to make people think you're smart =Þ.
 
Status
Not open for further replies.
Top