Jump to content

Sign in to follow this  
crazy_usmc

HVT/POW help

Recommended Posts

hey guy I need a little help. I'm not that great at scripting but I could use some help with this. I'm creating a mission where a fire team is HELOed in to rescue a BLUEFOR pilot. I have guards set up around the pow and I don't want them to kill the pow soon as the mission starts. I've been using this as an example to go by: http://www.kylania.com/ex/?p=11 but I've noticed that if the POWs are BLUEFOR then it doesn't work. any suggestions? this is how I have it set up:

r1-fireteam leader (me) int field: POW= [p1]

POW: p1 (name of pow) int field: this addAction ["Rescue POWs","rescuePows.sqf",[POWS],1,false,true,"","(_target distance _this) < 3"]; removeallweapons this; this disableai "MOVE"; this setbehaviour "CARELESS"; this setcaptive true;

then I have a trigger activated by BLUEFOR and type set to switch and in the on act field I have this: p1 enableAI "MOVE";

here's the sqf code I'm using:

_per = _this select 0; // Person who had the addAction

_ldr = _this select 1; // Person who used the addAction

_act = _this select 2; // ID of the addAction

// Group given in the arguments section (ie: [POWS]

_grp = _this select 3 select 0;

// Remove the rescue option

_per removeAction _act;

// Join preselected units (POWS) to callers group, silently.

{[_x] joinSilent _ldr} forEach _grp;

If anyone could help me out I would appreciate it.

Share this post


Link to post
Share on other sites

Single player or Multi Player? For SP just move the enableAI into the script instead of using a trigger. For MP you'll need to jump through a few hoops to remove the action from everyone.

Share this post


Link to post
Share on other sites

May I add, in MP, it might be useful to actually keep the action if you have several playing groups. This allows for exchanging the POW between groups, or even retake control of him if his whole group is killed.

Share this post


Link to post
Share on other sites

i have it working with spawning the pow via script if it helps. MP COMPATIBLE

spawnpow.sqf ==> just place a marker on the map where you want the pow to spawn

createcenter WEST;
P1grp = createGroup WEST;
_P1man = ["UN_CDF_Soldier_AAT_EP1","UN_CDF_Soldier_AMG_EP1","UN_CDF_Soldier_Officer_EP1"] call BIS_fnc_selectRandom;  // CHANGE TO WEST UNIT CLASSNAMES
P1 = _P1grp createUnit [_P1man, (markerPos "jail"), [], 0, "FORM"]; // CHANGE MARKER NAME HERE FOR SPAWN POS - P1man = WILL SELECT 1 OF THE ABOVE UNITS 
sleep 0.2;
P1 switchMove "boundCaptive_loop"; // PLACE POW IN CAPTURED POSITION HANDS TIED BEHIND BACK AND SITTING ON GROUND
//P1 call {[P1,300,3] execVM "missions\scripts\pow_positions.sqf"};
// player setpos P1;
P1 setcaptive true;
P1 setBehaviour "CARELESS";
P1 disableAI "MOVE";
removeAllWeapons P1; 
P1 setVehicleInit "this addAction ['Rescue Him!', 'missions\scripts\rescue.sqf'];";


rescue.sqf

_per = _this select 0;  // Person who had the addAction
_ldr = _this select 1;  // Person who used the addAction
_act = _this select 2;  // ID of the addAction

_per removeAction _act;
_ldr switchMove "AinvPknlMstpSnonWrflDnon_medic3"; //MOVE FOR RESCUE DUDE TO LOOK LIKE HE GETTING POW
sleep 15;
_ldr switchMove "AinvPknlMstpSnonWrflDnon_medicEnd"; // FINISH RESCUE DUDES MOVES
_per switchMove "boundCaptive_unaErc";  //POW STANDS UP 
[_per] joinSilent _ldr;
_per = setskill 1;
_per EnableAI "MOVE";

while {alive _per} do // this will add the addaction back on the pow if the rescue player dies
{

if (!alive _ldr) exitwith
	{
	  _per setVehicleInit "this addAction ['Escort Him!', 'missions\scripts\escort.sqf']";
	  [sgt,nil,rgroupChat,"reset escort option!"] call RE;
	};

sleep 3;
};

Edited by hogmason

Share this post


Link to post
Share on other sites
  kylania said:
Single player or Multi Player? For SP just move the enableAI into the script instead of using a trigger. For MP you'll need to jump through a few hoops to remove the action from everyone.

Single player for now

---------- Post added at 09:53 PM ---------- Previous post was at 09:51 PM ----------

  hogmason said:
i have it working with spawning the pow via script if it helps. MP COMPATIBLE

spawnpow.sqf ==> just place a marker on the map where you want the pow to spawn

createcenter WEST;
P1grp = createGroup WEST;
_P1man = ["UN_CDF_Soldier_AAT_EP1","UN_CDF_Soldier_AMG_EP1","UN_CDF_Soldier_Officer_EP1"] call BIS_fnc_selectRandom;  // CHANGE TO WEST UNIT CLASSNAMES
P1 = _P1grp createUnit [_P1man, (markerPos "jail"), [], 0, "FORM"]; // CHANGE MARKER NAME HERE FOR SPAWN POS - P1man = WILL SELECT 1 OF THE ABOVE UNITS 
sleep 0.2;
P1 switchMove "boundCaptive_loop"; // PLACE POW IN CAPTURED POSITION HANDS TIED BEHIND BACK AND SITTING ON GROUND
//P1 call {[P1,300,3] execVM "missions\scripts\pow_positions.sqf"};
// player setpos P1;
P1 setcaptive true;
P1 setBehaviour "CARELESS";
P1 disableAI "MOVE";
removeAllWeapons P1; 
P1 setVehicleInit "this addAction ['Rescue Him!', 'missions\scripts\rescue.sqf'];";


rescue.sqf

_per = _this select 0;  // Person who had the addAction
_ldr = _this select 1;  // Person who used the addAction
_act = _this select 2;  // ID of the addAction

_per removeAction _act;
_ldr switchMove "AinvPknlMstpSnonWrflDnon_medic3"; //MOVE FOR RESCUE DUDE TO LOOK LIKE HE GETTING POW
sleep 15;
_ldr switchMove "AinvPknlMstpSnonWrflDnon_medicEnd"; // FINISH RESCUE DUDES MOVES
_per switchMove "boundCaptive_unaErc";  //POW STANDS UP 
[_per] joinSilent _ldr;
_per = setskill 1;
_per EnableAI "MOVE";

while {alive _per} do // this will add the addaction back on the pow if the rescue player dies
{

if (!alive _ldr) exitwith
	{
	  _per setVehicleInit "this addAction ['Escort Him!', 'missions\scripts\escort.sqf']";
	  [sgt,nil,rgroupChat,"reset escort option!"] call RE;
	};

sleep 3;
};

Thanks Hog! do I activate both using a trigger and by marker do you mean actual markers or just a random object? Sorry if this sounds dumb lol

Share this post


Link to post
Share on other sites

place a marker on map named jail ==> this is where the POW will spawn

in your mission folder place in your init.sqf ==== execVM "spawnpow.sqf";

then create a sqf file called spawnpow.sqf adding the above spawnpow.sqf code only.

thats it now when the mission loads the pow will spawn on your marker

the rescue code is activated threw the spawn code ;

Share this post


Link to post
Share on other sites
  hogmason said:
place a marker on map named jail ==> this is where the POW will spawn

in your mission folder place in your init.sqf ==== execVM "spawnpow.sqf";

then create a sqf file called spawnpow.sqf adding the above spawnpow.sqf code only.

thats it now when the mission loads the pow will spawn on your marker

the rescue code is activated threw the spawn code ;

Thanks hog for the help!

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  

×