Jump to content
Sign in to follow this  
demonized

Preset Weapon selections by player UID [script]

Recommended Posts

Haing problems - Nothing writing to my RPT file. Any ideas?

have you followed the instructions in post 1 under "How it works"/"detailed instructions" and selected the radio trigger in demo mission?

do you have the correct .rpt file?

Share this post


Link to post
Share on other sites
Scroll your mouse wheel and select any of the loadouts to see how it works, and when done select "im ready" and all the actions will be removed, and you are good to go.

If actions are on a object/vehicle the action "im ready" will not appear, so you can choose from it as long as its not destroyed.

the destroyed part can ofc be modified to suit users needs, its a condition nothing else, all viable conditions can be used, _target is object, _this is the unit/player acessing _target actions.

I'm not 100% on this statement.

Following directions but I don not get the option of "I'm ready". Could this be the problem and how can I sort it out ?

Share this post


Link to post
Share on other sites

"im ready" only apears if you use actions on unit itself (you the player as a man unit on foot).

it will not appear if you use the actions on a object or vehicle, but the actions will be removed if the object or vehicle is destroyed.

if thats not the case, then what have you done, and what is not working exactly?

Share this post


Link to post
Share on other sites

Hi,

Thanks for your quick response.

Basically I start up the demo, select a load out and then use the radio command to save to the .RPT file.

When i go into the .RPT file it empty and nothing has been printed,although i do get the message in game that it has.

Steam version with ACE.

Completely stumped by this one, is there anything I might be missing? Do I have to test all the players before beign able to write to RPT?

Any help would be very appreciated.

Share this post


Link to post
Share on other sites

hmm, sounds like you have the wrong .rpt file?

do you have Arma2 or OA or both?

i have CO and mine is called arma2oa.rpt

also i have windows 7 64 bit ultimate and my game install is sprocket version and my rpt file is located here:

C:\Users\DP490\AppData\Local\ArmA 2 OA\arma2oa.rpt

also, make sure you start game as administrator.

Share this post


Link to post
Share on other sites

trying to figure out how i am going to implement this into insurgency! should this be run client side or serverside i.e. : initclient.sqf or initserver.sqf and what lines do i have to add in the init.sqf (in this case i think initclient.sqf)

right now i have:

Initclient.sqf:

// Individual Saved Loadout script by Demonized

Preset_loadOuts_backPacks = compile preprocessFile "loadouts\backpacks.sqf";

and this in de soldiers init lines:

_null = [this,"start"] execVM "loadouts\preset_weapons.sqf";

Share this post


Link to post
Share on other sites

place that in init.sqf: not initclient or initserver.

Preset_loadOuts_backPacks = compile preprocessFile "loadouts\backpacks.sqf";

_null = [this,"start"] execVM "loadouts\preset_weapons.sqf"; 

either in init line of unit or clientside.

but you need to figure out how insurgency respawns units because the actions will be lost once you are dead or respawned, so you need to readd them or simply just use an object like the MHQ or a ammo box instead..

MHQ or ammobox in insurgency have been done and how is posted somewhere in this thread, i think they provided proper instructions aswell, or atleast some hint of what works in insurgency.

hard to say when only information you bring is:

right now i have:

what happens when you do what you described?!

Edited by Demonized

Share this post


Link to post
Share on other sites

working! i deleted all your michael jackson entries and other files to just have the basics! then wrapped it in a pbo and tested it! now it works!

thx for the swift reply

Edited by BelgarionNL

Share this post


Link to post
Share on other sites

ok next problem: i cannot add more presets because for some reason it gives me errors:

_names = [
"M110 and MK17 TWS SD"
];
>
 Error position: <];
_names = [
"M110 and MK17 TWS SD"
];
>
 Error Missing ;
File mpmissions\__cur_mp.Takistan\loadouts\preset_weapons.sqf, line 62
Error in expression <,[["20Rnd_762x51_SB_SCAR"],[4]],"ruck"]
];
_names = [
"M110 and MK17 TWS SD"
];
>
 Error position: <];
_names = [
"M110 and MK17 TWS SD"
];
>
 Error Missing ;
File mpmissions\__cur_mp.Takistan\loadouts\preset_weapons.sqf, line 62
Creating debriefing

and the script is:

/*
Preset Loadouts v 1.44
	by Demonized

	x amount of actions, selectable preset mission member weapon loadouts.
	arm unit based on player id with x selectable presets.
	Backpacks and their content is also supported.
	ACE weapons, ACE backpacks and their content is also supported, and ACRE.
	Can also assign option to an object if needed as well, fex an ammo crate or a vehicle (MHQ etc...).

Usage:
place all clans presets here in this script, and place script in mission folder.

1: // this is needed for backpacks and content to work for Preset Loadouts v 1.42 SP and MP, place in init.sqf.
   Preset_loadOuts_backPacks = compile preprocessFile "loadouts\backpacks.sqf";
2: replace "1111111" in _Player_UID = ["1111111"]; with player "7 digit uid"
3: replace/add/remove the arrays in _loadouts with the arrays from the rpt file.
4: rename name displayed in each of the actions to whatever you want.

Copy and repeat for each player you want to include in this.
Look below for example on 2 players, add more as you wish.
You may also want to delete Michael Jackson and Mr kongs loadouts  ;)

For objects/vehicles in both SP and MP place in initline of vehicle, or replace player or this with vehicle name.
I have little knowledge of how JIP works so this may work as a workaround.
for missions without JIP, place this in init.sqf
{_null = [_x,"start"] execVM "loadouts\preset_weapons.sqf"} foreach playableunits;
for missions with JIP, place this in every units init line that is playable.
_null = [this,"start"] execVM "loadouts\preset_weapons.sqf"

*/

_script = "loadouts\preset_weapons.sqf";	// file path of this script.
_equip = "loadouts\preset_equip.sqf";	// file path for equip script.

_unit = _this select 0;
if ((count _this) > 2) then {_unit = _this select 1};
_mainArr = [];
_vehicle = "vehicle";
if (_unit == player) then {_vehicle = "man"};
if (_vehicle == "man" AND _unit != player) exitWith {};

// presets for player Bell.
_Player_UID = ["XXXXXXX"];
if ((getPlayerUID _unit) in _Player_UID OR "start" in _this) then {
_loadouts =	[[[["NVGoggles","ItemMap","ItemCompass","ItemWatch","ItemRadio","m8_carbineGL","ItemGPS","Laserdesignator"],[1,1,1,1,1,1,1,1]],[["30Rnd_556x45_G36","1Rnd_HE_M203","Laserbatteries"],[11,8,1]],"CZ_Backpack_EP1",[["BAF_AS50_TWS"],[1]],[["5Rnd_127x99_as50"],[4]],"ruck"],
[[["NVGoggles","ItemMap","ItemCompass","ItemWatch","ItemRadio","m8_tws","UZI_SD_EP1","ItemGPS","Binocular"],[1,1,1,1,1,1,1,1,1]],[["30Rnd_9x19_UZI_SD","8Rnd_B_Beneli_74Slug","30Rnd_556x45_G36"],[8,4,8]],"CZ_Backpack_EP1",[["M1014"],[1]],[["8Rnd_B_Beneli_74Slug"],[4]],"ruck"],
[[["NVGoggles","ItemMap","ItemCompass","ItemWatch","ItemRadio","BAF_LRR_scoped","UZI_SD_EP1","ItemGPS"],[1,1,1,1,1,1,1,1]],[["5Rnd_86x70_L115A1","30Rnd_9x19_UZI_SD","30Rnd_556x45_G36SD"],[7,8,5]],"CZ_Backpack_EP1",[["m8_tws_sd"],[1]],[["30Rnd_556x45_G36SD"],[4]],"ruck"]
];
_names = [
	"M8GL and HSniper","M8TWS and shotgun","Sniperkit and M8TWS SD"	
];
if ("start" in _this) then {_con = format["(getPlayerUID _this) in %1 AND (getDammage _target) < 1",_Player_UID];if (_vehicle == "man") then {_con = format["(getPlayerUID _this) == '%1' AND (getPlayerUID _this) in %2",(getPlayerUID _unit),_Player_UID]};_pid = [];_loNr = 0;{_name = _names select _loNr;_preset = _unit addAction [_name,_script,[_loNr],((count _loadouts) - _loNr),true,true,"",_con];_loNr = _loNr + 1;_pid = _pid + [_preset];} foreach _loadouts;if (_vehicle == "man") then {_endP = _unit addAction ["im ready",_script,["end", _pid],0,true,true,"",_con]}} else {_id = _this select 2;_arg = _this select 3;if ("end" in _arg) then {_actions = _arg select 1; _actions = _actions + [_id];{_unit removeAction _x} foreach _actions} else {_arg = _this select 3;_sel = _arg select 0;_mainArr = _loadouts select _sel;_equip_preset = [_unit,_mainArr] execVM _equip}};
};  // end player Bell presets.



// presets for player Jager.
_Player_UID = ["YYYYY"];
if ((getPlayerUID _unit) in _Player_UID OR "start" in _this) then {
_loadouts =	[[["NVGoggles","ItemMap","ItemCompass","ItemWatch","ItemRadio","UZI_SD_EP1","ItemGPS","Laserdesignator","M110_NVG_EP1"],[1,1,1,1,1,1,1,1,1]],[["30Rnd_9x19_UZI_SD","Laserbatteries","20Rnd_762x51_B_SCAR","PipeBomb","SmokeShell"],[8,1,8,1,1]],"CZ_Backpack_EP1",[["SCAR_H_STD_TWS_SD"],[1]],[["20Rnd_762x51_SB_SCAR"],[4]],"ruck"]
];
_names = [
	"M110 and MK17 TWS SD"
];
if ("start" in _this) then {_con = format["(getPlayerUID _this) in %1 AND (getDammage _target) < 1",_Player_UID];if (_vehicle == "man") then {_con = format["(getPlayerUID _this) == '%1' AND (getPlayerUID _this) in %2",(getPlayerUID _unit),_Player_UID]};_pid = [];_loNr = 0;{_name = _names select _loNr;_preset = _unit addAction [_name,_script,[_loNr],((count _loadouts) - _loNr),true,true,"",_con];_loNr = _loNr + 1;_pid = _pid + [_preset];} foreach _loadouts;if (_vehicle == "man") then {_endP = _unit addAction ["im ready",_script,["end", _pid],0,true,true,"",_con]}} else {_id = _this select 2;_arg = _this select 3;if ("end" in _arg) then {_actions = _arg select 1; _actions = _actions + [_id];{_unit removeAction _x} foreach _actions} else {_arg = _this select 3;_sel = _arg select 0;_mainArr = _loadouts select _sel;_equip_preset = [_unit,_mainArr] execVM _equip}};
};  // end player Jager presets.

Share this post


Link to post
Share on other sites
*snip*

you are missing a [, missing one is added here with red.

_Player_UID = ["YYYYY"];
if ((getPlayerUID _unit) in _Player_UID OR "start" in _this) then {
_loadouts =	[size="6"][color="Red"][[/color][/size][[["NVGoggles","ItemMap","ItemCompass","ItemWatch","ItemRadio","UZI_SD_EP1","ItemGPS","Laserdesignator","M110_NVG_EP1"],[1,1,1,1,1,1,1,1,1]],[["30Rnd_9x19_UZI_SD","Laserbatteries","20Rnd_762x51_B_SCAR","PipeBomb","SmokeShell"],[8,1,8,1,1]],"CZ_Backpack_EP1",[["SCAR_H_STD_TWS_SD"],[1]],[["20Rnd_762x51_SB_SCAR"],[4]],"ruck"]
];

also for the future, do this like shown in examples:

_loadouts =	[
	[[["NVGoggles","ItemMap","ItemCompass","ItemWatch","ItemRadio","UZI_SD_EP1","ItemGPS","Laserdesignator","M110_NVG_EP1"],[1,1,1,1,1,1,1,1,1]],[["30Rnd_9x19_UZI_SD","Laserbatteries","20Rnd_762x51_B_SCAR","PipeBomb","SmokeShell"],[8,1,8,1,1]],"CZ_Backpack_EP1",[["SCAR_H_STD_TWS_SD"],[1]],[["20Rnd_762x51_SB_SCAR"],[4]],"ruck"],
	[[["NVGoggles","ItemMap","ItemCompass","ItemWatch","ItemRadio","UZI_SD_EP1","ItemGPS","Laserdesignator","M110_NVG_EP1"],[1,1,1,1,1,1,1,1,1]],[["30Rnd_9x19_UZI_SD","Laserbatteries","20Rnd_762x51_B_SCAR","PipeBomb","SmokeShell"],[8,1,8,1,1]],"CZ_Backpack_EP1",[["SCAR_H_STD_TWS_SD"],[1]],[["20Rnd_762x51_SB_SCAR"],[4]],"ruck"],
	[[["NVGoggles","ItemMap","ItemCompass","ItemWatch","ItemRadio","UZI_SD_EP1","ItemGPS","Laserdesignator","M110_NVG_EP1"],[1,1,1,1,1,1,1,1,1]],[["30Rnd_9x19_UZI_SD","Laserbatteries","20Rnd_762x51_B_SCAR","PipeBomb","SmokeShell"],[8,1,8,1,1]],"CZ_Backpack_EP1",[["SCAR_H_STD_TWS_SD"],[1]],[["20Rnd_762x51_SB_SCAR"],[4]],"ruck"]
];

now you can see whats inside properly instead of guessing on amount of [ to use.

Share this post


Link to post
Share on other sites

Demonized,

Once again let me say what others have also said, this is a great script and is a "must have" for all of the missions I make for my group. Thanks for this.

I am about to set about porting this into ArmA 3 but before I start I figured I'd post here and find out two things;

1. Is there already a working script or version that does the same thing for ArmA 3? (I looked but could not find something that does exactly what your script does)

2. Does anyone following this thread have any suggestions or helpful tips before I get started?

Thanks,

Theopolus

Share this post


Link to post
Share on other sites
Demonized,

Once again let me say what others have also said, this is a great script and is a "must have" for all of the missions I make for my group. Thanks for this.

I am about to set about porting this into ArmA 3 but before I start I figured I'd post here and find out two things;

1. Is there already a working script or version that does the same thing for ArmA 3? (I looked but could not find something that does exactly what your script does)

2. Does anyone following this thread have any suggestions or helpful tips before I get started?

Thanks,

Theopolus

I second this.

Love this tool. Best one I have used.

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  

×