Solarus-Games English Forum

Solarus => Development => Topic started by: froggy77 on November 21, 2015, 07:59:19 PM

Title: Help: destructible / regenerate / lift / animation and sound
Post by: froggy77 on November 21, 2015, 07:59:19 PM
Hello,

I would like an object that can regenerate.
But, my problem is that when I tick the option to regenerate, there are two animations of destruction:
First, there is an animation of destruction (with the sound) when the hero begins to lift an object
and then, there is the same animation and the same sound when the hero is destroying this objet (after having throwing it).
The first animation is OK for a "flower bomb", not too ugly for a bush, but strange for a rock or something in wood.

Is there a way to have two animations and sounds or even delete the first animation of destruction and its sound?
I tried with metables, but I did not succeed.

Thanks in advance.
Title: Re: Help: destructible / regenerate / lift / animation and sound
Post by: Diarandor on November 21, 2015, 08:38:28 PM
Hi! Which type of entity are you using? Destrucribles? Or custom entities?
Title: Re: Help: destructible / regenerate / lift / animation and sound
Post by: MetalZelda on November 21, 2015, 09:13:06 PM
Yeah, this might be a bug, if you lift a destructible, the animation "destruction" is played.
But it's kinda cool though.
Title: Re: Help: destructible / regenerate / lift / animation and sound
Post by: froggy77 on November 22, 2015, 12:53:41 AM
I use a destructible entity, not a custom entity.
Not so cool for me. 8)
Title: Re: Help: destructible / regenerate / lift / animation and sound
Post by: MetalZelda on November 22, 2015, 01:39:00 AM
strange thing is that it doesn't do the thing in Mystery of Solarus ... You might try to copy / paste a destructible event from Mystery of Solarus and test in yout project with your destructible.
Title: Re: Help: destructible / regenerate / lift / animation and sound
Post by: Diarandor on November 22, 2015, 10:34:24 AM
I have tested destructibles with the "can regenerate" option and the same problem appears. I agree that this seems a bug.
Title: Re: Help: destructible / regenerate / lift / animation and sound
Post by: froggy77 on November 22, 2015, 12:23:53 PM
Thank you for your test.
I also tested with Mystery of Solarus (engine v1.4.2) and the problem is the same. It is not really a bug, but I would be happy to find a solution, even if it is just a workaround.
Title: Re: Help: destructible / regenerate / lift / animation and sound
Post by: Diarandor on November 22, 2015, 01:16:49 PM
There is a workaround with custom entities which create destructibles. You can use a timer to check if the associated destructible has been lift or destroyed and create a new one if necessary. You also need the timer to wait in case the hero or some enemy overlap the custom entity, to avoid overlapping the new destructible with something.
Title: Re: Help: destructible / regenerate / lift / animation and sound
Post by: Christopho on November 22, 2015, 03:54:53 PM
I confirm that you need custom entities to solve this.