Ok, though i am relatively new dev, i have an ambitious fun, strategic and educational game meant for older kids and pre-teens
It sounds like an interesting project. A structure would be good because it would leave room for expansion.
Do you want me to share the project file?
Do you want me to share the project file?
No, I don’t have the time to dig too deep into a project. Let me just put together a generic example based on the concept or at least my understanding. Once you understand the concept then you can adapt it to fit.
ok, thanks a whole lot,
It’s a basic setup using the 3 Stooges and 3 random countries.
Each button has a variable called “name”. At start change label text to the variable. You could use separate objects then put them into a group.
This would be the events to get the country based on the button label
try me:
Source:
I assumed your question was more involved than I believe it is. If I’m wrong, let me know. I’m going to put together a more advanced version. I’ll post it either later or tomorrow. You can use it or not. Either way, I hope you learn something.
Again, thanks a lot, i’ll try it out later today!
This is more advanced. It creates the buttons based on the structure and it uses multiple children. It also shows how to create a scene variable from a global using JSON. The json actions are under [other] [conversion]
try me:
source:
can you show the variable sheets both global and scene
I’m done for the day. My second example might answer some questions. If not, there’s always tomorrow.
ok, no probs, sleep well,
ok. How goes it? Any questions?
Not sure if you saw it but I’m trying to figure out if there’s a bug with using the label name of a button as a child name of a structure variable. You can use the parent’s name to get all of the child’s names with a for each child event and you can get the child names of children. For some reason using the button label text directly doesn’t work but putting the same string in a variable does.
I’ve been working on the advanced version. It’s getting more advanced. It’s actually pretty fun and I’m learning new concepts myself. I added glow effects for the player and buttons for the castles.
try me:
Source:
Global Variable structure has changed. The scene variables are the same.
The events are growing
I have a simple query, what is the basic difference between an array and a structure, apparently both can store multiple property values, but can you explain the details in a bit more detail?
Arrays are ordered with an index starting at 0 while structures use text otherwise they’re fairly identical structure wise.
Array
VariableName[number]
a[1]
a[Variable(i)]
Structure
VariableName[String]
or
VariableName.String
VariableName.childName
VariableName[“childName”]
VariableName[VariableString]