I'm writing a weapon purhcase menu. Problem: lbdata and lbsetdata only store text strings. My code basically checks what the user's selection is, and then grabs the price/name of the weapon/item from an array of the same name.
init.sqs defines all weapon arrays in format primaryweaponname = [displayname,price,weaponname,magazinename]
player selects M16 primary weapon
value of that option is read in and returned (m16)as "primaryweapon"
cashtemp then subtracts the value of primaryweapon select 1
This would all work great except for the fact that lbsetdata can only store a string in the dialog options, so when the primaryweapon is returned, it tries to use the string as an arry.
*shoots flashpoint*
Is there ANY command available to change the value of a variable from string to object? Or parse a string variable into a variable with type object/array?
The only other way i can think of is pretty nasty:
( if weapon selection is this string ) : (set primary weapon array to this array name)
And make lots of those..... ugh
Help?!
The Captain