Educational > Twine

Twine hack: inventory

<< < (2/2)

Milici:

--- Quote from: loopernow on December 18, 2014, 10:53:51 PM ---Is there a way to add more than one item to $carrying?


--- End quote ---

Hey guys does anyone know the answer to this?

Chris:

--- Quote from: loopernow on December 18, 2014, 10:53:51 PM ---Is there a way to add more than one item to $carrying?

Is there a way to remove an item, but not all items, from $carrying?

Is there a way to see if one item out of several is in $carrying?

--- End quote ---

Maybe this? I haven't tested it.


--- Code: ---<<set $carrying={'potions':0}>>
(all numbered items must be counted)

<<set $carrying['potions'] += 1>>
(This is code for "I picked up 1 potion.")
<<set $carrying['potions'] -= 1>>
(This is code for "I dropped 1 potion.")

<<if $carrying['potions']>>
You are carrying at least 1 potion.
<<endif>>
--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version