Home   Help Search Login Register  

Author Topic: First Time Dialog maker, having problems :)  (Read 466 times)

0 Members and 1 Guest are viewing this topic.

Offline ryankaplan

  • Members
  • *
  • yeah...
First Time Dialog maker, having problems :)
« on: 24 Mar 2005, 11:00:49 »

ok, my dialog lets (or would let) a player to command a  tank; 'wtank3'. It only has limited options. Fairly useless but i wanted to have a go on dialogs so... It's probably gonna be a big read but here it is;
#define ST_LEFT      0
#define ST_RIGHT     1
#define ST_CENTER    2
#define ST_MULTI        16
#define ST_SHADOW       256
#define ST_NO_RECT      512
#define CT_STATIC    0
#define ST_PICTURE   48
#define FontM "tahomaB36"
#define FontHTML "CourierNewB64"
#define CT_ACTIVETEXT 11
#define CT_BUTTON   1
#define ST_FRAME   64
#define CT_EDIT    2
#define CT_COMBO                 4
#define CT_LISTBOX               5
#define CT_SLIDER     3
#define ST_HPOS       0x0F

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 RscPicture
{
        type = CT_STATIC;
        idc = -1;
        style = ST_PICTURE;
        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 RscButton
{
        type = CT_BUTTON;
        idc = -1;
        style = ST_CENTER;
        colorText[] = {0, 0, 0, 1};
        font = FontHTML;
        sizeEx = 0.025;
        soundPush[] = {, 0.2, 1};
        soundClick[] = {"ui\ui_ok", 0.2, 1};
        soundEscape[] = {"ui\ui_cc", 0.2, 1};
        default = false;
};

class RscFrame
{
        type = CT_STATIC;
        idc = -1;
        style = ST_FRAME;
        colorBackground[] = {0, 0, 0, 0};
        colorText[] = {1, 1, 1, 1};
        font = FontM;
        sizeEx = 0.04;
};

class RscEdit
{
       type = CT_EDIT;
       idc = -1;
       style = ST_LEFT;
       font = FontHTML;
       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 RscListBox: RscLB_C
{
        type = CT_LISTBOX;
};

class RscCombo: RscLB_C
{
        type = CT_COMBO;
        wholeHeight = 0.3;
};

class RscSliderH
{
            type = CT_SLIDER;
            style = ST_HPOS;
            color[] = {0.2, 0.2, 0.2, 1};
            idc = -1;
            sizeEx = 0.025;
};

class DIALOG1
{
  idd = -1;
  movingEnable = true;
  controlsBackground[] = {DLG_BACK1, FRAME1};
  objects[] = { };
  controls[] = {TEXT1, COMBO3, COMBO6, BUTTON7, TEXT6, TEXT7, TEXT8, COMBO9, BUTTON10, TEXT11, BUTTON12, BUTTON13, BUTTON14};

  class DLG_BACK1: RscText
  {
     colorBackground[] = {0.4, 0.4, 0.4, 0.75};
     text = ;
     x = 0.19375;
     y = 0.06823;
     w = 0.71125;
     h = 0.4152;
  };
 class FRAME1 : RscText
 {
  x = 0.19375
  y = 0.06823
  idc = -1
  w = 0.71125
  h = 0.4152
  style = ST_FRAME
  colorText[] = {0, 0, 0, 1};
  colorBackground[] = {0.4, 0.4, 0.4, 0.75};
  SizeEX = 0.025
 text = "Armoured Support Menu"
  };
 class TEXT1 : RscText
 {
  x = 0.2125
  y = 0.15205
  idc = -1
  w = 0.1
  h = 0.047
  style = ST_LEFT
  colorText[] = {1, 1, 1, 1};
  colorBackground[] = {0, 0, 0, 0};
 font = "Garamond64"
  SizeEX = 0.025
 text = "Assault"
  };
 class COMBO3 : RscCombo
 {
  x = 0.3175
  y = 0.15205
  idc = 100
  w = 0.277
  h = 0.047
  style = ST_LEFT
  colorText[] = {0.2, 0.2, 0.2, 1};
  colorBackground[] = {0.4, 0.4, 0.4, 1};
 font = "Garamond64"
  SizeEX = 0.04
  colorSelect[] = {0.4, 0.4, 0.4, 1};
  colorSelectBackGround[] = {0.2, 0.2, 0.2, 1};
  RowHeight = 0.04
 wholeHeight = 0.3
  };
 class COMBO6 : RscCombo
 {
  x = 0.60625
  y = 0.15205
  idc = 101
  w = 0.156
  h = 0.047
  style = ST_LEFT
  colorText[] = {0.2, 0.2, 0.2, 1};
  colorBackground[] = {0.4, 0.4, 0.4, 1};
 font = "Garamond64"
  SizeEX = 0.04
  colorSelect[] = {0.4, 0.4, 0.4, 1};
  colorSelectBackGround[] = {0.2, 0.2, 0.2, 1};
  RowHeight = 0.04
 wholeHeight = 0.3
  };
 class BUTTON7 : RscButton
 {
  x = 0.76
  y = 0.15205
  idc = -1
  w = 0.136
  h = 0.047
  style = ST_CENTER
  colorText[] = {0, 0, 0, 1};
 font = "TahomaB48"
  SizeEX = 0.025
 text = "Execute"
 action = "this exec ""shortone.sqs"""
 default = false
  };
 class TEXT6 : RscText
 {
  x = 0.44625
  y = 0.08577
  idc = -1
  w = 0.2
  h = 0.061
  style = ST_CENTER
  colorText[] = {1, 1, 1, 1};
  colorBackground[] = {0.501, 0.501, 0.501, 0};
 font = "TahomaB36"
  SizeEX = 0.035
 text = "Direct Assault"
  };
 class TEXT7 : RscText
 {
  x = 0.44625
  y = 0.21248
  idc = -1
  w = 0.2
  h = 0.061
  style = ST_CENTER
  colorText[] = {1, 1, 1, 1};
  colorBackground[] = {0.501, 0.501, 0.501, 0};
 font = "TahomaB48"
  SizeEX = 0.035
 text = "Follow"
  };
 class TEXT8 : RscText
 {
  x = 0.2125
  y = 0.28265
  idc = -1
  w = 0.2
  h = 0.047
  style = ST_LEFT
  colorText[] = {1, 1, 1, 1};
  colorBackground[] = {0, 0, 0, 0};
 font = "Garamond64"
  SizeEX = 0.025
 text = "Follow and Support"
  };
 class COMBO9 : RscCombo
 {
  x = 0.4475
  y = 0.2807
  idc = 102
  w = 0.2
  h = 0.047
  style = ST_LEFT
  colorText[] = {0.2, 0.2, 0.2, 1};
  colorBackground[] = {0.4, 0.4, 0.4, 1};
 font = "Garamond64"
  SizeEX = 0.04
  colorSelect[] = {0.4, 0.4, 0.4, 1};
  colorSelectBackGround[] = {0.2, 0.2, 0.2, 1};
  RowHeight = 0.04
 wholeHeight = 0.3
  };
 class BUTTON10 : RscButton
 {
  x = 0.65625
  y = 0.28265
  idc = -1
  w = 0.136
  h = 0.047
  style = ST_CENTER
  colorText[] = {0, 0, 0, 1};
 font = "CourierNewB64"
  SizeEX = 0.04
 text = "Execute"
 action = "this exec ""follow.sqs"""
 default = false
  };
 class TEXT11 : RscText
 {
  x = 0.4475
  y = 0.34503
  idc = -1
  w = 0.2
  h = 0.061
  style = ST_CENTER
  colorText[] = {1, 1, 1, 1};
  colorBackground[] = {0.501, 0.501, 0.501, 0};
 font = "TahomaB48"
  SizeEX = 0.035
 text = "Other Orders"
  };
 class BUTTON12 : RscButton
 {
  x = 0.23375
  y = 0.4152
  idc = 110
  w = 0.2
  h = 0.047
  style = ST_CENTER
  colorText[] = {0, 0, 0, 1};
 font = "Garamond64"
  SizeEX = 0.04
 text = "Cease Fire"
 action = "wtank3 setcombatmode ""blue"""
 default = false
  };
 class BUTTON13 : RscButton
 {
  x = 0.66875
  y = 0.41715
  idc = -1
  w = 0.2
  h = 0.047
  style = ST_CENTER
  colorText[] = {0, 0, 0, 1};
 font = "Garamond64"
  SizeEX = 0.04
 text = "Hold Position"
 action = "dostop wtank3"
 default = false
  };
 class BUTTON14 : RscButton
 {
  x = 0.45
  y = 0.4152
  idc = -1
  w = 0.2
  h = 0.047
  style = ST_CENTER
  colorText[] = {0, 0, 0, 1};
 font = "Garamond64"
  SizeEX = 0.04
 text = "Open Fire"
 action = "wtank3 setcombatmode ""red"""
 default = false
  };
};


And here is the createdialog.sqs which the dialog is called through;
_ok = createDialog "Dialog1"
?(!_ok): hint "Error!"; exit

_index = lbAdd [100, "St. Louis form South"]
lbSetData [100, _index, "Ssouth"]
_index = lbAdd [100, "St. Louis from North"]
lbSetData [100, _index, "Snorth"]
_index = lbAdd [100, "St. Louis from East"]
lbSetData [100, _index, "Seast"]
_index = lbAdd [100, "St. Louis from West"]
lbSetData [100, _index, "Swest"]
_index = lbAdd [100, "Larche from South"]
lbSetData [100, _index, "Lsouth"]
_index = lbAdd [100, "Larche from North"]
lbSetData [100, _index, "Lnorth"]
_index = lbAdd [100, "Larche from East"]
lbSetData [100, _index, "Least"]
_index = lbAdd [100, "Larche from West"]
lbSetData [100, _index, "Lwest"]
lbSetCurSel [100, 0]

_index2 = lbAdd [101, "Now"]
lbSetData [101, _index2, "now"]
_index2 = lbAdd [101, "On Zulu"]
lbSetData [101, _index2, "onzulu"]
lbSetCurSel [101, 0]

_index3 = lbadd [102, "Alpha Black"]
lbsetdata [102, _index3, "Alpha"]
 _index3 = lbadd [102, "Alpha Red"]
lbsetdata [102, _index3, "Bravo"]
lbSetCurSel [102, 0]


Lnorth, Lsouth, SNorth, ssouth and all those ones are gamelogic positions which you can move the tank to, when the tank is there, they will attack a city (L stands for Larche, S stands for St. Louis) either directly or on zulu go code (sort of like raven shield).
shortone.sqs

?(lbData[101, lbCurSel 101] == now): this exec "now.sqs"
?(lbData[101, lbCurSel 101] == onzulu): this exec "onzulu.sqs"
exit

now.sqs
?(lbData[100, lbCurSel 100] == Nlouis): town = Louis
?(lbData[100, lbCurSel 100] == Slouis): town = Louis
?(lbData[100, lbCurSel 100] == Elouis): town = Louis
?(lbData[100, lbCurSel 100] == Wlouis): town = Louis
?(lbData[100, lbCurSel 100] == NLarche): town = Larche
?(lbData[100, lbCurSel 100] == SLarche): town = Larche
?(lbData[100, lbCurSel 100] == ELarche): town = Larche
?(lbData[100, lbCurSel 100] == WLarche): town = Larche
publicvariable "town"

wtank3 domove getpos (lbData[100, lbCurSel 100])
Wtank3 sidechat "Roger, Moving now"

#loop
~10
? wtankstop: exit
?(wtank3 distance lbData[100, lbCurSel 100] > 5): "loop"

wtank3 domove getpos [%1, town]

exit

now.sqs doesn't work for some reason (probably the way i put ?(lbData[100, lbCurSel 100] == is wrong. IS that the problem or is there some other problem? whn i run the dialog in it's current state(everything is working except the move and attack commands ^^, it doesn't give any errors, but the tank just refuses to move.

Thanks in advance and sorry for the big, boring read.

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:First Time Dialog maker, having problems :)
« Reply #1 on: 24 Mar 2005, 18:56:29 »
wtank3 domove getpos (lbData[100, lbCurSel 100])

Missing format command?

-->  wtank3 domove getpos (format ["%1",lbData[100, lbCurSel 100])


wtank3 domove getpos [%1, town]


-->  wtank3 domove getpos (format ["%1", town])


http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

Offline ryankaplan

  • Members
  • *
  • yeah...
Re:First Time Dialog maker, having problems :)
« Reply #2 on: 24 Mar 2005, 21:22:47 »
fixed that but still not working. thank you though, because that would have been another problem  ;D

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:First Time Dialog maker, having problems :)
« Reply #3 on: 25 Mar 2005, 00:29:41 »
?(lbData[101, lbCurSel 101] == now): this exec "now.sqs"

-->Try:   ?(lbData[101, lbCurSel 101] == now): [] exec "now.sqs"



?(wtank3 distance lbData[100, lbCurSel 100] > 5): "loop"

Missing goto

?(wtank3 distance lbData[100, lbCurSel 100] > 5): goto "loop"


Not sure if this line works,cant u change" lbData[100, lbCurSel 100]" with Gamelogic?



http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)