User Tools

Site Tools


twine2:add_an_inventory_system

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
twine2:add_an_inventory_system [2017/02/10 21:06]
ateyourlembas
twine2:add_an_inventory_system [2017/10/09 20:39] (current)
Line 5: Line 5:
 (If you're using another story format in Twine 1.x, you have to replace every instance of '​state.active.variables'​ in the the below code with '​state.history[0].variables'​.) (If you're using another story format in Twine 1.x, you have to replace every instance of '​state.active.variables'​ in the the below code with '​state.history[0].variables'​.)
  
-They will require significant modification to work in Harlowe or Snowman on Twine 2.x.+They will require significant modification to work in **Harlowe** or **Snowman** on Twine 2.x.
  
 <​code>//​ Begin Inventory Macros <​code>//​ Begin Inventory Macros
Line 18: Line 18:
 // 2. In a passage, check if there'​s an item in the inventory.. // 2. In a passage, check if there'​s an item in the inventory..
 // ...if so, give the user a choice to progress to a new passage: // ...if so, give the user a choice to progress to a new passage:
-// <<if $inventory.indexOf("​The Golden Key"​) ​== -1>>​[[Unlock the door.]]<<​endif>>​+// <<if $inventory.indexOf("​The Golden Key"​) ​!= -1>>​[[Unlock the door.]]<<​endif>>​
 // //
 // 3. To add an "​Inventory"​ link in your sidebar menu, create a passage named "​StoryMenu"​. // 3. To add an "​Inventory"​ link in your sidebar menu, create a passage named "​StoryMenu"​.
twine2/add_an_inventory_system.1486778780.txt.gz ยท Last modified: 2017/10/09 20:38 (external edit)