Is there any way to implement an inventory system with Harlowe? It'd be kind of doofy to write a story with 3 different lines for various inventory settings in my story, but I can always write it differently too I suppose.
Or is there a way to change what I'm using in Twine that's compatible with some pre-made inventory script?
I did use the search function but since I just started using Twine everything is pretty much flying over my head. I did read the wiki and look at the inventory stuff on there but I read that code there is just for SugarCube and I'm pretty sure the default Twine is using Harlowe unless I read something wrong.
Comments
Just use the Change Story Format option within the menu accessed via clicking on the upward facing arrow in the lower left corner of the Story Map.
Now I just need to figure out how to use the inventory code correctly, it just came up with a bunch of boxes... hm.
So, with a pack on your back full of...
My most needed essentials!
Everything I could fit into my pack that I wanted to take with me.
A bare pack with just some food for the trip, and camping supplies.
Is it possible to make 3 separate inventories with the code from http://twinery.org/wiki/twine2:add_an_inventory_system or no? I'd like the items to affect the beginning of the adventure and then merge into a later piece but I'm not sure if that's possible.
Edit: I'm also fiddling with the code for SugarCube for the inventory from that webpage but apparently it's not working correctly, or I'm not using it in the correct way.
I just found the story javascript -_- I was placing it in a new passage window... I'll try it again.
Alright, now how do I go about making 3 separate ways for a story to progress with 3 separate sets of inventory items?
Now how to make the inventory list actually show up as a list and not just a line of items... would be nice to get the underscores for the item names to disappear as well.
Is this a correct if statement? I want to make it so an option will show up, if the Stuffed_Rabbit is in the inventory.
Don't use them? Seriously, there's no reason to use them in the first place if you don't want to.
If I don't use the underscores the whole item name doesn't show up. Like, if I did "Hardened Cheese", it just shows up as "Hardened"?
Thanks for the help guys, I appreciate it quite a lot. I'm having a lot of fun writing and it's more fun than I've had writing in a long time.
Unfortunately this also throws me an error: Error: <<if>>: bad conditional expression in <<if>> clause: Cannot read property 'contains' of undefined
Crap, now my other inventory links are messing up as well... buhhhhh. Also yes, I am using SugarCube since that seems to work best for inventory stuff. Also now all of my <<addToInv>> macros are throwing: Error: cannot execute macro <<addToInv>>: Cannot read property 'indexOf' of undefined. (Also I'm literally sitting at my computer waiting for replies all day today lol)
Also, what other inventory links?
You must quote item names if they contain spaces. In fact, there's no reason not to quote all item names, really. For example: And:
Huh, no. I have <<initInv>> in the beginning, it's been there the whole time, I haven't touched it. I had it in my first passage of my story and it was working fine up until now for some reason. It actually buggered up after I put in your list code, so I just re-pasted it without the list code and it's still being weird.
I have another section of my story that has multiple items being added to the inventory, more than 3 anyway. The first section I was working on had <<addToInv Bread>> <<addToInv Waterskin>> and <<addToInv Hardened Cheese>>, and adding quotes around them didn't do anything for the errors, but I'll keep that in mind, thanks.
I added a StoryInit passage before the beginning of my story but that didn't do anything. In fact it gives me a pop-up that says...
Never mind, it was the StoryInit passage. I'm going to paste the list code in and see what happens. I deleted it because I thought I didn't need it since I had the <<initInv>> in my first page but I guess the StoryInit is important -_-.
Now the stuffed rabbit thing is back, it shows a connection to the passage, but the link isn't there.Never mind, I had to add the rabbit back to the inventory. Ah yes finally. Thanks much!By default SugarCube does not have an inventory system, the code (from the other thread) that you pasted in to the StoryInit passage was adding that feature to your story.
Also thank you @greyelf for that explanation.
If your inventory is a single passage then you have to basic macro options you can use either the <<back>> macro or the <<return>> macro.