An objective has been completed! ..help?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
cjrs
Corporal
Posts: 35
Joined: Tue Dec 31, 2002 7:08 am
Location: Canada
Contact:

An objective has been completed! ..help?

Post by cjrs »

Ok. I have a map where you're undercover in a German base. The objectives are snipe and kill an officer, then escape. I'm using the tutorial on the site to create the officer, but how would I go about making the "escape"? Triggering? And how do I get it to show up in obj list?
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Ok, create a trigger multiple where you want to escape. Give it a setthread "objective2". Put a script origin with targetname "obj2" above it.
Now for the scripting:

thread objectives

objectives:
waitthread global/objectives.scr::add_objectives 1 2 "Kill the officer" $obj1.origin //your officer
//code here
waitthread global/objectives.scr::add_objectives 2 2 "Escape." $obj2.origin// the script origin used to make the compass point to the escape way.
waitthread global/objectives.scr::current_objectives 1
end

//objective 1 code here
thread obj1_complete
end

obj1_complete:
waitthread global/objectives.scr::add_objectives 1 3 "Kill the officer." $obj1.origin
end

objective2: //the setthread in the trigger
thread levelend
end

levelend:
waitthread global/objectives.scr::add_objectives 2 3 "Escape" $obj2.origin
waitthread global/objectives.scr::current_objectives 0
exec global/missioncomplete.scr
end

That's it.
Live to map, not map to live.
-mohaa_rox, .map
moderator
cjrs
Corporal
Posts: 35
Joined: Tue Dec 31, 2002 7:08 am
Location: Canada
Contact:

Post by cjrs »

w00t w00t, i'm beginning to love this site.
Post Reply