OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: NightJay0044 on 14 Mar 2010, 17:17:47

Title: Rescue & Joining Group Help
Post by: NightJay0044 on 14 Mar 2010, 17:17:47
Hi guys I'm creating this missiosn where the seals have to rescue a guy who is captive by enemy forces.

What i want is to simply have the seals move into the captive and when they get up to him, be able to rescue him and join their group there after rescuing how can i do this?

Thanks...
Title: Re: Rescue & Joining Group Help
Post by: nominesine on 15 Mar 2010, 10:43:08
Add the follwing line to the captives init line:

Code: [Select]
this addAction ["Secure Hostage", "rescue.sqs"]
Then you write a short sqs script (no need for fancy sqf scripting here) with the following content:

Code: [Select]
myCaptive join myPlayer
When the player is close enough, he will get the "Secure Hostage" option added to the action menu. The script will start when the player executes the action, and the captive jouns the player. Voila!

You may find more information about the addAction command in the COMREF.