addEventhandler for dayz?

Microb

Member
Hello.

Recently I have found a illumination ammo script I wanted to add to my epoch server planes but I have stuck with eventhandler

In regular ArmA 2 Mission I would just add code to init of the vehicle in mission.sqm as it's given in script installation instructions

3. To use simply add this line to initialization field of unit in editor:
this addEventHandler ["fired", {_this execVM "illum.sqf"}];

script uses Mk82 bomb behaviour so I have added Mk82 bomb droppers to planes but I have no idea how to attach these event handlers because now planes are dropping actual bombs.

Is it possible to attach event handler to vehicles spawned trough database/traders? Or there is any alternatives?
 
Search for m249 on biplane, I think it's what your after, or it will at least have some code you can use in it, especially the part that attachs the actual m249 to the plane
 
if (_object isKindOf "An2_DZ") then {
_object addEventHandler ["fired", {_this execVM "illum.sqf"}];
};

seems not working
 
+ As I have seen with these M249 server adds them only after restart... so fresh spawned (bought from traders) dont have m249's... I guess the same will happen with eventhandler... Is it good idea to make loop for that trough while statement?
 
I would make make it both ways:
Via server.pbo to catch all vehicles which are already there
then add some similar code to the file which is spawning the vehicle from the traders, so it gets right away the varibale.
Maybe someobdy has some better idea, but this is how i would do it :)
 
Via server.pbo to catch all vehicles which are already there

Done

add some similar code to the file which is spawning the vehicle from the traders, so it gets right away the varibale.

Anybody have idea where they are located? compile folder in server.pbo seems empty
 
After adding

if (_object isKindOf "An2_DZ") then {
_object = vehicle addEventHandler ["fired", {_this execVM "illum.sqf"}];
};

if (_object isKindOf "An2_1_TK_CIV_EP1") then {
_object = vehicle addEventHandler ["fired", {_this execVM "illum.sqf"}];
};

if (_object isKindOf "An2_2_TK_CIV_EP1") then {
_object = vehicle addEventHandler ["fired", {_this execVM "illum.sqf"}];
};

server stops loading objects from database. Players gets stuck on waiting to start authentication.

EDIT:

RPT says error in statement
 
Last edited:
After adding

if (_object isKindOf "An2_DZ") then {
_object = vehicle addEventHandler ["fired", {_this execVM "illum.sqf"}];
};

if (_object isKindOf "An2_1_TK_CIV_EP1") then {
_object = vehicle addEventHandler ["fired", {_this execVM "illum.sqf"}];
};

if (_object isKindOf "An2_2_TK_CIV_EP1") then {
_object = vehicle addEventHandler ["fired", {_this execVM "illum.sqf"}];
};

server stops loading objects from database. Players gets stuck on waiting to start authentication.

EDIT:

RPT says error in statement
Post the error (going to bed but will check in morning)
 
ok. thanks

14:34:52 Error in expression <hen {
_object = vehicle addEventHandler ["fired", {_this execVM "illum.sqf"}];
>
14:34:52 Error position: <["fired", {_this execVM "illum.sqf"}];
>
14:34:52 Error Missing ;
14:34:52 File z\addons\dayz_server\system\server_monitor.sqf, line 269
14:34:52 Error in expression <hen {
_object = vehicle addEventHandler ["fired", {_this execVM "illum.sqf"}];
>
14:34:52 Error position: <["fired", {_this execVM "illum.sqf"}];
>
14:34:52 Error Missing ;
14:34:52 File z\addons\dayz_server\system\server_monitor.sqf, line 269
it says missing ; but it seems correct to me...




SchwEde-I'll try it now
 
how about:
Code:
_object addEventHandler ["fired", {_this execVM "illum.sqf"}];

Server launches properly... Script isn't executed on drop :(


EDIT:

I've found that this script is based napalm script you gave some time ago (nuke thread)...
I have tried the original script(napalm) and still nothing
 
Last edited:
trough script in mission file? No... but it seems that something is wrong with statement...

_object addEventHandler ["fired", {_this execVM "illum.sqf"}];

not working for even existing vehicles... I also tried addMPEventHandler and SetVehicleInit
(about SetVehicleInit-I'am not shure that I correctly used it)
 
i hate to picking in the dark, maybe this work alot better:
Code:
this addEventHandler ['fired', {(_this select 0) execVM 'illum.sqf'}];
 
Then it's a trial and error process:
I will check it tomorrow on my own files and see what I can get for you there.
Have you tried to see if the Script itself is working?
 
Back
Top