Jump to content

CryForce-f630d58d86399ab9

Member
  • Content Count

    3
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About CryForce-f630d58d86399ab9

  • Rank
    Rookie

Recent Profile Visitors

129 profile views
  1. CryForce-f630d58d86399ab9

    Arma 3 Dialog - Displaying an image on Listbox selection

    Yep, that one works. I think it may have been an invisible character that I didn't notice when I copied it over mine. But it's all good to go thanks a bunch. 😊
  2. CryForce-f630d58d86399ab9

    Arma 3 Dialog - Displaying an image on Listbox selection

    Hey 7erra, thanks for the help, it looks like its working however I'm getting an Invalid number in expression error but, the code does work and changes pictures how its meant to which is great.
  3. so I'm relatively new to Dialog Scripts in Arma 3 but what I'm trying to do is if the player selects an item in the Listbox. The item will then display a picture on the right and side depending on what item I select in the list box I've made sure my images can be linked to the display as entering them into the ctrlSetText works, but I can't figure out how I can go about making it display the image depending on what item I have selected. At first, I thought of just using if statements but I saw problems with it and an if statement for each item seems a bit of a workaround. so I decided to use Switch {} do and a case for each image as the _index gets a number that I assumed would work if I placed them into different cases like this. switch {_itemNumber} do // gets value { case (0): {ctrlSetText [1200, "images\1.paa"]}; // displays first item image case (1): {ctrlSetText [1200, "images\2.paa"]}; // displays second item image default {ctrlSetText [1200, ""]}; // if no item is selected displays nothing }; but I couldn't get it to display even though when I print it using the HINT command it prints the item selected via a number here is the full script: recipes.sqf disableserialization; _recipeArray = ["Food Materials", "Raw Materials"]; // array of items in list _ctrl = (findDisplay 3663) displayCtrl 1500; // finds dialog { _ctrl lbAdd _x; } forEach _recipeArray; // adds the _recipe array to list box while {!isNull (findDisplay 3663);} do // only loops when the display is open { sleep 1; _index = lbCurSel 1500; // gets _index value from selected item hint str (_index); // prints selection value for testing switch {_index} do // gets the _index value { case (0): {ctrlSetText [1200, "images\1.paa"]}; // displays first item image case (1): {ctrlSetText [1200, "images\2.paa"]}; // displays second item image default {ctrlSetText [1200, ""]}; // if no item is selected displays nothing }; }; if anyone could help I would be grateful.
×