Jump to content
nomadd

HVT capture and Hostage rescue scripts

Recommended Posts

These are a couple of scripts I made for some of my missions. Going to post them here is case anyone finds them useful. They have been tested on MP hosted and dedicated. Everything seems to work. Any scripting gurus want to improve them please feel free. 

 

Put a unit(s) down in the editor and name them  whatever you want ex: obj_HVT  , Obj_hostage , Boo_Boo , whatever

In init.sqf 

//prepare HVT and hostage
obj_hostage execvm "Hostage_setup.sqf";
obj_HVT execvm "Hvt_setup.sqf";

The HVT script will make the unit do a "surrender" animation when a player gets close, from there you will get the option to escort the HVT. HVT will attach to that player in front off to the left with hands on head. HVT is attached to player so it will not collide with anything and feet do not move but better than having a hostile HVT join your group and run around free (imo).

Player will get the option to "stop" escort , meaning HVT will be left on the spot. Another player can then pick up the HVT and escort. When escorting the HVT, players near vehicles get the option to "load in vehicle". The HVT will then get in what ever vehicle is close to the player under player's cursor. Once the HVT is loaded in a vehicle any player can "unload HVT".

Once  the HVT is captured , it can be killed at any time. Until HVT is captured they are invulnerable, plus dumb as a rock. I had to disable just about everything on the AI to make them play nice.

 

The Hostage script works much the same way. Except hostage is on the ground tied up.. Player has to free the hostage using a holdaction. (Once freed hostage can be killed)  Hostage will go into a wounded on the ground animation. Player has to pickup and carry hostage. When carrying the hostage player is forced to walk, you can set the hostage down at any time and another player can then pick up the hostage. You also will get the option to "load in Vehicle" when carrying the  hostage. Same as HVT script, you have to be close to a vehicle and vehicle under player's cursor. Once hostage is loaded anyone can unload the hostage.

 

The test mission linked does require CUP, was testing different vehicles, not just BIS vehicles. You can still extract the .sqfs and put them in a mission that does not require CUP to test it.

 

I know i need to do some more polishing but it works. I would like to add "grabcarried" and "grabcarry" to the hostage, just to make it look a bit nicer when player is picking the hostage up but working with animations just sucks. 

Right now there can only be one HVT and one Hostage in any given mission. Will try and maybe change things so there can be multiple hostages that need to be rescued or HVTs to be captured

 

 

HVT capture script

 

 

Hostage rescue script

 

 

update: v1.3 02-25-19

https://www.dropbox.com/s/fb52hxbrhvwbvp7/HVT%26Hostage test1.3.Stratis.7z?dl=0

 

any problems just post them up, i will try and get to it as soon as  I can

 

edit: 02-08-19

fixed some bugs

changed some animations

cleaned up some code

 

edit: 02-16-19 v1.2

removed CUP dependency

 

edit 02-16-19 v1.2

uploaded wrong version

 

edit 02-25-19 v1.3

fixed potential problem(s) on dedicated 

 

 

  • Like 7
  • Thanks 3

Share this post


Link to post
Share on other sites

Well I thought I had taken care of an annoyance with the AI getting in vehicles, but found it is back. AI will get into assigned seat, using assignascargoindex [veh, x], moveincargo [veh,x] , then immediately switch to drivers seat. I have found no way to stop the AI from changing seats, I have disabled everything but still the AI will change seats. This only seems to happen with empty vehicles and then it can vary from vehicle to vehicle . 

So I have a brute force method of checking the seat position of the unit. If unit is in wrong seat, will move the unit out of the vehicle and back to the correct seat, problem is unit starts blinking from the movement between the seats ,as soon as another unit or player gets in the drivers seat  the problem goes away. I may try and create an invisible unit and place it in the drivers seat, load the unit into the vehicle then delete the invisible driver

 

It is not a mission breaking problem but  just looks silly to be escorting  a prisoner, load them in a vehicle and they jump behind the wheel to drive. 

 

  • Haha 2

Share this post


Link to post
Share on other sites

Ace 3 has this option,maybe browse their github to see how they did it.

Share this post


Link to post
Share on other sites

Mr. H ,

thanks for the heads up, I actually saw this in  ACE and was trying to make something for vanilla. I don't use ACE nor any of the people I play with

 

I think I fixed it. Makes no sense but that is Arma. If I have the units join the players group the AI units will  stay in their assigned seat, even in an empty vehicle. I have no clue why grouping the AI makes a difference but it does.

I also cleaned up a few things.

I got rid of the loops I had been using to check units seat position and now using EH instead

I also changed the Hostage untie animation for the player and the unit to make it look alittle more realistic

made some other minor code changes

 

I tested it on hosted and dedicated and everything seems to be working correctly. I have to travel (RL stuff) will deal with any issues when I get back

 

 

 

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

I removed CUP dependency from test mission. Also added some videos to show what the scripts do

 

edit: fixed upload to most current version

 

  • Like 1

Share this post


Link to post
Share on other sites

-fixed potential problem(s) on dedicated 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Wow! This is just what I've been looking for, will be using this for my missions. 

 

Thanks!

Share this post


Link to post
Share on other sites

Hey Nomadd,

 

Really great scripts, thanks!

 

However, when testing the hostage script, when I hold space to untie the hostage, my character ends up moving and facing away from the hostage. The action still works however it kills the immersion a bit.

 

Is there anything I can do to fix this?

 

Thanks,

Share this post


Link to post
Share on other sites

Hello Nomadd,

 

I have used your script in a mission I'm developing for public release. 

 

I can't see any mention of licenses, but I wanted to check with you that it's ok to use your script in the mission!

 

Your name will go in as credit, I do intend to rewrite the script (I've already gutted and changed a few parts) once I figure it out, but for the time being, I'm ok to use yours with credit?

 

The mission is under the placeholder name Hostage Rescue (or A3HRT) at the minute and have just completed out first playtest!

 

You can view some of what I'm making here:

A3HRT Reddit Post

 

Thanks for writing the script and sharing it! You're work has helped me out tremendously.

 

Thanks,

Grape

Share this post


Link to post
Share on other sites

Hi Nomad.  Great script man.  A few questions:

 

1) Can player shoot while moving a HVT?  (Cool human shield (i.e. "meat shield") possibilities there btw).

2) Can player shoot while carrying hostage.

3) Can I have permission to integrate your scripts with my AI CQB Movement scripts?  I would credit you of course.  I have been thinking about adding some sort of hostage interactions in the future, so why re-invent the wheel since you've done some great work here already?  I would have to convert it so AI can perform these actions...

 

Once again, nice job.

Share this post


Link to post
Share on other sites

@nomadd can you reupload this please, seem to be having issues getting it from dropbox 

Share this post


Link to post
Share on other sites
4 hours ago, WarhammerZeus said:

I have used this script in the past but it will no longer open the mission.

This is a great script. I just tested it in a mission I used it in and works as normal.

Share this post


Link to post
Share on other sites

Yeah I use these all the time, they still work great.

Share this post


Link to post
Share on other sites

Thats strange I re-downloaded and tried a few more times and each time I get "error while loading the scenario" when I open Editor

 

Share this post


Link to post
Share on other sites

hello nomadd. this is just what i was looking !. i want to ask. is there anyway to add more than one hvt? or hostage? because if name each and call the "Hvt_setup.sqf"; for each on the init file i can manage all of them but if i load one in a truck i loose the option to manage all of them. hope you can respond thnx

Share this post


Link to post
Share on other sites
4 hours ago, Martin Guberna said:

hello nomadd. this is just what i was looking !. i want to ask. is there anyway to add more than one hvt? or hostage? because if name each and call the "Hvt_setup.sqf"; for each on the init file i can manage all of them but if i load one in a truck i loose the option to manage all of them. hope you can respond thnx

It seems unlikely. He's not logged in here for nearly 3 years.

Share this post


Link to post
Share on other sites
On 2/28/2022 at 5:16 PM, Martin Guberna said:

hello nomadd. this is just what i was looking !. i want to ask. is there anyway to add more than one hvt? or hostage? because if name each and call the "Hvt_setup.sqf"; for each on the init file i can manage all of them but if i load one in a truck i loose the option to manage all of them. hope you can respond thnx

how about just name the HVT_setup.SQF to HVT_setup1.SQF and HVT_setup2.SQF to match your HVT and HVT1, HVT2

Share this post


Link to post
Share on other sites
On 4/16/2019 at 12:56 PM, eXpo said:

Hey Nomadd,

 

Really great scripts, thanks!

 

However, when testing the hostage script, when I hold space to untie the hostage, my character ends up moving and facing away from the hostage. The action still works however it kills the immersion a bit.

 

Is there anything I can do to fix this?

 

Thanks,

Having this same issue... however when i start to rescue the hostage it moves me facing away and stops...

Share this post


Link to post
Share on other sites

im an idiot, total noob.

 

 

How does this work?

 

i want to catch a badguy. i named him "obj_HVT" then i typed in the script you have posted above. i get an error: "invalid number in expression". no idea what to do here. 

 

i got desperate and i saw the dropbox link with the "SQF files. i think that i need to put the files in my mission folder. i put them in and boot it up and now my mission is gone, replaced by the sample mission you made. 

 

 

how do i make this work on my mission? what went wrong? im a moron can you break this down Barny style? like step-by-step? is there a way to recover the mission i was working on, because now i cant get it to load.

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

×