Jump to content
Hard2Kill

Detecting what height someone is at

Recommended Posts

Hi guys,

 

I am building a mission but am having trouble, I want to set up a  trigger to activate when a player descends through 200m. I have Googled it and scoured the forums for an answer but every one doesn't work. Currently the trigger i have (that doesn't work is getPos pl1 select 2 == 200 I placed this in the condition area, set the activation to anybody and the trigger size to 10000 by 10000 so it fits the whole map)  Any help is appreciated. 

Share this post


Link to post
Share on other sites

So, in the activation try:

p1 getPosATL select 2 < 200

The problem with your activation was the position of p1 with getPos, sorry i can't help more, my break is over and I'm back to work :)

  • Like 2

Share this post


Link to post
Share on other sites

"player descends through 200m" = 200m above sea level or 200m above the ground, or 200m above the ground or sea?

 

Height is tricky thing in Arma, due to multiple height datums (0 points) to measure position. Different commands use different formats, and not all formats can be converted to the others.

See: https://community.bistudio.com/wiki/Position

 

You may also need to consider the case of the player being in a vehicle:

(getPosXXX vehicle player) select 2 < 200

getPosXXX isn't a real command, you'll need to choose the correct one that suits your needs.

  • Like 1

Share this post


Link to post
Share on other sites

So, in the activation try:

p1 getPosATL select 2 < 200

The problem with your activation was the position of p1 with getPos, sorry i can't help more, my break is over and I'm back to work :)

 

 

"player descends through 200m" = 200m above sea level or 200m above the ground, or 200m above the ground or sea?

 

Height is tricky thing in Arma, due to multiple height datums (0 points) to measure position. Different commands use different formats, and not all formats can be converted to the others.

See: https://community.bistudio.com/wiki/Position

 

You may also need to consider the case of the player being in a vehicle:

(getPosXXX vehicle player) select 2 < 200

getPosXXX isn't a real command, you'll need to choose the correct one that suits your needs.

 

Thanks guys for the help however I just tried them out and experimented with them, unfortunately they did't work. I tried

p1 getPosATL select 2 < 200 

and it just returned an error, then I saw 

(getPosATL vehicle player) select 2 < 200 

and sadly the trigger wouldn't work either, I am sure that the script i'm trying to run works as it works when i set it up as a radio trigger.

Share this post


Link to post
Share on other sites

Sorry, just rereading the posts, i incorrectly named your unit p1, whereas you've named it pl1. Also, in my haste i said that you had the ordering of getPos wrong but you were right (and me embarrassed at such a dumb mistake)...... So:

(getPosATL pl1) select 2 < 200

If you set the trigger's activation to that then you should be able to set its area to 0, as the trigger will then wait until that condition returns true (i.e. pl1 goes below 200m above the terrain) .

Again, sorry for the bum steer.

Edit: In future, if you have an error, include it cause it'll often help solve the problem.

Share this post


Link to post
Share on other sites

So you want a trigger to activate if the player is less than 200 metres high?

Bohemia added trigger heights just recently so in the trigger:

size: A:10000, B:10000, C:200

Activation: Group Leader (To do this just group the player to the trigger)

ActivationType: Present

condition: this

OnActivation:*Insert script or whatevs)

If you want to make it repeatable then just click on the repeat box.

Hope this helps

Share this post


Link to post
Share on other sites

Beno_83au, it works like a charm, thanks a million, i spotted the name last night. Also in future i will include the error! thanks again.

 

Sorry, just rereading the posts, i incorrectly named your unit p1, whereas you've named it pl1. Also, in my haste i said that you had the ordering of getPos wrong but you were right (and me embarrassed at such a dumb mistake)...... So:

(getPosATL pl1) select 2 < 200

If you set the trigger's activation to that then you should be able to set its area to 0, as the trigger will then wait until that condition returns true (i.e. pl1 goes below 200m above the terrain) .

Again, sorry for the bum steer.

Edit: In future, if you have an error, include it cause it'll often help solve the problem.

 

Jstibbsy, thanks for the help however where is the trigger height, it might just be that im on the apex branch but all i see is A, B and angle?

 

So you want a trigger to activate if the player is less than 200 metres high? Bohemia added trigger heights just recently so in the trigger: size: A:10000, B:10000, C:200 Activation: Group Leader (To do this just group the player to the trigger) ActivationType: Present condition: this OnActivation:*Insert script or whatevs) If you want to make it repeatable then just click on the repeat box. Hope this helps

Share this post


Link to post
Share on other sites

If you're on apex preview branch you should see Position: X, Y, Z, Rotation: Z and Size: A, B, C. C is the height attribute.

Share this post


Link to post
Share on other sites

If you're on apex preview branch you should see Position: X, Y, Z, Rotation: Z and Size: A, B, C. C is the height attribute.

 

Thanks, just saw it there in the 3D editor!

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

×