Object list?
Quantus
18 Feb 2016, 21:53Is it possible to create a list that contains a large number of objects? So, if anything in that list is visible you can do a certain thing? Or so you can call an object out of the list and place it in a room?
HegemonKhan
18 Feb 2016, 22:38I'm not sure why, but the 'objectlist' Attribute, isn't found in the GUI~Editor's options for Attribute Types, but it certainly exists in quest, even if not in direcly in the GUI~Editor.
String Lists and Object Lists work pretty much the same, and are set up the same, nearly identical in every way, except the Objects you name/use in lists, must actually exist of course. Also, note that Objects (Objects' Names) as Values, do NOT have double quotes, while strings DO have double quotes.
So, you got to manually script one in using the GUI~Editor's 'set a variable or attribute' Script (or go into code and do it that way, either as scripting or as a 'creation' tag):
run as script -> add new script -> variables -> 'set a variable or attribute' Script -> [expression] -> (see below, for example)
// cat, hat, and bat are al Objects that you created already
set variable game.mylist = [expression] split ("hat; bat; cat", ';')
// the 'split' Script~Function is a quick~east way to create a list (both a string list and an object list)
// there's also the 'NewObjectList' ( and 'NewStringList' ) too.
---------
and to manipulate/use lists:
http://docs.textadventures.co.uk/quest/ ... lists.html
http://docs.textadventures.co.uk/quest/scopes.html (these are built-in-generated object lists)
http://docs.textadventures.co.uk/quest/ ... ments.html (this mentions briefly about the lists for/with/of your Objects' Verbs)
--------------
Pixie's guide on using the 'displayverbs' and 'inventoryverbs' lists:
viewtopic.php?f=18&t=5023
--------------
here's a guide I wrote on using lists:
viewtopic.php?f=18&t=5137
--------------
lastly, you are NOT actually putting/moving an Object physically into (and thus also not out of) an Object list, ... think of a list as like a pe class roster, the students aren't actually on the piece of paper roster (lol), only their names are on the paper. However, the pe school coach-teacher can use that roster to bark orders at those students. That's a pretty good analogy I hope for understanding on Object Lists work.
------------
"Is it possible to create a list that contains a large number of objects? (Quentus)"
the lazy way (don't use this unless you have to, or unles you got very few objects in your game, lol):
http://docs.textadventures.co.uk/quest/ ... jects.html
this is a built-in-generated list of *ALL* Objects in your game
it's a good way for searching/checking if an Object exists (which you can then act upon), for example with Commands involving the person type in an Object's name/alias, you can use 'AllObjects()' to see if there's a match between what the person typed-inputted-in and what Objects exist in the game, for example:
String Lists and Object Lists work pretty much the same, and are set up the same, nearly identical in every way, except the Objects you name/use in lists, must actually exist of course. Also, note that Objects (Objects' Names) as Values, do NOT have double quotes, while strings DO have double quotes.
So, you got to manually script one in using the GUI~Editor's 'set a variable or attribute' Script (or go into code and do it that way, either as scripting or as a 'creation' tag):
run as script -> add new script -> variables -> 'set a variable or attribute' Script -> [expression] -> (see below, for example)
// cat, hat, and bat are al Objects that you created already
set variable game.mylist = [expression] split ("hat; bat; cat", ';')
// the 'split' Script~Function is a quick~east way to create a list (both a string list and an object list)
// there's also the 'NewObjectList' ( and 'NewStringList' ) too.
---------
and to manipulate/use lists:
http://docs.textadventures.co.uk/quest/ ... lists.html
http://docs.textadventures.co.uk/quest/scopes.html (these are built-in-generated object lists)
http://docs.textadventures.co.uk/quest/ ... ments.html (this mentions briefly about the lists for/with/of your Objects' Verbs)
--------------
Pixie's guide on using the 'displayverbs' and 'inventoryverbs' lists:
viewtopic.php?f=18&t=5023
--------------
here's a guide I wrote on using lists:
viewtopic.php?f=18&t=5137
--------------
lastly, you are NOT actually putting/moving an Object physically into (and thus also not out of) an Object list, ... think of a list as like a pe class roster, the students aren't actually on the piece of paper roster (lol), only their names are on the paper. However, the pe school coach-teacher can use that roster to bark orders at those students. That's a pretty good analogy I hope for understanding on Object Lists work.
------------
"Is it possible to create a list that contains a large number of objects? (Quentus)"
the lazy way (don't use this unless you have to, or unles you got very few objects in your game, lol):
http://docs.textadventures.co.uk/quest/ ... jects.html
this is a built-in-generated list of *ALL* Objects in your game
it's a good way for searching/checking if an Object exists (which you can then act upon), for example with Commands involving the person type in an Object's name/alias, you can use 'AllObjects()' to see if there's a match between what the person typed-inputted-in and what Objects exist in the game, for example:
get input {
user_input_variable = result
foreach (object_variable, AllObjects()) {
if (user_input_variable = object_variable.name or user_input_variable = object_variable.alias) {
msg (user_input_variable + "exists in the game")
} else {
msg ("Sorry, but, " + user_input_variable + ", doesn't exist. Maybe you typed it's name or alias in wrong...")
}
}
}