How would I change the objective?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Lt. Striker
Second Lieutenant
Posts: 165
Joined: Thu Jun 26, 2003 12:03 am

How would I change the objective?

Post 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?
<LT.STRIKER><LT.STRIKER>
Serph
Major
Posts: 278
Joined: Wed Jun 11, 2003 5:23 pm
Location: Barrie, Ontario Canada
Contact:

Post by Serph »

as you said i suck at scripting..... try the scripting forum...

as for your question, im not to great at scripting either :D but plenty of wise men in the scripting forum
Image
~serph~
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Yuo need to be more exact: What do you have and what do you want?
Admin .MAP Forums
Image
Head above heels.
User avatar
Lt. Striker
Second Lieutenant
Posts: 165
Joined: Thu Jun 26, 2003 12:03 am

Post 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?
<LT.STRIKER><LT.STRIKER>
Serph
Major
Posts: 278
Joined: Wed Jun 11, 2003 5:23 pm
Location: Barrie, Ontario Canada
Contact:

Post by Serph »

why not make it when the all ai are dead, they have to go to an exit..
Image
~serph~
User avatar
Lt. Striker
Second Lieutenant
Posts: 165
Joined: Thu Jun 26, 2003 12:03 am

Post by Lt. Striker »

Well how would I make it so that they cant go out the exit until all the ai are dead?
<LT.STRIKER><LT.STRIKER>
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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
}
Image
User avatar
Lt. Striker
Second Lieutenant
Posts: 165
Joined: Thu Jun 26, 2003 12:03 am

Post by Lt. Striker »

Ok thanks I will try that. :)
<LT.STRIKER><LT.STRIKER>
Post Reply