Jump to content
Sign in to follow this  
meade95

simple hostage rescue type script?

Recommended Posts

What is the simplest way to go about putting together a situation in which a friendly is being held captive? Where you want to attempt a rescue operation. So the friendly isn't immediately killed....but the percentage of them being killed can happen once an assault is attempted?

Thanks for any advice...and or mission I can look at via the editor.

Share this post


Link to post
Share on other sites

Thanks Kylania - Looking these two over -

But, with the warlord one....enemy AI won't kill him. You are more or less capturing him.

And with the other ones POWs- How would one go about having them guarded (but not being killed by enemies) until possibly once an assault has started.... Sometype of trigger making the (POWs) as a threat once other BLUFOR are within a certain distance??

Share this post


Link to post
Share on other sites

Usually you'd setCaptive true them at first, then remove that (setCaptive false) once they are on your team.

Share this post


Link to post
Share on other sites
Usually you'd setCaptive true them at first, then remove that (setCaptive false) once they are on your team.

So I could place a Civ - Put the SetCaptive True in the inti field. Then place a trigger (perhaps) and have it set to once BLUFOR is within 10/20 whatever distance it change there value to SetCaptive False?

Share this post


Link to post
Share on other sites

I don't think the setcaptive has any effect on civilians, because the AI won't attack them as a default setting.

In my hostage rescue missions if my hostage is BLUFOR I name him CAP1, and I put this in the units init field

removeallweapons this; this setcaptive true; this disableai "MOVE"; this setbehaviour "CARELESS";

Original quote by meade95. So the friendly isn't immediately killed....but the percentage of them being killed can happen once an assault is attempted?

I'd place a trigger activated by a GAME LOGIC, but with conditions that EAST knowsabout name of your unit >2 and when activated

CAP1 setcaptive FALSE.

Set the trigger on a couple of minutes timer, so your rescue team at least have a chance of reaching the hostage and saving him if they're quick. If you want a random chance of this happening change the GAME LOGICS probability of presence to around 50%.

If your hostage is on the CIV side you'd probably have to give OPFOR units a specific command to fire on the CIV. Try name of enemy unit DOFIRE cap1.

Share this post


Link to post
Share on other sites
I don't think the setcaptive has any effect on civilians, because the AI won't attack them as a default setting.

In my hostage rescue missions if my hostage is BLUFOR I name him CAP1, and I put this in the units init field

removeallweapons this; this setcaptive true; this disableai "MOVE"; this setbehaviour "CARELESS";

I'd place a trigger activated by a GAME LOGIC, but with conditions that EAST knowsabout name of your unit >2 and when activated

CAP1 setcaptive FALSE.

Set the trigger on a couple of minutes timer, so your rescue team at least have a chance of reaching the hostage and saving him if they're quick. If you want a random chance of this happening change the GAME LOGICS probability of presence to around 50%.

If your hostage is on the CIV side you'd probably have to give OPFOR units a specific command to fire on the CIV. Try name of enemy unit DOFIRE cap1.

Thank you......Going to try this out later today...

Share this post


Link to post
Share on other sites

I use a two-stage process for rescue scripts to get around locality problems with addAction. First is an addAction on the target that fires the following script:

if (side (_this select 1) == WEST) then {
rescuer = _this select 1;
rescuegroup = group rescuer;
varrescued = true;
publicvariable "varrescued";
publicvariable "rescuegroup";
};

A trigger with condition "varrescued" then fires the following script:

[vip] joinsilent rescuegroup;
hint parsetext (""Let's get out of here!"");
nul=[] execVM "scripts\1_task_complete.sqf";
vip removeaction 0;
sleep 1;
vip switchmove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";
vip enableAI "MOVE";
vip enableAI "AUTOTARGET";
vip enableAI "ANIM";

There is some superfluous stuff in there with the animations and the hints, but it's tried and tested on a dedicated server many times.

Edited by fatty86

Share this post


Link to post
Share on other sites

One simple way that works for me:

Give your hostage (lets say named "hostage1") a careless move waypoint into a building that is surrounded by enemy. name the rescuing group "alpha" .i.e. team leaders init:

alpha=group this

Then set a trigger around the building. When blufor (or your group) is present, use

[hostage1] join alpha  

Edited by katdogfizzow

Share this post


Link to post
Share on other sites
One simple way that works for me:

Give your hostage (lets say named "hostage1") a careless move waypoint into a building that is surrounded by enemy. name the rescuing group "alpha" .i.e. team leaders init:

alpha=group this

Then set a trigger around the building. When blufor (or your group) is present, use

[hostage1] join alpha  

Simplistic...which is nice..... But the issue here would be the enemy AI can't really be guarding him (or they would just shoot him, would they not??). I like "MoSTLY" option above.....where there is a trigger with a time limit assoicated to it......so once the assault is on...if you don't reach the hostage within a certain amount of time the likelyhood of him being killed goes up...

---------- Post added at 02:09 AM ---------- Previous post was at 01:46 AM ----------

I don't think the setcaptive has any effect on civilians, because the AI won't attack them as a default setting.

In my hostage rescue missions if my hostage is BLUFOR I name him CAP1, and I put this in the units init field

removeallweapons this; this setcaptive true; this disableai "MOVE"; this setbehaviour "CARELESS";

I'd place a trigger activated by a GAME LOGIC, but with conditions that EAST knowsabout name of your unit >2 and when activated

CAP1 setcaptive FALSE.

Set the trigger on a couple of minutes timer, so your rescue team at least have a chance of reaching the hostage and saving him if they're quick. If you want a random chance of this happening change the GAME LOGICS probability of presence to around 50%.

If your hostage is on the CIV side you'd probably have to give OPFOR units a specific command to fire on the CIV. Try name of enemy unit DOFIRE cap1.

Need some help on trying to put in the right information within the TRIGGER ?

What do I put in the INIT; ??? (of the trigger) ...Would it be - this;OpFor knows about SEAL Team

And what exactly, (how should it be written) on the activation field/code; ??

---------- Post added at 03:46 AM ---------- Previous post was at 02:09 AM ----------

Thanks for the help > Mostly. Have it working great now! Just had to "group" the trigger with my units commander. Works easy and very nicely.

---------- Post added at 04:41 AM ---------- Previous post was at 03:46 AM ----------

Wait. Not working now. Should I be using "Countdown" or "Timeout" option?

Also, do I have it right. I "GROUP" this trigger to MY Team Commander? - Which basically states...If Detected by OPFOR

Countdown or Timeout = 300 (min) ....which means I should have 5 mins before the triggers activation is set forth...that being ......CAP1 setcaptive FALSE.

However, I'm starting to notice in playtesting...They shoot the hostage long before 5 mins is up...??

What do I have wrong here..

Share this post


Link to post
Share on other sites

To make it easier I've just done a quick example mission for you.

http://www.mediafire.com/?mbr1pfwgvxvzwpg

To have a random chance of the hostage going to be executed just change the probability of presence for the GAME LOGIC.

I've put the captive on a chair too, I think it's a nice little touch :)

Share this post


Link to post
Share on other sites
To make it easier I've just done a quick example mission for you.

http://www.mediafire.com/?mbr1pfwgvxvzwpg

To have a random chance of the hostage going to be executed just change the probability of presence for the GAME LOGIC.

I've put the captive on a chair too, I think it's a nice little touch :)

Thank you! Much apprecaited.

Share this post


Link to post
Share on other sites

Plan to look it over once home in about 6 hours (long day!)....But thinking, what would be the best way to have this hostage link up with my Team once rescued.... Via a trigger? or an addaction command?

Share this post


Link to post
Share on other sites

Ok. Just looked it over (MOSTLY). Very nice. Somewhat confused on "how" game logic works? Why is there "3" AND Waypoints assoicted with it?

Also, plan to try and little play testing on my own....to figure out is there a way to make it so those guarding the hostage will fire on your team (but not on the hostage). As is the guy in the room won't move until he kills the hostage....

---------- Post added at 03:49 AM ---------- Previous post was at 02:17 AM ----------

Understand the game logic Flag now more - Makes sense. Also, was able to delete the disable move issue with the one defender (killer) guarding the hostage so he will fire on troops now....

Works very well.

Have noticed if I change the time to night (dark) AI is incredible slow to respond to shooting hostage....takes a long time for them to notice them if dark (which makes some sense I guess).

Share this post


Link to post
Share on other sites

I'm sure there is a more tidy way of doing it all but my scripting skills are limited. I'm getting better but I always managed to get the results I wanted by using GAME LOGICS and TRIGGERS in a creative way.

Just another thought to make your mission more interesting, create some empty markers and attach them as a group to the hostage. Put the markers at different locations, maybe inside different rooms or buildings in a complex. Now the hostage will be created at either his original location or at one of the markers on a random basis.

This should make the mission more interesting as you don't know exactly where the hostage is held and have to check each of the marker loctions.

Share this post


Link to post
Share on other sites

Mostly, I am very impressed. I primarily do scripts, but you have shown me a couple tricks that I didn't know. Not only that, but I managed to rescue the hostage on the first try with no friendly KIA :D

Share this post


Link to post
Share on other sites

How must i write if i want hostage to join anyone example: a1,a2,a3,a4,a5

I tested everything but nothing works.

joinassilent [a1,a2,a3,a4, 5] ?

this and [a1,a2,a3,a4] distance cap1 < 3 ?

doesn't work

Thanks!

Share this post


Link to post
Share on other sites
How must i write if i want hostage to join anyone example: a1,a2,a3,a4,a5

I tested everything but nothing works.

joinassilent [a1,a2,a3,a4, 5] ?

this and [a1,a2,a3,a4] distance cap1 < 3 ?

doesn't work

Thanks!

Look through MOSTLY mission - In his version, the hostages joins with the group commannder...after being freed...

I've also tweaked it to have all of them fire on the hostage (if need be) and to have them (or the OPFOR guarding the hostage) have the ability to shoot at you when entering to free him (instead of just firing on the hostage).

Edited by meade95

Share this post


Link to post
Share on other sites

Ok. Really like your setup/script on this MOSTLY - Thanks again - Have tweaked it some for my own needs...

I hvae one more question. For anyone who can help. How can I go about creating a trigger (or even game logic) that would begin the countdown until the hostage is killed as soon as any member of OPFOR is KIA? As is now, you can take out OPFOR guys standing near the hostage and if you aren't spotted the countdown does not begin (it is as if, they have no idea what is happening...not to realistic, if a member next to you dies...you would likely kill the hostage at some point in the not to distant future).

So how can I go about linking the Countdown Logic cmmd.....with that of any OPFOR member being KIA.

Share this post


Link to post
Share on other sites

Hey meade95!

Can you send your mission for me? Please:D, i must study it.

I'm out of luck with some triggers now....:confused:

Share this post


Link to post
Share on other sites

Thanks for the positive comments guys.

Meade95, to detect if any of the OPFOR men are killed it's probably best to look at arrays and scripting stuff like that.

If you want to do it using a trigger and game logic then name the OPFOR men, something like e1, e2, e3 etc... Create a trigger which is activated by anybody, but in the condition field put

this and not canmove e1 or not canmove e2 or not canmove e3 ......

Link this trigger to another game logic with the waypoints attached, just like the one in my example mission.

This means that whenever any of the OPFOR men named in the trigger are killed the countdown to execution begins!!:D

ORIGINAL POST BY AJN83_2007

How must i write if i want hostage to join anyone example: a1,a2,a3,a4,a5

Sorry, I don't understand what you want? Are you wanting the hostage to join your team in a sort of sub-group? If thats the case I don't think it's possible mate.

Share this post


Link to post
Share on other sites
Sorry, I don't understand what you want? Are you wanting the hostage to join your team in a sort of sub-group? If thats the case I don't think it's possible mate.

I mean if i change all group members to playable in mpmission. There's only one (a1) who can rescue hostage. If been other member of group i cannot rescue hostage.

One more question, how i can trigger this kind:

OPFOR guarding the hostage) have the ability to shoot at you when entering to free him (instead of just firing on the hostage).

Sry, if explain too messy. But anyway thanks for good support!:):D:yay:

Share this post


Link to post
Share on other sites
I mean if i change all group members to playable in mpmission. There's only one (a1) who can rescue hostage. If been other member of group i cannot rescue hostage.

One more question, how i can trigger this kind:

OPFOR guarding the hostage) have the ability to shoot at you when entering to free him (instead of just firing on the hostage).

Sry, if explain too messy. But anyway thanks for good support!:):D:yay:

You need to name the other members of your team (be it a2, a3, a4 or SEAL1, SEAL2, etc, etc).....Then just plug that into the script that is already assoicated with the Flag (next to the hostage)... It will be in the Upon Activation (I believe? - not home to check it out for sure right now).

---------- Post added at 02:59 PM ---------- Previous post was at 02:59 PM ----------

Thanks for the positive comments guys.

Meade95, to detect if any of the OPFOR men are killed it's probably best to look at arrays and scripting stuff like that.

If you want to do it using a trigger and game logic then name the OPFOR men, something like e1, e2, e3 etc... Create a trigger which is activated by anybody, but in the condition field put

this and not canmove e1 or not canmove e2 or not canmove e3 ......

Perfect! That is how I will do it. Thanks again!

Share this post


Link to post
Share on other sites

Whats wrong with my script here? My problem is the hostage will ONLY follow the lead SEAL (SEAL0). But if he/SEAL0 is KIA during the OP and another one of the SEALs gets to him....he will not follow them. He will stand up, chair will be removed but he wont "join" the group I guess you could say. Am I missing a bracket or something?

cap1 switchmove "end"; cap1 enableAI "MOVE"; deleteVehicle chair; cap1 joinassilent [sEAL0, SEAL2, SEAL3, SEAL4, SEAL5]

Outside of this issue, I have my rescue mission being set up quite well....With differing timmers set concerning the hostage. IF someone in the town is altered there is a apprx 5 min time frame for the rescue to happen.......Along with if one of the guards closer to the hostage is killed a much shorter apprx 30 second time frame starts up...

Edited by meade95

Share this post


Link to post
Share on other sites

Hey fellas i like where you guys are going with this. I am very intrested in this thread and if at all possible when your done would i be able to get this script/mission from you. Thanx.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×