Jump to content
Sign in to follow this  
pogoman979

Serialization in the mission namespace

Recommended Posts

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 :/

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

cheers that worked. its funny i never used all these setvariable commands until arma2 came along, were they in arma1?

Share this post


Link to post
Share on other sites

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 >.>

Share this post


Link to post
Share on other sites

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

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
Sign in to follow this  

×