Oh, that's awesome! I saw you mention working on a system for equipping items and clothes with a mannequin to alter stats while I was trolling through questions and I'm super excited for that because all of that has gone over my head so far lol.
One more question if you don't mind? I tried to input the cases I had had in my original inventory. They aren't working properly for some reason? If my inventory is
apple [ inspect | eat | toss all ]
apple pie [ inspect | eat | toss all ]
belt [ inspect | eat | toss all ]
and I click on "eat" for apple, "apple pie" is what's deleted. If I click "inspect" for apple or apple pie, I get the description for belt, or whatever's the last item on the list.
This is my code for my inventory:
:: inventory widget [widget nobr]
<<widget "secondinv">>
<span id="inventory"><<include "secondinv">></span>
<</widget>>
:: secondinv
<div id="inventory">
<<include "last meal">>
<<include "hunger">>
<<include "body">>
<<set _tempItems = UInv.GetItemsArraySortedByProperty("backpack", "plural")>>\
<<if _ItemsName == 0>>
Your backpack is empty.
<<else>>
Your backpack contains:
<<capture _i>>
<<for _i, _ItemName range _tempItems>>\
<<set _quant = UInv.BagHasItem("backpack", _ItemName)>>\
<<if _quant == 1>>\
<<set _tempName = UInv.GetItemPropertyValue("backpack", _ItemName, "name")>>\
<<else>>\
<<set _tempName = UInv.GetItemPropertyValue("backpack", _ItemName, "plural")>>\
<</if>>\
<<if UInv.ItemHasProperty("backpack", _ItemName, "expires")>>\
_tempName <<if _quant gt 1>>(_quant)<</if>>
(expires in: <<=UInv.GetItemPropertyValue("backpack", _ItemName, "expires")>> days)
<<else>>\
_tempName <<if _quant gt 1>>(_quant)<</if>>
<</if>>\
[
\<<link "inspect">>
\<<run alert(UInv.GetItemPropertyValue("backpack", _ItemName, "description"))>>
\<</link>>
\<<switch UInv.GetItemPropertyValue("backpack", _ItemName, "type")>>
\<<case "food">>
\ | <<link "eat">>
<<if UInv.GetItemPropertyValue("backpack", _ItemName, "nutrition") is 1>><<hunger -2>><<eat>>
<<elseif UInv.GetItemPropertyValue("backpack", _ItemName, "nutrition") is 2>><<hunger -10>><<eat>>
<<elseif UInv.GetItemPropertyValue("backpack", _ItemName, "nutrition") is 3>><<hunger -20>><<eat>>
<</if>> \
<<set UInv.DeleteItem("backpack", _ItemName, 1)>>\
<<replace "#inventory">><<include "secondinv">><</replace>>\
\<</link>>
\<<case "drink">>
\ | <<link "drink">>
<<if UInv.GetItemPropertyValue("backpack", _ItemName, "nutrition") is 1>><<hunger -2>>
<<elseif UInv.GetItemPropertyValue("backpack", _ItemName, "nutrition") is 2>><<hunger -10>>
<<elseif UInv.GetItemPropertyValue("backpack", _ItemName, "nutrition") is 3>><<hunger -20>>
<</if>> <<set UInv.DeleteItem("backpack", _ItemName, 1)>>
<<replace "#inventory">><<include "secondinv">><</replace>>\
\<</link>>
\<<case "clothes">>
\ | <<link "wear">>
\/* wear clothing */
<<set UInv.SetItemPropertyValue("backpack", _ItemName, "wearing", "yes")>>\
<<set UInv.MoveItem("backpack", "body", _ItemName, 1)>>\
\<<replace "#inventory">><<include "secondinv">><</replace>>
<</link>>\
\<<case "weapons">>
\ | <<link "equip">>
\/* equip weapons */
<</link>>\
\<<default>>\
\/* handle default switch case here */
\<</switch>>
\ | <<link "toss all">>
<<set UInv.DeleteItem("backpack", _ItemName)>>\
<<replace "#inventory">><<include "secondinv">><</replace>>\
\<</link>>
\ ]
/* NECESSARY SPACE */
<</for>>
<</capture>>
<</if>>
</div>\
<<link "bookstore boi">><<goto "bookshop">><</link>>
:/ not sure what i borked up