Jump to content
Sign in to follow this  
PartyHead

Need help with RscTitles dialog onLoad problem.

Recommended Posts

Hello all, I've got a problem with my titleRsc dialog.

Here is my dialog example.


class RscTitles
{
   class RscHud
   {
       idd = 1000000;
       movingEnable =  1;
       enableSimulation = 1;
       enableDisplay = 1;
       duration     =  99999;
       fadein       =  0.5;
       fadeout      =  2;
       name = "RscHud";
       onLoad = "[color="#FF0000"][b]display = _this select 0[/b][/color]";
class controls 
       {
           class text
           {
               access = 0;
               type = 13;
               idc = 1000001;
               style = 2 + 16;
               lineSpacing = 1;
               x = 0.817 - SafeZoneX;
               y = 0.500 + SafeZoneY;
               w = 0.5;
               h = 0.12;
               size = 0.020;
               colorBackground[] = {0,0,0,0};
               colorText[] = {0,0,0,0};
               text = "";
               font = "BitStream";
               class Attributes 
               {
                   font = "BitStream";
                   color = "#6aab4f";
                   align = "left";
                   shadow = true;
               };
           };
       };
   };
};

When i use the code I've highlighted in red above.

init.sqf example.

titleRsc ["RscHud", "PLAIN"];

disableSerialization;

(display DisplayCtrl 1000001) ctrlSetStructuredText (parseText format ["<t align='left'><t shadow='1'shadowColor='#000000'>MISSION STATUS</t>"]);

It displays the dialog but i get the error message in the screen shot below.

56521728.jpg

Does anyone know what i need to do to correct this ?

Cheers.

Edited by PartyHead

Share this post


Link to post
Share on other sites

I don't understand these things at all, but perhaps move the disableSerialization above the titleRsc call?

Share this post


Link to post
Share on other sites
I don't understand these things at all, but perhaps move the disableSerialization above the titleRsc call?

Yeah i tried that kylania but it didn't work mate. The only way I've been able to get things working is by running an extra script and changing the onLoad command like this.

description .EXT example.

class RscTitles
{
   class RscHud
   {
       idd = 1000000;
       movingEnable =  1;
       enableSimulation = 1;
       enableDisplay = 1;
       duration     =  99999;
       fadein       =  0.5;
       fadeout      =  2;
       name = "RscHud";
       onLoad = "[color="#FF0000"][b][_this select 0] spawn hud[/b][/color]";
class controls 
       {
           class text
           {
               access = 0;
               type = 13;
               idc = 1000001;
               style = 2 + 16;
               lineSpacing = 1;
               x = 0.817 - SafeZoneX;
               y = 0.500 + SafeZoneY;
               w = 0.5;
               h = 0.12;
               size = 0.020;
               colorBackground[] = {0,0,0,0};
               colorText[] = {0,0,0,0};
               text = "";
               font = "BitStream";
               class Attributes 
               {
                   font = "BitStream";
                   color = "#6aab4f";
                   align = "left";
                   shadow = true;
               };
           };
       };
   };
};

init.sqf example.

hud = compile preprocessFileLineNumbers "hud.sqf";

titleRsc ["RscHud", "PLAIN"];

hud.sqf example.

disableSerialization;

private ["_display"];

_display = _this select 0;

(_display DisplayCtrl 1000001) ctrlSetStructuredText (parseText format ["<t align='left'><t shadow='1'shadowColor='#000000'>MISSION STATUS</t>"]);

This works fine but i wasn't sure if doing it this way was just the same as doing it the other way. Id still like to know if there is a fix for the other way that my first post refers to if anyone knows of one.

Cheers.

Share this post


Link to post
Share on other sites
Try storing the reference to the dialog in the uiNamespace.

See DeadFast's post here for an example

This should sort your issue out.

Blake

Thanks for your reply blakeace and the link to DeadFast's post which was a big help.

Ive also got this to try out yet which should work i hope, this is pretty much what DeadFast's post was about aswell.

description .EXT example.

class RscTitles
{
   class hudDisplay
   {
       idd = 1000000;
       movingEnable =  1;
       enableSimulation = 1;
       enableDisplay = 1;
       duration     =  99999;
       fadein       =  0.5;
       fadeout      =  2;
       name = "hudDisplay";
       onLoad = [color="#FF0000"][b]"with uiNameSpace do { hudDisplay = _this select 0 }";[/b][/color]
class controls 
       {
           class text
           {
               access = 0;
               type = 13;
               idc = 1000001;
               style = 2 + 16;
               lineSpacing = 1;
               x = 0.817 - SafeZoneX;
               y = 0.500 + SafeZoneY;
               w = 0.5;
               h = 0.12;
               size = 0.020;
               colorBackground[] = {0,0,0,0};
               colorText[] = {0,0,0,0};
               text = "";
               font = "BitStream";
               class Attributes 
               {
                   font = "BitStream";
                   color = "#6aab4f";
                   align = "left";
                   shadow = true;
               };
           };
       };
   };
};

init.sqf example.

titleRsc ["hudDisplay", "PLAIN"];

waitUntil {!isNull (uiNameSpace getVariable "hudDisplay")};

((uiNameSpace getVariable "hudDisplay")displayCtrl 1000001) ctrlSetStructuredText (parseText format ["<t align='left'><t shadow='1'shadowColor='#000000'>MISSION STATUS</t>"]);

Edited by PartyHead

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  

×