Home   Help Search Login Register  

Author Topic: Two very simple trigger questions  (Read 554 times)

0 Members and 1 Guest are viewing this topic.

Lynxx

  • Guest
Two very simple trigger questions
« on: 05 Aug 2003, 02:06:45 »
I'm pretty new to the OFP scripting and mission making, so please excuse my ignorance here. Here's what I have and what I'm trying to do:

#1) I have a trigger that I want the player ONLY to activate. It is set over another west unit so naturally setting it to "west" is out, and it controlls the AI movements of enemy soldiers so being a radio channel is out as well. Is there some way to activate the trigger (amybe with the condition field) so that only the player will activate it?

#2)One of my missions is a search-and-rescue type operation. Right now I have two triggers, one activates if the soldier to be rescued is dead [not(alive unit1) in the condition field] and that fails the objective. The other is for a successful finding of the soldier to be rescued and it completes the objective (I just used a radio channel for this one).
I would like to combine these two into one trigger (either a radio channel or player activated) that will do both. Is this possible?

Again, excuse my ignorance... I'm a newbie! Thanks for any input on this.

Lynxx

Kaliyuga

  • Guest
Re:Two very simple trigger questions
« Reply #1 on: 05 Aug 2003, 02:21:29 »
 1) select your player... and hit F2 .. then hold down the mouse button and drag from the player to the trigger.. it should make a blue line..

grouping a vehicle/unit to a trigger gives you a few more options besides

West/East/Res  etc...

you now have the choices of   Vehicle.... Group Leader.. Any group member

available to you  for your trigger activation ...

2)  Yes...   i'm not too hot on syntax.. but i would imagine someone will come along and help you with that one

:cheers:

m21man

  • Guest
Re:Two very simple trigger questions
« Reply #2 on: 05 Aug 2003, 04:11:26 »
2. You could use a large trigger that activates when your guy gets close enough to the soldier.

In the Condition field put
"player distance guy"

I'd use a script now in the On Activation field ;D.

;livecheck.sqs
;script starts here
#start
?(alive guy):goto "alive"

#dead
obj_1 objstatus = "failed"
hint "Objective Failed"
goto "exit"

#alive
obj_1 objstatus = "done"
hint "Objective Completed"

#exit
exit
;script ends here
« Last Edit: 05 Aug 2003, 04:13:24 by m21man »

Lynxx

  • Guest
Re:Two very simple trigger questions
« Reply #3 on: 05 Aug 2003, 04:25:02 »
Thanks Kaliyuga, that worked great and opened up a whole new world for me....

M21Man - I'll definitely give that a try and see how it does. It sounds like it'll work out just as I'm wanting it to. I do have one question about the script (since I am a newbie to this). The - ?(alive unitname): goto "alive" -  line... I'm assuming that returns a boolean value? "alive" or "dead"? I guess what I'm wondering is this: if it shows he's not alive, how does it know to jump to the #dead portion of the script?

Sorry, just had to know.

BTW - What does the pig say to the cow? OINK!

Lynxx

m21man

  • Guest
Re:Two very simple trigger questions
« Reply #4 on: 05 Aug 2003, 04:43:13 »
Scripts are linear (If that's the right word?). Unless the script is redirected, it'll just proceed down through the commands one at a time till it finishes. The (goto "alive") part simply causes the script to skip straight to #alive. You'll notice that the goto "exit" area in the #dead section causes the script to skip straight to exiting.
« Last Edit: 05 Aug 2003, 04:44:55 by m21man »

Lynxx

  • Guest
Re:Two very simple trigger questions
« Reply #5 on: 05 Aug 2003, 04:48:13 »
Thanks, that clears up the confusion.
I just put the new script into play and it worked very nicely. Since I have several "lost soldiers" in the mission, I just made multiple scripts and called them from triggers.
Thanks again!

Lynxx

m21man

  • Guest
Re:Two very simple trigger questions
« Reply #6 on: 05 Aug 2003, 04:50:30 »
The - ?(alive unitname): goto "alive" -  line... I'm assuming that returns a boolean value? "alive" or "dead"?

Lynxx

Actually, it returns a True/False answer. But you don't need to change that part of the script cuz the T/F isn't necessary.

m21man

  • Guest
Re:Two very simple trigger questions
« Reply #7 on: 05 Aug 2003, 04:54:53 »
Do you have a Commands Manual. They have little examples for each command of what the correct format is for a command and what kind of value it returns.

Note: The "alive" command is weird. All you need is "alive (target unit). If you want something to activate when something is dead then it'd be !(alive target).