counting dead enemy soldiers
Posted: Tue May 03, 2005 6:52 pm
I have some enemy soldiers that spawn on my map and the objective is to kill them all before moving onto the next obhective.
In the map my soldiers are set to #set1 and have the $targetname of enemyspawner and i have this script...
obj2:
waitthread global/objectives.scr::add_objectives 1 1 "Kill any german soldiers" $obj2.origin
// Turn on objective #2 and set it as current objective.
waitthread global/objectives.scr::add_objectives 1 2
waitthread global/objectives.scr::current_objectives 1
thread spawnset1
end
spawnset1:
$first_trigger waittill trigger
thread global/ai.scr::spawnset 1 spawn 1
level.bad_guys_left = 0
$spawn1 thread BadGuyCheck
end
BadGuyCheck:
level.bad_guys_left++
self waittill death
level.bad_guys_left--
if ( level.bad_guys_left==0 )
{
// second mission complete check it off...
waitthread global/objectives.scr::add_objectives 1 3
waitthread global/objectives.scr::current_objectives 0
thread obj3
}
end
The problem is when i have killed all the soldiers it will not move onto the next obj,am i missing something here?
Oh yeah $first_trigger is to trigger the spawners and i clear the objectives after each mission so they are al objective 1 3 etc..
In the map my soldiers are set to #set1 and have the $targetname of enemyspawner and i have this script...
obj2:
waitthread global/objectives.scr::add_objectives 1 1 "Kill any german soldiers" $obj2.origin
// Turn on objective #2 and set it as current objective.
waitthread global/objectives.scr::add_objectives 1 2
waitthread global/objectives.scr::current_objectives 1
thread spawnset1
end
spawnset1:
$first_trigger waittill trigger
thread global/ai.scr::spawnset 1 spawn 1
level.bad_guys_left = 0
$spawn1 thread BadGuyCheck
end
BadGuyCheck:
level.bad_guys_left++
self waittill death
level.bad_guys_left--
if ( level.bad_guys_left==0 )
{
// second mission complete check it off...
waitthread global/objectives.scr::add_objectives 1 3
waitthread global/objectives.scr::current_objectives 0
thread obj3
}
end
The problem is when i have killed all the soldiers it will not move onto the next obj,am i missing something here?
Oh yeah $first_trigger is to trigger the spawners and i clear the objectives after each mission so they are al objective 1 3 etc..