creating a meeting point

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
cp51
Corporal
Posts: 27
Joined: Thu Jun 12, 2003 7:35 pm

creating a meeting point

Post by cp51 »

hi,

i want to make a meeting point, where atleast one player on the allies has to make it to in the coarse of the map. it would be an objective in the map. i figure it is something like in the map the hunt, where when you cross into the second half of the level, it says allies have breached the perimeter. i have it set up where the allies have to blow up something, but i also want atleast one of them to make it to this one point on the map...

does anyone know how to do this?

thanks
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 »

running usually works :P

if you mean scripting it then ur in the wrong forum, but i'll let them move ya with the answer :D

create a trigger->multiple where the "meeting point" is
key: setthread
value: we_are_there
key: targetname
value: final_check_point

then in the script, if you know how 2 make 1, if not see the tutorials, put

we_are_there:
if ( parm.other.dmteam == allies )
{
teamwin allies
}


it's that simple :D
hope this helps, prob not cos it's all foreign 2 me :-/
cp51
Corporal
Posts: 27
Joined: Thu Jun 12, 2003 7:35 pm

Post by cp51 »

thanks,

i did that, and put the code in the scr but, it doesnt work how i wanted. the way it is now, it is that if the person stepsinto the meeting zone, the level ends. however, i want them to have to blow up something also. both objectives have to be completed inorder to beat the level.

here is how i have the bomb set to win, currently:

allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy)
wait .1
teamwin allies
end

i want it to look for the bomb to explode, and for someone to be in the meeting zone. where would i add the code you posted to make this work?

o, and sorry about posting this in the mapping forum and not in the scripting one.

thanks for the help
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 »

i don't mind you posting it in here, but u lose the brains of all the other scripters,

put in the main thread
$final_check_point nottriggerable

and in the allies_bomb_win thread put
$final_check_point triggerable

pretty self explanitory of what this does, but just incase

the trigger can't be activated until the bomb has been exploded, so the meeting place trigger can then be triggered :D
Last edited by nuggets on Fri Jun 13, 2003 8:36 pm, edited 1 time in total.
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

missing stuff

Post by tltrude »

You have left out a few things nugget.

we_are_there:

local.player = parm.other
if ( local.player.dmteam == allies )
{
level.targets_destroyed ++ // adds one
$final_check_point nottriggerable
}
end

Your value for level.targets_to_destroy should be 2.
Last edited by tltrude on Sat Jun 14, 2003 3:53 am, edited 1 time in total.
Tom Trude,

Image
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 »

no i haven't, change what needs changing when it's wrong ;)

local.player = pram.other??? should this be parm
and then should this not be
parm.other = local.player

which is the default anyway when it's not defined???

level.targets_destoryed is only a counter, a counter isn't needed if the targets can only be reached in one order:- detonating the bomb and then making the check point :D no offense meant
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

order

Post by tltrude »

How do you know the bomb will be blown up first? It is safer to make it so it can go either way. In other word, make both of them objectives that can be done in any order.

Yes, I wrote parm wrong, but the line was in the right order. Here is part of a similar thread from the obj_dm.scr:

-------------------------------------------------------------------
local.player = parm.other
//"local.player.dmteam", can be 'spectator', 'freeforall', 'allies' or 'axis'
if (local.player.dmteam != level.planting_team)
{
goto bomb_waittill_set
println "failed dmteam check" local.player.dmteam
}
-------------------------------------------------------------------

That line checks the stats of any player that enters the trigger. I don't know if the way you had it would of done that, but the guy did say it didn't work.
Tom Trude,

Image
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 »

getting to the meeting point completes the mission, there's not a lot of point getting to the meeting point and "escaping" if the bomb hasn't been detonated

the objectives MUST be done in that order, therefore the meeting place trigger is only being triggerable to complete the mission once the bombs been set and detonated
hope this helps, prob not cos it's all foreign 2 me :-/
cp51
Corporal
Posts: 27
Joined: Thu Jun 12, 2003 7:35 pm

Post by cp51 »

k,

thanks guys, i got it to work. umm... i didnt try triggering the meeting point before i set the bomb, though... i just have one problem now. after the allies win the first time, everytime the level restarts the allies just win for no reason... here is what i did:

i combined both of your suggestions. i made it where there are 2 obj. in the level, and made both the bomb and the meeting point add one to the counter. adn then i just linked the bomb to enable the meeting point to be triggerable. here is the code:

allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy) // While undestroyed objectives left
level.targets_destroyed ++
waitframe // chill out
$final_check_point triggerable
thread we_are_there
end // end allied victory test

we_are_there:
if ( parm.other.dmteam == allies )
{
level.targets_destroyed ++
teamwin allies
}
end

do you see anything that is wrong that will cause it to keep triggering? ill look into it some more, and let you know if i find anything. im not a very good scripter, actually ive never scripted for a map beore, so i do a lot of guess and check, heh.

thanks for the help
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 »

never listen to 2 scripters at once :p

especially when one has the answers to one outcome and the other has an alternate way that won't work with any of the previous code

1) the counter isn't being reset and won't be unless you have a "main" thread

2) the trigger for the meeting point is trigger multiple, if it's entered twice then allies will win without the bomb having to be detonated

3) level.targets_destroyed is a counter that is not needed unless there are multiple bombs or multiple other objectives, as the meeting place is the only thing that can win the level, there's only 1 objective

allies_win_bomb:
$final_check_point triggerable
end

we_are_there:
if ( parm.other.dmteam == allies )
{
teamwin allies
}
end


that's all you need

if you did have multiple bombs or papers that needed retrieving, someone assassinating etc... (another objective)

then you'd need a counter such as
bomb_one:
level.cp51_obj++
if ( level.cp51_obj == 2 ) //2 being the total number of objectives
{
teamwin allies
}
end

bomb_two:
level.cp51_obj++
if ( level.cp51_obj == 2 )
{
teamwin allies
}
end


but if you'd have to then get to the meeting place, you'd have

main:
level.cp51_obj = 0
while ( $chappy isalive )
{
}
else
{
thread dead_guy
}
end

we_are_there:
if ( parm.other.dmteam == allies )
{
teamwin allies
}
end

bomb_one:
level.cp51_obj++
if ( level.cp51_obj == 3 ) //3 being the total number of objectives
{
$final_check_point triggerable
}
end

bomb_two:
level.cp51_obj++
if ( level.cp51_obj == 3 ) //3 being the total number of objectives
{
$final_check_point triggerable
}
end

dead_guy:
level.cp51_obj++
if ( level.cp51_obj == 3 ) //3 being the total number of objectives
{
$final_check_point triggerable
}
end

that kind of thing, hope i haven't made it all too confusing
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply