eagledude4 3 Posted June 30, 2013 (edited) When I enter the vehicle as a pilot, the headgear is not assigned to my player. class ED_MH9 : B_Heli_Light_01_F { scope = public; vehicleClass = "ED_Vehicles"; displayName = "MH-9 Hummingbird (Blue)"; hiddenSelectionsTextures[] = {"ED_Skins\skin_blue_co.paa"}; class eventhandlers { init = "this addEventHandler [""GetIn"", {_this execVM ""ED_Vehicles\civilian\air\mh-9\scripts\getin.sqf""}]; this addEventHandler [""GetOut"", {_this execVM ""ED_Vehicles\civilian\air\mh-9\scripts\getout.sqf""}];"; }; }; getin.sqf: systemchat "TEST"; if (_this select 1 == "driver") then { _pilot = _this select 2; removeHeadgear _pilot; _pilot addHeadgear "ED_pilotheadset"; }; The scripts are in this directory: "ED_Vehicles\civilian\air\mh-9\scripts" I used the exact scripts in my mission and it worked fine, but I decided to move the scripts over to the addon instead. Edited June 30, 2013 by eagledude4 Share this post Link to post Share on other sites
[aps]gnat 28 Posted June 30, 2013 Try a \ before the addon name Like {_this execVM ""\ED_Vehicles\civilian\air\mh-9\scripts\getin.sqf Share this post Link to post Share on other sites
eagledude4 3 Posted June 30, 2013 (edited) I'll give it a try, and if it works, I'll be scratching my head. I've never used the first backslash for any of my texture or model paths. EDIT: Didn't seem to work =/ Could it be because of the "-" in the path? init = "this addEventHandler [""GetIn"", {_this execVM ""\ED_Vehicles\civilian\air\[color="#FF0000"]mh-9[/color]\scripts\getin.sqf""}]; this addEventHandler [""GetOut"", {_this execVM ""\ED_Vehicles\civilian\air\[color="#FF0000"]mh-9[/color]\scripts\getout.sqf""}];"; Edited June 30, 2013 by eagledude4 Share this post Link to post Share on other sites
Sealife 22 Posted June 30, 2013 _this addeventhandler I think it is? Share this post Link to post Share on other sites
[aps]gnat 28 Posted June 30, 2013 (edited) EDIT sorry, scrub this post .... thinking ... Edited June 30, 2013 by [APS]Gnat Share this post Link to post Share on other sites
eagledude4 3 Posted June 30, 2013 (edited) So in the editor its "this" and in the config.cpp its "_this"? Edited June 30, 2013 by eagledude4 Share this post Link to post Share on other sites
Sealife 22 Posted June 30, 2013 yes i believe so or in editor can be _this inside Brackets because you cant have local variable in global space Share this post Link to post Share on other sites
eagledude4 3 Posted June 30, 2013 (edited) class eventhandlers { init = "_this addEventHandler [""GetIn"", {_this execVM ""\ED_Vehicles\civilian\air\mh-9\scripts\getin.sqf""}]; _this addEventHandler [""GetOut"", {_this execVM ""\ED_Vehicles\civilian\air\mh-9\scripts\getout.sqf""}];"; }; Still isn't working :( Edited June 30, 2013 by eagledude4 Share this post Link to post Share on other sites
Sealife 22 Posted June 30, 2013 (edited) First i dont have Arma3 loaded so sorry for guss work . A : Are you sure Getin and Getout handlers are present in A3 Beta ? B : usually an ID is given for exmple MyGetin = _this addeventhandler blah blah C: are you sure that _this execvm is the correct parameter to send , what is the sequence obviously when getin is activated does it send the vehicle the person or everything above and is that erroring the script thats recieving it ? sometimes (_this select 0) or th first identity of the handler is all thats required to b sent . it could also be something more simple like you said with the Path , but the Arma.rpt is usually telling full story i would probably try class eventhandlers { getin = " {_this execVM ""\ED_Vehicles\civilian\air\mh-9\scripts\getin.sqf""};"; getout = "{_this execVM ""\ED_Vehicles\civilian\air\mh-9\scripts\getout.sqf""};"; }; the above is not correct in syntax soorry once again but you get ide i hope Edited June 30, 2013 by Thromp Share this post Link to post Share on other sites
eagledude4 3 Posted June 30, 2013 (edited) I placed down the mh9 in the editor and applied the eventhandlers and everything works that way. This is the init line found in the mission.sqm: init="this addEventHandler [""GetIn"", {_this execVM ""ED_Vehicles\a3\airmh-9\scripts\getin.sqf""}]; this addEventHandler [""GetOut"", {_this execVM ""ED_Vehicles\a3\airmh-9\scripts\getout.sqf""}];"; However, when I use the same code for the vehicle class, it doesn't work. I can't find anything about it in the RPT either. http://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#GetIn So if there are no errors, and the same code works through the editor, is it safe to assume that this is a bug with the beta? Edited June 30, 2013 by eagledude4 Share this post Link to post Share on other sites
Sealife 22 Posted June 30, 2013 drop a hint in the sqf if you havent already HintSilent " its in the script" if its not firing then it would seem there maybe an error in the Beta as you say Share this post Link to post Share on other sites
mantls 2 Posted June 30, 2013 Afaik, you dont need the Double " . Im Not at home so i cant Test it, might therefore be mistaken. Share this post Link to post Share on other sites
eagledude4 3 Posted June 30, 2013 @Thromp: I have a systemChat notification in the sqf, that's how I found out it worked in the editor. @Mantis: You actually do need the double quotes. Share this post Link to post Share on other sites
Sealife 22 Posted June 30, 2013 If the beta isnt broke it maybe its just not picking up your init or the class is being overridden because of inheritance Try adding the handler in an init.sqf and put a sleep there to delay the activation. If you dont need any delays you could also precompile your getin sqf and use call Share this post Link to post Share on other sites
eagledude4 3 Posted June 30, 2013 I just found this in my rpt: Error in expression <_this addEventHandler ["GetIn", {_this execVM > Error position: <addEventHandler ["GetIn", {_this execVM > Error addeventhandler: Type Array, expected Object Share this post Link to post Share on other sites
Sealife 22 Posted June 30, 2013 this works here ok just tested this try in config.cpp class EventHandlers { getin = " _this execvm ""hello.sqf"" "; }; sqf = Hint Format ["%1,%2 %3", _this select 0,_this select 1,_this select 2]; returns correct Vehicle , Position ,Person entering as per vehicle: Object - Vehicle the event handler is assigned to position: String - Can be either "driver", "gunner", "commander" or "cargo" unit: Object - Unit that entered the vehicle Share this post Link to post Share on other sites
eagledude4 3 Posted July 1, 2013 Thanks, Thromp. I think I understand how to use the event handlers in the event handlers class now. Share this post Link to post Share on other sites