Home   Help Search Login Register  

Author Topic: Dialogue Tutorial  (Read 1471 times)

0 Members and 1 Guest are viewing this topic.

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Dialogue Tutorial
« on: 13 Feb 2008, 22:36:36 »
Hi. I'm looking for a tutorial on how to make Dialogues in Armed Assault but I couldn't find any. Could anyone give me a link? Sorry if this is a stupid question.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Dialogue Tutorial
« Reply #1 on: 13 Feb 2008, 23:07:20 »
I just learned to make dialogs with ArmA as well, and it's not exactly the easiest thing in the world. There are however fairly few changes in the syntax from OFP, so Vektorbosen's Dialog Tutorial is still almost 100% viable. However, when it comes to the controls there are a few more options you need to determine, but I never bothered to find them out. I just stole the list of controls from (I think) one CSL's dialogs, and then added a few of my own by looking through the default ones for ArmA. Here's what I got so far:

Code: [Select]
/*******************/
/*  Controls       */
/*******************/

// Control types
#define CT_STATIC           0
#define CT_BUTTON           1
#define CT_EDIT             2
#define CT_SLIDER           3
#define CT_COMBO            4
#define CT_LISTBOX          5
#define CT_TOOLBOX          6
#define CT_CHECKBOXES       7
#define CT_PROGRESS         8
#define CT_HTML             9
#define CT_STATIC_SKEW      10
#define CT_ACTIVETEXT       11
#define CT_TREE             12
#define CT_STRUCTURED_TEXT  13
#define CT_CONTEXT_MENU     14
#define CT_CONTROLS_GROUP   15
#define CT_XKEYDESC         40
#define CT_XBUTTON          41
#define CT_XLISTBOX         42
#define CT_XSLIDER          43
#define CT_XCOMBO           44
#define CT_ANIMATED_TEXTURE 45
#define CT_OBJECT           80
#define CT_OBJECT_ZOOM      81
#define CT_OBJECT_CONTAINER 82
#define CT_OBJECT_CONT_ANIM 83
#define CT_LINEBREAK        98
#define CT_USER             99
#define CT_MAP              100
#define CT_MAP_MAIN         101

// Static styles
#define ST_POS            0x0F
#define ST_HPOS           0x03
#define ST_VPOS           0x0C
#define ST_LEFT           0x00
#define ST_RIGHT          0x01
#define ST_CENTER         0x02
#define ST_DOWN           0x04
#define ST_UP             0x08
#define ST_VCENTER        0x0c

#define ST_TYPE           0xF0
#define ST_SINGLE         0
#define ST_MULTI          16
#define ST_TITLE_BAR      32
#define ST_PICTURE        48
#define ST_FRAME          64
#define ST_BACKGROUND     80
#define ST_GROUP_BOX      96
#define ST_GROUP_BOX2     112
#define ST_HUD_BACKGROUND 128
#define ST_TILE_PICTURE   144
#define ST_WITH_RECT      160
#define ST_LINE           176

#define ST_SHADOW         0x100
#define ST_NO_RECT        0x200
#define ST_KEEP_ASPECT_RATIO  0x800

#define ST_TITLE          ST_TITLE_BAR + ST_CENTER

// Slider styles
#define SL_DIR            0x400
#define SL_VERT           0
#define SL_HORZ           0x400

#define SL_TEXTURES       0x10

// Listbox styles
#define LB_TEXTURES       0x10
#define LB_MULTI          0x20


/*******************/
/*  Basic classes  */
/*******************/

class RscBackground
{
type = CT_STATIC;
IDC = -1;
style = 512;
x=0.0;
y=0.0;
w=1.0;
h=1.0;
text="";
ColorBackground[]={0.6,0.6,0.6,1};
ColorText[]={0.1,0.1,0.1,1};
font="BitStream";
SizeEx = 1;
};

class RscText
{
type = CT_STATIC;
IDC = -1;
style = ST_LEFT + ST_MULTI + ST_NO_RECT;
LineSpacing = 1.000000;
h = 0.040000;
ColorBackground[] = {1,1,1,0.2};
ColorText[] = {0.1,0.1,0.1,1};
// ColorBackground[] = CA_UI_grey;
// ColorText[] = Color_Black;
font = "BitStream";
SizeEx = 0.030000;

};
class RscPicture
{
type = CT_STATIC;
IDC = -1;
style = ST_PICTURE;
ColorBackground[] = {0,0,0,0};
ColorText[] = {1,1,1,1};
font = "BitStream";
SizeEx = 0;
};
class RscActiveText
{
type = CT_ACTIVETEXT;
style = ST_LEFT;
SizeEx = 0.05;
font = "BitStream";
color[]= {1,1,1,0.8};
colorActive[] = {1, 1, 1,1};
soundEnter[] = {"", 0.1, 1};
soundPush[] = {"", 0.1, 1};
soundClick[] = {"", 0.1, 1};
soundEscape[] = {"", 0.1, 1};
text = "";
};
class BIS_RscButton
{
     access = ReadAndWrite;
     type = VArmor;
     style = 0;
     x = 0;
     y = 0;
     w = 0.3;
     h = 0.1;
     text = "";
     font = "TahomaB";
     sizeEx = 0.04;
     colorText[] = {0, 0, 0, 1};
     colorDisabled[] = {0.3, 0.3, 0.3, 1};
     colorBackground[] = {1,1.1,1};
     colorBackgroundDisabled[] = {1, 1, 1, 1};
     colorBackgroundActive[] = {1, 0.5, 0, 1};
     offsetX = 0.004;
     offsetY = 0.004;
     offsetPressedX = 0.002;
     offsetPressedY = 0.002;
     colorFocused[] = {0, 0, 0, 1};
     colorShadow[] = {0, 0, 0, 0};
     colorBorder[] = {0, 0, 0, 1};
     borderSize = 0.000;
     soundEnter[] = {"", 0.1, 1};
     soundPush[] = {"", 0.1, 1};
     soundClick[] = {"", 0.1, 1};
     soundEscape[] = {"", 0.1, 1};
};
class RscButton : BIS_RscButton
{
     type = CT_BUTTON;
     idc = -1;
     style = ST_CENTER;
     sizeEx = 0.02000;
     borderSize = 0.000;
     default = false;
};

class RscEdit  {
access = 0;
type = 2;
style = 0;
h = 0.040000;
colorBackground[] = {0,0,0,0 };
colorText[] = {1,1,1,1 };
colorSelection[] = {1,1,1,0.250000 };
font = "TahomaB";
sizeEx = 0.040000;
autocomplete = "";
text = "";
size = 0.200000;
};

class RscCombo  {
access = 0;
type = 4;
style = 0;
h = 0.050000;
wholeHeight = 0.250000;
colorSelect[] = {0.600000,0.600000,0.600000,1 };
colorText[] = {1,1,1,1 };
colorBackground[] = {0.200000,0.200000,0.200000,1 };
colorScrollbar[] = {1,1,1,1 };
font = "TahomaB";
sizeEx = 0.040000;
soundSelect[] = {"",0.100000,1 };
soundExpand[] = {"",0.100000,1 };
soundCollapse[] = {"",0.100000,1 };
};

Basically what those do is pre-define a bunch of stuff for you that you'll use in your actual dialog. As for the dialog, I still use the excellent Dialog Maker by razorwings18, which works quite well for ArmA as well: you won't have to copy the pre-defined controls that the dialog maker creates, and you should change all the fonts to something like "TahomaB", and it should pretty much work right off the bat.  :good:

Good luck! It ain't easy, and whenever you've done the slightest mistake you'll be thrown back to desktop, but you can get some really cool results out of it!

Wolfrug out.

"When 900 years YOU reach, look as good you will not!"

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Dialogue Tutorial
« Reply #2 on: 13 Feb 2008, 23:07:51 »
Well, it is basically the same as it was in OFP + some extra hoops to jump through now and then.

Try Dialog Tutorial by Vektorboson here:

http://www.ofpec.com/ed_depot/index.php?action=list&game=OFP&type=tu&cat=xyz

Also look at the OFP Dialog Maker tool by razorwings18 here:

http://www.ofpec.com/ed_depot/index.php?action=list&game=OFP&type=to&cat=xyz


Planck
I know a little about a lot, and a lot about a little.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Dialogue Tutorial
« Reply #3 on: 13 Feb 2008, 23:25:47 »
Planck, Planck...you're growing too old for your own good.  :cool2: Not to mention SLOW.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re: Dialogue Tutorial
« Reply #4 on: 14 Feb 2008, 00:23:46 »
Thanks for the rapid and comprehensive result guys. Looks like I got my work cut out for me  :good:

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Dialogue Tutorial
« Reply #5 on: 14 Feb 2008, 01:23:45 »
Whoah, 31 seconds isn't that bad, not denying the old bit mind.   :P


Planck
I know a little about a lot, and a lot about a little.