Jump to content
Sign in to follow this  
lightspeed_aust

set height of trigger

Recommended Posts

say i want the trigger zone on the 3rd level of a building - how to set it for a height. I can do it for objects but not sure about the trigger.

thanx

Share this post


Link to post
Share on other sites

On Act.:

if (unit getpos select 2 > 7) then
{
 //blah
}

Just let the script check the unit's height.

Triggers can't be set to a certain height afaik.

Share this post


Link to post
Share on other sites

You can also just have it as a condition

condition

(unit getpos select 2 > 7)

or

condition

this and (unit getpos select 2 > 7)

Share this post


Link to post
Share on other sites

Don't use getPos. It will return height of 0 for units on any floor of the building. Try this instead:

(unit modelToWorld [0,0,0]) select 2

Share this post


Link to post
Share on other sites
Triggers can't be set to a certain height afaik.

They can actually, but... I've only got it to affect sound effects set in the trigger (in the effects tab). I use if for "dynamic volume control of sound effects", such as wind sound. The list the trigger area generates (at least circular ones) seems to be infinite cylinders rather than spheres, at least in the upward direction. I haven't checked if moving a circular trigger up still lists things below it.

Share this post


Link to post
Share on other sites

I assume you want to check if a unit which fits certain criteria is on 3rd floor in a building for example?

I don't think you can do what you want that way by moving the trigger.

Instead you can do this. Set the corresponding triggerside and condition, eg. ANYBODY and PRESENT for example. Then you can do something like this:

Condition: found = false; {if (getPosATL _x select 2 > 14.0) then {found = true;};} forEach thisList; found;

On Act: hint "On 3rd floor";

You of course will have to find the correct height of the floor above terrain level (ATL). I don't think the loop will cause much performance issue since thisList is empty when noone is there, which means theres nothing to check. If there is something then it only has to do it once, assuming you've not set it to repeating.

Share this post


Link to post
Share on other sites

Here's a kind of similar question. I have a blufor plane flying through a trigger that I don't want to trip it. But I have blufor units on the ground that I do want to trip it.

Is there a way to get the trigger to ignore the plane?

Share this post


Link to post
Share on other sites

Try this for the condition line:

this && {((getPosATL _x) select 2) < 5} count thislist > 0

Now the trigger should only fire when there is at least one foot soldier in it.

If you work with thislist later you still have to filter out the plane within that script.

Share this post


Link to post
Share on other sites

Thanks Deadfast. That worked a treat on getting the infantry triggers to only trip when ground units went into them and nothing airbourne.

And as for the last trigger that the ground units wouldn't encounter anyway, I just grouped that one to the specific unit (a helicopter) that had to trigger it.

So now the plane can fly through all the triggers and it doesn't set off any of them.

Sorted :D

Share this post


Link to post
Share on other sites

Is there a way to tweek this into a script or trigger so that it only fires for the players above 50 altitude ?

Condition: found = false; {if (getPosATL _x select 2 > 50.0) then {found = true;};} forEach thisList; found;

On Act: hint "Someone detected above 50";

A script would be great. If it had to be a trigger I could just make it as big as the map.

Thank you in advance.

Share this post


Link to post
Share on other sites

you can set a trigger to any height you want, thus the sounds played from trigger pos will be up in air etc.

but you can adjust the range of trigger only in x and y directions, z axis is infinite in triggers, so it will detect anythig 5000 above it or whatever even when its only 50 big .

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×