Mystery of Solarus: Signs and Eggs

Started by ffomega, March 23, 2017, 02:30:26 AM

Previous topic - Next topic
I'm looking through the maps in Mystery of Solarus, and noticed that signs are created as NPC entities.  So in order to replicate the sign, being able to show the hero a dialogue, as well as be lifted, thrown, and then destroyed, I was unable to find the code that shows how to do that.

The millasaur eggs in the first dungeon would be kind of perfect for the large black and white rocks littered around hyrule.  I noticed that they were marked as enemy entities, which is fine to be honest.  I do not need the segments that allow them to hatch however.

In the case of the eggs, is it wise to leave it as an enemy or (considering I don't need the enemy to spawn from it), can it be copied and pasted in as a custom entity?

In the case of the signs, where within your game would I be able to find the code that allows me to lift, throw, and destroy NPCs to make the signs work like a destructable that can be spoken to?
My tilesets page can be found here:
http://absolute-hyrule-tutorials.solarus-games.org/

For signs, there is unfortunately a legacy hardcoded rule in the engine. If an NPC has a sprite called exactly "entities/sign", then it can be lifted. There is no way to customize this yet, but I planned to fix it in Solarus 1.6.

About eggs, it is totally possible to use their sprite in a custom entity rather than an enemy.