le-doux / bitsy

a little engine for little games, worlds, and stories
https://bitsy.org
MIT License
839 stars 147 forks source link

Feature Request: Add Dialog to Tiles #254

Closed kafujo closed 5 months ago

kafujo commented 9 months ago

I'd like the ability for dialog to trigger whenever the player steps on a specific type of background tile. Currently you can attach dialog to sprites, items, and exits, but not tiles - even if you add a DLG code beneath a tile manually in the game data section, the bitsy editor deletes it.

Alternative solutions to this problem would be to 1) Have an option to make sprites walkable. 2) Allow the dialog of an entrance or exit to function once when the player steps on it, if the entrance and exit are coded to be on the same coordinate.

Examples of where this feature would be useful:

The current workarounds are to:

1) Insert invisible items with dialog onto every tile of that type - however the player will pick up these items and the dialog will not re-trigger when the player steps back on that tile again. This also clogs up the inventory, which can become a problem in longer games.

2) Create and duplicate a sprite for every tile of that type - however then you cannot walk on the tile.

3) Create an Exit, then code the desired dialog or script into the Exit dialog - however then you have to constantly set up and adjust exit entrances and exits, and as the exit has to be at least one coordinate away it will propel the player. You can't accommodate for the fact that the player can step onto the tile from various directions, it will always propel them back into the same direction.

le-doux commented 5 months ago

thanks for the thorough write-up! I agree that the kind of feature you're describing is useful for a lot reasons

I think you actually can achieve the behavior you want in the current version of bitsy using exits or endings. you just need to "lock" the exit/ending so that it doesn't perform its default effect after the dialog finishes. you do this by adding {property locked true} to the dialog. for example:

{property locked true}Your message here

I do still agree this feature isn't the most convenient or discoverable, so I'll think about ways to improve it in the future. that said, I'd rather not add dialog to tiles, since I feel that would break expectations about what those represent. possibly adding a new type of exit/ending that doesn't have a default effect would be a good solution.

thanks again for your feedback!