• 🏆 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!

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