Dialog question

Inkko

Valued Member!
recently figure out how to create dialogs and was wondering about something with them.

If I have several different dialogs, is it bad to have the same names for dialogs if they just have different text fields?

like this?

Code:
class dialog1
{
    idd = 44417;
    movingenable = 0;

    class Controls
    {
class D_Dialog_1: D_RscText
{
    idc = 1001;
    text = "Some Text";
    x = 0.277068 * safezoneW + safezoneX;
    y = 0.266021 * safezoneH + safezoneY;
    w = 0.150872 * safezoneW;
    h = 0.0340181 * safezoneH;
};
};
};

class dialog2
{
    idd = 44418;
    movingenable = 0;

    class Controls
    {
class D_Dialog_1: D_RscText
{
    idc = 1001;
    text = "Different text";
    x = 0.277068 * safezoneW + safezoneX;
    y = 0.266021 * safezoneH + safezoneY;
    w = 0.150872 * safezoneW;
    h = 0.0340181 * safezoneH;
};
};
};

Can I use the same IDD/IDC for all of them if I'm not calling a script to change it specifically? Just a little confused about a couple things with dialogs and wanted to see if anyone could clear that up for me. I'm just using the dialogs to display some text and call them with the dialog name; createdialog "dialogname";
 
Obviously if you are creating the dialog using its name, the names need to be unique. They should be named so you know which dialog you are calling rather than dialog_1 ... could be info about zombies or weapons ... next week when you look at the code again you will have to look up what it is . So give the name something descriptive.

I have the perfect solution for the IDC/IDD question. Create the dialog using the GUI and whatever is spits out is what I use :)
As per the documention https://community.bistudio.com/wiki/Dialog_Control you dont need an IDD unless you are going to use finddisplay to select an open dialog. The IDC is the same, but for a control. So if you dont need to access that control then it doesnt need a unique IDC
So you can set them both to -1 if uneeded. I would say that you cant have positive numbers that are not unique because the point of them is to be able to access that dialog or control, so if the same number references multiple items ... that would be undesirable ..
 
Obviously if you are creating the dialog using its name, the names need to be unique. They should be named so you know which dialog you are calling rather than dialog_1 ... could be info about zombies or weapons ... next week when you look at the code again you will have to look up what it is . So give the name something descriptive.

I have the perfect solution for the IDC/IDD question. Create the dialog using the GUI and whatever is spits out is what I use :)
As per the documention https://community.bistudio.com/wiki/Dialog_Control you dont need an IDD unless you are going to use finddisplay to select an open dialog. The IDC is the same, but for a control. So if you dont need to access that control then it doesnt need a unique IDC
So you can set them both to -1 if uneeded. I would say that you cant have positive numbers that are not unique because the point of them is to be able to access that dialog or control, so if the same number references multiple items ... that would be undesirable ..
I have my dialogs uniquely named and changed their IDD to -1, all the controls in them are named the same and I have changed the text field in each one. There would be no issues with controls named the same since they're being called from different dialogs?
 
I guess I'll clarify what I am doing and maybe that will help, I am making a static quest type system (maybe make it more dynamic if I learn more about dialogs since just the other day I finally got the GUI editor working).

I have 9 AI I have setup on dayz 1.8.5 that you can talk to and it'll open up the dialogs. They'll have tasks for you or require stuff and when you have the items you can come back and turn in the stuff. Each dialog is named uniquely, but the controls are all named the same and I have just changed the text field for the RscText for each individual AI. It is all working perfectly fine, I just want to make sure I'm not doing a no no with all the controls named the same.
 
gotcha.
no, i dont think there would,be an issue reusing the controls as the dialog has a list of controls ... it knows what to load and changing text or other sertings when loading.
 
gotcha.
no, i dont think there would,be an issue reusing the controls as the dialog has a list of controls ... it knows what to load and changing text or other sertings when loading.
in the future I might make it so they have multiple quests at each one but at the moment its just 1 per AI cine I haven't done much with dialogs ect... When I do decide to do that do I need to make the IDCs unique to the text fields so that I can modify them with a script to randomize what the quest will be?
 
Yes. If you are going to refer to a control via script, you will use the IDC number.
For instance: I have a dialog that displays the Debug Monitor information instead of using the HINT box as normal (this was a question/request from someone last week ). So I put all the debug info into a string variable _message and then I update the text control in my dialog. The IDC of the text control is 1, so I get the dialog ("stats_display") and then displayctrl 1 (the IDC of my text control) and set the text to _message.
((uiNamespace getVariable "stats_display") displayCtrl 1) ctrlSetText _message;

I could have multiple controls and change the text of each control individually by referring to the IDC of the specific control.
 
Thanks for the help! Took me a while to figure out how to modify the text but I finally got it... was using call instead of spawn.. seems to be working perfectly now and I'm slowly improving everything.
 
Back
Top