this is just the basics of checking the inventory for an item (in case you don't know already), but I'm unable to help any further, as Sora's Stackable library is beyond my ability~understanding, I can't help you past this basic way of checking an item in your inventory (or whatever ObjectList Attribute):
http://docs.textadventures.co.uk/quest/ ... tains.htmlhttp://docs.textadventures.co.uk/quest/ ... tains.htmlhttp://docs.textadventures.co.uk/quest/ ... tains.htmlObject Lists (and~or important String Lists, which aren't for this topic but useful to know, aka: displayverbs, inventoryverbs):
http://docs.textadventures.co.uk/quest/ ... jects.htmlhttp://docs.textadventures.co.uk/quest/ ... jects.htmlhttp://docs.textadventures.co.uk/quest/ ... ldren.htmlhttp://docs.textadventures.co.uk/quest/ ... ments.html (displayverbs, inventoryverbs)
http://docs.textadventures.co.uk/quest/scopes.htmlhttp://docs.textadventures.co.uk/quest/ ... ntory.htmlhttp://docs.textadventures.co.uk/quest/ ... y/got.htmlyou may want to take a look at these two list+dictionary guides of mine as well:
viewtopic.php?f=18&t=5137 (guide on using lists and dictionaries)
viewtopic.php?f=18&t=5138 (you can see how the 'contains~listcontains~dictionarycontains' works in this, I think)
----------
an example syntax-code would be:
the Stack (conceptual "container", but NOT an actual Object Type: container) Object:
Object0: life_50_potion_stack
Alias0: life 50 potion stack
// initial setting of its Integer Attribute, quantity: life_50_potion_stack.quantity = 0 // or whatever you want
// Final Displayed Alias0: life 50 potion stack (quantity)*
the Individual Objects:
Object1: life_50_potion_1 // it restores your current life by +50
Alias1: life 50 potion
Object2: life_50_potion_2
Alias2: life 50 potion
etc etc etc
* see below:
http://docs.textadventures.co.uk/quest/ ... alias.htmllife_50_potion_stack.alias = GetDisplayAlias(life_50_potion_stack) + "(life_50_potion_stack.quantity)"
// GetDisplayAlias (life_50_potion_stack) --> life 50 potion stack
// + "(life_50_potion_stack.quantity)" --> (quantity, let's say it's: 99)
// life_50_potion_stack.alias = GetDisplayAlias(life_50_potion_stack) + "(life_50_potion_stack.quantity)" --> life 50 potion stack (99)
<turnscript name="global_turnscript">
<enabled />
<script>
foreach (object_variable, ScopeInventory()) {
if (object_variable.alias = "life 50 potion") {
life_50_potion_stack.quantity = life_50_potion_stack.quantity + 1
destroy (object_variable.name)
}
}
<script>
</turnscript>