Home   Help Search Login Register  

Author Topic: SetPos a trigger to the surface of the earth  (Read 695 times)

0 Members and 3 Guests are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
SetPos a trigger to the surface of the earth
« 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
Code: [Select]
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?


Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:SetPos a trigger to the surface of the earth
« Reply #1 on: 26 May 2005, 18:33:41 »
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...

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:SetPos a trigger to the surface of the earth
« Reply #2 on: 26 May 2005, 18:40:08 »
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.  
Plenty of reviewed ArmA missions for you to play

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:SetPos a trigger to the surface of the earth
« Reply #3 on: 26 May 2005, 21:29:22 »
Maybe try using one of the sound "objects" that appear under the "empty" side? They might behave normally when setpossing them.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:SetPos a trigger to the surface of the earth
« Reply #4 on: 26 May 2005, 22:22:46 »
That is where I started.  The sound objects can't be setPosed (nor can they be created) unfortunately.

Thanks again
« Last Edit: 26 May 2005, 22:23:04 by THobson »

UNN

  • Guest
Re:SetPos a trigger to the surface of the earth
« Reply #5 on: 27 May 2005, 01:49:03 »
Try using the same method Vektorbosons used for his height above seal level function:

Code: [Select]
Trigger01 SetPos [XPos,YPos,0]
Trigger01 SetPos [XPos,YPos,Abs((GetPos Trigger01) Select 2)]

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:SetPos a trigger to the surface of the earth
« Reply #6 on: 27 May 2005, 07:34:33 »
That seeme to be the answer.  Thank you.  When testing this I found a strange thing.  If I use:

Code: [Select]
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:

Code: [Select]
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. :)