Jump to content
Sign in to follow this  
AgentJonathan

Cover blown

Recommended Posts

I am under way in creating a mission where you must Go into a russian base undercover as a russian, but a russian guard figures out you are resistance and tells you to run your butt off or die.

These guys know who you are, and right now the 'setcaptive' is true. There is a 1x1 trigger around your character that falsifies your captivity if you leave, that is under control, but there are two other things that I want to fix, most preferably in a script.

(1.)I need a script that also falsifies your captivity if you pull out your pistol, (2.)I need a way for the russians to keep their weapons on their backs, regardless to you being a resistance soldier, but for them to pull out their weapons once you pull out yours.

Pretty much creating a "quick draw" effect.

Thanks. wink_o.gif

Share this post


Link to post
Share on other sites

I can remember using a script to check a unit's behaviour some time ago. The unit in question was the one I was playing. I'm sure I can remember that putting my weapon in hand instead of on my back changed my behaviour from "SAFE" to"AWARE". Don't think it worked for secondary weapons though.

As for the russians going mad when you pull out your pistol won't they do this automatically if you setcaptive to false?

Sounds like a good mission smile_o.gif

Share this post


Link to post
Share on other sites

I'm afraid there is no way to detect if a weapon is on hand or not.

An easiest way would be to test if you have or not a weapon with the "hasweapon" command. The player can pick up a weapon from a weaponholder when he wants to fight.

Let's say that the weapon is a beretta. Create a trigger, and write this in the condition line : player hasweapon "beretta"

And this in the on activation line : player setcaptive false

To create a weaponholder, just put an object somewhere where you want the weapon to appear. Let's say an invisible helipad, named "heli". Type this in the init line of the helipad.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">weaponh = "weaponholder" createvehicle getpos heli;weaponh addWeaponCargo ["beretta",1];weaponh addMagazineCargo ["beretta",10]

Share this post


Link to post
Share on other sites

Thx.

1. THe weapon is a CZ75 tounge2.gif

2. The player already has this weapon in the beginning, but you have it on your side. I wanted them to draw their rifles once you have drawn your CZ75.

There are 3 top skilled guys who stop you

A Colonel Officer

A Major Spetz Natz

And another Major Spetz Natz with a Dragunov.

Basically, you gotta pull out your CZ75 and kill them before they pull out their guns and shoot you.

But their is--yet again--one problem... When you are in setcaptive mode they all pull out their guns and keep it pointed at you, but not to kill you.

So the reason I want some way to keep the guns on their backs is so they don't waste you after you kill one guy.

Thanks in advance, mates.

Share this post


Link to post
Share on other sites

Ok, there's a trick :

(1) Set the player captive from the beginning (in its init line), enemy AI will stay in a safe mode with weapon on back (cause AI is in safe mode, isn't it ?).

(2) Remove all weapons from the player.

(3) Then, add an action which simulates the "CZ75 in hands" command. Copy and paste this in the init line of the player :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">handgunaction=Player addaction ["CZ75 in hands","handgun.sqs"]

(4) Copy the following script, name it "handgun.sqs" and put it in the mission folder :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player addmagazine "cz75mag"

player addmagazine "cz75mag"

player addmagazine "cz75mag"

player addmagazine "cz75mag"

player addmagazine "cz75mag"

player addweapon "cz75"

~0.1

player selectweapon "cz75"

player removeaction handgunaction

player setcaptive false

exit

(5) Voila;. When the player selects the action, as he would normally do, he has the CZ75 in hands and he is fired on.

It works well, i just tested it.

Regards,

ProfT

Share this post


Link to post
Share on other sites

Nice nice!

Thanks a lot.

I still cant get them to put away their weapons until that script activates though.

I'll bet there isn't even a way to do that, is there?

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  

×