Jump to content
aeroson

GET/SET Loadout (saves and loads pretty much everything)

Recommended Posts

Not sure if it will work, as i didn't test it or you might have different version.

Open =BTC=_revive/=BTC=_functions.sqf

Find function BTC_player_respawn

BTC_player_respawn =
{
player setVariable ["BTC_need_revive",0,true];
player setPos getMarkerPos BTC_respawn_marker;
sleep 1;
player setDamage 0;
player switchMove "amovpercmstpslowwrfldnon";
player switchMove "";
player enableSimulation false;
player enableSimulation true;
if (BTC_black_screen == 1) then {titleText ["", "BLACK IN"];};  
};

And add, this line to it

[player,loadout] call setLoadout;

Just like this:

BTC_player_respawn =
{
player setVariable ["BTC_need_revive",0,true];
player setPos getMarkerPos BTC_respawn_marker;
sleep 1;
player setDamage 0;
player switchMove "amovpercmstpslowwrfldnon";
player switchMove "";
player enableSimulation false;
player enableSimulation true;
if (BTC_black_screen == 1) then {titleText ["", "BLACK IN"];};  
[player,loadout] call setLoadout;
};

Share this post


Link to post
Share on other sites

Thanks for the info, I'll give it a shot as soon as I get a chance to get back online at home.

Share this post


Link to post
Share on other sites

Had no luck in getting that to work, do appreciate it though....curious though, is there another way that I can have a 2nd type of Init or way to revive and the objectives? So prefer having your loadout_fncs and specific set up ammo crate than the Virtual Ammo box, its nice and all, but just not the same.

Share this post


Link to post
Share on other sites

Thank you, works perfectly! Really appreciate you taking the time.

Share this post


Link to post
Share on other sites

Finally ported my simple mouse wheel based loadout manager.

Uses profileNamespace so all loadouts are saved permanently into your profile.

Requires compiled set/get functions (usually in the mission's init.sqf)

getLoadout = compile preprocessFileLineNumbers 'fnc_get_loadout.sqf';
setLoadout = compile preprocessFileLineNumbers 'fnc_set_loadout.sqf';

88R2KwF.png

Put this into init line of object you wish to be loadout manager

0 = [this] execVM 'loadout_manager.sqf';

download loadout_manager.sqf

Edited by aeroson

Share this post


Link to post
Share on other sites

I get an error message ---- Script client\loadout\manager.sqf not found ------ when using your loadout_manager.sqf as described above. I set the Supplybox [blue] as my loadout mgr and when first accessed it returns the error. This was being previewed in the Editor, would that make a difference ?

Share this post


Link to post
Share on other sites

Thank you, fixed it.

No it doesn't make any difference as long as you have have loadout_manager.sqf in your mission folder, i just left wrong paths there :/

Share this post


Link to post
Share on other sites

Hey Gents

I have been using Aeroson's scripts to keep my character's latest loadout on his respawn and they have been working wonderfully...very efficient scripts, if I dare say :)

In Version: 0.53.103558 and still today with Version: 0.53.103608, something wrong is going on with the Vest. The vest respawns but it is empty.

The following error is reported on the client side:

"soldier[b_Soldier_TL_F]:Some of magazines weren't stored in soldier Vest or Uniform?

soldier[b_Soldier_TL_F]:Some of magazines weren't stored in soldier Vest or Uniform?

Duplicate weapon Throw detected for B_Soldier_TL_F

Duplicate weapon Put detected for B_Soldier_TL_F

Speaker Male01_F not found in CfgVoiceTypes

Suspending not allowed in this context

String STR_EVAL_GEN not found

Error in expression <

_t addMagazine _m;

waitUntil{_m in magazines _t};

_mz = getArray(config>

Error position: <in magazines _t};

_mz = getArray(config>

Error

File mpmissions\__CUR_MP.Stratis\scripts\fnc_set_loadout.sqf, line 73

c:\w\c_branch\poseidon\futura\lib\gamestateext.cpp ObjAddItemOnWeapon: NULL ptr in weaponItem

c:\w\c_branch\poseidon\futura\lib\gamestateext.cpp ObjAddItemOnWeapon: NULL ptr in weaponItem

c:\w\c_branch\poseidon\futura\lib\gamestateext.cpp ObjAddItemOnWeapon: NULL ptr in weaponItem" Did Bis change how inventory behaves or a new bug has come up? It seems that the default gear (inventory) respawns ok. I will keep investigating.

Share this post


Link to post
Share on other sites

Not sure if it will help, but i added/changed few lines (fnc_set_loadout.sqf v3.0)

Also i have some questions:

1. Did it properly add your primary weapon ?

2. Did it add your primary weapon loaded ?

3. Was there something more regarding fnc_set_loadout.sqf in the error log ?

Share this post


Link to post
Share on other sites

Yes, it added the primary weapon correctly and with a magazine in place. All else seemed in order including uniform and backpacks when the saved loadout had them. I will test your new version very soon and report back.

Greatly appreciate your patience going through this. I know it can be frustrating but...we chose to...didn't we :)

---------- Post added at 12:49 PM ---------- Previous post was at 11:42 AM ----------

Tested and Reporting:

Unfortunately, the Vest is still empty. It is added to the inventory if you throw it away, it is only that no items are placed in it.

Everything else is working fine. Uniform and uniform items, as well as backpack and backpack items. Primary weapon loads fine, greanade launcher including along with primary magazines for both and all attachments. Same with handgun stuff.

Error rpt this time:

String STR_DISP_INT_RESPAWN not found

soldier[b_Soldier_TL_F]:Some of magazines weren't stored in soldier Vest or Uniform?

soldier[b_Soldier_TL_F]:Some of magazines weren't stored in soldier Vest or Uniform?

Duplicate weapon Throw detected for B_Soldier_TL_F

Duplicate weapon Put detected for B_Soldier_TL_F

the first line was reported before, it is probably from BIS coding but I included it since it was not being reported before the latest versions.

Edited by KadinX

Share this post


Link to post
Share on other sites

For testing purposes, I have disabled your loadout system and used another system that produces similar results except for the primary weapon magazine issue :) and it is working. Now some of the errors above, are still being reported:

String STR_DISP_INT_RESPAWN not found

soldier[b_Soldier_TL_F]:Some of magazines weren't stored in soldier Vest or Uniform?

soldier[b_Soldier_TL_F]:Some of magazines weren't stored in soldier Vest or Uniform?

Duplicate weapon Throw detected for B_Soldier_TL_F

Duplicate weapon Put detected for B_Soldier_TL_F

So I guess these errors are not related to your scripts.

Share this post


Link to post
Share on other sites

fnc_set_loadout seems to have a bug in the script when loading the vest items in our mission - pop in and test it when you can.

actually i think the DEV has broken "vestitems"

CONFIRMED

the DEV does not now respond to "vestitems" but the normal alpha does. just tested my mission opting out and in.

Edited by eggbeast

Share this post


Link to post
Share on other sites

Nice find eggbeast, thank you !

Someone should report it ^.^

Edited by aeroson

Share this post


Link to post
Share on other sites

In the mean time, your workaround is working wonderfully :).

Some people are just so smart...

So many thanks!!:)

Share this post


Link to post
Share on other sites
Nice find eggbeast, thank you !

Someone should report it ^.^

seems to be fixed now

Share this post


Link to post
Share on other sites

Nice job aeroson.

I was just thinking about writing something like this myself when I luckily stumbled across this thread. :)

Very useful.

It's also a very handy tool for missionmakers as it takes only a tiny script to save those gear-loadouts to clipboard and paste them directly in the editor to define the initial loadout for a unit. :cool:

Share this post


Link to post
Share on other sites

Im using profiles server-side to save a few values, any idea how to stop the dedicated server exe from overriding the profile files whenever you restart it?

Share this post


Link to post
Share on other sites
seems to be fixed now

Thank you again. Was thinking about doing some clumsy ugly workaround, iam happy i didn't have to D:

It's also a very handy tool for missionmakers as it takes only a tiny script to save those gear-loadouts to clipboard and paste them directly in the editor to define the initial loadout for a unit. :cool:

Yeah, if you know how to use it, its definitely a time saver.

Im using profiles server-side to save a few values, any idea how to stop the dedicated server exe from overriding the profile files whenever you restart it?

You can't, its a bug, dedicated server doesn't load profile variables. Although he saves them = he saves empty profile variables = erases profile variables.

But, you can use extensions to utilize different saving methods such as mysql. Arma2NETMySQLPlugin > read its readme for plenty of useful info and links.

Edited by aeroson

Share this post


Link to post
Share on other sites

You can't, its a bug, dedicated server doesn't load profile variables. Although he saves them = he saves empty profile variables = erases profile variables.

But, you can use extensions to utilize different saving methods such as mysql. Arma2NETMySQLPlugin > read its readme for plenty of useful info and links.

Thanks for the info, really appreciate it!

Share this post


Link to post
Share on other sites

http://forums.bistudio.com/showthread.php?152279-norrin-s-ArmA2-scripts-ported-to-ArmA3&p=2366686&viewfull=1#post2366686

for info aero

norrin has released his revive script and i cannot get your script to work with it no matter what i try

mission is here

http://forums.bistudio.com/showthread.php?148074-MP-COOP-GITS-EVOLUTION-main-thread&p=2366694&viewfull=1#post2366694

loadout is managed in norrins script in several places - actually quite confusing but his script is designed to work with all types of mission...

Share this post


Link to post
Share on other sites

@eggbeast So far no luck, will continue

@Nimrod Thank you, merged

Share this post


Link to post
Share on other sites

Updated

Was looking throughTonic's VAS, seems like he found a way to get currently loaded magazines. Improved it a bit and added into my scripts ^.^

download fnc_get_loadout.sqf v2.2

- Added: Saves currently loaded magazines, and currently selected weapon/muzzle

download fnc_set_loadout.sqf v3.4

- Added: Loads saved loaded magazines and selects saved selected weapon/muzzle, backwards compatible

Also updated my loadout manager, you can now load VAS saved loadouts both new and old.

download loadout_manager.sqf

http://i.imgur.com/XlDqn8g.png (image size too large >100kb)

(Offer loadout is WIP)

And for latest example of all these scripts working together with custom crate fillers => download example mission

Enjoy D:

Edited by Alex72
Image >100kb

Share this post


Link to post
Share on other sites

This is most excellent!! Thank you for continuous support and constant improvements.

I think I have become a groupie :)

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

×