Hi, thanks. How is this different from object.animation? In my case it’s a color combination code the player has to click on. Clicking makes the color change and I want it to stay that way when the player does another thing. Is there any fault in my coding?
I was just sharing one way of capturing a sprite’s current animation frame, so it could be saved or used for other things. I was not suggesting that your code had faults. Others here are better equipped to advise on the best way to save. It’s not something I have done in my game yet. I’m sorry if I caused any confusion.
Hi Jastrid - i noticed that in the events you’ve got …condition; number of animation of color1 less than 4 and then below it as a sub event you’ve got condition - number of animation of color1 equals 4. - these can’t go together. they need to be separate conditions. (Edit - if there is no animation 4 i think it’ll return 0 and so the sub event is processed)
Small thing - if you’ve got a condition like tas<0 you don’t need the same condition as a sub event below it
You’re using an object variable to refer to it’s animation number but that number can be referred to with an expression painting.Animation::Index()
So for saving each objects animations you can set the children of the array to object.Animation::Index()
ie if all the paintings are numbered with a variable ‘ID’ repeat for each painting…
set savedata.paintings[painting.id].animation to painting.Animation::Index()
im a bit tired so there’s possibly errors above
all the best
dave
@worriedpixels no problem, I’m really happy people are replying! There was a fault in my coding, because it didn’t work
@petlimpet thanks for the tips about the subevents en index. This seems to work now! This was a colorcode though, not the painting. My saving for the painting also works, but it seems a lot of coding I’m using, so I’ll share what I have on just the color red now. Maybe this can be done easier? I don’t understand arrays… note: all the colored parts are painted seperatly.
The painting
Beginning of scene
These are in the scene structure variable
Hi @jastrid!
Your painting is very beautiful.
When i saw in the first seconds your colored picture, i couldn’t help thinking of Picasso! And that is a compliment, isn’t it?
A+
Xierra
Thanks, but not completely my work…I use mostly stock pictures.
Great that you’ve got things working now! If you’ve got things how you want things then leave Arrays for another day. I hadn’t really fully understood what you what up to until the last post. It’s worth getting to grips with Arrays and repeat events at some point as it makes things much easier when you’re got lots of objects and information about them to store. here we go ---- i’
m going to complicate things again. The R;G;B elements of each painting could be stored like this usersaves.painting[painting.id].red =255
Hello
In computer science, arrays (1 or more dimensions) are the basis of any programming learning.
After that the structures come (in memory or in the form of records in the files). Jadis, the pointers were (almost) an obligatory passage but no more now.
I encourage you to familiarize yourself with the arrays.
A+
Xierra
Thanks guys, I will keep the array-study for later!