Solarus-Games English Forum

Solarus => Development => Topic started by: jojo_f on February 21, 2018, 04:48:17 AM

Title: Animated Tiles in Quest Editor
Post by: jojo_f on February 21, 2018, 04:48:17 AM
Hello! I am making some animated tiles in the Quest Editor. Is there a way to change the timing of animated tiles, the way there is to change for character animations?

Thanks!
Title: Re: Animated Tiles in Quest Editor
Post by: Diarandor on February 21, 2018, 08:36:33 AM
It's not possible yet, but I think it is planned for Solarus v1.6. The same happens for the number of frames of animated tiles.
Title: Re: Animated Tiles in Quest Editor
Post by: jojo_f on February 21, 2018, 10:15:49 AM
The reason I am doing this, is to have environmental animations continue while the game pauses. Is there another way to do this? Is this a silly question?  ???
Title: Re: Animated Tiles in Quest Editor
Post by: Diarandor on February 21, 2018, 12:44:35 PM
That is not a silly question, but a good one. You can use custom entities with sprites for that, but if you use a lot of them (several hundreds on the same map) it would not be optimal for the speed of the game. My custom tilesets have animated tiles that will need these new features for tiles, so we should have them for Solarus v1.6. In my opinion, some animated entities, which are too big and/or rarely used, are better as sprites (outside the tileset image), to keep tilesets simple.
Title: Re: Animated Tiles in Quest Editor
Post by: Christopho on February 21, 2018, 03:39:41 PM
You can call sprite:set_ignore_suspend(true) to make sprites continue their animation when the game is suspended. It should not be a problem even with hundreds of them.
But I agree that more customization of animated tiles would be nice :)
Title: Re: Animated Tiles in Quest Editor
Post by: jojo_f on February 22, 2018, 02:39:44 AM
Using sprite:set_ignore_suspend() and as a reference the Solarus Lua API--I am running into errors, because I am not sure how to use this method. My big problem is that all of the code I have made has been for events.

Currently I have a bonfire as an animated NPC, to prevent Link from pushing/pulling, and hurt him if he interacts it. So things like flowers are ok, but this bonfire is not. I guess I could place the NPC with no sprite, and then draw a sprite on top?

Thank you for your patience! I have been using Solarus a lot for about a month, and learning as much as I can, by watching every tutorial multiple times and reading everything on this forum!! I hope to have a decent demo game soon, but it is hard for my little brain to learn without seeing examples and following along.
Title: Re: Animated Tiles in Quest Editor
Post by: MetalZelda on February 23, 2018, 09:01:12 PM
you need to get the sprite of the entity first by using

entity:get_sprite()

Code (lua) Select
local sprite = entity:get_sprite()
sprite:set_ignore_suspend(true)
Title: Re: Animated Tiles in Quest Editor
Post by: jojo_f on March 03, 2018, 05:17:51 AM
Thanks! That works perfectly. I was trying a lot of ways to get this to work, getting as far as having no errors, but also having no function haha. This is very helpful.