Jump to content
Sign in to follow this  
Dr_Cox1911

[Dr_Cox1911] Hostage Script

Recommended Posts

Hi guys!

Just here to release my first script ever! This is only a small one but maybe for some of you it will be useful.

So here it is, my little Hostage script.

ReadMe/HowTo/Changelog:

SCRIPT README

==============

SCRIPT: Hostage

Version: 0.2

Developer(s): Dr_Cox1911

README CONTENTS

===============

01. VERSION HISTORY

02. COPYRIGHT STATEMENT

03. TERMS OF USE

04. LEGAL DISCLAIMER

05. INSTALLATION

06. REQUIRED ADDONS

07. NOTES

08. CHANGE HISTORY

01. VERSION HISTORY

===================

Version | Date | Notes

0.1 |130325| Alpha

0.2 |130329| Alpha

02. COPYRIGHT STATEMENT

=======================

This script is ©2013 Dr_Cox1911. All rights reserved.

03. TERMS OF USE

================

This script (hereafter 'Software') contains files to be used in the PC CD-ROM simulator "Armed Assault 3" (hereafter 'ArmA3'). To use the Software you must agree to the following conditions of use:

1. Dr_Cox1911 (hereafter 'The Author(s)') grant to you a personal, non-exclusive license to use the Software.

2. The commercial exploitation of the Software without written permission from The Author(s) is expressly prohibited.

04. LEGAL DISCLAIMER

====================

The Software is distributed without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. The Software is not an official addon or tool. Use of the Software (in whole or in part) is entirely at your own risk.

05. INSTALLATION

================

To begin using the Software:

1. Place the "captive.sqf" and the "captivevars.sqf" inside your missionfolder.

2. Place the following code in the init-line of your hostage:

_null = [this] execVM "captive.sqf"

3. Alter the amount of spawnpoints within the "captive.sqf"

4. Place the amount of markers named like you did in the "captive.sqf" (e.g. "cap_pos0")

06. REQUIRED ADDONS

===================

To play this mission the following addons are required:

NONE

07. NOTES

=========

Hope you like it!

08. CHANGE HISTORY

==================

Version | Date

0.1 | 130325

*initial Alpha release

0.2 | 130329

*Reworked the code (hopefully easier to handle now)

*Added MP-compatibility (need more testing though | Thanks to FSF_TargetZero)

DOWNLOAD

Current Version: 0.2

Edited by Dr_Cox1911
Update to 0.2

Share this post


Link to post
Share on other sites

Yep, only tested it with AI. For use with an human player I would recommend to attach the player on a object to prevent him from moving.

Share this post


Link to post
Share on other sites

@Foxhound: Thanks for frontpaging it!

@FSF_TargetZero: I couldn´t really test it long in MP, but within the few minutes of testing everything has worked. But the could be many bug though^^

Share this post


Link to post
Share on other sites

It doesnt work in Multiplayers, my whole group spawned on the hostage location :(

You need to run hostage teleport only server side and not client side by using IsServer condition.

In captive.sqf one mate made this modification and it works on dedicated server:

if(isServer || isDedicated)then{

_ranPos = ["cap_pos0","cap_pos1","cap_pos2"] call BIS_fnc_selectRandom;

z = 1;

if (_ranPos == "cap_pos1") then [{z=1;},{z=3;}]; //height-settings for the different spawnpositions

_cap setPos [getMarkerPos _ranPos select 0, getMarkerPos _ranPos select 1, (getMarkerPos _ranPos select 2) + z];

};

Edited by FSF_TargetZero

Share this post


Link to post
Share on other sites

Thanks for your feedback, FSF_TargetZero! That´s why I´m the beginner and you guys the pros! I will incorporate these piece of code within the next version. This will take some time I think because I will completely rewrite the whole thing, hopefully way better this time.

Where there any other problems too? I can cope with criticism;)

Share this post


Link to post
Share on other sites

I really like this script, thanks a ton for putting it out there. I did have to change it to spawn downstairs only because the hostie was getting stuck in the wall upstairs 75% of the time, but that's most likely due to the pathing in the Alpha. One question, what would be the best way to tie this to a task? In my mission that I'm finishing up one of the tasks is linked to a trigger that activates when any group member gets within in a small circle around the hostage, I'm going to use your script now because I like it a lot better than just a fixed location every time but I can't think of how to tie him to a trigger with the hostage spawning in random locations. I tried having it activate when the hostage (named Dude) joins our group, but that doesn't seem to work.

Share this post


Link to post
Share on other sites

Updated the script. Couldn´t test MP though, SP works fine.

I reworked some parts of the code to make the handling better. You can now just add as many randomspawns as you like with the desired height.

@lee1hy: You can do this with triggers if you like. In my current mission I´m doing the same by just checking if the hostage is dead (so you just have to put "!alive cap1" in the condition field, where cap1 is the name of the captive). What exactly should happen when a gun sound occures?

@Banky: Glad that you like it! I use the FHQ_TaskTracker for my taskhandling. If you set it up correctly you just have to place a trigger with "!(captive cap1);" in the condition field. The trigger will be activated when the captive is no longer a captive (what a sentence:cool:). cap1 is the name of the captive.

Hope this works for you. My mission is almost done now.

EDIT: If someone of you knows a better untie-animation I would be very glad. The ones that suited better are really hard to set (couldn´t play them nice enough to implement).

Edited by Dr_Cox1911

Share this post


Link to post
Share on other sites

thanks for the great script just one question how would i place the hostage inside a building

---------- Post added at 22:08 ---------- Previous post was at 21:55 ----------

i got it working silly me

Share this post


Link to post
Share on other sites

I think this still doesn't work on MP. Players teleported beside of hostage. You should check it. :D

Share this post


Link to post
Share on other sites

Hm, that´s strange. Hope that I can test it tomorrow. Could you send me your mission? Just to check if the setup is correct.

Share this post


Link to post
Share on other sites

@a040005: Can´t download your mission, always getting "forbidden".

I made some new additions to the code but this time I will test it with MP first. Hope you guys can wait a bit:(

Share this post


Link to post
Share on other sites
@a040005: Can´t download your mission, always getting "forbidden".

I made some new additions to the code but this time I will test it with MP first. Hope you guys can wait a bit:(

Sorry for that. This is new link. Thanks.

https://dl.dropbox.com/s/ilqukf4rpdg7fsk/co-08_hostage.Stratis.pbo?token_hash=AAG1-ggQhkRrXTUhHU1BkaUbQhv4S_DZKyJO-UGNyJVxyw&dl=1

Edited by a040005

Share this post


Link to post
Share on other sites

Thanks Dr. Cox. This worked perfectly.

I had tried everything to get a Hostage rescue script working (Kylania's, various joinsilent tips, etc) but it was like trying to scale a plate-glass window after eating KFC.

Share this post


Link to post
Share on other sites

Anyone else having an animation problem with dedicated servers?

My hostage is in the stance of holding the gun and did not transition into the hands behind the back stance.

Share this post


Link to post
Share on other sites
Anyone else having an animation problem with dedicated servers?

Same here. He did not tied.

Share this post


Link to post
Share on other sites

I'm guessing that you used switchMove. If so, that is the reason why no one but the host can see the unit's animation.

Share this post


Link to post
Share on other sites
Thanks Dr. Cox. This worked perfectly.

I had tried everything to get a Hostage rescue script working (Kylania's, various joinsilent tips, etc) but it was like trying to scale a plate-glass window after eating KFC.

So why not just do it in the editor? Add a guy, take his stuff off him, give him a few commands (setcaptive true, disableAI "MOVE" etc.) and then have a trigger that when blufor are present it runs a really basic script changing all the commands (if you want, you could even put all that in a trigger) and makes him join your squad. There's not always a need to make some simple things so complicated. Suppose that also depends on if you want all the animations or random positions etc. or you're happy with him just lying on the floor for example.

By the way, what does this script actually do? Somebody else asked too and I don't think it says anywhere in the thread how it actually works.

I'm guessing that you used switchMove. If so, that is the reason why no one but the host can see the unit's animation.

So what do you do instead to get around this problem?

Edited by clydefrog

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  

×