Ya,
I am using the former of your two samples now, and it works better, although, as I mentioned in the thread, there seems to be a problem still.
In SP, I am using this to call the event:
_params call moveHeloHandler;
This works properly.
In MP I use:
moveHeloEvent = _params;
publicVariable "moveHeloEvent";
This MP call doesn't seem to work properly as the script I compiled as the event isn't entered (according to some debug 'hints' and sidechats).
UPDATE:
I did some more testing and I am still having problems. What it appears to me is that the dedi-server isn't executing the precompiled .sqf file.
Let me explain.
I used Spooner's first sample where the action for the heli was explicit in the init.sqf. This worked great (dedi and non).
I used the second example, where a precompiled script is assigned to the publicvariable handler (see above, in my instance, preprocessFileLineNumbers "alphainsertion.sqf").
When I use this method, in dedi, this precompiled script isn't executed. I have a hint in the first line of this script, that never displays.
I am wondering if someone can confirm for sure if they know that this method works in dedi-server?
I want to know if it is a problem with my code or not, so I can try to make some more progress here. If nobody has actually made this work in dedi, then I will move on and make several eventhandlers doing smaller things for now.
Thanks again for everyone's help with this!
Cheers!
p.s. If someone wants a copy of my scripts to have a look at, please let me know, I would be more than happy to send them to you to take a look at.
ANOTHER UPDATE:
To clarify, and make a long story short.
When calling an event handler, is this the proper syntax: (making this up for simplicity's sake)
Init.sqf
moveHeloHandler = compile preprocessFileLineNumbers "Insertion.sqf";
"moveHeloEvent" addPublicVariableEventHandler moveHeloHandler;
Insertion.sqf
stuff... doesn't matter for my question, as what is happening to me on dedi, this doesn't ever get called
HeloMoveTrigger.sqf - i only left the section that calls the event handler... This is the sqf called from my radio trigger.
_params = [_heli, 50, _pos, _team];
if (local _heli) then
{
// So the local machine performs the function directly:
_heli sidechat "in local";
_params call moveHeloHandler;
}
else
{
// Request that every OTHER machine performs the function based on receiving the event:
_heli sidechat "In else";
moveHeloEvent = _params;
publicVariable "moveHeloEvent";
};
The above code, is where my question REALLY is. Is this syntax correct?
Basically, if it is local, it runs it using a call to the handler name defined in the init.sqf, and if it is remote (ie on dedi-server), it calls it by passing the parameters into the publicvariable?
Is this correct?
If it is, I can't for the life of me see what I am doing wrong.
Again, thanks for your consideration on this problem.
Cheers!