Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

bitsy

a little engine for little games, worlds, and stories · By adam le doux

triggering an ending from dialogue

A topic by ninamartinez created Jun 10, 2023 Views: 228 Replies: 2
Viewing posts 1 to 2

Hi all!

I'm trying to trigger an ending from dialogue (I test the door, and, bizarrely, it opens this time.), but not sure how to do it. 

Context: the player needs to have an item to be able to open a locked door that they were previously able to use, which then will prompt the 'I test the door' dialogue, then should end. Currently, with the end I have added, it triggers without needing the item. Would I need to do a modified version of the code below? or change something in the ending code?



thanks!

Just add {pg}{end} immediately after the word "unpacking." and that dialogue branch will run then trigger the end of the game. (The pagebreak is just if you want the dialogue to play on the last game screen rather than over a black screen, you can take it off and just use the {end} code if you don't care about that.) 

I'm not seeing the {end} tag on the code you've shown, so I'm guessing you've accidentally added the ending outside of the if/else part of the dialogue, so the game is reading it as an absolute rather than part of the if statement.

Another way to fix it is to go through the non-code part of the bitsy editor. Wherever you have the lil end box (the one that says "end     stop the game") in the dialogue, click on it once, then click on the up arrow of the arrows that appear to move it up the dialogue chain until it's in the correct position.

Hope that helps!

it worked! Thanks! I think i was trying to add it as a separate ending instead of adding it to the picture above.