Jump to content
Sign in to follow this  
ADuke

Help with init eventhandler for ruck loadout

Recommended Posts

Hi,

I found out how to load out the ace rucksacks and I am trying to load out the rucksack in an eventhandler, in a unit's config.

What I am using at the moment doesn't seem to be working, can anyone help?

Here it is...

	class EventHandlers {
		init = "[_this select 0, ""ACE_wirecutter"", 1] call ace_fnc_PackWeapon ; [_this select 0, ""ACE_Knicklicht_G"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_R"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_IR"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""SmokeShell"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_B"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_Y"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_W"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_W"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""HandGrenade_West"", 10] call ace_fnc_PackMagazine"; 
	};

Thanks,

-AD

Share this post


Link to post
Share on other sites

As you call ACE functions, at this point they are probably not set. Move it to a script, add a waituntil condition which checks if ACE has been initialized (you might ask this in the ACE thread) and then it should work.

I'm almost sure that it is related to the fact that your init is executed before ACE init has finished.

Share this post


Link to post
Share on other sites

Concider moving this code to the XEH postinit class instead. That way all the modules should be finished loading.

Share this post


Link to post
Share on other sites
Concider moving this code to the XEH postinit class instead. That way all the modules should be finished loading.

Thanks Evil_Echo,

So it would look something like this?

	class Extended_PostInit_EventHandlers {
		SLX_MyAddon_postinit= "[_this select 0, ""ACE_wirecutter"", 1] call ace_fnc_PackWeapon ; [_this select 0, ""ACE_Knicklicht_G"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_R"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_IR"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""SmokeShell"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_B"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_Y"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_W"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""ACE_Knicklicht_W"", 10] call ace_fnc_PackMagazine ; [_this select 0, ""HandGrenade_West"", 10] call ace_fnc_PackMagazine"; 
	};

I used that and this...

	class EventHandlers {
		init = "[_this select 0] execVM ""\wjp_soldiers\scripts\ruck_loadout.sqf""";
	};

RUCK_LOADOUT.SQF....

waitUntil{!isNil "ace_main"};

_unit = _this select 0; 

sleep 0.1;

[_unit, "ACE_Wirecutter", 1] call ace_fnc_PackWeapon;

[_unit, "ACE_Knicklicht_G", 20] call ace_fnc_PackMagazine;

[_unit, "ACE_Knicklicht_R", 20] call ace_fnc_PackMagazine;

[_unit, "ACE_Knicklicht_IR", 20] call ace_fnc_PackMagazine;

[_unit, "SmokeShell", 20] call ace_fnc_PackMagazine;

[_unit, "ACE_Knicklicht_B", 20] call ace_fnc_PackMagazine;

[_unit, "ACE_Knicklicht_Y", 20] call ace_fnc_PackMagazine;

[_unit, "ACE_Knicklicht_W", 20] call ace_fnc_PackMagazine;

[_unit, "HandGrenade_West", 20] call ace_fnc_PackMagazine;

exit;

Neither option seems to be working :(:confused:

EDIT: The second option works, I had "ace_sys_stamina" disabled so I could not use the rucks!!

Edited by ADuke
New Results

Share this post


Link to post
Share on other sites

I'm having trouble accessing the rucks atall.. just wondering if anyones had the same issue.

I can pack most items in most rucks no problem, but when it comes to unpacking them no items display (in the ruck atall).

P.s stanima is enabled

Share this post


Link to post
Share on other sites

Ok my mistake, the rucks where working fine, it was just taking a good while to display the contents. All good

P.s My hat off to sickboy, ur a busy bee

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  

×