I want to create a player list , where the player can add their name in runtime and it gets saved for them to choose next time i am unable to save the list created by combo box i am able to add options with help of editable text box but those options generated in “Combo Box” does not get saved
Thanks in advance !!!
Did you save the added options to a Save Game object, and saved to slot? And then loaded them next time the widget is created and pushed the names back into the combo box? If no:
i tried i added a array of strings to save game object , and also added the names in form of “for loop” and tried to populate the the combo box . only the last added name is shown rest just disappears
Thankyou,
That does not look right:
- the indexing is not counting correctly
- we keep adding duplicate entries to the array every time the user commits
For saving it should be probably closer to:
- top bit: create a save game (or use existing one), fetch the content of the combo, push it into the save game object → save:
- bottom bit: fetch the content of the combo - note the array is a
local variable
Also, consider saving only when it’s actually needed - when we destroy that widget or when we quit the game.
For loading:
It’s all pseudoscript - please adjust to your needs. You did not include your implementation of this so it’s pretty much impossible to tell what could have gone wrong.
sorry i forgot to add the save and load game script , but yeah i have done the same adding back the options after i load the game , i am confused with the subtract node. mine looks different.
The inside of the combo box works the same way as an array. They start at 0 and end at length -1
If you start the loop at 1, you’ll ignore element 0, if you access Count (which is 5 here - five elements), well, there’s no index 5…
awesome this worked but only problem is when i quit the game and come back only one option remain when i quit the game and restart again.

You sure this is OK?
Also, the first screenshot - please read my post again, you’re just expanding and expanding the same array:
we keep adding duplicate entries to the array every time the user commits
If the user adds more than one name, you’ll get duplicates. Consider a small pure getter function that reads the content of the combo box - this way you won’t even need to keep track of another array - called Combo Name
in your script.
Print what you’re trying to save - see if it checks out.
it does print all the names but the combo box shows only one entry,
i will create the function and try again .
i did check that its correct
And it still does not work as expected? If so, would you mind posting the updated script?
I did create a pure function , but I didn’t understand how to connect the execution node , so I connect as before.
I see that this is solved, but if you keep going like this, you will get duplicates.
If you decide to use a pure function, you will not need this script (crossed out) and then could use a pure function where the green arrow is - instead of the array.
Apart from that, well done & good luck with the rest!
Thankyou so much !! had been struggling from days ,
really appreciate your help
this worked really well
I was trying to add even age of the player , this does not work with multiple combo box any help would be great
Why wouldn’t it work? It’s just the same script but repeated for many combo boxes.
confused about the saving and loading i am tying in same array its mixing up the string data , should i create multiple save games or only one save game is enough .
1 Save Game is enough. If you have 4 combo boxes, you can have 4 arrays. If you have 4000 combo boxes, you do not want to manually create 4000 arrays, ofc.
You could use Map of Int | String Array (made with a struct) and push in the arrays of entries you pulled out of the widget.
It’s hard to advise as I do not understand how you’ve structured the data but here’s something very generic:
- lets say each combo widget has an ID and can spit out its own data (perhaps via a pure function mentioned somewhere above):
- a struct that holds entries:
- when you’re ready to save all 4000 combo boxes, you add the data to the Map whose key is the comboID and the abovementioned struct is the combo data:
- to read and redo the combo boxes:
Again, this is all pseudoscript as we do not know what goes where. I wouldn’t bother with the above if I had just a few combo boxes, though.
edit: updated images & entires* = entries, ofc, ffs And info on Maps:
Vital stuff for many things. Think of it as of a smart and very fast array.
A pseudoscript would be of great help !!