How would I change the objective?
Moderator: Moderators
- Lt. Striker
- Second Lieutenant
- Posts: 165
- Joined: Thu Jun 26, 2003 12:03 am
How would I change the objective?
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?
<LT.STRIKER><LT.STRIKER>
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
- Lt. Striker
- Second Lieutenant
- Posts: 165
- Joined: Thu Jun 26, 2003 12:03 am
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?
<LT.STRIKER><LT.STRIKER>
- Lt. Striker
- Second Lieutenant
- Posts: 165
- Joined: Thu Jun 26, 2003 12:03 am
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.
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.
Well actually this waits till all dead bodies of the badguys have dissappeared. Something like this may be better:bdbodger wrote: while !($badguys.size<1)
waitframe
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
}
- Lt. Striker
- Second Lieutenant
- Posts: 165
- Joined: Thu Jun 26, 2003 12:03 am


