// Define the dictionary outside any proc or verb
var/dictionary object_categories = new{
// Initialize the dictionary with category names as keys and empty lists as values
object_categories["Entertainment"] = list()
object_categories["Movies"] = list()
object_categories["TV Shows"] = list()
}
mob
User
verb
Info()
usr << "Hello [src], welcome to OrBlitz AI! In order to speak to the AI, click the Speak Button below."
usr << "If you would like to teach the AI, click Teach."
usr << "The AI can learn through conversation as well as learning about object structures."
Teach()
var/d = input("OrBlitz: What would you like to teach me?", "User Interface") in list("--OBJECT--", "--CONVERSATION--", "--EXIT--")
if (d == "--EXIT--") // Corrected to "--EXIT--" with all uppercase letters
return 1
if (d == "--OBJECT--")
usr << "<b>OrBlitz:</b> These are the Categories I am aware of: " + object_categories.keys()
switch(alert("Would you like to teach me something about these CATEGORIES?", "User Interface", "Yes", "No")) // Wrapped alert() with parentheses
if ("Yes")
var/e = input("What is the name of the CATEGORY?", "User Interface") as text
if (e in object_categories)
var/object_name = input("What is the name of the OBJECT?", "User Interface") as text
if (!object_name in object_categories[e])
object_categories[e].Add(object_name)
usr << "<b>OrBlitz:</b> [object_name] has been added to the [e] category."
else
usr << "<b>OrBlitz:</b> [object_name] is already in the [e] category."
else
usr << "<b>OrBlitz:</b> [e] is not a valid category."
if ("No")
return 1
else return 1
Problem description: It compiles but states object_categories undefined variable, I want to be able to teach my AI the difference between a Movie and a TV Show.
There is no dictionary class in DM, only associative lists.