Page 1 of 1

New mapper needs help!

Posted: Wed Aug 07, 2002 4:14 pm
by swskier
Im working on a SP map where you have to eliminate a group of soldiers, how do i make the objective to kill everyone? thanks!

(this post probably belongs in the scripting forum, sorry)

Posted: Thu Aug 08, 2002 9:27 am
by UBER_SOLDAT
You need to have in your script a variable like level.enemy_count, and that when one of the enemies dies, level.enemy_count -- , and then have:

'if (level.enemy_count ==0)
{
waitthread global/objectives.scr::add_objectives etc
}

so if there are no more soldiers left, it will add an objective. There should be a tut for adding objectives somewhere.

make sure you put at the start of your script that level.enemy_count = 20, or however many enemies you've got.

Posted: Fri Aug 09, 2002 3:09 am
by swskier
i have no idea what you mean :roll: are there any tutorials i could look at?
thanks!

Posted: Fri Aug 09, 2002 12:30 pm
by UBER_SOLDAT
heres what you'd write:

main

level waittill prespawn

exec global ai.scr
etc

level waittill spawn

////////////
$enemy thread enemy_death //$enemy is your enemies targetname

enemy_death:

if (isALive self) //if hes alive, it will end
{
end
}

level.enemy_count -- //subtract from counter of enemies alive
/////////////

end

thats all i know about this. look at the nebelwerfer level script for help, that has an objective for destroying a set number of objects [nebelwerfers], so that should help