Devastator_cm 434 Posted October 11, 2018 Hi Guys, the init eventhandler defined in vehicle config, runs on each machine at mission start and when object spawned via commands? How to make it run only on the server? Is there any parameter for it? Share this post Link to post Share on other sites
reyhard 2082 Posted October 12, 2018 There are plenty of script commands to achieve that https://community.bistudio.com/wiki/Multiplayer_scripting Share this post Link to post Share on other sites
Devastator_cm 434 Posted October 12, 2018 I already use isserver etc. It behaves fine if vehicle is on the map of mission but if it is created via Zeus (Ares mod on) then init script is not running as far as I see. So question is, is the init eventhandler which is set via config behaves different when unit is spawned or added over EDEN? Share this post Link to post Share on other sites
Dedmen 2716 Posted October 30, 2018 On 12.10.2018 at 2:48 PM, Devastator_cm said: So question is, is the init eventhandler which is set via config behaves different when unit is spawned or added over EDEN? Might be that init event only runs locally on the machine that spawns the vehicle. Zeus placed objects are initialized on the Players machine. 3DEN placed objects are initialized on the server. Do you have CBA per chance? CBA's init handler works everywhere. Share this post Link to post Share on other sites
Devastator_cm 434 Posted October 30, 2018 yeah I have dependency to CBA and good hint! I will check the CBA init handler and try to use that one instead of default vanilla init.. And yes, I also suspect the init kicks in by zeus guy instead of Server... Share this post Link to post Share on other sites
Dedmen 2716 Posted October 30, 2018 Here is the documentation about them: via config: https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new)#extended_init_eventhandlers Or via script: https://github.com/CBATeam/CBA_A3/wiki/Adding-Event-Handlers-to-Classes-of-Objects 1 Share this post Link to post Share on other sites
Devastator_cm 434 Posted October 30, 2018 Ok now I see another weird thing which I cannot figure out... In the init file which I call now via CBA Init XEH, I set some variables on the object i.e. _Submarine setvariable ["Weapon Switches", _WeaponSwitches, true]; When I try to access this variable I can see the value if submarine was already on map at mission start. For the spawned submarines (via zeus interface), the variable is not set and giving back nil value. In rpt file I actually see that it was set, when I put in init file following thing diag_log format ["%1", _Submarine getvariable "Weapon Switches"]; Why variable setting is ignoring the public bit of the command (varspace setVariable [name, value, public])? :( Share this post Link to post Share on other sites
Dedmen 2716 Posted October 31, 2018 It might be that the object is not initialized enough yet to handle public variables. Maybe use initPost XEH instead. 1 Share this post Link to post Share on other sites
Devastator_cm 434 Posted November 5, 2018 Dedmen, you nailed it :) Post Init solved the issue! Many Thanks! Share this post Link to post Share on other sites