Home   Help Search Login Register  

Author Topic: Triggers, help please  (Read 1895 times)

0 Members and 1 Guest are viewing this topic.

Offline Knight Trane

  • Members
  • *
Triggers, help please
« on: 22 Apr 2008, 18:02:27 »

  Hi there,

I have a Mission I making, that involves targets materializing as u walk through an area.

I have set up my "Targets" and named them.  Condition of presence : False

I've set up my "Triggers" but, I don't know the proper command to put in the "On Activation" field.

I thought it would something like      TargetName setCondition True

I've checked the CommandRef, looked at the Tuts, and don't see anything that helps.

Please, if u respond;  include any links that may help with just the basic commands.   Everything I'm finding is script related.  I just need to learn the editor right now.

Thank you.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Triggers, help please
« Reply #1 on: 22 Apr 2008, 18:10:11 »
What do you mean with "target materialization"?

Offline Knight Trane

  • Members
  • *
Re: Triggers, help please
« Reply #2 on: 22 Apr 2008, 18:19:25 »
Go from no presence to present.

Make presence = true.  Maybe the term is "Spawn".
« Last Edit: 22 Apr 2008, 18:32:48 by Knight Trane »

Offline Denz

  • Former Staff
  • ****
Re: Triggers, help please
« Reply #3 on: 22 Apr 2008, 18:47:34 »
I think I know what you are trying to do. CreateVehicle is what you are looking for.
Off the top of my head
Try something like this in the init line of a trigger
Quote
target = "TargetEpopup" createVehicle getmarkerpos  "trig1"

This uses a marker called trig1 for the target to appear in.

Also check the Comref for the class name for the targets you want to use.
« Last Edit: 22 Apr 2008, 18:49:17 by Denz »
I've got 'em right where I want 'em - surrounded from the inside!
Jerry "Mad Dog" Shriver, SOG Recon One-Zero
24/09/41 - 24/04/69

Offline Knight Trane

  • Members
  • *
Re: Triggers, help please
« Reply #4 on: 22 Apr 2008, 19:12:40 »
Thank you,

I have already positioned my target right where I want it with setPos [xxxx,yyyy,zzzz]  with a certain azmith.

Isn't there a setting for the presence, that the trigger can switch to make the presence True.

Forgive my ignorance with the Code.  The CommandRef is helpful if you know what you're looking for.  I will try your suggestion though.

Thanks.   


Offline Cheetah

  • Former Staff
  • ****
Re: Triggers, help please
« Reply #5 on: 22 Apr 2008, 20:45:27 »
Quote
A unit with a Condition of Presence that returns false will not exist in the mission
source: biki

So, best might be to spawn the targets.

Alternatively, you can place them in the editor and give them a name. Then, have a script which saves their position and puts them somewhere far far away on some island for example. If they should be 'up' you can then setpos them back to their original (and saved) position.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Rommel92

  • Members
  • *
Re: Triggers, help please
« Reply #6 on: 22 Apr 2008, 21:25:42 »
Code: (TRIG#) [Select]
ANYBODY - PRESENT
Condition: this
OnAct: target = "TargetEpopup" createVehicle [x,y,z]

You claim you already have [x,y,z] coordinates you wish to use, well good on ya, wack em in there, put there trigger you want them to go off when someone walks through it, and voilah. Your set.

 :good:

Offline Knight Trane

  • Members
  • *
Re: Triggers, help please
« Reply #7 on: 22 Apr 2008, 23:56:49 »
Rommel92 You are a god!
I may make you a rifleman in my Corps.
works great.  Thanks.

Is there anyway to put the azmith in there?

Denz and Cheeta, thanks for the replies but I couldn't get a simple trigger to work.  Let alone figure out what getPos is or whats it for.   

I'm going low and slow, but I'll be cruisin soon.


Thanks, :cool2:
« Last Edit: 23 Apr 2008, 00:33:26 by Knight Trane »

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Triggers, help please
« Reply #8 on: 23 Apr 2008, 02:12:45 »
User setdir for azimuth:

Code: [Select]
ANYBODY - PRESENT
Condition: this
OnAct: target = "TargetEpopup" createVehicle [x,y,z]; target setdir 90
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Knight Trane

  • Members
  • *
Re: Triggers, help please
« Reply #9 on: 23 Apr 2008, 16:11:28 »
Thanks johnnyboy,

I found that in the CommandRef.  Put it in same line and "Bobs your uncle".  But another problem has cropped up.  When I put several targets in the "On Activation" field, I get one target spawning for every instance that the Trigger is tripped. 

For instance:

I placed a trigger with something like this in On Activation:TargetA= "abc" creatVehicle [xx,yy,zz]; TargeA setDir 45;TargetB= "abc" creatVehicle [xx,yy,zz]; TargeB setDir 45;.  I thought that would give me 2 Tartgets at different locations at the same time.  But, it doesn't.  I gives me one Target per intance that the trigger is tripped. 
So my next question is this:   Should the command in the On Activation field for this Trigger be createGroup, or some sort of string, or an array?

I have to say that I am very greatefull for the help you guys give.  I know you all must have better things to do. 
Thanks,

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Triggers, help please
« Reply #10 on: 23 Apr 2008, 17:46:54 »
All code in the On Activation field should execute, so it should create 2 targets.  Be sure that each target has a different name (i.e., TargetA and TargetB, like you stated). Be sure that the positions for each are where you want them.  Maybe it created a target, but it put in BF Egypt so you can't see it.  Be sure the type of object ("TargetEpopup") is typed correctly for each.

You have other options:

1. Put your object creation code in a script, and call the script from the On Activation field.

2. Instead of using createVehicle, you can actually place all the targets via the editor.  Then in your init.sqs, move them all to position [0,0,0].  Your triggers would then be simpler, they would setpos targets where you wanted them.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...