solarus-games / zelda-xd2-mercuris-chess

This repository was moved to GitLab: https://gitlab.com/solarus-games/zelda-xd2-mercuris-chess
http://www.solarus-games.org
Other
12 stars 6 forks source link

Replace custom lift for cannonball with a better one #21

Closed Diarandor closed 7 years ago

Diarandor commented 7 years ago

Replace custom lift for cannonball with a better one: -use custom entities instead of destructibles -adapt the script to the multi events script to make it as independent as possible

This would allow to avoid all the bugs related to the cannonball.

Diarandor commented 7 years ago

In the end we will be using destructibles with modifications in the carried_object metatable to allow customizations. But I am having a problem to make the iron ball traversable: https://github.com/solarus-games/solarus/issues/1045

Could this be fixed before the next bugfix of ZS-XD2?

Diarandor commented 7 years ago

I updated the iron ball with the new version (check the new version of the script for the metatable of carried objects). The new iron ball does not get stuck in walls!!! During the falling trajectory a custom entity is used, which is replaced by a destructible again after falling.

Remark: the script is short and allows a lot of easy customization. The path of the sprite has to be of the form "portables/" .. TYPE .. "filename", where TYPE is a string of the form "type/subtype1/subtype2/..." with as many subtypes as needed (if TYPE is "" then the default properties are used). The types/subtypes can be used to choose how to modify the properties of the falling trajectory (a casewise function of the script has to be modified for this purpose).

Diarandor commented 7 years ago

-Don't forget about the bug I mentioned above. The iron ball is still not traversable, so the hero may get stuck with the ball, which is very annoying.

-I haven't tried to test what happens when throwing the new iron ball into water, but probably there will be some problem (I think I forgot to add some sprites for the ground effects that are necessary in that case for the splash animation in water, and probably the sound too). If so, open a new issue and I will add what is needed.

Diarandor commented 7 years ago

Workaround for the first bug (of the hero getting stuck with the iron ball): just wait until the hero is not overlapping the custom entity (used during the throw) before creating the destructible.

christopho commented 7 years ago

There is an easy way to modify the ground even when an entity has no "set_modified_ground" method: just add another entity above that supports modifying the ground.

And ZSXD2 already has some custom entity models whose only purpose is to modify the ground.

So as a workaround for the ground issue, you can put a custom entity with model "traversable" while the hero is overlapping the destructible iron ball. Just to allow the hero to get out of the iron ball. And with a timer, remove that custom entity as soon as the hero is no longer overlapping.