Jump to content
Sign in to follow this  
the unknown

Dialogs

Recommended Posts

I am working on a mission where one is able to change weather durring the mission.

I have the scripts done to change the weather, but I want to use a dialog to give some data to the scripts.

The problem is that I dont know anyting about how to make dialogs, so does anyone know some good tutorials about dialogs.

I tried vektorboson's one but some how afther i copy past the codes it keeps crashing arma.

Any help would be appriciated.

The Unknown

Share this post


Link to post
Share on other sites

Would you show me the source code? Either here or with PM.

Then i may help you better. Plus a description of the error.

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#define FontM "tahomaB36"

#define ST_LEFT 0

#define ST_RIGHT 1

#define ST_CENTER 2

#define CT_STATIC 0

#define CT_ACTIVETEXT 11

class RscText

{

type = CT_STATIC;

idc = -1;

style = ST_LEFT;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {1, 1, 1, 1};

font = FontM;

sizeEx = 0.04;

};

class RscActiveText

{

type = CT_ACTIVETEXT;

idc = -1;

style = ST_LEFT;

color[] = {1, 1, 1, 1};

colorActive[] = {1, 0, 0, 1};

font = FontM;

sizeEx = 0.04;

soundEnter[] = {"ui\ui_over", 0.2, 1};

soundPush[] = {, 0.2, 1};

soundClick[] = {"ui\ui_ok", 0.2, 1};

soundEscape[] = {"ui\ui_cc", 0.2, 1};

default = false;

};

class DlgTutorial

{

idd = -1;

movingEnable = true;

controlsBackground[] = { };

objects[] = { };

controls[] = { HELLO_WORLD, CLICK_ME };

class HELLO_WORLD : RscText

{

idc = 100;

style = ST_CENTER;

x = 0.4;

y = 0.45;

w = 0.2;

h = 0.1;

text = "Hello World!";

};

class CLICK_ME : RscActiveText

{

idc = 101;

style = ST_CENTER;

x = 0.4;

y = 0.65;

w = 0.2;

h = 0.05;

text = "Click Me!";

action = "ctrlSetText [100, ""Thanks""]";

default = true;

};

};

This is what I copyed past into the description file.

And this is what I already had for the other tings like respawn.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Respawn = "BASE";

RespawnDelay = 300;

ShowCompass = true;

ShowGPS = false;

ShowMap = true;

ShowPad = true;

ShowRadio = false

There wasnt a real error message just the normal do you want to send the report ting.

Share this post


Link to post
Share on other sites

It looks alright at a quick look,

try giving a number (!=-1) like 555 for the IDD in the dialog class.

Also search for possible other error causes (other addons installed that might cause the crash) , that's all i can say for now, hope it helps.

Share this post


Link to post
Share on other sites

Short and simple. The font you've chosen doesnt exist.

I have replaced it with Bitstream as marked in bold:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#define FontM "tahomaB36"

#define ST_LEFT       0

#define ST_RIGHT      1

#define ST_CENTER     2

#define CT_STATIC     0

#define CT_ACTIVETEXT 11

class RscText

{

      type = CT_STATIC;

      idc = -1;

      style = ST_LEFT;

      colorBackground[] = {0, 0, 0, 0};

      colorText[] = {1, 1, 1, 1};

      font = Bitstream;

      sizeEx = 0.04;

};

class RscActiveText

{

      type = CT_ACTIVETEXT;

      idc = -1;

      style = ST_LEFT;

      color[] = {1, 1, 1, 1};

      colorActive[] = {1, 0, 0, 1};

      font = Bitstream;

      sizeEx = 0.04;

      soundEnter[] = {"ui\ui_over", 0.2, 1};

      soundPush[] = {, 0.2, 1};

      soundClick[] = {"ui\ui_ok", 0.2, 1};

      soundEscape[] = {"ui\ui_cc", 0.2, 1};

      default = false;

};

class DlgTutorial

{

idd = -1;

movingEnable = true;

controlsBackground[] = { };

objects[] = { };

controls[] = { HELLO_WORLD, CLICK_ME };

class HELLO_WORLD : RscText

{

  idc = 100;

  style = ST_CENTER;

  x = 0.4;

  y = 0.45;

  w = 0.2;

  h = 0.1;

  text = "Hello World!";

};

class CLICK_ME : RscActiveText

{

  idc = 101;

  style = ST_CENTER;

  x = 0.4;

  y = 0.65;

  w = 0.2;

  h = 0.05;

  text = "Click Me!";

  action = "ctrlSetText [100, ""Thanks""]";

  default = true;

};

};

edit: ah damn, that doesnt work in codes.

Well you see what i meant. One is on line 17 and the other is on line 28.

Share this post


Link to post
Share on other sites

No, sorry. I've been searching in the biki but no found.

I got this one from the RscCommon.hpp : Zeppelin32

Share this post


Link to post
Share on other sites

Well I found one that worked to : tahomaB

I gave the tute of vektorboson another try and I managed to get it all done I only get some errors from the buttons about a collor being disabled.

The error message:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Dialog.intro\description.ext/TU_WEATHER/TU_CANCELB.colorDisabled

Here is the description codeing till the part its going wrong:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#define FontM "tahomaB"

#define ST_LEFT 0

#define ST_RIGHT 1

#define ST_CENTER 2

#define CT_STATIC 0

#define CT_BUTTON 1

#define CT_EDIT 2

#define CT_COMBO 4

#define ST_FRAME 64

class RscTextBig

{

type = CT_STATIC;

idc = 200;

style = ST_LEFT;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {0, 0, 0, 1};

font = FontM;

sizeEx = 0.04;

};

class RscTextSmall

{

type = CT_STATIC;

idc = 200;

style = ST_LEFT;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {0, 0, 0, 1};

font = FontM;

sizeEx = 0.02;

};

class RscButton

{

type = CT_BUTTON;

idc = 201;

style = ST_CENTER;

colorText[] = {0, 0, 0, 1};

font = FontM;

sizeEx = 0.025;

soundPush[] = {, 0.2, 1};

soundClick[] = {"ui\ui_ok", 0.2, 1};

soundEscape[] = {"ui\ui_cc", 0.2, 1};

default = false;

};

class RscEdit

{

type = CT_EDIT;

idc = -1;

style = ST_LEFT;

font = FontM;

sizeEx = 0.02;

colorText[] = {0, 0, 0, 1};

colorSelection[] = {0.5, 0.5, 0.5, 1};

autocomplete = false;

text =;

};

class RscLB_C

{

style = ST_LEFT;

idc = -1;

colorSelect[] = {0.4, 0.4, 0.4, 1};

colorSelectBackground[] = {0.2, 0.2, 0.2, 1};

colorText[] = {0.2, 0.2, 0.2, 1};

colorBackground[] = {0.4, 0.4, 0.4, 1};

font = FontHTML;

sizeEx = 0.025;

rowHeight = 0.04;

};

class RscCombo : RscLB_C

{

type = CT_COMBO;

wholeHeight = 0.3;

};

class TU_WEATHER

{

idd = 202;

movingEnable = true;

controlsBackground[] = { TU_BACKGROUND, TU_FRAME };

objects[] = { };

controls[] = { TU_WEATHERTEXT, TU_CANCELB, TU_OKB, TU_TIMERAIN, TU_TIMEOVERCAST, TU_TIMERAINTEXT, TU_TIMEOVERCASTTEXT, TU_RAINLEVEL, TU_OVERCASTLEVEL, TU_TIME1, TU_TIME2, TU_TIME3, TU_TIME4, TU_TIMETEXT };

class TU_WEATHERTEXT : RscTextBig

{

idc = 100;

style = ST_CENTER;

x = 0.275;

y = 0.15;

w = 0.42;

h = 0.05;

text = "Weather\Time Controle Center";

};

class TU_CANCELB : RscButton

{

idc = 101;

x = 0.723;

y = 0.75;

w = 0.07;

h = 0.04;

text = "Cancel";

action = "closeDialog 0";

};

class TU_OKB : RscButton

{

idc = 102;

x = 0.64;

y = 0.75;

w = 0.07;

h = 0.04;

text = "Ok";

action = "closeDialog 0";

};

Also can someone explain me how I can get the info thats filled in the selection boxes and the typeing boxes, so I can use it in a script.

The Unknown

Share this post


Link to post
Share on other sites

The Button definition in Vektorbosons tutorial is a bit "incomplete", means, arma wants each an every definition of the button. I would advise you to use a RscCommon.hpp :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#define true 1

#define false 0

#define Size_Main_Normal 0.03

#define Size_Text_Default Size_Main_Normal

#define Size_Text_Small 0.025

#define Color_White {1, 1, 1, 1}

#define Color_Black {0, 0, 0, 1}

#define Color_Gray {0.3, 0.3, 0.3, 1}

#define Color_GrayLight {0.6, 0.6, 0.6, 1}

#define Color_GrayDark {0.2, 0.2, 0.2, 1}

#define Color_Orange {1, 0.5, 0, 1}

#define Color_Main_Foreground1 Color_White

#define Color_Text_Default Color_Main_Foreground1

#define ProcTextWhite "#(argb,8,8,3)color(1,1,1,1)"

#define CT_STATIC 0

#define CT_BUTTON 1

#define CT_COMBO 4

#define CT_ACTIVETEXT 11

#define CT_STRUCTURED_TEXT 13

#define ST_LEFT 0x00

#define ST_CENTER 0x02

#define ST_PICTURE 48

#define ST_MULTI 16

#define ReadAndWrite 0

#define FontMAIN "Zeppelin32"

class CfgFontFamilies

{

class Zeppelin32

{

fonts[] =

{

"\ca\UIFonts\Data\Fonts\Zeppelin3212",

"\ca\UIFonts\Data\Fonts\Zeppelin3213",

"\ca\UIFonts\Data\Fonts\Zeppelin3214",

"\ca\UIFonts\Data\Fonts\Zeppelin3215",

"\ca\UIFonts\Data\Fonts\Zeppelin3216",

"\ca\UIFonts\Data\Fonts\Zeppelin3217",

"\ca\UIFonts\Data\Fonts\Zeppelin3218",

"\ca\UIFonts\Data\Fonts\Zeppelin3219",

"\ca\UIFonts\Data\Fonts\Zeppelin3220",

"\ca\UIFonts\Data\Fonts\Zeppelin3222",

"\ca\UIFonts\Data\Fonts\Zeppelin3228"

};

spaceWidth = 0.7;

spacing = 0.07;

};

};

//Standard static text.

class RscText

{

access = ReadAndWrite;

type = CT_STATIC;

idc = -1;

style = ST_LEFT;

w = 0.1;

h = 0.05;

font = FontMAIN;

sizeEx = Size_Text_Default;

colorBackground[] = {0, 0, 0, 0};

colorText[] = Color_Text_Default;

text = "";

};

//Standard button.

class RscButton

{

// common control items

access = ReadAndWrite;

type = CT_BUTTON;

style = ST_LEFT;

x = 0;

y = 0;

w = 0.3;

h = 0.1;

// text properties

text = "";

font = FontMAIN;

sizeEx = Size_Text_Default;

colorText[] = Color_Black;

colorDisabled[] = Color_Gray;

// background properties

colorBackground[] = Color_GrayLight;

colorBackgroundDisabled[] = Color_GrayLight;

colorBackgroundActive[] = {0.84,1,0.55,1};

offsetX = 0.004; // distance of background from shadow

offsetY = 0.004;

offsetPressedX = 0.002; // distance of background from shadow when button is pressed

offsetPressedY = 0.002;

colorFocused[] = Color_Black; // color of the rectangle around background when focused

// shadow properties

colorShadow[] = Color_Black;

// border properties

colorBorder[] = Color_Black;

borderSize = 0.0; // when negative, the border is on the right side of background

// sounds

soundEnter[] = {"", 0.1, 1};

soundPush[] = {"", 0.1, 1};

soundClick[] = {"", 0.1, 1};

soundEscape[] = {"", 0.1, 1};

};

//Standard combo box.

class RscCombo

{

access = ReadAndWrite;

type = CT_COMBO;

style = 0;

h = 0.05;

wholeHeight = 0.25;

colorSelect[] = Color_GrayLight;

colorText[] = Color_Text_Default;

colorBackground[] = Color_GrayDark;

colorScrollbar[] = Color_Text_Default;

font = FontMAIN;

sizeEx = Size_Text_Default;

soundSelect[] = {"", 0.1, 1};

soundExpand[] = {"", 0.1, 1};

soundCollapse[] = {"", 0.1, 1};

};

//Standard active text.

class RscActiveText

{

access = ReadAndWrite;

type = CT_ACTIVETEXT;

style = ST_CENTER;

h = 0.05;

w = 0.15;

font = FontMAIN;

sizeEx = Size_Text_Default;

color[] = Color_Text_Default;

colorActive[] = {0.84,1,0.55,1};

soundEnter[] = {"", 0.1, 1};

soundPush[] = {"", 0.1, 1};

soundClick[] = {"", 0.1, 1};

soundEscape[] = {"", 0.1, 1};

text = "";

default = 0;

};

/*

class RscStructuredText

{

access = ReadAndWrite;

type = CT_ACTIVETEXT;

style = ST_CENTER + ST_MULTI;

h = 0.05;

w = 0.15;

font = FontMAIN;

sizeEx = Size_Text_Default;

color[] = Color_Text_Default;

colorActive[] = {1, 0.5, 0, 1};

soundEnter[] = {"", 0.1, 1};

soundPush[] = {"", 0.1, 1};

soundClick[] = {"", 0.1, 1};

soundEscape[] = {"", 0.1, 1};

text = "";

default = 0;

};

*/

//Standard structured text.

class RscStructuredText

{

access = ReadAndWrite;

type = CT_STATIC;

idc = -1;

style = ST_LEFT + ST_MULTI;

lineSpacing = 1;

w = 0.1;

h = 0.05;

font = FontMAIN;

sizeEx = Size_Text_Small;

colorBackground[] = {0, 0, 0, 0};

colorText[] = Color_Text_Default;

text = "";

};

(copy & paste in the editor and save it as rscCommon.hpp)

and then to include it with this line in your description:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#include "rscCommon.hpp"

To get the text of a control you need it's idc to be higher than 0. And as the Biki is our friend, use the function ctrlText.

Share this post


Link to post
Share on other sites

<s>Thanks to all of you I managed to get every ting to work.

If someone wants to see the end codeing just post a request here and ill post it.</s>

Gues I was wrong the data in the drop downboxs and type boxs arent given trough to the other script.

The Script that puts the data in the drop down boxes.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; *****************************************************

; ** Armed Assault Script File

; *****************************************************

_ok = createDialog "TU_WEATHER"

?(!_ok): hint "Error!"; exit

;RainLevel

_index = lbAdd [108, "0"]

lbSetData [108, 1, "0"]

_index = lbAdd [108, "0.1"]

lbSetData [108, 1, "0.1"]

_index = lbAdd [108, "0.2"]

lbSetData [108, 1, "0.2"]

_index = lbAdd [108, "0.3"]

lbSetData [108, 1, "0.3"]

_index = lbAdd [108, "0.4"]

lbSetData [108, 1, "0.4"]

_index = lbAdd [108, "0.5"]

lbSetData [108, 1, "0.5"]

_index = lbAdd [108, "0.6"]

lbSetData [108, 1, "0.6"]

_index = lbAdd [108, "0.7"]

lbSetData [108, 1, "0.7"]

_index = lbAdd [108, "0.8"]

lbSetData [108, 1, "0.8"]

_index = lbAdd [108, "0.9"]

lbSetData [108, 1, "0.9"]

_index = lbAdd [108, "1"]

lbSetData [108, 1, "1"]

lbSetCurSel [108, 0]

;OvercastLevel

_index = lbAdd [109, "0"]

lbSetData [109, _index, "Data 0"]

_index = lbAdd [109, "0.1"]

lbSetData [109, _index, "0.1"]

_index = lbAdd [109, "0.2"]

lbSetData [109, _index, "0.2"]

_index = lbAdd [109, "0.3"]

lbSetData [109, _index, "0.3"]

_index = lbAdd [109, "0.4"]

lbSetData [109, _index, "0.4"]

_index = lbAdd [109, "0.5"]

lbSetData [109, _index, "0.5"]

_index = lbAdd [109, "0.6"]

lbSetData [109, _index, "0.6"]

_index = lbAdd [109, "0.7"]

lbSetData [109, _index, "0.7"]

_index = lbAdd [109, "0.8"]

lbSetData [109, _index, "0.8"]

_index = lbAdd [109, "0.9"]

lbSetData [109, _index, "0.9"]

_index = lbAdd [109, "1"]

lbSetData [109, _index, "1"]

lbSetCurSel [109, 0]

exit

The Script that needs the data.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; *****************************************************

; ** Armed Assault File

; *****************************************************

;

;

;

;?! (Local Server): Exit

;--------{Getting Data}---------

_TimeRain = ctrlText 104

_TimeOver = ctrlText 105

_DensityRain = ctrlText 108

_DensityOver = ctrlText 109

_DayTime = ctrlText 110

closeDialog 0

~2

;--------{Setting Time}---------

#SetTime

skiptime (_DayTime-daytime)

;--------{Setting Weather}------

#SetWeather

_TimeRain SetRain _DensityRain

_TimeOver SetOvercast _DensityOver

~1

;--------{Ending Script}--------

#exit

Exit

The Description file

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">///////////////////////////////////////////////////////

// Armed Assault Description File

///////////////////////////////////////////////////////

#include "rscCommon.hpp"

#define FontM "tahomaB"

#define ST_LEFT 0

#define ST_RIGHT 1

#define ST_CENTER 2

#define CT_STATIC 0

#define CT_BUTTON 1

#define CT_EDIT 2

#define CT_COMBO 4

#define ST_FRAME 64

class RscTextBig

{

type = CT_STATIC;

idc = 200;

style = ST_LEFT;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {0, 0, 0, 1};

font = FontM;

sizeEx = 0.04;

};

class RscTextSmall

{

type = CT_STATIC;

idc = 200;

style = ST_LEFT;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {0, 0, 0, 1};

font = FontM;

sizeEx = 0.02;

};

class RscEdit

{

type = CT_EDIT;

idc = -1;

style = ST_LEFT;

font = FontM;

sizeEx = 0.02;

colorText[] = {0, 0, 0, 1};

colorSelection[] = {0.5, 0.5, 0.5, 1};

autocomplete = false;

text =;

};

class TU_WEATHER

{

idd = 202;

movingEnable = true;

controlsBackground[] = { TU_BACKGROUND, TU_FRAME };

objects[] = { };

controls[] = { TU_WEATHERTEXT, TU_CANCELB, TU_OKB, TU_TIMERAIN, TU_TIMEOVERCAST, TU_TIMERAINTEXT, TU_TIMEOVERCASTTEXT, TU_RAINLEVEL, TU_OVERCASTLEVEL, TU_TIME1, TU_TIMETEXT };

class TU_WEATHERTEXT : RscTextBig

{

idc = 100;

style = ST_CENTER;

x = 0.275;

y = 0.15;

w = 0.42;

h = 0.05;

text = "Weather\Time Controle Center";

};

class TU_CANCELB : RscButton

{

idc = 101;

x = 0.7;

y = 0.75;

w = 0.08;

h = 0.04;

text = "Cancel";

action = "closeDialog 0";

};

class TU_OKB : RscButton

{

idc = 102;

x = 0.617;

y = 0.75;

w = 0.08;

h = 0.04;

text = "Ok";

action = "this exec ""Weather.sqs"" ";

};

class TU_TIMERAIN : RscEdit

{

idc = 104;

x = 0.22;

y = 0.3;

w = 0.1;

h = 0.025;

};

class TU_TIMEOVERCAST : RscEdit

{

idc = 105;

x = 0.22;

y = 0.35;

w = 0.1;

h = 0.025;

};

class TU_TIMERAINTEXT : RscTextSmall

{

idc = 106;

style = ST_LEFT;

x = 0.315;

y = 0.29;

w = 0.4;

h = 0.05;

text = "Seconds till RainLevel";

};

class TU_TIMEOVERCASTTEXT : RscTextSmall

{

idc = 107;

style = ST_LEFT;

x = 0.315;

y = 0.34;

w = 0.4;

h = 0.05;

text = "Seconds till OvercastLevel";

};

class TU_RAINLEVEL : RscCombo

{

idc = 108;

x = 0.51;

y = 0.3;

w = 0.05;

h = 0.025;

};

class TU_OVERCASTLEVEL : RscCombo

{

idc = 109;

x = 0.51;

y = 0.35;

w = 0.05;

h = 0.025;

};

class TU_TIME1 : RscEdit

{

idc = 110;

x = 0.375;

y = 0.4;

w = 0.2;

h = 0.025;

};

class TU_TIMETEXT : RscTextSmall

{

idc = 114;

style = ST_LEFT;

x = 0.22;

y = 0.39;

w = 0.4;

h = 0.05;

text = "Set Time to (0-24):";

};

class TU_BACKGROUND : RscTextBig

{

colorBackground[] = {0.4, 0.4, 0.4, 0.75};

text =;

x = 0.2;

y = 0.1;

w = 0.6;

h = 0.7;

};

class TU_FRAME : RscTextBig

{

idc = 103;

style = ST_FRAME;

colorText[] = {0, 0, 0, 1};

text = "";

sizeEx = 0.025;

x = 0.2;

y = 0.1;

w = 0.6;

h = 0.7;

};

};

The Unknown

Share this post


Link to post
Share on other sites

You need that first i think, but i haven't tested it.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_display = findDisplay IDD;

_control = _display displayCtrl IDC;

And then you can use

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">ctrlText _control

Share this post


Link to post
Share on other sites

Nope doesnt work it still says it cant find a number.

I am getting a error saying the overcast command doesnt have a time.

Share this post


Link to post
Share on other sites

Yeah I know the syntax.

Probally i wasnt clear enough.

As you can see in the script it gets its time from the dialog.

I tought if you would know what error I got at the top it would help finding the problem. I am gonna unpbo the old mfcti and see how they got there data out of the dialogs there mabey i can find the problem solution there.

Share this post


Link to post
Share on other sites

Ok afther a couple of days testing I managed to narrow the problem down with some help of a debug tool.

I just added this code block so its a bit more clear.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@ TU_SetWeather

_Indexrain = lbcursel 108

_IndexOver = lbcursel 109

_ValueRain = lbValue [108, _Indexrain]

_ValueOver = lbValue [109, _IndexOver]

TU_RainTime = Ctrltext 104

TU_OverCastTime = Ctrltext 105

TU_Time = Ctrltext 110

TU_Rainlevel = _ValueRain

TU_Overcastlevel = _ValueOver

~1

closeDialog 0

The script works fine till the next part then it starts messing up.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

~2

;--------{Setting Time}---------

#SetTime

skiptime (TU_Time-daytime)

;--------{Setting Weather}------

#SetWeather

TU_RainTime SetRain TU_Rainlevel

TU_OverCastTime SetOvercast TU_Overcastlevel

~1

;--------{Ending Script}--------

#exit

Exit

As far as I know all the syntax is correct.

The Unknown

Share this post


Link to post
Share on other sites

Doesnt work its still giveing me the error that it isnt getting a number.

I am starting to think that the ctrltext command doesnt work for getting numbers, that arma just reads it if it where just normal text.

Share this post


Link to post
Share on other sites
Quote[/b] ]

Syntax:

ctrlText idc

Parameters:

idc: Integer - control ID

Return Value:

String - The text or image path is returned, dependant on the control type.

The Wiki states unambiguously that a string is returned and not a variable.

So what you have to do is to convert the string

into a variable

for instance like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_variable= call compile format ["%1",Ctrltext 104]

Share this post


Link to post
Share on other sites

Thank you that did the trick.

Ill gather some people on a server tommorrow and see if the dialog pops up on everybodys side and if the script works in mp.

Share this post


Link to post
Share on other sites

If you add the action to an object (like a radio) you can use an ArmA Bug (you will have the action if you watch the object).

Share this post


Link to post
Share on other sites

And why is this considered a bug ?

Wiki description:

Quote[/b] ]

Parameters:

unit: Object - unit or object to assign the action to - OFP & ArmA

Share this post


Link to post
Share on other sites

Because the action is assigned to the radio, not the person. But the person can use it.

Share this post


Link to post
Share on other sites

Ok I just ran the tests with some of the guys and fixed the little bugs that showed up.

It all works perfect now.

Thanks for all your help.

The Unknown

P.S. If someone wants to the scripts just send me a pm and ill post them here.

Share this post


Link to post
Share on other sites

Hello to whoever may still be drifting through these boards.

I have a game crashing problem. It has nothing to do with the actual Description.ext file since the mission loads, previews and all displays/controls work properly. I suspect that it has something to do with me not closing the dialog(s) properly.

Basically all of the backgrounds, buttons and image classes are in the same parent class. The parent class is assigned a control idd = 4000, Each subclass follows in sequence, idc = 4010. idc = 4020, etc.

Is there a specific way to close dialogs out? Closing controls out before displaying others?

EDIT: A search is what brought this thread to my attention. I suppose I should mention that the mission is in fact for CWA 1.99(OFP)

EDIT EDIT: I have discovered that the problem is being caused by a wrongly converted image from the format of TGA to PAA with the pngtopac tool. I would never have guessed an image to do this, hence the reason I expended three days in confusion(normal confusion aside). So, to answer my own question, using the command "CloseDialog #" is the only way of closing a dialog.

Edited by savedbygrace
Problem Solved

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  

×