Jump to content
Unknown_GTX

Why is disableSerialization not working?

Recommended Posts

I get this error everytime the game starts up & when a mission is being startup. But only if i own the apex dlc! 

https://steamuserimages-a.akamaihd.net/ugc/964224088525703614/C8AB26D25C26A6AE7CF500F5286D1056D72CDCD7/

 

I have put disableSerialization in every of the 3 script files but it doesnt work either. Then i just moved every control over to uinamespace but it still is the same.

What did i overlook? The script works anyway but the warning message is annoying for every subscriber ofcourse. Heres the workshop btw.

The first script/function is loaded from the config: 

class initCompass {postInit = 1;};

here is initCompass sqf

disableSerialization;
waitUntil {!isNull player};
UGTX_needCompass = true;
UGTX_toggle = true;
UGTX_posTop = true;

UGTX_imgCompImg = "\MyProject\compass\imgs\default-sfp.paa";
UGTX_imgScrollLock = "\MyProject\compass\imgs\key-scrolllock.paa";
UGTX_imgEnd = "\MyProject\compass\imgs\key-end.paa";
UGTX_imgPgUp = "\MyProject\compass\imgs\key-pageup.paa";

[] spawn {
   disableSerialization;
   while {true} do {
     waitUntil {  UGTX_toggle &&
                  (!UGTX_needCompass OR
                  (UGTX_needCompass && ("ItemCompass" in (assignedItems Player))))
               }; _compassInit = [] spawn UGTX_fnc_showCompass;

     waitUntil {  !UGTX_toggle OR
                  (UGTX_needCompass && !("ItemCompass" in (assignedItems Player)))
               }; ["864", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
                  GTX_ctrlGrp = uiNamespace getVariable "GTX_ctrlGrp";
                  GTX_compNeed = uiNamespace getVariable "GTX_compNeed";
                  GTX_grpBg = uiNamespace getVariable "GTX_grpBg";
                  ctrlDelete GTX_ctrlGrp;
                  ctrlDelete GTX_compNeed;
                  ctrlDelete GTX_grpBg;
};};

GTX_ctrlGrp = uiNamespace getVariable "GTX_ctrlGrp";
GTX_compNeed = uiNamespace getVariable "GTX_compNeed";
GTX_grpBg = uiNamespace getVariable "GTX_grpBg";

UGTX_fnc_keyDown = {
   switch (_this select 1) do {
   	case 70: {
      UGTX_shift = true;
      _title  = "<t color='#fbfbfb' size='1.3' shadow='1' font='PuristaSemiBold' shadowColor='#000000' align='center'>VoyagerCompass Lite</t><br/><br/><br/>";
      _text   = "<img image='"+ UGTX_imgScrollLock +"' size='2' /> + <img image='"+ UGTX_imgEnd +"' size='2'/>   Toggle Compass<br/><br/>";
      _text2   = "<img image='"+ UGTX_imgScrollLock +"' size='2'/> + <img image='"+ UGTX_imgPgUp +"' size='2'/>   Toggle Position<br/><br/>";
      _needcomp = "";
      if (UGTX_needCompass) then {
        _needcomp = "Compass in inventory required!";
      };
      hint parseText ( _title + _text + _text2 + _needcomp);
   	};
    case 207: {
      if (UGTX_shift) then {
        if (UGTX_toggle) then {
          UGTX_toggle = false;
        }else{
          UGTX_toggle = true;
   	};};};
    case 201: {
      if (UGTX_shift) then {
        if (UGTX_posTop) then {
          { _x ctrlSetPosition [(ctrlPosition _x) select 0, 0.93 * safezoneH + safezoneY, (ctrlPosition _x) select 2, (ctrlPosition _x) select 3];
            _x ctrlCommit 0.1;
          } forEach [uiNamespace getVariable "GTX_ctrlGrp", uiNamespace getVariable "GTX_compNeed", uiNamespace getVariable "GTX_grpBg"];
          UGTX_posTop = false;
        }else{
          { _x ctrlSetPosition [(ctrlPosition _x) select 0, 0.01111 * safezoneH + safezoneY, (ctrlPosition _x) select 2, (ctrlPosition _x) select 3];
            _x ctrlCommit 0.1;
          } forEach [uiNamespace getVariable "GTX_ctrlGrp", uiNamespace getVariable "GTX_compNeed", uiNamespace getVariable "GTX_grpBg"];
          UGTX_posTop = true;
};};};};};

UGTX_fnc_keyUp = {
  switch (_this select 1) do {
    case 70: {
      UGTX_shift = false;
};};};
waituntil {!isnull (finddisplay 46)};
disableSerialization;
(findDisplay 46) displayAddEventHandler ["KeyDown", "_this call UGTX_fnc_keyDown;false;"];//["KeyDown", "hint str _this"];
(findDisplay 46) displayAddEventHandler ["KeyUp","_this call UGTX_fnc_keyUp;false;"];


systemChat "@VoyagerCompass-Lite 2.2 Addon:: Press [SCROLL LOCK] Key.";

here is showCompass sqf

disableSerialization;
_comp = [] call UGTX_fnc_compileCompass;

GTX_compImg = uiNamespace getVariable "GTX_compImg";

["864", "onEachFrame",{
  _sPos = screenToWorld [0.5,0.5];
	_pPos = getPos player;
	_dir = (((((_sPos select 0) - (_pPos select 0)) atan2 ((_sPos select 1) - (_pPos select 1))) + 360) % 360)/100;
  _stripe = 0.96 * safezoneW;
  _calc = ((_stripe/570) * _dir)* 100 + (_stripe/570) * 45;
  GTX_compImg ctrlSetPosition [_calc - _calc*2,-0.01,_stripe,1.8 * safezoneH];
  GTX_compImg ctrlSetText UGTX_imgCompImg;
  GTX_compImg ctrlCommit 0;
}] call BIS_fnc_addStackedEventHandler;

and the last one is compileCompass sqf

disableSerialization;
("compassTitle" call BIS_fnc_rscLayer) cutRsc ["RscTitleDisplayEmpty", "PLAIN", -1, false];
with uiNamespace do {
disableSerialization;
_display = uiNamespace getVariable "RscTitleDisplayEmpty";
GTX_ctrlGrp = _display ctrlCreate ["RscControlsGroup", 7634];
GTX_ctrlGrp ctrlSetPosition [0.4 * safezoneW + safezoneX,0.01111 * safezoneH + safezoneY,0.2 * safezoneW,10 * safezoneH];
uiNamespace setVariable ["GTX_ctrlGrp", GTX_ctrlGrp];
GTX_ctrlGrp ctrlCommit 0;

GTX_grpBg = _display ctrlCreate ["RscStructuredText", 7635];
GTX_grpBg ctrlSetBackgroundColor [0, 0, 0, 0.1];
GTX_grpBg ctrlSetPosition [0.4 * safezoneW + safezoneX,0.01111 * safezoneH + safezoneY,0.2 * safezoneW,0.038 * safezoneH];
uiNamespace setVariable ["GTX_grpBg", GTX_grpBg];
GTX_grpBg ctrlCommit 0;

GTX_compImg = _display ctrlCreate ["RscPicture", 7636, GTX_ctrlGrp];
GTX_compImg ctrlSetText "\MyProject\compass\imgs\default-puristax2.paa";
uiNamespace setVariable ["GTX_compImg", GTX_compImg];
GTX_compImg ctrlCommit 0;

GTX_compNeed = _display ctrlCreate ["RscStructuredText", 7637];
GTX_compNeed ctrlSetPosition [(0.5 * safezoneW + safezoneX)- 0.05,0.01111 * safezoneH + safezoneY,0.1,0.09 * safezoneH];
GTX_compNeed ctrlSetStructuredText parseText ("<t shadow=1><t align='center' size='0.4' font='PuristaLight'>I");
uiNamespace setVariable ["GTX_compNeed", GTX_compNeed];
GTX_compNeed ctrlCommit 0;
};

 

Share this post


Link to post
Share on other sites

You are moving the variable to missionNamespace

1 hour ago, Unknown_GTX said:

GTX_compImg = uiNamespace getVariable "GTX_compImg";

 

missionNamespace needs to be serializeable. You cannot put a non-serializable variable into missionNamespace.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, Dedmen said:

You are moving the variable to missionNamespace

 

missionNamespace needs to be serializeable. You cannot put a non-serializable variable into missionNamespace.

 

Your help in combination with this link solved my problem. Thank you!

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×