Jump to content
Sign in to follow this  
kocrachon

Hight check?

Recommended Posts

So I am doing a mission inside of a hotel, and in it I want to try to set a trigger for when the player reaches the specific floor. I am trying this current script but it seems to not work right..

(getPos Soldier1 select 2) <= 11

The trigger sets of right away, even before I hit the elevation of 11.

11 is the elevation that should trigger it off, anyone able to help?

Share this post


Link to post
Share on other sites

You got it reversed (smaller or equal instead of greater or equal) ;)

It should be

(getPos Soldier1 select 2) >= 11

Share this post


Link to post
Share on other sites

oh jesus... I cant believe i got my > and < mixed up... thanks *face palm*

Share this post


Link to post
Share on other sites

Hmm, strangley, I set it the right way, but now the trigger doesn't activate at all...

EDIT:

Looks like the reason for that is the fact that as long as my guy is walking on the floor of the building, he is still at an altitude of "1". Anyone know of a way around this?

Edited by HavocDemon

Share this post


Link to post
Share on other sites
Hmm, strangley, I set it the right way, but now the trigger doesn't activate at all...

EDIT:

Looks like the reason for that is the fact that as long as my guy is walking on the floor of the building, he is still at an altitude of "1". Anyone know of a way around this?

getPosASL :)

Share this post


Link to post
Share on other sites

I've tried getposasl in my own missions but at least prior to 1.16 it has bugged in buildings as well.

Here's a workaround in the form of a script:

activatetrigger=false

_detector = "Logic" createvehicle [0,0,0]

#loop

~1

_detector setpos [(getpos Soldier1 select 0),(getpos Soldier1 select 1)]

?(Soldier1 distance _detector)>=11:activatetrigger=true

goto "loop"

It counts the distance between the unit and a game logic that is on ground level.

Put activatetrigger==true into the condition box of the trigger.

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  

×