Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

You may disagree with me, but your rationale agrees exactly with what I was saying. If you try to pocket something and your inventory is full, you DON'T pocket it and you DON'T create it, you just say "Your hands are full." (or whatever the system message is) and nothing changes.

If you think your sample code is messy, you should see my code for 'Seeker of Magic' and 'The Witch's Apprentice', where I have to do this sort of thing over and over again. And I'm going to have to do it again for this one for 20 or so objects.

(1 edit)

Yes, I understand what you are saying, but what I disagree with is that the overhead would be acceptable to beginners. The easy way of doing this, is with a swap command, if it is a swap (and there are no weight limits), but in the simple case that you want a cut scene not to happen until the player has room in their hands, then you have all of that code to write. I could write a simple function to try to semi automate some of this but I don't think it would be generic enough.

Adventuron Classroom is for beginners to coding, they don't want to think about rollback of a failed transaction.

Considering a command like this (not for this jam though), in the background it will issue the has_not_created logic, and the create commands too, and will not run the standard command unless hands are free. Needs more thinking about :

: receive {
   receive = [key, lamp]
   // Optional, if not provided then this command does nothing if we cannot receive
   on_hands_full {
      : print "Come back when you have some hands free, I have some things for you.";
   }
   : print "Here is the key to the shed";
}