Page 1 of 1
How would I change the objective?
Posted: Thu Aug 07, 2003 2:04 pm
by Lt. Striker
Sorry this is probally a dumb question but I suck at scripting. I read the objectives tutorial and was wondering how would I change that objective to a different one and make it end after that is completed?
Posted: Thu Aug 07, 2003 2:12 pm
by Serph
as you said i suck at scripting..... try the scripting forum...
as for your question, im not to great at scripting either

but plenty of wise men in the scripting forum
Posted: Thu Aug 07, 2003 2:51 pm
by Bjarne BZR
Yuo need to be more exact: What do you have and what do you want?
Posted: Thu Aug 07, 2003 3:06 pm
by Lt. Striker
On the tutorial it shows you the script to make it have an objective but the objective is go through the door and beyond. How would I change that to something like if I added some AIs how would I change the objective to Eliminate AIs and have the level end after they do eliminate all the AIs?
Posted: Thu Aug 07, 2003 3:59 pm
by Serph
why not make it when the all ai are dead, they have to go to an exit..
Posted: Thu Aug 07, 2003 9:59 pm
by Lt. Striker
Well how would I make it so that they cant go out the exit until all the ai are dead?
Posted: Fri Aug 08, 2003 7:40 am
by bdbodger
well if all ai have the same name such as $badguys then what you could do is put a brush with the clip texture on it in front of the door and make it a script object . Give it a targetname such as $doorclip and put a trigger_use in front of that give that a name such as $doorlock_trigger . Then do this for the trigger
key:setthread value:lockthread
main:
thread door
end
door:
while !($badguys.size<1)
waitframe
$doorclip remove
$doorlock_trigger remove
end
lockthread:
self playsound door_wood_locked_clue
end
also if you spawn your ai with the global/ai.scr it makes a variable called level.totalbaddies that is equal to the number of spwaned ai that are alive.
Posted: Fri Aug 08, 2003 8:05 am
by jv_map
bdbodger wrote:
while !($badguys.size<1)
waitframe
Well actually this waits till all dead bodies of the badguys have dissappeared. Something like this may be better:
Code: Select all
while !(local.ok)
{
local.ok = 1
for(local.i = 1; local.i <= $badguys.size; local.i++)
{
if(isAlive $badguys[local.i])
{
local.ok = 0
break
}
}
waitframe
}
Posted: Fri Aug 08, 2003 1:28 pm
by Lt. Striker
Ok thanks I will try that.
