Jump to content
AveryTheKitty

Need help with Eventhandlers!

Recommended Posts

So I made a randomization script for my troops:

		class EventHandlers: EventHandlers {
		init = "(_this select 0) execVM "JointOps\SF\BLUFOR\British\scripts\gear_randomization.sqf";";
	};

However, whenever I bin it and binarize, it get these errors:

File c:\users\night515\desktop\jointops\SF\BLUFOR\British\config.cpp, line 210: '/CfgVehicles/B_BAF_Soldier_F/EventHandlers.init': Missing ';' at the end of line
Error context SF\BLUFOR\British\scripts\gear_randomization.sqf";";
File c:\users\night515\desktop\jointops\SF\BLUFOR\British\config.cpp, line 210: '/CfgVehicles/B_BAF_Soldier_F/EventHandlers.JointOps': '\' encountered instead of '='
Config : some input after EndOfFile.
Error 3 while parsing
Error in config c:\users\noah\desktop\jointops\SF\BLUFOR\British\config.cpp
..\El\ParamFile\paramFile.cpp(891) : Class destroyed, but still locked
File c:\users\night515\desktop\jointops\SF\BLUFOR\British\config.cpp, line 210: '/CfgVehicles/B_BAF_Soldier_F/EventHandlers.init': Missing ';' at the end of line
Error context SF\BLUFOR\British\scripts\gear_randomization.sqf";";
File c:\users\night515\desktop\jointops\SF\BLUFOR\British\config.cpp, line 210: '/CfgVehicles/B_BAF_Soldier_F/EventHandlers.JointOps': '\' encountered instead of '='
Config : some input after EndOfFile.
Error 3 while parsing

I have no idea how to fix this.

Share this post


Link to post
Share on other sites

here's the init line for equipment randomizer script from A2 CH Abrams by Mateck (i think)

class Extended_Init_EventHandlers
{
     class CH_M1A1HC {
      stuff = "CH_Stuff = [_this select 0, ""random""] execVM ""\ch_m1abrams_cfg\scripts\m1a1\stuff.sqf"";";
   panc = "CH_Panc = [_this select 0, ""unhide"", ""unhide"", ""hide""] execVM ""\ch_m1abrams_cfg\scripts\m1a1\panc.sqf"";";
       };
};

maybe this could help

they released the CH Abrams as unbinarized sample

The addon requires Extended event handlers though

Edit: Here is a non extended event handler line from here

class EventHandlers {
  getin = "_this execVM ""\cmSound_c_UH1Y\scripts\radioOn.sqf""";
  getout = "_this execVM ""\cmSound_c_UH1Y\scripts\radioOff.sqf""";
};

Edited by Fennek

Share this post


Link to post
Share on other sites

Use double quotes when putting string inside quotes:

		class EventHandlers: EventHandlers {
		init = "(_this select 0) execVM ""JointOps\SF\BLUFOR\British\scripts\gear_randomization.sqf"";";
	};

Or apostrophe:

		class EventHandlers: EventHandlers {
		init = "(_this select 0) execVM 'JointOps\SF\BLUFOR\British\scripts\gear_randomization.sqf';";
	};

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

×