Home   Help Search Login Register  

Author Topic: inconsistent trigger  (Read 1138 times)

0 Members and 2 Guests are viewing this topic.

Offline mcnorth

  • Members
  • *
inconsistent trigger
« on: 01 Apr 2007, 06:25:04 »
The following code is being used in a trigger to detect Player's proximity to another unit. The other unit is on the second floor of a bombed out building and it's important that the trigger not fire unless the player is on the same floor. This should explain the use of the z coordinate.

Code: [Select]
aP in thislist AND (GetPos aP) select 2 >= (GetPos Troop1) select 2
The trigger works perfectly when tested about 5 or 6 times then it starts malfunction.  Then, when testing again, it fires before the player gets to the second floor, as if that condition didn't even exist.

Any ideas? A better way perhaps? The mission objective is to find the guys that are holed up in the bombed out building, have them join up and then everybody escapes from enemy held territory.

Thanks

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: inconsistent trigger
« Reply #1 on: 01 Apr 2007, 11:52:03 »
not sure if this is still the case in arma, but getpos select 2 within buildings almost always returns something near to 0, regardless of which floor the loon is standing on. the way to get around this is to turn the problem on its head, in a manner of speaking.

place a game logic 50 metres above the house. use the distance between it and the loons to determine which floor they are on. for example, if the distance between the second floor loon and the gl is 10 metres, the ground floor loon needs to be within 10 metres of the gl before he can be assumed to be on the second floor.