Home   Help Search Login Register  

Author Topic: Non-Interactive Dialogs  (Read 2009 times)

0 Members and 1 Guest are viewing this topic.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Non-Interactive Dialogs
« on: 01 Jul 2009, 02:20:07 »
Right, I've been taking my first venture into doing some dialog stuff, as I figure I can't put it off any longer.  I've got my dialog working using createDialog, but I don't want it to be modal/interactive (I want it to just plod along in the background).  How do I go about making it non-interactive?  I've tried some of the older examples, such as using titleRsc, but then Arma2 just complains that it can't find the relevant resource.

What should I be changing/doing differently?

Thanks in advance :)

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Non-Interactive Dialogs
« Reply #1 on: 01 Jul 2009, 06:23:27 »
I use titlersc in my hoz_countdowntimer without seeing some code its pretty hard to see where you might be going wrong.
Xbox Rocks

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Non-Interactive Dialogs
« Reply #2 on: 01 Jul 2009, 10:52:12 »
I used your hoz_countdowntimer as a means of learning, actually.  Here's what "works" but shows an interactive dialog:

Code: [Select]
_dialog = createDialog "HMM_TEST_HUD";
And here's what doesn't (Resource "HMM_TEST_HUD" not found):
Code: [Select]
titleRsc ["HMM_TEST_HUD", "PLAIN"];
waitUntil {!isNull (uiNameSpace getVariable "HMM_TEST_HUD")};

And here's my .h file (derived mosty from your own .h):
Code: [Select]
class HMM_TEST_HUD
{
    idd = 650;
    movingEnable =  0;
    duration =  99999;
    fadein =  2;
    fadeout =  2;
    name = "HMM_TEST_HUD";
    onLoad = "with uiNameSpace do { HMM_TEST_HUD = _this select 0 }";
   
    class controls
    {
        class HMM_TEST_HUD_Text
        {
            idc = 660;
            type = 13;
            access = 0;
            style = 2 + 16;
            colorBackground[] = {0, 0, 0, 0};
            colorText[] = {1, 1, 1, 1};
            font = "Bitstream";
            sizeEx = 0.02;
            x = 0.488;
            y = 0.4;
            w = 0.2;
            h = 0.1;
            text = "";
            size = 0.05;

            class Attributes
            {
                font = "Bitstream";
                color = "#ffffff";
                align = "left";
                shadow = true;
            };
        };
    };
};

Any ideas would be welcomed :)  I'm using the following in my Description.ext:
Code: [Select]
#include "fps_dialog.h"

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Non-Interactive Dialogs
« Reply #3 on: 01 Jul 2009, 16:43:19 »
It should work I think by the looks of it. Are you remembering to save the mission after edits to description.ext or .h files? The editor needs to reread the files and it doesn't until you save the mission. Also try initiating the titlersc a few seconds after the mission is loaded. A good test is to use a radio trigger to test with, if you are activating the dialog in the init.sqf you need to give the player display a few seconds to appear.
Xbox Rocks

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Non-Interactive Dialogs
« Reply #4 on: 01 Jul 2009, 17:52:06 »
I am saving/reloading the mission.  Additionally, I'm activating it in the player's init field... and that works fine... it displays a modal dialog... but I just want a non-modal one, so that the text can stay on the display and the player can still move :p

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Non-Interactive Dialogs
« Reply #5 on: 01 Jul 2009, 19:24:56 »
Try the example below, I think you were missing the definition of rsctitles in the description.ext. in my example run it from the trigger or place it in the player init line.

edit: it could also been that you had text = "";   Once I populated that attribute with  some text, you can see the results.
« Last Edit: 01 Jul 2009, 19:28:39 by hoz »
Xbox Rocks

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Non-Interactive Dialogs
« Reply #6 on: 02 Jul 2009, 00:48:26 »
That worked like an absolute charm.  I think it was mainly the RscTitles thing... dialog newbie mistake ;)

Thanks a lot, hoz.