Jump to content
Sign in to follow this  
zooloo75

CBA-based config help

Recommended Posts

I don't have much experience with setting up configs. I am trying to get my ragdoll mod set up with CBA so it can apply the effect to any unit that is spawned.

The config will load the ragdoll.sqf, but it appears the InitPost stuff doesn't execute (tested that by checking the unit getVars). Can anyone point out what I did wrong?

class CfgPatches
{
class z75Ragdoll
{
	units[]={};
	weapons[]={};
	requiredAddons[] = {"CBA_Extended_EventHandlers"};
	version = "1";
	projectName = "Ragdoll'd";
	author = "Zooloo75";
};
};

class Extended_PreInit_EventHandlers
{
z75RagdollPreInit = "[] execVM '\z75_Ragdoll\scripts\ragdoll.sqf';";
};

class Extended_InitPost_EventHandlers
{
class CaManBase
{
	onRespawn = "true";
	init = "[_this] spawn {_unit = _this select 0; _unit setVariable['z75_Loaded', false]; waitUntil {!isNil 'Zooloo75_Ragdoll_Ready'}; _unit call z75_UnitHook; _unit setVariable['z75_Loaded', true];";
};
};

Share this post


Link to post
Share on other sites

I think initpost doesn't work that way and you probably won't need to run it like that instead just use


class Extended_Init_Eventhandlers
{
   class CaManBase
   {
       class z75Ragdoll_RespawnInitMan
       {
           onRespawn = true;                    // Run this even after respawn
           init = "[_this] spawn {_unit = _this select 0; _unit setVariable['z75_Loaded', false]; waitUntil {!isNil 'Zooloo75_Ragdoll_Ready'}; _unit call z75_UnitHook; _unit setVariable['z75_Loaded', true];";
       };
   };
};

EDIT: actually your issue might be just the [_this], _this is already an array so it might be nesting it

Edited by Kerc Kasha

Share this post


Link to post
Share on other sites

Thanks I'll give it a shot!

Sent from my HTC One V using Tapatalk

---------- Post added at 06:28 PM ---------- Previous post was at 04:54 PM ----------

I think initpost doesn't work that way and you probably won't need to run it like that instead just use


class Extended_Init_Eventhandlers
{
   class CaManBase
   {
       class z75Ragdoll_RespawnInitMan
       {
           onRespawn = true;                    // Run this even after respawn
           init = "[_this] spawn {_unit = _this select 0; _unit setVariable['z75_Loaded', false]; waitUntil {!isNil 'Zooloo75_Ragdoll_Ready'}; _unit call z75_UnitHook; _unit setVariable['z75_Loaded', true];";
       };
   };
};

EDIT: actually your issue might be just the [_this], _this is already an array so it might be nesting it

No luck :(

I even tried it without putting _this in an array.

Also tried to do it like this, but no luck either, no hint message popped up...

class CfgPatches
{
class z75Ragdoll
{
	units[]={};
	weapons[]={};
	requiredAddons[] = {"CBA_Extended_EventHandlers"};
	version = "1";
	projectName = "Ragdoll'd";
	author = "Zooloo75";
};
};

class Extended_PreInit_EventHandlers
{
z75RagdollPreInit = "[] execVM '\z75_Ragdoll\scripts\ragdoll.sqf';";
};

class Extended_Init_Eventhandlers
{
   class CaManBase
   {
	onRespawn = true;
	init = "_this spawn {hint str _this; _unit = _this select 0; _unit setVariable['z75_Loaded', false]; waitUntil {!isNil 'Zooloo75_Ragdoll_Ready'}; _unit call z75_UnitHook; _unit setVariable['z75_Loaded', true];";
   };
};  

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  

×