| 09-15-2004, 10:02 PM | #1 |
When the map starts, how do i make a unit spawn in 1 of 4 places. Its random. i cant figur it out... |
| 09-15-2004, 10:17 PM | #2 |
Here is what you want. Code:
Make Units
Events
Map initialization
Conditions
Actions
Set varMiscInt = (Random integer number between 1 and 4)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
varMiscInt Equal to 1
Then - Actions
Unit - Create 1 Seal for Player 1 (Red) at (Center of RegRand1 <gen>) facing (Random angle) degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
varMiscInt Equal to 2
Then - Actions
Unit - Create 1 Seal for Player 1 (Red) at (Center of RegRand2 <gen>) facing (Random angle) degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
varMiscInt Equal to 3
Then - Actions
Unit - Create 1 Seal for Player 1 (Red) at (Center of RegRand3 <gen>) facing (Random angle) degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
varMiscInt Equal to 4
Then - Actions
Unit - Create 1 Seal for Player 1 (Red) at (Center of RegRand4 <gen>) facing (Random angle) degrees
Else - ActionsThe Random number triggers are found under Math - Random Number. The Random Angle is just for fun. |
| 09-15-2004, 10:59 PM | #3 |
it's best to make several small triggers if it's multiplayer, because internet lag can cause trouble for long triggers to run properly |
| 09-15-2004, 11:02 PM | #4 |
or set 4 regions to spots in a region array. so reg1 = regarray[1], reg2 = regarray[2] etc. then you have a trigger create 1 (the unit) at regarray[random number between 1 & 4] |
| 09-16-2004, 06:44 AM | #5 | ||
Quote:
THAT'S not a long trigger. A long trigger is 15+ different random spawn locations. You should also create the unit first, and then move "Last created unit" to one of the 4 spots, just like he said. Quote:
More effective, more complicated for newbies. |
| 09-16-2004, 03:08 PM | #6 | |
Quote:
thats stupid... having MORE triggers would cause more lag... If its in 1 trigger its more streamline and does everything in one go instead of doing each thing 1 at a time. |
| 09-16-2004, 08:34 PM | #7 | |
Quote:
|
| 09-17-2004, 10:05 AM | #8 | |
Quote:
If you plan on running one trigger and do everything or have one trigger pull a lot of triggers, wouldn't there be a performance loss? Apart from memory? |
| 09-17-2004, 01:00 PM | #9 |
ok... with this small of a trigger, 10 triggers versus 1 tigger really will make such an unnoticeable difference |
| 09-17-2004, 02:58 PM | #10 |
thanx guys! all all of them helped! THanx again! |
| 09-17-2004, 11:14 PM | #11 | |
Quote:
|
