Solarus-Games English Forum

Solarus => Development => Topic started by: Zefk on May 01, 2017, 04:38:40 AM

Title: [Solved]Bring hero back?
Post by: Zefk on May 01, 2017, 04:38:40 AM
I am wondering if there is a way to being the hero behind other entities without changing the layer. The reason is for my push and pull animation.

I tried hero:bring_to_back(), but the documentation (http://www.solarus-games.org/doc/latest/lua_api_entity.html#lua_api_entity_bring_to_back) does mention that the hero is not affected by this.

Animation looks funny:
Changing the length of her arms and legs would make her look like she is doing some sort of monkey dance. The only way this could work is if I make the excuse that she has telekinesis psychic powers.
(https://media.giphy.com/media/3ohzdVQNoyI1RY5faw/giphy.gif)

Hero needs to be sent to back:

(https://media.giphy.com/media/3ohzdOHA0cHOmElRJK/giphy.gif)


What I want it to look like, but it has a bug: (In this case...I chopped the heroines legs off.)

(https://media.giphy.com/media/xUPGcEZzWW5jVjTk8E/giphy.gif)

I would need to cancel the push/pull animation for everything, but the block. What would be the best way to disable push and pull for everything, but the block entity?
Title: Re: Bring hero back?
Post by: Liu_Kong on May 01, 2017, 12:39:43 PM
Quote from: Zefk on May 01, 2017, 04:38:40 AM
I am wondering if there is a way to being the hero behind other entities without changing the layer. The reason is for my push and pull animation.

I tried hero:bring_to_back(), but the documentation (http://www.solarus-games.org/doc/latest/lua_api_entity.html#lua_api_entity_bring_to_back) does mention that the hero is not affected by this.

Animation looks funny:
Changing the length of her arms and legs would make her look like she is doing some sort of monkey dance. The only way this could work is if I make the excuse that she has telekinesis psychic powers.
(https://media.giphy.com/media/3ohzdVQNoyI1RY5faw/giphy.gif)

Hero needs to be sent to back:

(https://media.giphy.com/media/3ohzdOHA0cHOmElRJK/giphy.gif)


What I want it to look like, but it has a bug: (In this case...I chopped the heroines legs off.)

(https://media.giphy.com/media/xUPGcEZzWW5jVjTk8E/giphy.gif)

I would need to cancel the push/pull animation for everything, but the block. What would be the best way to disable push and pull for everything, but the block entity?

Hmm... maybe for entities/heroes/etc. drawing order should be determined by tile position? So that entities in tiles with lower Y get drawn first, giving the effect that you wish.
Title: Re: Bring hero back?
Post by: Zefk on May 01, 2017, 06:27:29 PM
QuoteHmm... maybe for entities/heroes/etc. drawing order should be determined by tile position? So that entities in tiles with lower Y get drawn first, giving the effect that you wish.

Maybe the hero should have a Z order function. Kinda like how the custom entity has a y order function (http://www.solarus-games.org/doc/latest/lua_api_custom_entity.html#lua_api_custom_entity_set_drawn_in_y_order) or maybe the hero should only be able to push and pull on blocks.

1. One way at the moment to solve this problem is by making a funny looking push/pull animation. That would be done by pushing her legs up and extending the arms.

2. The second way would be by having another block entity follow the block entity on a different layer. I do not know the kind of weird effects this will have.
Title: Re: Bring hero back?
Post by: Diarandor on May 01, 2017, 11:34:49 PM
IMO, the best solution is to adapt the art to these engine limitations (related to bounding boxes and traversable properties), and hence these limitations have to be taken into account during the creation of the art. Some of these limitations may just be the way Solarus works (or maybe not, only Chris knows this), so maybe sometimes there is no other solution than re-drawing.
Title: Re: Bring hero back?
Post by: llamazing on May 02, 2017, 12:02:58 AM
Could you cut off the tops of the bookshelves and draw the tops on a higher layer? That way the hero would naturally be behind them without having to change the layer of the hero.
Title: Re: Bring hero back?
Post by: Zefk on May 02, 2017, 12:33:34 AM
QuoteIMO, the best solution is to adapt the art to these engine limitations (related to bounding boxes and traversable properties), and hence these limitations have to be taken into account during the creation of the art. Some of these limitations may just be the way Solarus works (or maybe not, only Chris knows this), so maybe sometimes there is no other solution than re-drawing.

The animation just looks funny when trying to adapt the art to this limitation. I setup a few animations before posting, but it would just look better if I was able to bring the hero behind the block entity.

QuoteCould you cut off the tops of the bookshelves and draw the tops on a higher layer? That way the hero would naturally be behind them without having to change the layer of the hero.

That is a good idea, but I will just go with one of the funny animations I created...

Title: Re: Bring hero back?
Post by: Diarandor on May 02, 2017, 01:35:25 AM
I agree with llamazing. Actually I was refering to the blocks case: in this case, just modify the origin point of the hero sprites. I guess that there is no need to modify the art to solve this issues.
Title: [Solved]Bring hero back?
Post by: Zefk on May 02, 2017, 05:23:30 AM
I just released v2 of my sprite. In case anyone wants to see the new push and pull animation.

(https://media.giphy.com/media/xUPGcEDJ52JMP3OSmk/giphy.gif)

I guess this post is not an issue anymore, but it would nice to be able to "bring the hero back" in the future.