Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

bitsy

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

end when specific item has run out

A topic by izalea created Dec 23, 2023 Views: 97 Replies: 1
Viewing posts 1 to 2

Hiya!! i wanted to know if its possible to trigger and ending when the final of an item is used, lets say bread given to npc and if its the last bread it teleports to an ending? many thanks

i have tried doing this when moving between rooms but after taking me to the endings room it takes me straight back to the room the door connects to.

heres the text code

{

  - daysdoor == 5 ?

     you decide to waste a day going back to the starting room {shk} -1 day{/shk}{item "2" {{item "2"} - 1}}{daysdoor = daysdoor + 1}

  - {item "2"} <= 1 ?

     why did you do that?{pg}... no days left{drwi "days"}{item "2" {{item "2"} - 1}}you didnt need to do that.{exit "4" 3 5 "tunnel"}

  - {item "2"} >= 1 ?

      are you going to keep doing that?{pg}{shk}{wvy}... -1 day{/wvy}{/shk}{item "2" {{item "2"} - 1}}

}

(1 edit)

hi there! I know nothing about coding, so I'd turn the NPC into a one-way exit that only unlocks when the item breadgiven equals 5 or more. Hope this helps!