OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: R.I.P-omega- on 17 Sep 2005, 15:34:05
-
Hi im makeing a mission and there is a point in the mission where the player needs to get on a scaffold and shoot from there, is there a way to make a trigger wrok from a certen hight?
for a instance if ill be under the trriger nothing will happen or if ill be on top of a triiger nothing will happen ethir only if im at the same hight of the trriger....
PS- mind my english :)
-
AFAIK triggers are not height specific, in other words they work whatever your height, as long as the subject enters the area covered by the trigger.
Edit: Ummmmm......think I might have misunderstood the question..........never mind ;D
Planck
-
if its only for the player then put this in the condition field of the trigger (which is activated by player present):
this AND (getpos player select 2)==8
this should do it. it assumes that the player is called "player" and that the height you are after is about 8 (you can change this with testing). syntax not guaranteed.
-
Don't use ==. Use <= or >=, possibly in combination depending on exactly what you want.
-
good point. otherwise you have to be at exactly 8. make it variable between 7 and 9 rather than a flat 8.
so:
this AND (getpos player select 2)<= 9 AND (getpos player select 2)>= 7
i think
-
WoW guys you dont know how much you have helped me :D
BIIIIIG THX!
-
Addendum to:
http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=25605
Take care with select 2 if the unit is in or over a building. The distance then is measured from the unit down to the nearest usable floor. So for example a unit on the top floor of a three floor building will have a getPos select 2 value of close to zero, just as it would if it was on the middle floor or the ground floor.
I will leave this open a little while before solving it in case there other comments.
-
Yea I was gonna suggest this but he hit the solve button before he actualy solved it... If a unit is on a building or scaffold, the z pos (getpos unit select 2) will register as 0, so you need to use a different method such as distance.
-
yea sorry for tha misstake i did :P i tryed it out and the trriger dosent work while im on the scaffold.
PS- shold i unsolve the topic or contunue posting on this one?
I merged this topic with the original topic and unsolved the original.......Planck
-
To do this I placed a game logic high over the building (1000 m) and had a trigger covering the building. I grouped the trigger with the player and had inthe condition field:
this and (player distance gameLogicName < 999.9)
Play with the last number to get it to fire on the correct floor.
-
I grouped the trigger with the player
how do i do that?
-
Click on Groups F2 at the top of hte Mission Editor Screen. Click and hold on the trigger, then drag and drop a thin light blue line on to the group leader.
-
be sure to check the activation conditions afterwards (the east/west present stuff) as they will change when grouped
-
To do this I placed a game logic high over the building (1000 m) and had a trigger covering the building. I grouped the trigger with the player and had inthe condition field:
this and (player distance gameLogicName < 999.9)
Play with the last number to get it to fire on the correct floor.
didnt work..... i did exactly what you said and still it didnt work :(
-
Did you set the height of the GameLogic? To to this you will need to put the following code in the init field of the GameLogic:
this setpos [(getpos this select 0), (getpos this select 1), 1000]
-Student Pilot
-
Did you set the height of the GameLogic? To to this you will need to put the following code in the init field of the GameLogic:
this setpos [(getpos this select 0), (getpos this select 1), 1000]
-Student Pilot
yes i did still dosent work....
-
I suggest you tell us exactly what you did. Copy and paste the various fields of the trigger and the init field of the GL and describe the trigger fields that you can't copy.
-
it works(my misstake i forgot to name the game logic...) BUT i need it to work on the TOP of the scaffold becuse it dose work BUT it all so works when im at the buttom of the scffolld...
-
make the distance smaller until it works at the height you want
-
well it works thx to you all you have helped me alot! :D