Download

How do i go about retrieving an integer for each generated button to GET something out of an array?

erm, if i generated a button to widget, how do i specify an integer id to each of the button so when i click on one, it would GET data from an array with the integer for said button?
oh, is there a way to call an integer or for each generated button?
a58ba8db4f8ee737195a7bc2f275a6a708d9e584.png

got up to that, probably a lot of junk that doesnt need to be there, but still stuck at getting each button’s id to call the data out from the array

any pointer would be greatly appreciated, tyty

It’s really difficult to say without knowing your overall goal. Are you really trying to make 100 buttons, with each one grabbing its value in the array? There’s a difference between trying to find the first value of an array, and the location of a specific piece of information. Honestly, if you’re trying to make a dino command center UI, I have a suggestion: turn all of your arrays into single values, and turn your structure into an array of that structure. The logic flows like this:

Grab a dino, make a structure of DinoInfo. This contains all of the variables you have - scanned ID, tamed, tamed name, etc. Take this DinoInfo structure and add it to the array of LocatedDinos. When you access LocatedDinos[0], you can break the structure and have that specific dino’s info at your disposal.

If I’ve got this backwards, just let me know.

well, that kinda what i wanted to do, but right now, im stuck with the generated buttons, i tried following SamKO’s idea of add custom data into the button as (0) and running the event through OnClickedObject instead of the normal OnClicked, but im not quite sure how i would go about adding +1 to that value for every instance a button is generated and have each button its added +1 value. caz right now whenever i clicked any of the generated buttons, it always call out the default custom data value.

got this setup on every generate button function

trying to make it so each button has its own order number(from which it was generated), so i can do a function with a single data from the array with the generated button id (the amount of generated buttons are the same as the data count on the arrays)

i have a feeling that i’d be stuck at this same instance if were to go down your route, just cant seems to figure out how to work this through right now. (edit: to be more precise, i wanna pull an integer from each button on which order it was generated)

thank you so much for the input, btw

erm, Grebog pointed be out to the thing i missed, it was a very simple thing at that, too

Grebog - Today at 2:41 PM @WereAsian search for SetCustomData while dragging out the pin from your button

thank you, again, Huston, feels like i always find you answering the questions i needed when i search the support forum, too XD, appreciates you taking your time to help us, much luv

Glad I could help.