No! you can't write sleep in config classes.
So, there is two separate kind of files:
- You can script functions in sqf files, and by the way "schedule" them with functions such as "sleep" under certain conditions ("spawning parallel" script and not "calling" sub-functions which halts the main script);
- on the other hand, config.cpp or description.ext enable you to declare own classes (with inheritance with common Arma classes). Your class bar:RscPicture is a kind of subclass (of rscPicture) already declared in engine.
With that, you can "control" via idc (as ident control) your resource (rsc) picture.
So you can parameter text via control (idc) with a variable, but don't forget your global display (idd)
class my_display
{
idd = -1;
duration = 100000; // to be displayed as long as you want
fadein = 0;
fadeout = 0;
name="the_name_of_display"; // what u like
onLoad = "uiNamespace setVariable ['important_variable_here', _this select 0]";
controls[]= {my_picture};
class my_picture: RscPicture
{
idc = 2200; // what u want but never the same
text = ""; // in blanc but feed is provided by variable above
colorText[] = {0,0,0,0};
x = 0.391146 * safezoneW + safezoneX;
y = 0.335 * safezoneH + safezoneY;
w = 0.240625 * safezoneW;
h = 0.044 * safezoneH;
};
};
This display class (my_display) belongs on its turn to RscTitles. You need t owrap it in:
class RscTitles
{
titles[] = {"my_display"};
// ALL ABOVE HERE
};
Then, in a sqf file, you can script what you want:
_handling_variable = (uiNameSpace getVariable "important_variable_here") displayCtrl 2200;// call the good control!
_handling_variable ctrlSetText "rsc\image.jpg";// not sure all jpg work. Try paa file instead
_handling_variable ctrlSetBackgroundColor [1, 1, 1, 1 ]; // example for white , no transparency (just background)
then sleep...
then
_handling_variable ctrlSetText "rsc\image2.jpg";
...
and of course, you must call your RscTitle to make it displayed: 0 cutRsc ["my_display","PLAIN",0,false];
Sometimes Rsc controls and scheduled script with sleep are working weird, depending on CPU load. For better results you need to "onEachFrame" the control. You can find all documentation on BIKI.