Home   Help Search Login Register  

Author Topic: condition "plr at certain altitude" affects several triggers  (Read 1005 times)

0 Members and 1 Guest are viewing this topic.

Offline beefholishness

  • Members
  • *
  • I'm a llama!
Hey gents, I'm working on some Coast Guard missions and I have one part in which you take an HH65 to pick up some supplies and fly them to a remote mountain house.  So I have a bunch of card board boxes next to the LZ.  In a trigger covering the LZ, I have

West present
condition: (getpos plr select 2) < 1
activation: plr addAction ["Pick up supplies", "pickup.sqs"]

The script teleports the crates to the middle of a forest, and when you land at the dropoff LZ, I have a similar trigger that teleports them back right next to the helicopter, with the same condition (creating the effect that they had been on the helicopter).

So, naturally, I only want this action to be available when the chopper is on the ground.  The problem, however, is that when I land at either LZ, BOTH actions show, even though they are separate triggers that cover only their respective LZs.  For example, when I land for pickup both "Pick up supplies" and "Drop off supplies" appears in the action menu, though that trigger only covers the former.  Even weirder, when I remove the condition, the action no longer shows up at all, which I can find positively no explanation to.  Before I added the condition, the action would show up if I was hovering 50m above the town, and now, nothing.  That may not be germane though.

Any way to reconcile this?  Thanks a lot.
don't take the name the wrong way

Offline firecontrol

  • Members
  • *
Re: condition "plr at certain altitude" affects several triggers
« Reply #1 on: 01 Aug 2007, 07:33:57 »
Condition:

Code: [Select]
this and ((getPos plr select 2) < 1)

"This" refers to the trigger's statements (the fields you fill out above the condition/act/deact lines.) When you remove the condition field all together, it will never activate.

When you create a trigger in the editor, the condition field will say "this" by default.

Use "this" to use the trigger's statements.
"True" to always enable.
"False" or blank to never enable (no use for this)

Add things like: "this and (yada yada)" .... or "this or (yada yada)" for different logic/truth tests.
« Last Edit: 01 Aug 2007, 07:40:23 by firecontrol »

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: condition "plr at certain altitude" affects several triggers
« Reply #2 on: 01 Aug 2007, 17:41:15 »
So basically, group the triggers to the player.
Then, in the set it to VEHICLE, and IS PRESENT for both of them.

Then, make the on Activation line:
Code: [Select]
this && ((getPos plr select 2) < 1)
and that should do it.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline beefholishness

  • Members
  • *
  • I'm a llama!
Re: condition "plr at certain altitude" affects several triggers
« Reply #3 on: 01 Aug 2007, 19:36:28 »
So I'm reading your post fire, going "yup, yup... yeah, I know that..." and go back and check the triggers and of course that's the problem.  I was accidentally using the older versions that I had been messing around with. Right now I have three different saves of the same mission, and putting them together has caused this snafu. I didn't even notice it when I copied the text for the post (duh).  Thanks a lot.

I'll make sure to try yours as well, Tyger.

This place is the greatest.

edit: fellas I thought I'd add as a point of interest that the action must be tied to the vehicle, NOT the player.  For example-

My character is named plr.  The HH65 is named air2.  I start the mission outside the chopper and get in with my crew.  Right now, for the actions to show up when I land, I followed Tyger's advice and grouped the triggers to the player, but my fields look like this-

Vehicle present
condition: this && ((getPos air2 select 2) < 1)
activation: air2 addAction ["Drop off supplies", "dropoff.sqs"]

If it's set up with "plr" in the air2 spaces, you actually have to get out of the chopper in order for the action to show up.  Now I may actually use this if I decide I want to make the objects un pick-upable unless you have your crew chief outside the helicopter, so you can mix it up.

You guys may already know this, but I figured it might help someone else.  Thanks again, this is just phenomenal.
« Last Edit: 01 Aug 2007, 21:19:16 by beefholishness »
don't take the name the wrong way