Jump to content
Sign in to follow this  
havena

overide class EventHandlers init problem

Recommended Posts

hi,

today i try to overide class EventHandlers of SUV & VAN.

For remove this part of init "(_this select 0) execVM ""\A3\soft_f_gamma\SUV_01\scripts\clock.sqf"";"

Overide look work, if i call "getText (configFile >> "CfgVehicles" >> "C_SUV_01_F" >> "EventHandlers" >> "init")"

i get the new init :

if (local (_this select 0)) then {[(_this select 0), "", [], false] call bis_fnc_initVehicle;};

But, spawn a SUV or VAN, always call this clock script......

diag_activeSQFScripts say :

16:44:23 "["A3\soft_f_gamma\SUV_01\scripts\clock.sqf","A3\soft_f_gamma\SUV_01\scripts\clock.sqf",true,20]"
16:44:23 "["A3\soft_f_gamma\SUV_01\scripts\clock.sqf","A3\soft_f_gamma\SUV_01\scripts\clock.sqf",true,20]"
16:44:23 "["A3\soft_f_gamma\SUV_01\scripts\clock.sqf","A3\soft_f_gamma\SUV_01\scripts\clock.sqf",true,20]"
16:44:23 "["A3\soft_f_gamma\van_01\scripts\clock.sqf","A3\soft_f_gamma\van_01\scripts\clock.sqf",true,20]"
16:44:23 "["A3\soft_f_gamma\SUV_01\scripts\clock.sqf","A3\soft_f_gamma\SUV_01\scripts\clock.sqf",true,20]"
16:44:23 "["A3\soft_f_gamma\SUV_01\scripts\clock.sqf","A3\soft_f_gamma\SUV_01\scripts\clock.sqf",true,20]"

my code :

class DefaultEventhandlers;
class CfgPatches
{
class overide
{
	units[] = {};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {"A3_Data_F","A3_Soft_F","A3_Soft_F_Truck","A3_Soft_F_SUV"};
};
};
class CfgVehicles
{

class Car;
class Car_F: Car {
};
class Truck_F: Car_F {
	class EventHandlers;
};
class Van_01_base_F: Truck_F {
	class EventHandlers: EventHandlers
	{
		init = "if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};";
	};
};
class Van_01_fuel_base_F: Van_01_base_F {};
class C_Van_01_fuel_F: Van_01_fuel_base_F
{
	class EventHandlers: EventHandlers
	{
		init = "";
		init = "if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};";
	};
};

class SUV_01_base_F: Car_F {
	class EventHandlers;
};
class C_SUV_01_F: SUV_01_base_F
{

	displayName = "SUV TEST";
	class EventHandlers: EventHandlers
	{
		init = "";
		init = "if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};";
	};
};
};

thx for ur help

Share this post


Link to post
Share on other sites

This worked for me:

class DefaultEventhandlers;
class CfgPatches
{
class BNRG_carClock_Remove
{
	units[] = {};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {"A3_Data_F","A3_Soft_F","A3_Soft_F_Truck","A3_Soft_F_SUV"};
};
};
class CfgVehicles
{

class Car;
class Car_F: Car {
};
class Truck_F: Car_F {
	class EventHandlers;
};
class Van_01_base_F: Truck_F {
	class EventHandlers: EventHandlers
	{
		init = "if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};";
	};
};
class Van_01_fuel_base_F: Van_01_base_F {};
class C_Van_01_fuel_F: Van_01_fuel_base_F
{
	class EventHandlers: EventHandlers
	{

		init = "if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};";
	};
};

class SUV_01_base_F: Car_F {
	class EventHandlers;
};
class C_SUV_01_F: SUV_01_base_F
{

	displayName = "SUV TEST";
	class EventHandlers: EventHandlers
	{

		init = "if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};";
	};
};
};

Here is what you did wrong (you defined init twice):

class DefaultEventhandlers;
class CfgPatches
{
class BNRG_carClock_Remove
{
	units[] = {};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {"A3_Data_F","A3_Soft_F","A3_Soft_F_Truck","A3_Soft_F_SUV"};
};
};
class CfgVehicles
{

class Car;
class Car_F: Car {
};
class Truck_F: Car_F {
	class EventHandlers;
};
class Van_01_base_F: Truck_F {
	class EventHandlers: EventHandlers
	{
		init = "if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};";
	};
};
class Van_01_fuel_base_F: Van_01_base_F {};
class C_Van_01_fuel_F: Van_01_fuel_base_F
{
	class EventHandlers: EventHandlers
	{
		init = "";//Dont define init twice!
		init = "if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};";
	};
};

class SUV_01_base_F: Car_F {
	class EventHandlers;
};
class C_SUV_01_F: SUV_01_base_F
{

	displayName = "SUV TEST";
	class EventHandlers: EventHandlers
	{
		init = "";//Dont define init twice!
		init = "if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};";
	};
};
};

I tested this in SP editor, let me know if the issue persists.

Share this post


Link to post
Share on other sites

Thx, but i dont define twice, its a mistake when i paste here.

I try your cfg but clock always running :

diag_activeSQFScripts :

21:10:15 "["A3\soft_f_gamma\SUV_01\scripts\clock.sqf","A3\soft_f_gamma\SUV_01\scripts\clock.sqf",true,20]"
21:10:15 "["A3\soft_f_gamma\SUV_01\scripts\clock.sqf","A3\soft_f_gamma\SUV_01\scripts\clock.sqf",true,20]"
21:10:15 "["A3\soft_f_gamma\SUV_01\scripts\clock.sqf","A3\soft_f_gamma\SUV_01\scripts\clock.sqf",true,20]"
21:10:15 "["A3\soft_f_gamma\van_01\scripts\clock.sqf","A3\soft_f_gamma\van_01\scripts\clock.sqf",true,20]"
21:10:15 "["A3\soft_f_gamma\van_01\scripts\clock.sqf","A3\soft_f_gamma\van_01\scripts\clock.sqf",true,20]"
21:10:15 "["A3\soft_f_gamma\van_01\scripts\clock.sqf","A3\soft_f_gamma\van_01\scripts\clock.sqf",true,20]"
21:10:15 "["A3\soft_f_gamma\van_01\scripts\clock.sqf","A3\soft_f_gamma\van_01\scripts\clock.sqf",true,20]"
21:10:15 "["A3\soft_f_gamma\van_01\scripts\clock.sqf","A3\soft_f_gamma\van_01\scripts\clock.sqf",true,20]"

Share this post


Link to post
Share on other sites

Can you also post the script you are using and maybe a mission file so I can easily replicate what youre doing. It will make debugging a lot easier for me, thanks.

Are you logging your results to the .rpt?

Share this post


Link to post
Share on other sites

yes,

mission : https://mega.co.nz/#!OhJSxSRJ!cnQgPZ9VKERpqx6ou4pBOTKY01fb5AeI-23v4U7H63o

RPT debug script :

diag_log format["====================diag_activeSQFScripts %1",count diag_activeSQFScripts];
{diag_log str _x} forEach diag_activeSQFScripts;
diag_log format["====================diag_activeSQSScripts %1",count diag_activeSQSScripts];
{diag_log str _x} forEach diag_activeSQSScripts;
diag_log format["====================diag_activeMissionFSMs %1",count diag_activeMissionFSMs];
{diag_log str _x} forEach diag_activeMissionFSMs;
diag_log format["%1",getText (configFile >> "CfgVehicles" >> "C_SUV_01_F" >> "EventHandlers" >> "init")];

the only working way i find is too overide clock.sqf : https://mega.co.nz/#!WpIjUDAR!wI6v3CgKIQawOjiIdNB6C9WbavwsQoUyK5CkqyhWBJM

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  

×