Smellis
New member
- Joined
- May 22, 2011
- Messages
- 22
Could anyone give me any tips with "[cnt]" im trying to make a script that creates 10 platoons in a random spot, that respawn after killed. in previous versions i got one platoon to respawn after they died and stopped the loop after i press escape but once i started messing with count to try and get many platoons to do this i started to get in over my head hehe. anyone know how to repair this?
this is the code that worked to spawn infinite platoons after each one died.
Code:
define script Fight
begin script Fight
cnt = 0
qplatoon[cnt] = 0
qRandomnumber = 0
Randomnumber = 0
Middle = marker at {1250,29,1110}
start
begin loop
qRandomnumber = number from -423 to 423
Randomnumber = number from -423 to 423
//randomnumber is radius of map from middle
if qplatoon[cnt] not exists
qplatoon[cnt] = create platoon PLATOON_INFO_AZTEC_RANGED_3 at {Middle}+{Randomnumber,0,qRandomnumber} with 100 men and 0 women
cnt ++
end if
wait until cnt == 10
end loop
end script Fight
this is the code that worked to spawn infinite platoons after each one died.
Code:
define script Fight
begin script Fight
qplatoon = 0
qRandomnumber = 0
Randomnumber = 0
Middle = marker at {1250,29,1110}
start
begin loop
qRandomnumber = number from -423 to 423
Randomnumber = number from -423 to 423
//randomnumber is radius of map from middle
if qplatoon not exists
qplatoon = create platoon PLATOON_INFO_AZTEC_RANGED_3 at {Middle}+{Randomnumber,0,qRandomnumber} with 100 men and 0 women
end if
until key KB_ESC down
end loop
end script Fight