OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: MRsteve on 21 Mar 2005, 15:42:32

Title: Passing a variable to a dialog(ue)
Post by: MRsteve on 21 Mar 2005, 15:42:32
Hello good people!

Ok I'm hoping to pass two numerical variables to a dialog(ue) text box, is this possible?

If not could I achieve the same by having sliders to recieve the numbers?

Thanks all

Steve

Ps: BTW: For those who dont know    PLANCK   is a god  and his unexhaustable patience with modding noobs like me is unparalled......Do OFPEC give out medals?
 ???
Title: Re:Passing a variable to a dialog(ue)
Post by: StonedSoldier on 21 Mar 2005, 15:53:56
ill assume you have a ctrl with idc 100,

Code: [Select]
_somenumber = 100

ctrlSetText [100,format ["%1",_somenumber]

or a slider

Code: [Select]
sliderSetRange [100, 0, _somenumber]
Title: Re:Passing a variable to a dialog(ue)
Post by: MRsteve on 21 Mar 2005, 16:17:06
THANKYOU!!!!

_somenumber = 100

ctrlSetText [100,format ["%1",_somenumber]]

It needed the extra bracket at end, but apart from that works a dream.

Keep it "green" soldier and thanks again

Steve
 ;D


EDIT: The forum wont show  two brackets together so I imagine you did type it right first time round.