I am making a small project to help me manage some stuff at work (self employed), and I am trying to do something that sounds like this:
I have a set of 18 buttons, all setup to represent specific timeframes (e.g. January 2024, Year 2024, All time, etc...). These buttons are in a family.
I have a map of my region with 54 different postcodes. These 54 postcodes are all separate sprites which I have put in a family.
What I am trying to achieve is some kind of "heat map", where whenever I press a button, every postcode on the map "radiates" proportionally to the number of jobs I got during the timeframe selected by pressing the button.
So I have setup each button with its own variable (set up by the family itself, not on each button separately), and have created a global variable to store which button has been pressed.
For example, if I press the button "Year 2024", the global variable will change to "Year_2024". The reason I set it up this way is to I could then "pick" the variable on my postcode sprites based on what the global variable value is, as these sprites have 1 variable by time frame (so 18 variables), each with their own values, variating for each sprite, for each timeframe.
I have set up my variable names on the sprite family to be the same names as whatever the global variable "text value" will be when you press any button.
So the logic Im trying to write is this:
When any button of the "button family" is clicked on -> Set global variable value to the name of that button's variable (ex: you press the button Year 2024, now the global variable text value is "Year_2024". You press Year 2023, global variable text value now becomes "Year_2023", etc...)
Then
For each Sprite in the Sprite Family, "Pick" the value from the variable with the same name as the global variable (e.g. you clicked the button "year 2024", global variable now shows "Year_2024", so you need to pick the variable named "Year_2024" for each sprite in the sprite family)
Then
Read the value associated with the correct variable (here, Year_2024, the value will vary depending on postcode) and store that value in another variable on the same sprite, for each of the 54 sprites independently.
Than finally
With the correct value taken from the correct variable for each sprite now stored in each sprite independently, change the opacity of each sprite based on their respective values. Higher value, higher visibility.
I hope this makes some kind of sense to anybody.
I would really appreciate some help on how to achieve this, and unfortunately, if this really, REALLY have to involve arrays, I'm going to have a massive problem because I don't understand arrays, or how to pick values out of cells etc... so a solution not involving arrays would be preferable.
Thanks in advance to anyone willing to help.
I'll keep trying on my end but I don't have much hope.