Hi! :)
I'm using Twine 2 / Sugarcube 2.
So I don't know much about coding, but I've been playing around with a game that relies heavily on gathering and swapping items with those items being a big part of what options are available.
The problem is all the tutorials I've been using haven't answered one of my crucial questions. How to use all the item variables I've created to display options based on certain items in your inventory.
So I have started making a bunch of items as per below:
<<set $inventory = []>>
<<set $toolkit = {
"name" : "Toolkit",
"description" : "A small leather toolkit meant for repairing your chemistry tools.",
"weight" : 5.0,
"material" : "metal",
"edible" : false,
"drinkable" : false,
"physProtect" : false,
"elmProtect" : false,
"flammable" : false,
"sparkable" : true,
"weapon" : true,
"trapPart" : true,
"repair" : true,
}>>
Now I'm aware the below is not code, but I'm drawing a blank as to what to do or even if I'm explaining myself correctly so I thought I'd add it to show what I mean.
You look in your bag for something to throw as a distraction.
<<if any item under "weight" lte 4.0 or "trapPart" = true >>
[[Attempt distraction by throwing $ITEM]]
repeat for all possible items
remove item from inventory
<</if>>
[[Stay silent and wait for him to move on]]
I guess my questions is is this possible and can anyone link me a tutorial or something that explains how I would do this in very simple terms?
Thanks