You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 13, 2020. It is now read-only.
Hello! I am finding that character.inventory.removeItem() does not work, at least for me. Here is a short story that should show that removeItem() doesn't work:
Home
You are standing in a grassy field.
<%if(!character.inventory.hasItem("sword")){%>
A sword lies here.
[[Take sword.|Take]]
<%}else{%>
You wield a sword.
[[Drop sword.|Drop]]
<%}%>
Take
<%character.inventory.addItem("sword");%>
You take the sword.
[[Continue.|Home]]
Drop
<%if(character.inventory.removeItem("sword")){%>
You put the sword down.
<%}else{%>
ERROR: character.inventory.removeItem("sword") failed!
character.inventory.indexOf("sword") is <%=character.inventory.items.indexOf("sword")%>.
<%}%>
[[Continue.|Home]]
This will print:
ERROR: character.inventory.removeItem("sword") failed! character.inventory.indexOf("sword") is -1.
The text was updated successfully, but these errors were encountered:
Hello! I am finding that character.inventory.removeItem() does not work, at least for me. Here is a short story that should show that removeItem() doesn't work:
Home
Take
Drop
This will print:
ERROR: character.inventory.removeItem("sword") failed! character.inventory.indexOf("sword") is -1.
The text was updated successfully, but these errors were encountered: