Skip to main content

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

Môsi

A tiny game editor you can use on your phone or in your browser · By sg

Key to pass?

A topic by Fastlane created Mar 10, 2022 Views: 275 Replies: 6
Viewing posts 1 to 3

I am already working on a little project, but there is one thing I cant figure out. I know how to collect items, but what are the steps, I need to take for a simple "get one key to pass a door"? There might be an option with the move-avatar script in addition? If multiple items to collect for a specific goal isnt too hard to do, I would be interested in that, too. Thanks for any help! 

Developer

I'd recommend using item scripts. For example, if you have an item called "key" you could have a door sprite that checks for it with {if {eq {item-count "key"} 1}} ... {/if}. And if you want to check for multiple items, you could do this: {if {all-true {eq {item-count "flour"} 1} {eq {item-count "sugar"} 1} {eq {item-count "butter"} 1}}} ... {/if}.

To make the door passable, you could either make two sprites - an open one and a closed one - and use {transform-sprite "open-door"} OR you could just make the door no longer block the player with {set-sprite-wall false}

Hope that helps!

Thank you for your help! It totally worked out for me and now I have every script running for my little project. But I have one question left: after I set up the door and key, the blank dialogue box will pop up two times when using the key in the door. Can I disable the boxes in that case? I was already thinking about filling it with a text maybe as a workaround, but maybe i just dont understand, why these boyes do Pop up and why this happens two times. Any help would be highly appreciated! 

Developer

That might be because of extra whitespace between script commands. Sometimes whitespace gets misinterpreted as dialog... perhaps not the best design decision on my part, but give that a shot and let me know if it doesn't work.

Awesome! This did the trick for me! Afterwards I added a {remove-sprite} so the door will crack open after first push. I am really satisfied by the outcome. Thank you so much for this amazing work and support. I think it's a pretty clever design decision btw. You should keep it that way. I just wasnt smart enough or experienced enough to figure this out. So I am really thankful for the Support!! 

Developer

<3

Thanks for your help! I will try that!