all i want is one objective!!!!!

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
williewisp
First Lieutenant
Posts: 208
Joined: Fri May 16, 2003 1:10 pm
Location: ireland

all i want is one objective!!!!!

Post by williewisp »

:? i'm doing this level at the mo, it's single player, going grand.
i have3 stuka plane set up so u can blow them up(workin grand), how would i set them as 1 objective so that every time 1 was blowin up it would take it off a counter, say like "destroy the planes, 3 remaining", "destroy the planes, 2 remaining" and so on. and how would i get the compass to point to the close'st 1?????????? anyone got any ideas?

also how do i set it so that i can only see a certain amount of the level cus at the mo, i done a big open area to try this out, wit a few things stuck in it, it wants to show me all.?????????? :lol:
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

//code up here

waitthread global/objectives.scr::add_objectives 1 2 "Destroy the planes [3 remaining]." $firstplane.origin
thread bombfirst
end

bombfirst:
//bombing code
iprintlnbold_noloc "First Plane Destroyed."
wait 1
waitthread global/objectives.scr::add_objectives 1 2 "Destroy the planes [2 remaining]." $secondplane.origin
thread bombsecond
end

bombsecond:
//bombing code
iprintlnbold_noloc "Second Plane Destroyed."
wait 1
waitthread global/objectives.scr::add_objectives 1 2 "Destroy the planes [1 remaining]." $thirdplane.origin
thread bombthird
end

bombthird:
//bombing code
iprintlnbold_noloc "Third Plane Destroyed."
wait 1
waitthread global/objectives.scr::add_objectives 1 3 "Destroy the planes [0 remaining]." $thirdplane.origin //place a check over obj
end
Live to map, not map to live.
-mohaa_rox, .map
moderator
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

will only work if they're blown up in that order though, best to add a counter

level.wisp_counter = 3

then instead of using
waitthread global/objectives.scr::add_objectives 1 2 "Destroy the planes [2 remaining]."

use

level.wisp_counter = level.wisp_counter - 1
waitthread global/objectives.scr::add_objectives 1 2 "Destroy the planes [" level.wisp_counter " remaining]."

that'll do the trick :D
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

or you could do this...

whenever a plane was destroyed, it would take away one, until it goes to 0...

//code blah blah

//somewhere before the threads are started, type this line...

level.planesleft = 3
waitthread global/objectives.scr::add_objectives 1 2 "Kill stukas. [3 remaining]"

//blah blah

$stuka1 thread obj_stuka_death
$stuka2 thread obj_stuka_death
$stuka3 thread obj_stuka_death
thread stuka_obj
end

obj_stuka_death:

self waittill death //the one that called the thread will wait till it dies...
iprintlnbold_noloc "Stuka Destroyed...HAHAHA"
level.planesleft--
end

stuka_obj:

if (level.planesleft == 2)
{
waitthread global/objectives.scr::add_objectives 1 2 "Kill stukas. [2 remaining]"
}

if (level.planesleft == 1)
{
waitthread global/objectives.scr::add_objectives 1 2 "Kill stukas. [1 remaining! Dont screw it up!!!!!]"
}

if (level.planesleft == 0)
{
waitthread global/objectives.scr::add_objectives 1 3 "Kill stukas. - Completed"
}
end
User avatar
williewisp
First Lieutenant
Posts: 208
Joined: Fri May 16, 2003 1:10 pm
Location: ireland

Post by williewisp »

cheers for that men, twas buggin me that thing :lol: :lol:
it's not a time for thinking its a time for drinking!
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

nuggets wrote:will only work if they're blown up in that order though, best to add a counter
yup, simple, but not realistic. :wink:
Live to map, not map to live.
-mohaa_rox, .map
moderator
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

but simplistic is better than realistic only if realism isn't an issue :P wahoo new post buttons, when the hell did they get here?

good work SURGEON!!!
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply