Jump to content
Sign in to follow this  
breeze

Loadout script not working

Recommended Posts

Can anyone tell me why this isn't working??

Script is called loudout.sqf

This is the script in its entirety, this is my first script also.

_breeze = _this select 0;

removeAllWeapons '_breeze';

removeAllItems '_breeze';

removeAllAssignedItems '_breeze';

removeUniform '_breeze';

removeVest '_breeze';

removeBackpack '_breeze';

removeHeadgear '_breeze';

removeGoggles '_breeze';

'_breeze' forceAddUniform "U_B_CombatUniform_mcam";

'_breeze' addItemToUniform "FirstAidKit";

'_breeze' addItemToUniform "Chemlight_green";

for "_i" from 1 to 2 do {'_breeze' addItemToUniform "hlc_30Rnd_9x19_B_MP5";};

'_breeze' addVest "V_PlateCarrier1_rgr";

'_breeze' addItemToVest "16Rnd_9x21_Mag";

'_breeze' addItemToVest "SmokeShell";

'_breeze' addItemToVest "SmokeShellGreen";

'_breeze' addItemToVest "Chemlight_green";

for "_i" from 1 to 2 do {'_breeze' addItemToVest "HandGrenade";};

'_breeze' addItemToVest "hlc_30Rnd_9x19_B_MP5";

'_breeze' addHeadgear "H_HelmetB";

'_breeze' addWeapon "hlc_smg_MP5N";

'_breeze' addPrimaryWeaponItem "muzzle_snds_L";

'_breeze' addPrimaryWeaponItem "RH_SFM952V";

'_breeze' addPrimaryWeaponItem "optic_SOS";

'_breeze' addWeapon "hgun_P07_F";

'_breeze' addHandgunItem "muzzle_snds_L";

'_breeze' linkItem "ItemMap";

'_breeze' linkItem "ItemCompass";

'_breeze' linkItem "ItemWatch";

'_breeze' linkItem "ItemRadio";

'_breeze' linkItem "NVGoggles";

Then in the mission folder I have a init.sqf with

execVM "loadout.sqf";

Then in the player name breeze init line I have this

nul = [this] execVM "loadout.sqf"

I do not get the loadout at all.

And I do not know how to add a hint to see errors.

Share this post


Link to post
Share on other sites

All the commands you've used require an object, _breeze is an object, '_breeze' is a meaningless string to them, remove the quote marks from '_breeze'. You also only need to call the script once, remove the execVM line from your init.sqf. Also this might just be a typo in your post but you've said the script is called "loudout.sqf" but you're calling it as "loadout.sqf".

In your startup line add '-ShowScriptErrors' (something like that, can't remember precisely).

Share this post


Link to post
Share on other sites
Startup parameters, check Developer section and search the page for rpt to learn how to view and hopefully better understand logs.

Share this post


Link to post
Share on other sites

Hey thank you so much this worked for me immediately. I have always loved this game played it since Operation flashpoint and have never really been able to get a mission of the ground. The problem being I am an older guy and I don't get the time I need to do these things I think I often have spent hours trying to do things as well before asking which ate up a lot of the time. So I was hoping to ask a couple more questions about this.

This is from Kylaina site

{this addMagazine "30Rnd_556x45_Stanag"} forEach [1,2,3,4,5,6];

this addWeapon "M4A3_CCO_EP1";

{this addMagazine "17Rnd_9x19_glock17"} forEach [1,2,3,4];

this addWeapon "glock17_EP1";

{this addMagazine "HandGrenade_West"} forEach [1,2,3,4];

My question is can I use this type of code where he is using the brackets and the foreach command to dictate the number of magazines or grenades?

Can I add that to my script?

Also If I wanted to take this script a step further and say I like a particular type of squad Can I add multiple load-outs to one script for a squad load-out and then how would I call it to each member?

Say I wanted a medic load-out and a sniper load-out, with 2 other assault rifle load-outs and so on.

Thanks for the help though it is very much appreciated.

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  

×