Hi there,
I am currently using the inventory system from the Twine Wiki
here.
I am currently using SugarCube because I love the responsive css which passes Google's Mobile Friendly Test, and the built-in save/load. For me, they're must-have. I was previously building in Harlowe, and used to have a far better inventory system found
here which was better in the sense that it was built to allow passages in which items could be dropped by use of the "drop" tag. Items could be picked up in one passage and then later dropped (and remain to be picked up again) in a different passage.
Currently I have the SugarCube inventory set to allow a drop via going to inventory, clicking on an item, and then in that item's passage a drop option using a click macro, like this:
<span id="Drop">\
<<click "Drop">>\
<<removeFromInv "An Unsigned Note">>\
<<replace "#Drop">>Dropped!<</replace>>\
<</click>>\
<span id="output"></span>\
It works, but the trouble is that when you drop an item in a different passage from where you found the item, it removes it from your inventory, but places it back in the passage you picked it up in. To the player this would need to be explained in the story to be some kind of magic in order for it to be plausible.
What would be the easiest way to modify the code from
here to better manage items so that they are not "attached" permanently to a given passage and can be picked up and dropped into any passage seamlessly? Attaching my current test story.
Thanks very much in advance for any help!
Comments
I might be able to re-work that extension to work with the wikis inventory system, but that's gonna take a bit.
I'm hardly objective though, so don't go taking my word for it. Maybe play around with my system a bit first. Someone else might also be able to come up with a simpler solution than what I have planned.
Example non-final code:
The original simple inventory just kind of ignored dropping as a rule because of the things you mentioned. It was possible, but that's about it. I'm going to work on making a new list macro that includes these <<dropinplace>> style links for you, which is why we need to have this register macro. Otherwise, we could just say:
But you won't be able to in the linked list.
It's coming along, but it'll take quite a bit of testing.
If you have the time, I'd wait for my container system, which should take a couple more days or so. If you don't have the time, I'd honestly just not let players drop things, unless it's extremely important to the mechanics of your game.
Knife *Drop*
Axe *Drop*
Water Bottle *Drop*
It would drop the items into the last gameplay passage before entering the inventory passage. The complication could be if someone is using it in a footer without a separate Inventory passage, it would have to know to drop the items right there in that passage.
Perhaps more trouble than it's worth and it's nothing critical or anything but would be a really cool feature.
Perhaps after this (meaning your containers work), you should rename it to, "Not So Simple Inventory". LOL
Thanks again Chapel!
If I don't, just keep an eye on the repository.