Hi guys,
Hopefully there is no bis_fnc_stopwatch or something because I have spent too much time on this problem
I am trying to make a stopwatch that appears as a non-interactive object on the players screen [ ie they keep playing while the display is active] and this is what I have so far.
* Stopwatch .paa file which pops up on screen when I call the dialogue.
* Working counter in seconds on the display. Further scripting will be added later to add hours, minutes, seconds and hundreds of seconds.
The problem I have is whenever I call the script the stopwatch pops up fine, but so does the mouse icon so I can not keep playing until I close the dialogue ie it is more an interactive control than a display?
I have enableSimulation = true; which lets the game carry on while the display is up...but still the mouse icon is active to my player can not move until I close the display.
stopwatch.hpp
Then my calling script [only total time in seconds ATM]:Code:#define CT_STATIC 0 #define ST_PICTURE 48 #define ST_LEFT 0 #define ST_FRAME 64 #define RACE_TIME 10100 class RscText { type = CT_STATIC; idc = -1; style = ST_LEFT; h = 0.04; colorBackground[] = {0, 0, 0, 0}; colorText[] = {0.1, 0.1, 0.1, 1}; font = "Bitstream"; sizeEx = 0.1; }; class RscPicture { type = CT_STATIC; idc = -1; style = ST_PICTURE; colorBackground[] = {0, 0, 0, 0}; colorText[] = {1, 1, 1, 1}; font = "Bitstream"; sizeEx = 0.04; }; class dialoguestopwatch { idd = fro_stopwatch; movingEnable = false; enableSimulation = true; controlsBackground[] = {ST_BACKGROUND}; class ST_BACKGROUND : RscPicture { colorBackground[] = {0, 0.2, 0.4, 0}; text = "fro_timer\stopwatch.paa"; moving = true; sizeEx = 0.015; x = 0.0; y = 0.0; w = 0.22; h = 0.215; }; objects[] = { }; controls[] = {FRO_TIMER}; class FRO_TIMER : RscText { idc = RACE_TIME; x = 0.09; y = 0.08; w = 0.2; h = 0.04; font = "Bitstream"; sizeEx = 0.05; text = ""; }; };
I am hoping there is a dialogue control that allows for a non-interactive display. Can anyone advise me on how to achieve this? Is this the diference between createDialogue and createDisplay?Code:private ["_n", "_time1", "_time2"]; RACE_TIME = 10100; n = 2; _n = 0; _ok = createDialog "dialoguestopwatch"; if (!_ok) then {hint "Problem creating stopwatch!"}; _time1 = time; _time2 = 0; while {true} do //controls to be added later { if (true) then //controls to be added later { _time2 = time - _time1; _n = round (_time2 * (10 ^ n)) / (10 ^ n); //time rounded to two decimal points. ctrlSetText [RACE_TIME, format["%1", _n]]; sleep 0.033; }; sleep 0.1; };
I hope I haven't been barking up the wrong tree. Thanks heaps.
Rough Knight
HOME 
Reply With Quote


