Author Topic: Animated Tiles in Quest Editor  (Read 359 times)

jojo_f

  • Newbie
  • *
  • Posts: 18
    • View Profile
Animated Tiles in Quest Editor
« 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!

Diarandor

  • Hero Member
  • *****
  • Posts: 957
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Animated Tiles in Quest Editor
« Reply #1 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.
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

jojo_f

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Animated Tiles in Quest Editor
« Reply #2 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?  ???

Diarandor

  • Hero Member
  • *****
  • Posts: 957
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Animated Tiles in Quest Editor
« Reply #3 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.
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1103
    • View Profile
Re: Animated Tiles in Quest Editor
« Reply #4 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 :)

jojo_f

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Animated Tiles in Quest Editor
« Reply #5 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.
« Last Edit: February 22, 2018, 10:07:30 pm by jojo_f »

MetalZelda

  • Hero Member
  • *****
  • Posts: 546
    • View Profile
Re: Animated Tiles in Quest Editor
« Reply #6 on: February 23, 2018, 09:01:12 pm »
you need to get the sprite of the entity first by using

Code: [Select]
entity:get_sprite()
Code: Lua
  1. local sprite = entity:get_sprite()
  2. sprite:set_ignore_suspend(true)

jojo_f

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Animated Tiles in Quest Editor
« Reply #7 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.