Results 1 to 6 of 6

Thread: Dialogue\Display problem...Display as background object ?

  1. #1

    Dialogue\Display problem...Display as background object ?

    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
    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 = "";
      };
    };
    Then my calling script [only total time in seconds ATM]:
    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 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?

    I hope I haven't been barking up the wrong tree. Thanks heaps.

    Rough Knight
    Last edited by Rough Knight; Aug 7 2012 at 05:06.

  2. #2
    You need to use cutRsc instead of createDialog (and therefore move your dialoguestopwatch class into RscTitles).

  3. #3
    Here is an example on how you can structure dialogs and display in very similar manner.
    Regards
    Carl Gustaffa - left this game due becoming Steam Exclusive

  4. #4
    Thanks guys,

    I got it working using the cutRsc method. Thanks heaps both of you.

    I didn't quite follow that example Carlos, it was a little over my head but I will go back and experiment once I have perfected a few more things.

    I am glad for the example because I saw this:

    5 cutRsc ["DEFAULT","PLAIN"]; //Removes it as a display
    I couldn't work out how to kill the display until I saw that.

    Thanks

    ROugh Knight

  5. #5
    You should use "" (empty string) instead of "DEFAULT". Pretty sure the latter will produce an error in RPT (Resource not found).

  6. #6
    This should help you with the time script as well. I dont remember where I got this from but it was a real old time script, I edited it slightly for my needs. Should work for you as well.

    Code:
    while {true} do {
        _seconds = time;
        
        _hours = floor(_seconds / 3600);
        _seconds = _seconds - (_hours * 3600);
        _tensOfMinutes = floor(_seconds / 600);
        _seconds = _seconds - (_tensOfMinutes * 600);
        _minutes = floor(_seconds / 60);
        _seconds = _seconds - (_minutes * 60);
        _tensOfSeconds = floor(_seconds / 10);
        _wholeSeconds = floor(_seconds - (_tensOfSeconds * 10));
        _elapsed ="";
    
    
        _elapsed = format ["%1:%2%3:%4%5", _hours, _tensOfMinutes, _minutes,_tensOfSeconds, _wholeSeconds];
        
        
        ctrlSetText [1072, _elapsed];
    
    
        
        sleep 1;
        
    };

Similar Threads

  1. Display Obscured Object ID's
    By Pudd'n in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Jan 28 2012, 16:09
  2. No object or waypoints display in editor preveiw
    By Stuphor in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 4
    Last Post: Dec 3 2004, 05:06
  3. Problem with display name
    By Odin_Soliel in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 1
    Last Post: Jun 12 2003, 15:35
  4. O2light won't display background images
    By mooncaine in forum OFP : O2 TROUBLESHOOTING
    Replies: 2
    Last Post: Feb 17 2003, 17:45
  5. Display problem
    By Benze in forum TROUBLESHOOTING
    Replies: 3
    Last Post: Jun 19 2002, 18:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •