Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: Height Activated Trigger  (Read 2038 times)

0 Members and 1 Guest are viewing this topic.

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Height Activated Trigger
« on: 01 Sep 2005, 09:14:05 »
ive been trying to ge this to work, and im having difficultys with it, What im trying to do is when you land a BIS Camel the trigger is activated i cant seem to get it to work though, this is what im trying to do in the editor>

Condition: this && Getpos Player select 0 < 2

that didnt work, i also tried the following:

this && Getpos Player select 0 <= 2
this && Getpos Player select 0 >= 2
this && Getpos Player select 0 == 0
this && Getpos Player select 0 > 2

no luck with any of them though  
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Height Activated Trigger
« Reply #1 on: 01 Sep 2005, 09:55:52 »
Do you need the 'this &&' part of it? What type of trigger are you using?

silent1

  • Guest
Re:Height Activated Trigger
« Reply #2 on: 01 Sep 2005, 10:09:40 »
If you're trying to activate the trigger when the plane reaches a certain height, then you need the 'z' value, and that should be

Code: [Select]
Getpos Player select 2 < 2
Couple of other ideas if this doesn't work.

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re:Height Activated Trigger
« Reply #3 on: 01 Sep 2005, 12:17:06 »
it is a trigger over an airfield that you are meant to land at, i want the trigger to activate when the player lands, or gets down to 2 meters or less on the air field, and the trigger is grouped to the player's aircraft, all i want it to do is activate when the player lands at this specific airfield. i just tried that now silent1 and it didnt work :(
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

bored_onion

  • Guest
Re:Height Activated Trigger
« Reply #4 on: 01 Sep 2005, 13:51:37 »
silent1 is on the right track. to isolate the height you do need the z coordinate using getpos player select 2. try putting

Code: [Select]
height = getpos player select 2
in the init line of the player and then in your script try

Code: [Select]
condition: this AND height =< 2
this might help

also try a higher number like 3 because the vehicle you are in might be holding you slightly above 2

hope this helps :-\
« Last Edit: 01 Sep 2005, 13:53:24 by bored_onion »

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re:Height Activated Trigger
« Reply #5 on: 01 Sep 2005, 17:22:51 »
tired it and it still dosnt work
« Last Edit: 01 Sep 2005, 17:23:16 by Ding »
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

bored_onion

  • Guest
Re:Height Activated Trigger
« Reply #6 on: 01 Sep 2005, 17:33:32 »
what is in the activation field of the trigger (eg. west present). it might be that it isnt completing that. either that or my snytax is wrong  :-[

Offline Pilot

  • Contributing Member
  • **
Re:Height Activated Trigger
« Reply #7 on: 01 Sep 2005, 17:44:47 »
maybe "()" are required?

this AND (getpos player select 2) < 2

or

this AND ((getpos player select 2) <2)

I don't know, just thinking out loud right now.

-Student Pilot

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Height Activated Trigger
« Reply #8 on: 01 Sep 2005, 18:00:43 »
bored_onion is close I think, but by setting the variable height in the player's init field will just set it to the value at the start of the mission.  Maybe that is what you want and I just mis-read the quesiton.

You have a trigger right?  It is grouped with the player right?  It activates when the vehicle is in the trigger area right?

Then put the following in the condition field of the trigger:

this and (getPos (vehicle player) select 2 <= 2)

The trigger will then fire when the player's vehicle is in the trigger area and the height of the vehicle is <= 2.

Check that you have 0 inthe Min Max and Mid fields.


The problem might be that the getPos select 2 of a player in a vehicle might behave the same as it does when he is in a building, it measures his height from the floor he is standing/sitting on.  You could check this by creating a repeatable radio trigger with the following inthe activation field:

hint format["height of player = %1\nheight of plane = %2",getPos player select 2,getPos (vehicle player) select 2]

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re:Height Activated Trigger
« Reply #9 on: 01 Sep 2005, 18:28:05 »
works perfectly thobson, thanks to everyone for your replys :)
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re:Height Activated Trigger
« Reply #10 on: 02 Sep 2005, 08:31:55 »
For some reason it has suddenly stopped working,i just put an aircraft in the editor and when i landed using that command it worked, but then i copyed the plane and the trigger into my other mission, they were still grouped and then made myself the player of that plane and it didnt work when i tried to land it  ???
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Height Activated Trigger
« Reply #11 on: 02 Sep 2005, 08:57:23 »
Have you used my hint to find out the height of the player and the plane?  What are the results?

Is it the same island, and the same place on that island?

Bye the way I thing I was wrong in suggesting that getPos in a vehicle might be working the same way it does in a house.  The problem could well have been that although the plane was on the ground the player was still > 2 m above ground

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re:Height Activated Trigger
« Reply #12 on: 02 Sep 2005, 09:05:29 »
its the same island in exactly the same place, i changed it up to 20 and it still didnt work, i also then changed the trigger to a regular this, Grouped it to the plane, and it still didnt work? ??? im probably doing somthing realy obviously wrong but i cant see what it is.

ive figuerd out what hte problem is, for some reason End1 isnt working (maybe because i used it in the intro?) i'll just use end2 instead.
« Last Edit: 02 Sep 2005, 09:11:43 by Ding »
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Height Activated Trigger
« Reply #13 on: 02 Sep 2005, 09:11:42 »
What results do you get from the hint I gave you?

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re:Height Activated Trigger
« Reply #14 on: 02 Sep 2005, 09:42:17 »
the result i got was that the plane was at -1 (rounded up) and the player was at 0.8 (Rounded Up), well it works fine now, thanks :D
"If I remain lost and die on a cross, atleast I wasn't born in a manger"