addPublicVariableEventHandler help

Inkko

Valued Member!
I'm having an issue with broadcasting messages server side to clients.

I have the addPublicVariableEventHandler setup client side in publicEH.sqf and have that moved into my mission. Server side when I broadcast the publicvariable nothing happens. It is as if the publicVariable isn't actually being broadcast. I'm trying to make messages that look nicer for lets say AI missions for when one of those pop up.

As an example mission side i have this for the EH:
Code:
"CustomMessage" addPublicVariableEventHandler {
        _message = _this select 1;
       [_message,[safezoneX + 0.01 * safezoneW,2.0],[safezoneY + 0.01 * safezoneH,0.3],30,0.5] spawn BIS_fnc_dynamicText;
    };

Then serverside when a mission pops up it normally broadcasts with a titletext RE but I replaced that with the message such as:
Code:
CustomMessage = "AI mission started......";publicVariable "CustomMessage";

Does anyone happen to know where I am going wrong?
 
looks ok, how about changing your eventhandler from the text to
hint "event fired"; so you can see if its working or not.
Probably should also note that I'm running 1.8.6.1 and have infistar as well. I'll try changing the eventhandler to just a hint message, maybe I'll diag_log the _message too to see if its even getting anything as well. running the code for just the message tho works fine just the eventhandler doesn't seem to want to work.
 
Added this serverside:
Code:
CustomMessage = "AI mission started......";diag_log format[":: %1 ::",CustomMessage];publicVariable "CustomMessage";

In the RPT server side it shows the message but its as if the publicVariable just isn't being broadcast. Nothing ever shows up client side. Tried what Shooting blanks said and just having a hint message inside the eventhandler and nothing pops up.
 
these event handlers,are pretty straightforward and it,shouldnt,be giving a problem that i see.
put a diag_log into the eventhandler code to check if its being executed during init on the client, remember that will be in your arma2oa.rpt in some hidden folder becuase its client side.
 
these event handlers,are pretty straightforward and it,shouldnt,be giving a problem that i see.
put a diag_log into the eventhandler code to check if its being executed during init on the client, remember that will be in your arma2oa.rpt in some hidden folder becuase its client side.
Had a slight mental retardation. Was uploading file changes to my server last night while it was restarting which corrupted it all so I had to start over. Must have done it all too quick and missed changing the publicEH.sqf to the mission so.. seems to all work now.
 
I was just coming here to tell you to ignore my "mental retardation" moment where I said to put a diag_log in the event handler code. that code is not executed at init so that wouldnt work. a diag_log immediatedly before the eventhandler statement would have to suffice.

a side note: describing your error as "mental retardation" is probably not PC and might offend some actual tard. So please be more sensitive in the future.

maxresdefault.jpg
 
Last edited:
Back
Top