OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: aurek on 02 Oct 2003, 21:13:00

Title: Ok Some Dialog Questions
Post by: aurek on 02 Oct 2003, 21:13:00
Today I took a look at dialogs using Vektorboson's tutorial. And Ive run into a problem so I have a few questions.

a)What actions are valid for use with the CT_Button (action = "";)
b)More of a general scripting problem this, how do I create (if/then) statements in OFP scripting?

Basically what I want to do is:

If listbox "cars" is selected then .etc.
else if listbox "motorcycle" is selected then .etc.

I want this to happen after the button "buy" is pressed. Will I need to run a script for this, or is it doable within the dialog its self?

c) I want the text of a CT_Static to change depending on the currently selected list box item.

Ok I hope Ive made myself clear. Any help appreciated,
thanks :)


p.s If this was VB Id have it done twice by now :(
Title: Re:Ok Some Dialog Questions
Post by: Rubble_Maker on 03 Oct 2003, 11:40:00
You can put anything you want into the action slot, actually its a general script command. You could use something like

[] exec "button_down.sqs"

or whatever. No need to fiddle with if statements ;)

c) Try ctrlSetText [], see OCR for more
Title: Re:Ok Some Dialog Questions
Post by: CrashDome on 04 Oct 2003, 04:44:48
In regards to B:

You need to associate a value with the list item.

lbSetValue [<Listbox Index number>,<integer>]

Then when the buy button is pressed, get the currently selected items value with:

lbValue [<idc>,lbCurSel (<idc>)]

Title: Re:Ok Some Dialog Questions
Post by: aurek on 04 Oct 2003, 14:39:50
Ill try  that, thanks ;)