![]() | |
| | #1 |
![]() Join Date: Oct 2007
Posts: 1,089
![]() ![]() | random reigens so far i have Code: timer
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Countdown Timer - Start timer as a Repeating timer that will expire in 5.00 seconds
Countdown Timer - Create a timer window for timer with title Spawn Time
Countdown Timer - Show (Last created timer window)
Set region[1] = starting spot 1 <gen>
Set region[2] = starting spot 2 <gen>
Set region[3] = starting spot 3 <gen>
Set region[4] = starting spot 4 <gen>
Set region[5] = starting spot 5 <gen>
Set region[6] = starting spot 6 <gen>
Set region[7] = starting spot 7 <gen>
Set region[8] = starting spot 8 <gen>
For each (Integer B) from 1 to 8, do (Actions)
Loop - Actions
Set random[(Integer B)] = (Random integer number between 1 and 8)
Unit - Create 1 Rifleman for (Player((Integer B))) at (Center of region[random[(Integer B)]]) facing Default building facing degrees |
| | |
| | #2 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Re: random reigens Code: timer
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Countdown Timer - Start timer as a Repeating timer that will expire in 5.00 seconds
Countdown Timer - Create a timer window for timer with title Spawn Time
Countdown Timer - Show (Last created timer window)
Set region[1] = starting spot 1 <gen>
Set region[2] = starting spot 2 <gen>
Set region[3] = starting spot 3 <gen>
Set region[4] = starting spot 4 <gen>
Set region[5] = starting spot 5 <gen>
Set region[6] = starting spot 6 <gen>
Set region[7] = starting spot 7 <gen>
Set region[8] = starting spot 8 <gen>
For each (Integer B) from 1 to 8, do (Actions)
Loop - Actions
Unit - Create 1 Rifleman for (Player((Integer B))) at (Center of region[(Integer B)]) facing Default building facing degrees |
| | |
| | #3 |
![]() Join Date: Oct 2007
Posts: 1,089
![]() ![]() | Re: random reigens if you do it like that the spots well be the same every game. i want the spots to be random. the problem with the my trigger is 2 people might start in the same spot and i dont want that. |
| | |
| | #4 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Re: random reigens Code: timer
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Countdown Timer - Start timer as a Repeating timer that will expire in 5.00 seconds
Countdown Timer - Create a timer window for timer with title Spawn Time
Countdown Timer - Show (Last created timer window)
Set region[1] = starting spot 1 <gen>
Set region[2] = starting spot 2 <gen>
Set region[3] = starting spot 3 <gen>
Set region[4] = starting spot 4 <gen>
Set region[5] = starting spot 5 <gen>
Set region[6] = starting spot 6 <gen>
Set region[7] = starting spot 7 <gen>
Set region[8] = starting spot 8 <gen>
For each (Integer B) from 1 to 8, do (Actions)
Loop - Actions
For each (Integer A) from 1 to 0, do (Actions)
Loop - Actions
Set random = (Random integer number between 1 and 8)
Set temp_unitgroup = (Units in (region[random]))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in temp_unitgroup) Greater than 1
Then - Actions
Else - Actions
Unit - Create 1 Rifleman for (Player((Integer B))) at (Center of region[random]) facing Default building facing degrees
Custom script: call DestoryGroup(udg_temp_unitgroup)
Custom script: exitwhen true "Custom script: exitwhen true" - Will exit the loop it's looping in. |
| | |
| | #5 |
![]() Join Date: Oct 2007
Posts: 1,089
![]() ![]() | Re: random reigens what did i do wrong? Code: timer
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Countdown Timer - Start timer as a Repeating timer that will expire in 5.00 seconds
Countdown Timer - Create a timer window for timer with title Spawn Time
Countdown Timer - Show (Last created timer window)
Set region[1] = starting spot 1 <gen>
Set region[2] = starting spot 2 <gen>
Set region[3] = starting spot 3 <gen>
Set region[4] = starting spot 4 <gen>
Set region[5] = starting spot 5 <gen>
Set region[6] = starting spot 6 <gen>
Set region[7] = starting spot 7 <gen>
Set region[8] = starting spot 8 <gen>
For each (Integer B) from 1 to 8, do (Actions)
Loop - Actions
For each (Integer A) from 1 to 0, do (Actions)
Loop - Actions
Set random2 = (Random integer number between 1 and 8)
Set temp_unitgroup = (Units in region[random2])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in temp_unitgroup) Greater than 1
Then - Actions
Else - Actions
Unit - Create 1 Rifleman for (Player((Integer B))) at (Center of region[random2]) facing Default building facing degrees
Custom script: call DestoryGroup (udg_temp_unitgroup)
Custom script: exitwhen true Last edited by shocker; 04-12-2008 at 01:07 PM. |
| | |
| | #6 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Re: random reigens I spelled "DestoryGroup" wrong =|. Try "DestroyGroup". |
| | |
| | #7 |
![]() Join Date: Oct 2007
Posts: 1,089
![]() ![]() | Re: random reigens well the exitwhen true makes nothing happen so i redid some parts and got this Code: timer
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Countdown Timer - Start timer as a Repeating timer that will expire in 5.00 seconds
Countdown Timer - Create a timer window for timer with title Spawn Time
Countdown Timer - Show (Last created timer window)
Set region[1] = starting spot 1 <gen>
Set region[2] = starting spot 2 <gen>
Set region[3] = starting spot 3 <gen>
Set region[4] = starting spot 4 <gen>
Set region[5] = starting spot 5 <gen>
Set region[6] = starting spot 6 <gen>
Set region[7] = starting spot 7 <gen>
Set region[8] = starting spot 8 <gen>
For each (Integer B) from 1 to 8, do (Actions)
Loop - Actions
For each (Integer A) from loop2[(Integer B)] to 0, do (Actions)
Loop - Actions
Set starting_spot_player[(Integer B)] = (Random integer number between 1 and 8)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
starting_spot_player[(Integer B)] Not equal to starting_spot_player[((Integer B) - 1)]
starting_spot_player[(Integer B)] Not equal to starting_spot_player[((Integer B) - 2)]
starting_spot_player[(Integer B)] Not equal to starting_spot_player[((Integer B) - 3)]
starting_spot_player[(Integer B)] Not equal to starting_spot_player[((Integer B) - 4)]
starting_spot_player[(Integer B)] Not equal to starting_spot_player[((Integer B) - 5)]
starting_spot_player[(Integer B)] Not equal to starting_spot_player[((Integer B) - 6)]
starting_spot_player[(Integer B)] Not equal to starting_spot_player[((Integer B) - 7)]
Then - Actions
Unit - Create 1 Rifleman for (Player((Integer B))) at (Center of region[starting_spot_player[(Integer B)]]) facing Default building facing degrees
Set loop2[(Integer B)] = 0
Else - Actions at lest now they dont spawn in the same spot |
| | |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||||
| Thread | Thread Starter | Forum | Replies | Last Post | ||
| Random Assorted Ideas | TheStinger | World War Z | 1 | 04-04-2008 10:25 PM | ||
| Dead_Spirt | World Editor Help | 0 | 03-21-2008 03:17 PM | ||
| Dead_Spirt | World Editor Help | 0 | 03-21-2008 03:10 PM | ||
| New Hero! Jinn Kinichy | Matar | Ultimate Footmen | 31 | 12-19-2006 04:02 PM | ||