To deal with multiple items, you need to use lists, as they allow you to iterate (cycle) through all of the items (via using 'foreach' Function) and act or don't act upon them depending on if they match or don't match your conditions (your 'if' scripts).
--------------------------
IMPORTANT NOTE:
when adding~putting Objects into an Objectlist Attribute (or when getting~creating an Objectlist containing Objects), those Objects are
*NOT* physically moved into the Objectlist. Think of an Objectlist Attribute as like a PE class student roster (a piece of paper with the PE students names on it, NOT the actual physical students themselves on the paper roster, lol), which can be used to do actions upon those Objects, but the Objects themselves remain physically where-ever they are located at, despite their names being put into~onto the roster~Objectlist Attribute, (unless the action you're doing is a 'MoveObject' Function that moves an Object to inside of another Object, of course). An Object can NEVER physically be inside or put into an Objectlist.
------------------------
These two Functions below, will put all of the desired (see~read the differences between the two functions below) items in an Object, into an objectlist:
http://docs.textadventures.co.uk/quest/ ... ldren.htmlhttp://docs.textadventures.co.uk/quest/ ... jects.htmlif you want to do the same for specifically the Player Object, you can use this too:
http://docs.textadventures.co.uk/quest/ ... ntory.htmlor, if you want~need to (or can: the very lazy way, lol), you can use an objectlist containing every single object in your entire game:
http://docs.textadventures.co.uk/quest/ ... jects.html------------------
As for the water issue, the best way (or you can use the 'not' negation keyword instead) would be to give your Objects an Attribute that distinguishes that Object as a water vs non-water/other Object, for example (using a String Attribute as it gives more versatility, but if you rather you can use a Boolean Attribute too, or there's also using an Object Type and its Inherited Attribute, too):
using a String Attribute:
(Object Name: fresh_water)
Attribute Name: type_of_object
Attribute Type: string
Attribute Value: water
(Object Name: dirty_water)
Attribute Name: type_of_object
Attribute Type: string
Attribute Value: water
(Object Name: holy_water)
Attribute Name: type_of_object
Attribute Type: string
Attribute Value: water
(Object Name: poisoned_water)
Attribute Name: type_of_object
Attribute Type: string
Attribute Value: water
(Object Name: cocacola)
Attribute Name: type_of_object
Attribute Type: string
Attribute Value: soda
(Object Name: pepsi)
Attribute Name: type_of_object
Attribute Type: string
Attribute Value: soda
(Object Name: rootbeer)
Attribute Name: type_of_object
Attribute Type: string
Attribute Value: soda
(Object Name: green_tea)
Attribute Name: type_of_object
Attribute Type: string
Attribute Value: tea
(Object Name: black_coffee)
Attribute Name: type_of_object
Attribute Type: string
Attribute Value: coffee
using a Boolean Attribute:
(Object Name: fresh_water)
Attribute Name: IsWater
Attribute Type: boolean
Attribute Value: true
(Object Name: dirty_water)
Attribute Name: IsWater
Attribute Type: boolean
Attribute Value: true
(Object Name: holy_water)
Attribute Name: IsWater
Attribute Type: boolean
Attribute Value: true
(Object Name: poisoned_water)
Attribute Name: IsWater
Attribute Type: boolean
Attribute Value: true
(Object Name: cocacola)
Attribute Name: IsWater
Attribute Type: boolean
Attribute Value: false
(Object Name: pepsi)
Attribute Name: IsWater
Attribute Type: boolean
Attribute Value: false
(Object Name: rootbeer)
Attribute Name: IsWater
Attribute Type: boolean
Attribute Value: false
(Object Name: green_tea)
Attribute Name: IsWater
Attribute Type: boolean
Attribute Value: false
(Object Name: black_coffee)
Attribute Name: IsWater
Attribute Type: boolean
Attribute Value: false
using an Object Type (Inherited Attribute):
Object Type Name: water_type
Object Type Attribute(s): (optional, but not necessary to add~create any for just this 'water vs non-water' differentiation)
Object Type Name: soda_type
Object Type Attribute(s): (optional, but not necessary to add~create any for just this 'water vs non-water' differentiation)
Object Type Name: tea_type
Object Type Attribute(s): (optional, but not necessary to add~create any for just this 'water vs non-water' differentiation)
Object Type Name: coffee_type
Object Type Attribute(s): (optional, but not necessary to add~create any for just this 'water vs non-water' differentiation)
(Object Name: fresh_water)
Inherited Attribute: water_type
(Object Name: dirty_water)
Inherited Attribute: water_type
(Object Name: holy_water)
Inherited Attribute: water_type
(Object Name: poisoned_water)
Inherited Attribute: water_type
(Object Name: cocacola)
Inherited Attribute: soda_type
(Object Name: pepsi)
Inherited Attribute: soda_type
(Object Name: green_tea)
Inherited Attribute: tea_type
(Object Name: black_coffee)
Inherited Attribute: coffee_type
------------------------------------------
which allows you to check for this Attribute and its Value, via an 'if' Script inside of the 'foreach' Function...
the examples below is now showing the complete scripting coding (you got to still actually create the Objects and Attributes as shown above, of course) for doing what you want:
using String Attributes:
objectlist_variable = GetDirectChildren (small_sack)
foreach (object_item, objectlist_variable) {
if (GetString (object_item, "type_of_object") = "water") {
RemoveObject (object_item)
} else if (GetString (object_item, "type_of_object") = "soda") {
msg ("You drink the soda, Aaahhh, so good!")
} else if (GetString (object_item, "type_of_object") = "tea") {
msg ("Tea is not your favorite drink, but you can handle it")
} else {
msg ("(You spit out the coffee, as you can't stand the stuff!)")
}
}
using Boolean Attributes:
objectlist_variable = GetDirectChildren (small_sack)
foreach (object_item, objectlist_variable) {
if (GetBoolean (object_item, "IsWater")) {
RemoveObject (object_item)
} else {
msg ("You drink down the liquid regardlessly, even if it's coffee...")
}
}
using Object Types (Inherited Attributes):
objectlist_variable = GetDirectChildren (small_sack)
foreach (object_item, objectlist_variable) {
if (DoesInherit (object_item, "water_type")) {
RemoveObject (object_item)
} else if (DoesInherit (object_item, "soda_type")) {
msg ("You drink the soda, Aaahhh, so good!")
} else if (DoesInherit (object_item, "tea_type")) {
msg ("Tea is not your favorite drink, but you can handle it")
} else {
msg ("(You spit out the coffee, as you can't stand the stuff!)")
}
}