OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: THobson on 26 May 2005, 18:15:05
-
I have a trigger that is generating some environmental sounds. All is fine if the trigger stays where it is, but I want to setPos it about to different locations.
SetPos ing a trigger seems to put it at sea level even if I do a
trigName setPos [getPos (object _obj) select 0,getPos (object _obj) select 1,0]
A subsequent getPos reveals the trigger to be at -330 or so. The worms at that depth may then be able hear my sounds, but the player on the surface can't.
Does anybody have a solution?
-
If you can get the 'depth' as a value, can't you just change the sign and use it as a positive z component? The SetPos would be in three stages - SetPos to new [x,y,0] coordinates; calculate depth z from GetPos; SetPos to new [x,y,-z].
I think the logic's right...
-
Yes, but setPos works off ground level, not sea level. So he is already setpossing to the right place. It's just not going there.
I think I have heard of something like this before. Triggers are placed at ground level but when you start messing them around they go to sea level in at least some respects.
-
Maybe try using one of the sound "objects" that appear under the "empty" side? They might behave normally when setpossing them.
-
That is where I started. The sound objects can't be setPosed (nor can they be created) unfortunately.
Thanks again
-
Try using the same method Vektorbosons used for his height above seal level function:
Trigger01 SetPos [XPos,YPos,0]
Trigger01 SetPos [XPos,YPos,Abs((GetPos Trigger01) Select 2)]
-
That seeme to be the answer. Thank you. When testing this I found a strange thing. If I use:
trig1 setpos getpos player
trig2 setPos [getpos trig1 select 0,getpos trig1 select 1,abs(getpos trig1 select 2)]then trig2 ends up at height 0 (ie on the surface)
but if instead of the player I use an object:
trig1 setpos getpos (object 2884)as the first line then trig2 ends up at -4.97
So I got the location of object 2884 and found it was at +4.97. Something wierd is happening - but what I now have will do for me.
Thanks again. Yesterday was not a good day - I can already see today will be different. :)