Jump to content
Sign in to follow this  
TheSensor

Enable Backpack?

Recommended Posts

I am sure this is a simple init code but how can I enable backpack like that is done in Xeno's West Revive Domination map???

Please help...

Share this post


Link to post
Share on other sites
I am sure this is a simple init code but how can I enable backpack like that is done in Xeno's West Revive Domination map???

Please help...

This is not something in the game by default. DePBO Xeno's mission (or ask him about it), he must be using some user created scripts.

Share this post


Link to post
Share on other sites

Hmmm, How to de-PBO??? Sorry noobtastic here. I am understand what you mean its the how...

Share this post


Link to post
Share on other sites

Use a tool like cpbo.exe to extract the files from the PBO so that you can view them. What you're asking is not a simple copy/paste procedure however, so if you're not comfortable with scripting you might want to either play Domination stock, or build your skills up to this. :)

Share this post


Link to post
Share on other sites

has anyone managed to extract the backpack script successfully from Xeno's excellent mission? I've had a look, and it's waay beyond me working what snippets I need to keep etc.

Any help appreciated

Share this post


Link to post
Share on other sites

Mr.Murray's guide goes over how to add/incorporate a backpack/extra storage

Share this post


Link to post
Share on other sites

Failing that -post in Xeno's Domination thread!

He's a very helpfull guy when it comes to anything to do with his Domination!

Share this post


Link to post
Share on other sites

Just to let you know.

I'm reading the scripts involved. I'll need a beer and some more time because this is quite complicated ;)

If in another 30 minutes I have no good result, I'll let you know and take another beer and play a game :bounce3:

Share this post


Link to post
Share on other sites
Hmmm, How to de-PBO??? Sorry noobtastic here. I am understand what you mean its the how...

I use PboView0.8 to do that.

If you are not affraid of scripting, follow the instructions here. Tomorrow, if you need more details, i'll be glad to provide. I'm just way tired. Burned 2 hours on this without realizing it ! Note that all the credit goes to Xeno for providing every pieces of script I use here.

1. Create a mission in the mission editor and save it.

2. Navigate to the mission folder. On my pc : User/UserName/Documents/Arma 2/missions/TheNameOfTheMission

In that folder, you should see mission.sqm file. Put all the file I ask you to create in the same directory.

3. Create the text file : prep_backpack.sqf

4. put the following text in the prep_backback.sqf file :

// Taken from the script x_functions2.sqf 
// The x_functions2.sqf  script has been made by Xeno for his domination pack.
XfGetDisplayName = {
private ["_obj_name", "_obj_kind", "_cfg"];
_obj_name = _this select 0;_obj_kind = _this select 1;
_cfg = (switch (_obj_kind) do {case 0: {"CfgVehicles"};case 1: {"CfgWeapons"};case 2: {"CfgMagazines"};});
getText(configFile >> _cfg >> _obj_name >> "displayName")
};

// Taken from the script x_setupplayer.sqf
// The x_setupplayer.sqf script has been made by Xeno for his domination pack.
private ["_p", "_pos", "_trigger"];

_p = player;
_pos = position _p;
player_backpack = [];
prim_weap_player = "";
x_weapon_array = [];
pbp_id = -9999;
d_backpack_helper = [];
prim_weap_player = primaryWeapon _p;
_s = format ["%1 to Backpack", [prim_weap_player,1] call XfGetDisplayName];


if (prim_weap_player != "" && prim_weap_player != " ") then {
pbp_id = _p addAction [_s, "x_backpack.sqf",[],-1,false];
};

// No Weapon fix for backpack
_trigger = createTrigger["EmptyDetector" ,_pos];
_trigger setTriggerArea [0, 0, 0, false];
_trigger setTriggerActivation ["NONE", "PRESENT", true];
_trigger setTriggerStatements["primaryWeapon player != prim_weap_player && primaryWeapon player != ' '","prim_weap_player = primaryWeapon player;if (pbp_id != -9999 && count player_backpack == 0) then {player removeAction pbp_id;pbp_id = -9999;};if (pbp_id == -9999 && count player_backpack == 0 && prim_weap_player != '' && prim_weap_player != ' ') then {pbp_id = player addAction [format ['%1 to Backpack', [prim_weap_player,1] call XfGetDisplayName], 'x_backpack.sqf',[],-1,false];};",""];

5. Create the file x_backpack.sqf and put the following text in it :

// by Xeno

private ["_anim","_mag_types","_magazines","_mags_backpack","_muzzles","_p","_primary","_s","_pistol","_base"];
_p = player;
if (pbp_id != -9999) then {
_p removeAction pbp_id;
pbp_id = -9999;
};

if (count player_backpack == 0) then {
_primary = primaryWeapon _p;
if (_primary != "") then {
	_mag_types = getArray(configFile>> "cfgWeapons" >> _primary >> "magazines");
	_magazines = magazines _p;
	_mags_backpack = [];
	{
		if (_x in _mag_types) then {
			[_mags_backpack, _x] call BIS_fnc_arrayPush;
		};
	} forEach _magazines;
	_muzzles = getArray(configFile>> "cfgWeapons" >> _primary >> "muzzles");
	if (count _muzzles == 2) then {
		_mag_types = getArray(configFile>> "cfgWeapons" >> _primary >> (_muzzles select 1) >> "magazines");
		{
			if (_x in _mag_types) then {
				[_mags_backpack, _x] call BIS_fnc_arrayPush;
			};
		} forEach _magazines;
	};
	d_backpack_helper = [_mags_backpack, _primary];
	_weapons = weapons _p;
	d_backpack_helper = [_magazines, _weapons];
	_pistol = "";
	{
		scopeName "pistolsearch";
		_base = inheritsFrom (configFile >> "cfgWeapons" >> _x);
		for "_xs" from 1 to 3 do {
			if (configName _base == "Pistol") then {
				_pistol = _x;
				breakOut "pistolsearch";
			};
			_base = inheritsFrom (configFile >> "cfgWeapons" >> (configName _base));
		};
	} forEach _weapons;
	if (_pistol != "") then {
		_p removeWeapon _pistol;
	};
	{
		_p removeMagazine _x;
	} forEach _mags_backpack;
	_p removeWeapon _primary;
	_anim = animationState _p;
	player_backpack = [_primary, _mags_backpack];
	waitUntil {animationState player != _anim};
	_p = player;
	_s = format ["Weapon %1", [_primary,1] call XfGetDisplayName];
	if (_pistol != "") then {
		_p addWeapon _pistol;
		_p selectWeapon _pistol;
	};
	if (pbp_id == -9999) then {
		pbp_id = _p addAction [_s, "x_backpack.sqf",[],-1,false];
	};
	if (alive player) then {
		d_backpack_helper = [];
	};
};
}
else // switch weapon
{ 
_primary = primaryWeapon _p;
if (_primary == "") then {
	{
		_p addMagazine _x;
	} forEach (player_backpack select 1);
	_p addWeapon (player_backpack select 0);
	_muzzles = getArray(configFile>>"cfgWeapons" >> (player_backpack select 0) >> "muzzles");
	_p selectWeapon (player_backpack select 0);
	_p selectWeapon (_muzzles select 0);
	_s = format ["%1 to Backpack", [player_backpack select 0,1] call XfGetDisplayName];
	player_backpack = [];
	if (pbp_id != -9999) then {
		_p removeAction pbp_id;
		pbp_id = -9999;
	};
	if (pbp_id == -9999) then {
		pbp_id = _p addAction [_s, "x_backpack.sqf",[],-1,false];
	};
} else {
	_mag_types = getArray(configFile>> "cfgWeapons" >> _primary >> "magazines");
	_magazines = magazines _p;
	_mags_backpack = [];
	{
		if (_x in _mag_types) then {
			[_mags_backpack, _x] call BIS_fnc_arrayPush;
		};
	} forEach _magazines;
	_muzzles = getArray(configFile>> "cfgWeapons" >> _primary >> "muzzles");
	if (count _muzzles == 2) then {
		_mag_types = getArray(configFile>> "cfgWeapons" >> _primary >> (_muzzles select 1) >> "magazines");
		{
			if (_x in _mag_types) then {
				[_mags_backpack, _x] call BIS_fnc_arrayPush;
			};
		} forEach _magazines;
	};
	{
		_p removeMagazine _x;
	} forEach _mags_backpack;
	_weapons = weapons _p;
	d_backpack_helper = [_mags_backpack, _primary];
	_pistol = "";
	{
		scopeName "pistolsearch2";
		_base = inheritsFrom (configFile >> "cfgWeapons" >> _x);
		for "_xs" from 1 to 3 do {
			if (configName _base == "Pistol") then {
				_pistol = _x;
				breakOut "pistolsearch2";
			};
			_base = inheritsFrom (configFile >> "cfgWeapons" >> (configName _base));
		};
	} forEach _weapons;
	if (_pistol != "") then {
		_p removeWeapon _pistol;
	};
	_p removeWeapon _primary;
	sleep 1;
	_anim = animationState _p;
	waitUntil {animationState player != _anim};
	_p = player;
	{
		_p addMagazine _x;
	} forEach (player_backpack select 1);
	if (_pistol != "") then {
		_p addWeapon _pistol;
	};
	_p addWeapon (player_backpack select 0);
	_muzzles = getArray(configFile>> "cfgWeapons" >> (player_backpack select 0) >> "muzzles");
	_p selectWeapon (player_backpack select 0);
	_p selectWeapon (_muzzles select 0);
	player_backpack = [_primary, _mags_backpack];
	_s = format ["Weapon %1", [_primary,1] call XfGetDisplayName];
	if (pbp_id == -9999) then {
		pbp_id = _p addAction [_s, "x_backpack.sqf",[],-1,false];
	};
	if (alive player) then {
		d_backpack_helper = [];
	};
};
};

if (true) exitWith {};

6. Create a soldier, in the name field, put a name, in the init field, put :

null0 = this execVM "prep_backpack.sqf";

7. Voila. You have the backpack. Now, I dont have a clue on how to have the backpack to be active once you respawn. I tried with triggers, etc, but it is not working. I hope someone could shed some ligh on that.

8. Thank Xeno for the epic work done on the Domination maps.

Share this post


Link to post
Share on other sites

7. Voila. You have the backpack. Now, I dont have a clue on how to have the backpack to be active once you respawn. I tried with triggers, etc, but it is not working. I hope someone could shed some ligh on that.

Well, if you use norrins revive you could use the execVM sections at bottom of revive_init.sqf to have it re-enabled upon revive/spawn.

Or you could specify the code with each playable unit name in init.sqf and use it with "killed" eventHandler? (Can't remember now how it was done, sorry)

Share this post


Link to post
Share on other sites

create trigger set to repeat. in condition line put

alive player

and in onactivation line put

null0 = [player] execVM "prep_backpack.sqf";

Share this post


Link to post
Share on other sites
create trigger set to repeat. in condition line put
alive player

and in onactivation line put

null0 = [player] execVM "prep_backpack.sqf";

Thx sir. I will try that.

Share this post


Link to post
Share on other sites

This is how to do it and tested!!!

alive player

player addEventHandler ["killed",{[_this select 0, _this select 1] execVM "prep_backpack.sqf"}];

Share this post


Link to post
Share on other sites

Fantastic! Excellent work chaps, and of course all dues to Xeno for creating it in the first place :)

Love these BI forums. Most helpful thing ever!

~Z~

EDIT - just tried this, but I get 10 entries on my action menu to put weapon to backpack, and none to get anything back out. Any ideas?

I've created the two scripts mentioned by the Angry Canadian, and put the init line for each of the playable units.

Edited by zach72

Share this post


Link to post
Share on other sites

this backpack script works, but i have a problem. if i put the null0 = [player] execVM "prep_backpack.sq; code in more than 1 unit, i get the menu to backpack repeated the times i put this code in diferent units.

if i put 6 units with this code, i got 6 menu to backpack.

any idea how to solve this? am i the only one with this thing?

edited:solved if i put in the same code all player names [player,player1,player2]

next question: the script only put into backpack the weapon, how to make the ammo put into the backpack too??

i reedit :) : i only need to put the code to 1 player to make all players get the backpack, but i only want 2 of 14 available players get the backpack..... any idea??

Edited by Vlhare

Share this post


Link to post
Share on other sites

The script never put the ammo to backback. It would need to be modified to do that. I'm leaving on vacation and can't really take a look at it right now but it should be easy to do. Look into the backpack code and repeat the procedure done for the gun.

Share this post


Link to post
Share on other sites

I'll post a solution, as soon as I'm home ;)

Xeno

Share this post


Link to post
Share on other sites
The script never put the ammo to backback.

Actually, that is working fine. You just forget to include or compile BIS_fnc_arrayPush :)

Nevertheless, new version of prep_backpack.sqf.

Just place a trigger.

Condition: local player

On Act.: handle = [true] execVM "prep_backpack.sqf"

The true parameter just tells the script that a player will respawn with the same weapons and magazines he had before he died (it automatically checks if norrins revive gets used and let the revive script handle the normal weapon respawn).

prep_backpack.sqf:

_weaprespawn = if (count _this > 0) then {_this select 0} else {false};

BIS_fnc_arrayPush = compile preprocessFileLineNumbers "\ca\modules\Functions\arrays\fn_arrayPush.sqf";

// Taken from the script x_functions2.sqf 
// The x_functions2.sqf  script has been made by Xeno for his domination pack.
XfGetDisplayName = {
   private ["_obj_name", "_obj_kind", "_cfg"];
   _obj_name = _this select 0;_obj_kind = _this select 1;
   _cfg = (switch (_obj_kind) do {case 0: {"CfgVehicles"};case 1: {"CfgWeapons"};case 2: {"CfgMagazines"};});
   getText(configFile >> _cfg >> _obj_name >> "displayName")
};

// Taken from the script x_setupplayer.sqf
// The x_setupplayer.sqf script has been made by Xeno for his domination pack.
private ["_p", "_pos", "_trigger"];

_p = player;
_pos = position _p;
player_backpack = [];
prim_weap_player = "";
pbp_id = -9999;
d_backpack_helper = [];
prim_weap_player = primaryWeapon _p;
_s = format ["%1 to Backpack", [prim_weap_player,1] call XfGetDisplayName];

if (prim_weap_player != "" && prim_weap_player != " ") then {
   pbp_id = _p addAction [_s, "x_backpack.sqf",[],-1,false];
};

// No Weapon fix for backpack
_trigger = createTrigger["EmptyDetector" ,_pos];
_trigger setTriggerArea [0, 0, 0, false];
_trigger setTriggerActivation ["NONE", "PRESENT", true];
_trigger setTriggerStatements["primaryWeapon player != prim_weap_player && primaryWeapon player != ' '","prim_weap_player = primaryWeapon player;if (pbp_id != -9999 && count player_backpack == 0) then {player removeAction pbp_id;pbp_id = -9999;};if (pbp_id == -9999 && count player_backpack == 0 && prim_weap_player != '' && prim_weap_player != ' ') then {pbp_id = player addAction [format ['%1 to Backpack', [prim_weap_player,1] call XfGetDisplayName], 'x_backpack.sqf',[],-1,false];};",""];

[_weaprespawn] spawn {
   private ["_weaprespawn", "_p", "_weapons", "_magazines", "_primw", "_muzzles", "_s"];
   _weaprespawn = _this select 0;
   while {true} do {
       waitUntil {!alive player};
       _p = player;
       if (_weaprespawn && isNil "NORRN_revive_array") then {
           _weapons = weapons _p;
           _magazines = magazines _p;
       };
       if (pbp_id != -9999) then {
           _p removeAction pbp_id;
           pbp_id = -9999;
       };
       waitUntil {alive player};
       _p = player;
       if (_weaprespawn  && isNil "NORRN_revive_array") then {
           removeAllItems _p;
           removeAllWeapons _p;
           {_p addMagazine _x} forEach _magazines;
           {_p addWeapon _x} forEach _weapons;
       };
       if (count d_backpack_helper > 0) then {
           {_p addMagazine _x} forEach (d_backpack_helper select 0);
           {_p addWeapon _x} forEach (d_backpack_helper select 1);
           d_backpack_helper = [];
       };
       _primw = primaryWeapon _p;
       if (_primw != "") then {
           _p selectWeapon _primw;
           _muzzles = getArray(configFile>>"cfgWeapons" >> _primw >> "muzzles");
           _p selectWeapon (_muzzles select 0);
       };
       if (count player_backpack == 0) then {
           if (primaryWeapon _p != "" && primaryWeapon _p != " ") then {
               _s = format ["%1 to Backpack", [primaryWeapon _p,1] call XfGetDisplayName];
               if (pbp_id == -9999) then {
                   pbp_id = _p addAction [_s, "x_backpack.sqf",[],-1,false];
               };
           };
       } else {
           _s = format ["Weapon %1", [player_backpack select 0,1] call XfGetDisplayName];
           if (pbp_id == -9999) then {
               pbp_id = _p addAction [_s, "x_backpack.sqf",[],-1,false];
           };
       };
   };
};

Xeno

Share this post


Link to post
Share on other sites

:mad:

I don't understand... Whatever I do, I still get a message "script prep_backpack.sqf not found"...

What files do I have to dePBO from the Xeno's mission?

EDIT. My bad.. Problem solved

Edited by Psykedeeli

Share this post


Link to post
Share on other sites

Hi Psykedeeli,

All you need to do is copy the following into a new text file and call it "prep_backpack.sqf":-

_weaprespawn = if (count _this > 0) then {_this select 0} else {false};

BIS_fnc_arrayPush = compile preprocessFileLineNumbers "\ca\modules\Functions\arrays\fn_arrayPush.sqf";

// Taken from the script x_functions2.sqf

// The x_functions2.sqf script has been made by Xeno for his domination pack.

XfGetDisplayName = {

private ["_obj_name", "_obj_kind", "_cfg"];

_obj_name = _this select 0;_obj_kind = _this select 1;

_cfg = (switch (_obj_kind) do {case 0: {"CfgVehicles"};case 1: {"CfgWeapons"};case 2: {"CfgMagazines"};});

getText(configFile >> _cfg >> _obj_name >> "displayName")

};

// Taken from the script x_setupplayer.sqf

// The x_setupplayer.sqf script has been made by Xeno for his domination pack.

private ["_p", "_pos", "_trigger"];

_p = player;

_pos = position _p;

player_backpack = [];

prim_weap_player = "";

pbp_id = -9999;

d_backpack_helper = [];

prim_weap_player = primaryWeapon _p;

_s = format ["%1 to Backpack", [prim_weap_player,1] call XfGetDisplayName];

if (prim_weap_player != "" && prim_weap_player != " ") then {

pbp_id = _p addAction [_s, "Cust_scripts\Backpack\x_backpack.sqf",[],-1,false];

};

// No Weapon fix for backpack

_trigger = createTrigger["EmptyDetector" ,_pos];

_trigger setTriggerArea [0, 0, 0, false];

_trigger setTriggerActivation ["NONE", "PRESENT", true];

_trigger setTriggerStatements["primaryWeapon player != prim_weap_player && primaryWeapon player != ' '","prim_weap_player = primaryWeapon player;if (pbp_id != -9999 && count player_backpack == 0) then {player removeAction pbp_id;pbp_id = -9999;};if (pbp_id == -9999 && count player_backpack == 0 && prim_weap_player != '' && prim_weap_player != ' ') then {pbp_id = player addAction [format ['%1 to Backpack', [prim_weap_player,1] call XfGetDisplayName], 'Cust_scripts\Backpack\x_backpack.sqf',[],-1,false];};",""];

[_weaprespawn] spawn {

private ["_weaprespawn", "_p", "_weapons", "_magazines", "_primw", "_muzzles", "_s"];

_weaprespawn = _this select 0;

while {true} do {

waitUntil {!alive player};

_p = player;

if (_weaprespawn && isNil "NORRN_revive_array") then {

_weapons = weapons _p;

_magazines = magazines _p;

};

if (pbp_id != -9999) then {

_p removeAction pbp_id;

pbp_id = -9999;

};

waitUntil {alive player};

_p = player;

if (_weaprespawn && isNil "NORRN_revive_array") then {

removeAllItems _p;

removeAllWeapons _p;

{_p addMagazine _x} forEach _magazines;

{_p addWeapon _x} forEach _weapons;

};

if (count d_backpack_helper > 0) then {

{_p addMagazine _x} forEach (d_backpack_helper select 0);

{_p addWeapon _x} forEach (d_backpack_helper select 1);

d_backpack_helper = [];

};

_primw = primaryWeapon _p;

if (_primw != "") then {

_p selectWeapon _primw;

_muzzles = getArray(configFile>>"cfgWeapons" >> _primw >> "muzzles");

_p selectWeapon (_muzzles select 0);

};

if (count player_backpack == 0) then {

if (primaryWeapon _p != "" && primaryWeapon _p != " ") then {

_s = format ["%1 to Backpack", [primaryWeapon _p,1] call XfGetDisplayName];

if (pbp_id == -9999) then {

pbp_id = _p addAction [_s, "Cust_scripts\Backpack\x_backpack.sqf",[],-1,false];

};

};

} else {

_s = format ["Weapon %1", [player_backpack select 0,1] call XfGetDisplayName];

if (pbp_id == -9999) then {

pbp_id = _p addAction [_s, "Cust_scripts\Backpack\x_backpack.sqf",[],-1,false];

};

};

};

};

Then copy the following into another new text file and call it "x_backpack.sqf":-

// by Xeno

private ["_p"];

_p = player;

_p removeAction pbp_id;

if (count player_backpack == 0) then {

_primary = primaryWeapon _p;

if (_primary != "") then {

_mag_types = getArray(configFile>> "cfgWeapons" >> _primary >> "magazines");

_magazines = magazines _p;

_mags_backpack = [];

{

if (_x in _mag_types) then {_mags_backpack = _mags_backpack + [_x]};

} forEach _magazines;

_muzzles = getArray(configFile>> "cfgWeapons" >> _primary >> "muzzles");

if (count _muzzles == 2) then {

_mag_types = getArray(configFile>> "cfgWeapons" >> _primary >> (_muzzles select 1) >> "magazines");

{

if (_x in _mag_types) then {_mags_backpack = _mags_backpack + [_x]};

} forEach _magazines;

};

player_backpack = [_primary, _mags_backpack];

_weapons = weapons _p;

_pistol = "";

{

scopeName "pistolsearch";

_base = inheritsFrom (configFile >> "cfgWeapons" >> _x);

for "_xs" from 1 to 3 do {

if (configName _base == "Pistol") then {

_pistol = _x;

breakOut "pistolsearch";

};

_base = inheritsFrom (configFile >> "cfgWeapons" >> (configName _base));

};

} forEach _weapons;

if (_pistol != "") then {

_p removeWeapon _pistol;

};

{

_p removeMagazine _x;

} forEach _mags_backpack;

_p removeWeapon _primary;

_anim = animationState _p;

WaitUntil {animationState player != _anim};

_s = format ["Weapon %1", _primary];

if (_pistol != "") then {

_p addWeapon _pistol;

_p selectWeapon _pistol;

};

pbp_id = _p addAction [_s, "Cust_scripts\Backpack\x_backpack.sqf",[],-1,false];

} else { // has no primary

};

} else { // switch weapon

_primary = primaryWeapon _p;

if (_primary == "") then {

{

_p addMagazine _x;

} forEach (player_backpack select 1);

_p addWeapon (player_backpack select 0);

_muzzles = getArray(configFile>>"cfgWeapons" >> (player_backpack select 0) >> "muzzles");

_p selectWeapon (player_backpack select 0);

_p selectWeapon (_muzzles select 0);

_s = format ["%1 to Backpack", (player_backpack select 0)];

player_backpack = [];

_p removeAction pbp_id;

pbp_id = _p addAction [_s, "Cust_scripts\Backpack\x_backpack.sqf",[],-1,false];

} else {

_mag_types = getArray(configFile>> "cfgWeapons" >> _primary >> "magazines");

_magazines = magazines _p;

_mags_backpack = [];

{

if (_x in _mag_types) then {_mags_backpack = _mags_backpack + [_x]};

} forEach _magazines;

_muzzles = getArray(configFile>> "cfgWeapons" >> _primary >> "muzzles");

if (count _muzzles == 2) then {

_mag_types = getArray(configFile>> "cfgWeapons" >> _primary >> (_muzzles select 1) >> "magazines");

{

if (_x in _mag_types) then {_mags_backpack = _mags_backpack + [_x]};

} forEach _magazines;

};

{

_p removeMagazine _x;

} forEach _mags_backpack;

_weapons = weapons _p;

_pistol = "";

{

scopeName "pistolsearch2";

_base = inheritsFrom (configFile >> "cfgWeapons" >> _x);

for "_xs" from 1 to 3 do {

if (configName _base == "Pistol") then {

_pistol = _x;

breakOut "pistolsearch2";

};

_base = inheritsFrom (configFile >> "cfgWeapons" >> (configName _base));

};

} forEach _weapons;

if (_pistol != "") then {

_p removeWeapon _pistol;

};

_p removeWeapon _primary;

sleep 1;

_anim = animationState _p;

WaitUntil {animationState player != _anim};

{

_p addMagazine _x;

} forEach (player_backpack select 1);

if (_pistol != "") then {

_p addWeapon _pistol;

};

_p addWeapon (player_backpack select 0);

_muzzles = getArray(configFile>> "cfgWeapons" >> (player_backpack select 0) >> "muzzles");

_p selectWeapon (player_backpack select 0);

_p selectWeapon (_muzzles select 0);

player_backpack = [_primary, _mags_backpack];

_s = format ["Weapon %1", _primary];

pbp_id = _p addAction [_s, "Cust_scripts\Backpack\x_backpack.sqf",[],-1,false];

};

};

if (true) exitWith {};

Save both of these files in a new folder in your mission folder as follows:-

\MISSION_NAME\Cust_scripts\Backpack\

NOTE:- I HAVE STRUCTURED MY FOLDERS DIFFERENTLY THAN NORRIN ORIGINALLY INTENDED. SEARCH THROUGH "x_backpack.sqf" TO SEE FILE LOCATIONS.

Finally in you mission create a trigger as follows:-

ACTIVATION = NONE

SET TO = REPEATEDLY

TYPE = NONE

CONDITION = local player

ON ACT. = handle = [true] execVM "Cust_scripts\Backpack\prep_backpack.sqf";

Finish, :yay::yay::yay:

Hope this helps,

Thanks

Cool Breeze-ICON

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  

×