Jump to content
Sign in to follow this  
Merad

Dealing with Dialogs.

Recommended Posts

I'm working on a mission and rough or not it's near completion. The last thing to do is drop in dialog. A LOT of dialog. And I'm really confused how to do it.

I've read the tutorials about creating dialog but I'm confused on several points.

Firstly, the tutorials are geared toward multiplayer option switching, two buttons appear select one yadda yadda. While the mission I'm making is multiplayer the dialog is through talking to people so I need a tutorial or advice geared toward creating dialog trees and adding dialog options to people.

Secondly, while the tutorials I've read are great in describing in detail how to make the text purple or in MSComincSans font they don't actually tell you how to actually put it in a game. They mention creating a class but never address what a class actually is and how the game uses it. Now I can find other tutorials that do just that but there's a disconnect between what a class is in general and how to practically use it in this particular case.

Are there any missions I could look at that have the player actually dialog talking to people? Are there any pointers of where to go and learn this?

Thanks!

(For example: What I need to do is let the player walk up to *Certain Person* have a dialog option of *Where did you purchase these droids?* and a response from the person *These aren't the droids your looking for.*)

That is what I'm trying to do and I'm mightily confused on how to do it.

Thank you again.

Edited by Merad

Share this post


Link to post
Share on other sites
What I need to do is let the player walk up to *Certain Person* have a dialog option of *Where did you purchase these droids?* and a response from the person *These aren't the droids your looking for.*

This can also be done via addaction that you use in the "Certain persons" init field.

Try searching the forums with addaction

Share this post


Link to post
Share on other sites

So you want to be a Gui whore :p jk

Dialogs are fun to make.. as long as you know what you want to make..

might take some time to get the hang of it but once you do.. it should be a pize of cake to get dialogs ingame.. only thing imo that takes time is the finetuning of the possitions of pictures/texts/buttons etc etc.

what i would do is to start with something real simple and use this as your dialog referance..

http://community.bistudio.com/wiki/Dialog_Control

here is a simple example i have and i'll try to explain my best.

dialog code

#define NUX_MISSIONFRAME		12345
#define CT_COMBO				4 

#define NUX_STATIC              0
#define CT_STRUCTURED_TEXT		13 
#define NUX_MULTI               16
#define NUX_PICTURE             48
#define NUX_MAP_TYPE	        101
#define FontMandM               "Bitstream"
#define FontMandHTML            "Bitstream"
#define FontMandMAIN            "TahomaB"




// 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 





class NUX_MISSIONFAME
{
idd = NUX_MISSIONFRAME;
moving = false;
movingEnable = false;
movingEnabled = false;
objects[ ]={ };
onLoad="uiNamespace setVariable ['NUX_MissionDisplay', _this select 0]"; // new methode in arma2!
controlsBackground[ ]={};
controls[ ]={
			NUX_MISSION_BG,
			NUX_MISSIONTEXT,
			NUX_MISSION_YES,
			NUX_MISSION_NO

			};

class NUX_MISSION_BG // my background
{
	idc = -1;
	type = NUX_STATIC;
	style = NUX_PICTURE;
	colorText[] = {1, 1, 1, 1};
	font = "Bitstream";
	colorBackground[] = {0, 0, 0, 0};
	text="pic\greenframe.paa";
	sizeEx = 0.015;
	x = 0.25;
	y = 0.25;
	w = 0.5;
	h = 0.5;
};	

class NUX_MISSIONTEXT 
{ 
	idc = 12346; 
	type = CT_STRUCTURED_TEXT; 
	style = ST_LEFT; 
	colorBackground[] = { 1, 1, 1, 1 }; 
	x = 0.27;
	y = 0.3;
	w = 0.46.5;
	h = 0.1;
	sizeEx = 0.035;
	size = 0.018; 
	text = " ||| TESTELitest ||| "; 
	class Attributes 
	{
		font = "TahomaB";
		color = "#000000"; 
		align = "center"; 
		valign = "middle"; 
		shadow = false; 
		shadowColor = "#ff0000"; 
		size = "1"; 
	}; 
};

class NUX_MISSION_YES
{ 
	idc = -1; 
	type = 1; 
	style = 0x02 ; 
	default = false; 
	font = "Bitstream"; 
	sizeEx = 0.028 ; 
	colorText[] = { 0, 0, 0, 1 }; 
	colorFocused[] = { 0, 0, 0, 0 }; 
	colorDisabled[] = { 0, 0, 0, 0 };
	colorBackground[] = { 0, 0, 0, 0 };  
	colorBackgroundDisabled[] = { 0, 0, 0, 0 };
	colorBackgroundActive[] = { 0, 0, 0, 0 };
	offsetX = 0.003; 
	offsetY = 0.003; 
	offsetPressedX = 0.002; 
	offsetPressedY = 0.002; 
	colorShadow[] = { 0, 0, 0, 0 }; 
	colorBorder[] = { 0, 0, 0, 0 }; 
	borderSize = 0; 
	soundEnter[] = { "", 0, 1 };
	soundPush[] = { "buttonpushed.ogg", 0.1, 1 }; 
	soundClick[] = { "", 0, 1 };
	soundEscape[] = { "", 0, 1 };
	x = 0.33;
	y = 0.575; 
	w = 0.10; 
	h = 0.06; 
	text = "Yes"; 
	action = "[] execvm ""scripts\missions\transport.sqf"";closeDialog 0;";
};

class NUX_MISSION_NO
{ 
	idc = -1; 
	type = 1; 
	style = 0x02 ; 
	default = false; 
	font = "Bitstream"; 
	sizeEx = 0.038; 
	colorText[] = { 0, 0, 0, 1 }; 
	colorFocused[] = { 0, 0, 0, 0 }; 
	colorDisabled[] = { 0, 0, 0, 0 };
	colorBackground[] = { 0, 0, 0, 0 };  
	colorBackgroundDisabled[] = { 0, 0, 0, 0 };
	colorBackgroundActive[] = { 0, 0, 0, 0 };
	offsetX = 0.003; 
	offsetY = 0.003; 
	offsetPressedX = 0.002; 
	offsetPressedY = 0.002; 
	colorShadow[] = { 0, 0, 0, 0 }; 
	colorBorder[] = { 0, 0, 0, 0 }; 
	borderSize = 0; 
	soundEnter[] = { "", 0, 1 };
	soundPush[] = { "buttonpushed.ogg", 0.1, 1 }; 
	soundClick[] = { "", 0, 1 };
	soundEscape[] = { "", 0, 1 };
	x = 0.53;
	y = 0.585; 
	w = 0.15; 
	h = 0.06; 
	text = "Later"; 
	action = "closeDialog 0;"; 
};	

};

Now you might ask.. wher do i put the shit..

What i do when i make my own dialogs is put put them in subdir called hpp in my mission dir.. and save them as "Yourdialogname.hpp"

offcource ther are other ways to do it..

also i did define the types as "NUX_" which is not nessesary. you could eighter use the ones arma uses or just put the number in ther instead.. or as me define you own :p

In desctiption.ext, on top you put

#include "hpp\Yourdialogname.hpp"

To access the dialog you only need to run the command

in my case:

createDialog "NUX_MISSIONFAME";

you could do it from a script or a trigger or both.

i combine both in my example

in my trigger on act i have

x= [player] execvm "scripts\missions\createmission.sqf"

Create Mission dialog text "randomly"

createmission.sqf

_mission = round (random 6);
_dlg = createDialog "NUX_MISSIONFAME";
sleep 0.3;
switch (_mission) do
{
case 0 : 
{
	((uiNamespace getVariable 'NUX_MissionDisplay') displayCtrl 12346) ctrlSetStructuredText parseText "Do you want to transport some troops?";
};
case 1 : 
{
	((uiNamespace getVariable 'NUX_MissionDisplay') displayCtrl 12346) ctrlSetStructuredText parseText "We have located a enemy radiotower<br />and we need it destroyed.<br /> are you up for it?";
};
case 2 : 
{
	((uiNamespace getVariable 'NUX_MissionDisplay') displayCtrl 12346) ctrlSetStructuredText parseText "Ther are some enemy fighters incomming.<br /> can you intersept them?";
};
case 3 : 
{
	((uiNamespace getVariable 'NUX_MissionDisplay') displayCtrl 12346) ctrlSetStructuredText parseText "We spotted a enemy ship inside our seazone.<br /> can you hunt it down and destroy it?";
};
case 4 : 
{
	((uiNamespace getVariable 'NUX_MissionDisplay') displayCtrl 12346) ctrlSetStructuredText parseText "There is and enemy convoie moving north from Kamenka. can you engage it?";
};
case 5 : 
{

	((uiNamespace getVariable 'NUX_MissionDisplay') displayCtrl 12346) ctrlSetStructuredText parseText "we have located a enemy base near balota, can you destroy it?";
};
case 6 : 
{
	((uiNamespace getVariable 'NUX_MissionDisplay') displayCtrl 12346) ctrlSetStructuredText parseText "Go bother someone else. OK.";
};	
};

this dialog will show me a text randomly form 7 diffrent "mission text"

nb. this dosent create any mission.. only the text for it..

also take a look at the commands dialogs uses

http://community.bistudio.com/wiki/Category:Command_Group:_GUI_Control

hope this super simple example could be of any help :)

Share this post


Link to post
Share on other sites

Simple, not so much, but very helpful! Thanks!

Share this post


Link to post
Share on other sites

Are you trying to make a DIALOG or some DIALOGUE?

If you're trying to make the latter, you could just use a bunch of addActions as stated. Not sure if there's a more efficient way to go about doing it. Don't really know if you can use the stringtable thing for it, maybe.

If you're trying to make a custom DIALOG tho, I'm not the person to ask anyway :P

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×