addPublicVariableEventHandler help

Discussion in 'Trouble Shooting' started by Inkko, Jan 9, 2016.

  1. Inkko

    Inkko Valued Member!

    Joined:
    Jan 12, 2013
    Messages:
    660
    Likes Received:
    78
    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?
     
  2. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,414
    Likes Received:
    336
    looks ok, how about changing your eventhandler from the text to
    hint "event fired"; so you can see if its working or not.
     
  3. Inkko

    Inkko Valued Member!

    Joined:
    Jan 12, 2013
    Messages:
    660
    Likes Received:
    78
    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.
     
  4. Inkko

    Inkko Valued Member!

    Joined:
    Jan 12, 2013
    Messages:
    660
    Likes Received:
    78
    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.
     
  5. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,414
    Likes Received:
    336
    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.
     
    Inkko likes this.
  6. Inkko

    Inkko Valued Member!

    Joined:
    Jan 12, 2013
    Messages:
    660
    Likes Received:
    78
    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.
     
  7. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,414
    Likes Received:
    336
    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.

    [​IMG]
     
    Last edited: Jan 11, 2016

Share This Page