Ok my last question for this map!!!

Icey_Gregorio

Member!
Joined
Aug 16, 2004
Messages
129
Reaction score
0
Location
My home
Website
Visit site
I told u it was a short map lol. The problem i got know is there are 4 differnet area's of 14 regions that spawn units. The problem is I need to make it where, every 10 secs a tank spawns in a random region on each of the four sides.

Meaning four differnet spawns every 10 secs and it most be a random region. And there is only one spawn on each side. Not where all four randoms could be on the same side.

So how do I do this random shit, I tried and I jsut got a headace now lol. And thanks a shit load for whoever cracks this for me.
 

SlayMaximus

Member!
Joined
Dec 29, 2003
Messages
64
Reaction score
0
Location
Virginia
Website
www.riplo.com
One way is below. It is not elegant, but it works. There might be a better way. I only made it for four regions since I didn't want to type all morning; you will have to expand it to 14 regions. Also, change the event time to 10 seconds or whatever you want. I have attached the map so you can cut-and-paste these triggers. You also need to define the variables, of course -- see the attached map.

E.

+----Triggers follow----+

Events
Time - Every 3.00 seconds of game time
Conditions
Actions
-------- Get random number and set top region based thereon --------
Set Random = (Random integer number between 1 and 4)
If (Random Equal to 1) then do (Set TopSpawn = Region top1 <gen>) else do (Do nothing)
If (Random Equal to 2) then do (Set TopSpawn = Region top2 <gen>) else do (Do nothing)
If (Random Equal to 3) then do (Set TopSpawn = Region top3 <gen>) else do (Do nothing)
If (Random Equal to 4) then do (Set TopSpawn = Region top4 <gen>) else do (Do nothing)
-------- Get random number and set right region based thereon --------
Set Random = (Random integer number between 1 and 4)
If (Random Equal to 1) then do (Set RightSpawn = Region right1 <gen>) else do (Do nothing)
If (Random Equal to 2) then do (Set RightSpawn = Region right2 <gen>) else do (Do nothing)
If (Random Equal to 3) then do (Set RightSpawn = Region right3 <gen>) else do (Do nothing)
If (Random Equal to 4) then do (Set RightSpawn = Region right4 <gen>) else do (Do nothing)
-------- Get random number and set left region based thereon --------
Set Random = (Random integer number between 1 and 4)
If (Random Equal to 1) then do (Set LeftSpawn = Region left1 <gen>) else do (Do nothing)
If (Random Equal to 2) then do (Set LeftSpawn = Region left2 <gen>) else do (Do nothing)
If (Random Equal to 3) then do (Set LeftSpawn = Region left3 <gen>) else do (Do nothing)
If (Random Equal to 4) then do (Set LeftSpawn = Region left4 <gen>) else do (Do nothing)
-------- Get random number and set bottom region based thereon --------
Set Random = (Random integer number between 1 and 4)
If (Random Equal to 1) then do (Set BottomSpawn = Region bottom1 <gen>) else do (Do nothing)
If (Random Equal to 2) then do (Set BottomSpawn = Region bottom2 <gen>) else do (Do nothing)
If (Random Equal to 3) then do (Set BottomSpawn = Region bottom3 <gen>) else do (Do nothing)
If (Random Equal to 4) then do (Set BottomSpawn = Region bottom4 <gen>) else do (Do nothing)
-------- Create Units --------
Unit - Create 1 Siege Engine for Player 1 (Red) at (Center of TopSpawn) facing (Center of (Playable map area))
Unit - Order (Last created unit) to Move To (Center of Goal <gen>)
Unit - Create 1 Siege Engine for Player 1 (Red) at (Center of RightSpawn) facing (Center of (Playable map area))
Unit - Order (Last created unit) to Move To (Center of Goal <gen>)
Unit - Create 1 Siege Engine for Player 1 (Red) at (Center of BottomSpawn) facing (Center of (Playable map area))
Unit - Order (Last created unit) to Move To (Center of Goal <gen>)
Unit - Create 1 Siege Engine for Player 1 (Red) at (Center of LeftSpawn) facing (Center of (Playable map area))
Unit - Order (Last created unit) to Move To (Center of Goal <gen>)
 

FreeManKiller

Member
Joined
Aug 28, 2004
Messages
9
Reaction score
0
Website
www.battlenetforums.cjb.net
well . . thats the complicated way . . . ill post the simple way . . .make a trigger like below
Event - Every 9.99 seconds of the game
Action - Set varaible (need to make a var with the intiger type) the var u just made = Math - Random number between 1 and 12
now create another var
Event - Every 10 seconds of the game
Action - If/Then/Else - If: (last var u just made) = 1 Then: create one tank at center of (first region) Else: Do nothing.
then repeate the last action 12 times changeing the #1 with the next number.
Then you have one nice trig that spawn 1 unit every 10 seconds at a randome location. :D gl wit ur map ^_^
 

SlayMaximus

Member!
Joined
Dec 29, 2003
Messages
64
Reaction score
0
Location
Virginia
Website
www.riplo.com
That might be too simple freeman - I don't think that will do exactly what he wants since he wants (as I understand) to create units in four areas having 12 regions in each area wherein 1 of the 12 regions in each area are selected at random. But, the basic idea remains the same - create a random number, use an If-Then-Else to create the unit based on the number.

Also, I don't understand why you used the first event every 9.99 seconds of game time to create the random number. Why can't the random number be generated in the event that creates the units every 10 seconds?
 

Icey_Gregorio

Member!
Joined
Aug 16, 2004
Messages
129
Reaction score
0
Location
My home
Website
Visit site
SlayMaximus said:
One way is below. It is not elegant, but it works. There might be a better way. I only made it for four regions since I didn't want to type all morning; you will have to expand it to 14 regions. Also, change the event time to 10 seconds or whatever you want. I have attached the map so you can cut-and-paste these triggers. You also need to define the variables, of course -- see the attached map.

E.

+----Triggers follow----+

Events
Time - Every 3.00 seconds of game time
Conditions
Actions
-------- Get random number and set top region based thereon --------
Set Random = (Random integer number between 1 and 4)
If (Random Equal to 1) then do (Set TopSpawn = Region top1 <gen>) else do (Do nothing)
If (Random Equal to 2) then do (Set TopSpawn = Region top2 <gen>) else do (Do nothing)
If (Random Equal to 3) then do (Set TopSpawn = Region top3 <gen>) else do (Do nothing)
If (Random Equal to 4) then do (Set TopSpawn = Region top4 <gen>) else do (Do nothing)
-------- Get random number and set right region based thereon --------
Set Random = (Random integer number between 1 and 4)
If (Random Equal to 1) then do (Set RightSpawn = Region right1 <gen>) else do (Do nothing)
If (Random Equal to 2) then do (Set RightSpawn = Region right2 <gen>) else do (Do nothing)
If (Random Equal to 3) then do (Set RightSpawn = Region right3 <gen>) else do (Do nothing)
If (Random Equal to 4) then do (Set RightSpawn = Region right4 <gen>) else do (Do nothing)
-------- Get random number and set left region based thereon --------
Set Random = (Random integer number between 1 and 4)
If (Random Equal to 1) then do (Set LeftSpawn = Region left1 <gen>) else do (Do nothing)
If (Random Equal to 2) then do (Set LeftSpawn = Region left2 <gen>) else do (Do nothing)
If (Random Equal to 3) then do (Set LeftSpawn = Region left3 <gen>) else do (Do nothing)
If (Random Equal to 4) then do (Set LeftSpawn = Region left4 <gen>) else do (Do nothing)
-------- Get random number and set bottom region based thereon --------
Set Random = (Random integer number between 1 and 4)
If (Random Equal to 1) then do (Set BottomSpawn = Region bottom1 <gen>) else do (Do nothing)
If (Random Equal to 2) then do (Set BottomSpawn = Region bottom2 <gen>) else do (Do nothing)
If (Random Equal to 3) then do (Set BottomSpawn = Region bottom3 <gen>) else do (Do nothing)
If (Random Equal to 4) then do (Set BottomSpawn = Region bottom4 <gen>) else do (Do nothing)
-------- Create Units --------
Unit - Create 1 Siege Engine for Player 1 (Red) at (Center of TopSpawn) facing (Center of (Playable map area))
Unit - Order (Last created unit) to Move To (Center of Goal <gen>)
Unit - Create 1 Siege Engine for Player 1 (Red) at (Center of RightSpawn) facing (Center of (Playable map area))
Unit - Order (Last created unit) to Move To (Center of Goal <gen>)
Unit - Create 1 Siege Engine for Player 1 (Red) at (Center of BottomSpawn) facing (Center of (Playable map area))
Unit - Order (Last created unit) to Move To (Center of Goal <gen>)
Unit - Create 1 Siege Engine for Player 1 (Red) at (Center of LeftSpawn) facing (Center of (Playable map area))
Unit - Order (Last created unit) to Move To (Center of Goal <gen>)

Ok thank you. I probarly should of metioned the have to go to the region straghit across from them but hey I can probarly do it myself I hope
 

NewPosts

New threads

Top