PDA

View Full Version : Serialization in the mission namespace



pogoman979
Jun 9 2009, 07:39
using for eg: onLoad="cdisplay = _this select 0";
in a resource title causes the following error:


"Variable 'cdisplay' does not support serialization and should not be stored in the mission namespace."

everything still works you just get the error.
now im not fantastic with dialogs so the only way i know how to display Rsctitles is by using the onload command to name the display, so does anyone know how to do it without causing the above error? calling disableserialization of course doesnt work in .hpp's :/

Dr_Eyeball
Jun 9 2009, 07:53
hpp file: use uiNamespace setVariable

onLoad="uiNamespace setVariable ['Display_StatsHUD', _this select 0]";
in your sqf file: use uiNamespace getVariable

((uiNamespace getVariable 'Display_StatsHUD') displayCtrl 1530) ctrlShow true;


It starts getting messy with lots of controls, so still looking for a better way. There's also a new 'with uiNamespace do { }' block command.

pogoman979
Jun 9 2009, 07:59
cheers that worked. its funny i never used all these setvariable commands until arma2 came along, were they in arma1?

.kju [PvPscene]
Jun 9 2009, 08:07
More info from here on A2 GUI finds (http://dev-heaven.net/boards/37/topics/show/949#message-1077).

pogoman979
Jun 9 2009, 08:21
More info from here on A2 GUI finds (http://dev-heaven.net/boards/37/topics/show/949#message-1077).

wow some of that stuff is actually pretty useful!

JDog
Sep 13 2009, 04:32
Okay I'm having this same problem. I got it fixed with the display, but now it's telling me the same issue for an individual control.

Display name is RTT_Display, with 4 controls. For some reason it's giving me an issue with the variable _Range which is control 2, saying it doesnt support yadda yadda...


disableSerialization;

_List = _this Select 0;
_caller = _this select 1;
_Range = ((uiNamespace getVariable 'RTT_Display') displayCtrl 2);
_Target = ObjNull;

//---then used here:

If !(IsNull _Target) Then {
_distance = player distance _Target;
_caller setVariable ["RTL", _distance];
_Range ctrlSetText format ["%1", floor (_distance)];
};


It tells me to put in that disableSerialization; in this file (I have it in all 3 files this script of mine uses) but it doesnt do anything.

This script works perfectly fine too, just annoying that warning keeps coming up >.>

Cougarxr7
Nov 22 2009, 21:31
I tried this in my core.sqf.
It was,

displayVendor = findDisplay 100;

Now it's,

((uiNamespace getVariable 'displayVendor') findDisplay 100) ctrlShow true;
displayVendor = findDisplay 100;
and got this error,

"Error in expression <iNamespace getVariable 'displayVendor') findDisplay 100) ctrlShow true;
displayV>
Error position: <findDisplay 100) ctrlShow true;
displayV>
Error Missing )
File C:\Documents and Settings\Cougar\My Documents\ArmA 2\missions\EVO_UNLOCKED_ULTIMATE_COMBAT.Chernarus\data\scripts\Core.sqf, line 3

The uiNamespace line is line 3.
I'm thinking I need to remove the second line becasue the uiNamespace takes care of that, yes?
Still confused about the missing ).
Any ideas??
Thanks