triggers for 'istouching' in liberation....

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

triggers for 'istouching' in liberation....

Post by Splaetos »

first off... thank you bjarne for the liberation scripts for mohaa!!

now if only mine will work =)

I am making two liberation maps, set in prison type environments, one is quite far along... I want to do a bunch of redesigning but the main hurdle is getting these prison counters to work.

so triggers.... Ive not used trigger-multiple for much of anything up till now, but from looking at several maps, and reading a few things, It seems that most of them are just small boxes meant to 'go off' whenever someone approaches. Also, I gathered from the breakthrough tutorial that the trigger had to be in a 'box' basicaly though im not sure to what extent.

anyway, I made several triggers, but the basic simple one is the one im concerned with right now. In a room that consists only of 4 walls, a roof and a floor, I have a trigger-multiple with a targetname $allied_sensor1. In the thread where the trigger comes into play, is the statement...

if(local.player istouching $allied_sensor1)

should that prove true, it should print something for my reference, and incremet the number of axis in prison. I know that the script works up till then because the number of axis in the GAME is successfully incremented, but little or nothing happens when I run around my trigger.

Is there something else I have to do to my triggers? Im not sure what im missing here...

Most of my scripting for this portion is drawn directly, from the canal liberation script, and I beleive the relevant portions of it are posted in Bjarne's thread on canal.
When I am king, you will be first against the wall~
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 »

i'm guessing that you've already used
local.player = parm.other

and what your trying to do is find out how many axis are in the trigger,

your problem is your only checking to see if someone is in the trigger while they're in the trigger,

what you'll need...
once the player has triggered the check you'll need to constantly need to check until he leaves the trigger, and you'll need to check that he's still alive,

main:
thread axis_check
thread allied_check
end

axis_check:
$allied_sensor1 waitTill trigger
local.player = parm.other
if (local.player.counting == 1)
{
end
}
else
{
local.player.counting = 1
local.player thread touching
}
end

touching:
while (self.counting == 1)
{
if !(self istouching $allied_sensor1)
{level.axis_counters--
self.counting = 0}
if !(isalive self)
{level.axis_counters--
self.counting = 0}
wait 1}
end

do the same for allies and then you'll have a number in level.axis_counters and level.allied_counters as the number of people touching the trigger

alternatively

create a second trigger_multiple around your 1st and have it so it tells the player that he's no longer touching the $allied_sensor1, remember to leave enough of a gap so they can't trigger both at once, and remember to add a variable so they'll only be checked once for not touching it
hope this helps, prob not cos it's all foreign 2 me :-/
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

your problem is your only checking to see if someone is in the trigger while they're in the trigger,
its already in a loop that checks for axis, allies, spectators and then axis in jail, allies in jail, once a second or so.

I think perhaps the problem is a misconception i attained from decompiling maps.

edit- problem was definately a misperception on my part, but thats bound to happen a bit when you learn half this mapping stuff from 50 different sources, as well as decompiling maps(which never works perfect, but can give you major insights at times lol)
When I am king, you will be first against the wall~
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

After a lot of Liberation talk here in the forum, I picked myself together and completed the Liberation for MOH:AA tutorial. It now actually tells you the details, and allows you to download an example map file and script.

If you find any errors, please fix them yourself or comment the error ( you can because its a Wiki :D ).
Admin .MAP Forums
Image
Head above heels.
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

that woul,d have helped me heaps about a week and a half ago =)

two things...

You do know that in your canal map players can indeed bash each other?

And the one thing that I didnt see explained in the tutorial was the creation and use of the trigger multiple, to count the prisoners, but I didnt read it close enough perhaps?
When I am king, you will be first against the wall~
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Never actually tested tha bashing after I thickened the clip the first time... but if an axis stands that close, I'd hit him: so lets call it realism ;)

You are right, I forgot to mention the prison volume triggers. But maby you can add a descripton of how to do those ( Remember: it's a Wiki :) ), I'm off to bed right now.
Admin .MAP Forums
Image
Head above heels.
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

wiki means nothing to me lol... dunno what it is...

as far as the bashing, you are right, especialy on canal, but strangely guys jsut LOVE to try and bash the prisoners. and of course, for the prisoners there is no risk =p

On the other hand, ive been shot through the clipping too, but perhaps I was standing too close, and my arms stuck out....
When I am king, you will be first against the wall~
Image
Post Reply