ID:170054
 
Is there a way to create an associative list where the associations are lists themselves?

Example:

/list/links["Tavern"=["room","3_tavent","Stroll to the tavern"],"Sewers"=["room","4_sewent","Open the manhole in the middle of the street and enter the sewers."]]

The above is a two parameter list where both parameters are associated with lists of 3 text strings, each.

=$= Big J Money =$=
Sure you can!

Of course, alot of times, it's easier to have a datum than have such bloated lists.

var/list/links = list(\
"Tavern" = list("room","3_tavent","Stroll to the tavern"),\
"Sewers" = list("room","4_sewant_",\
"Open the manhole in the middle of the street and enter the sewers."))
In response to Wizkidd0123
Thanks for the reply.

Thanks for the advice too, which I normally would use, but in my particular case, this is the better way. Mainly because I don't want to mess with creating variables on an object at run-time; not these objects anyway. If you know a better way, what I'm trying to do is make Creatable Menus. This is so builders can make menu-based MUD areas if they so desire. The complicated lists are for the menu items. This way they can make whatever they want. A tavern menu item or a volcano menu item. Each menu item stores values for its name, description the base_type of item it is (room reference, menu reference, misc action) and then finally a special value that is used with the base_type.

If it sounds too weird, don't even worry about it. This is my mess.

=$=
In response to BigJMoney
BigJMoney wrote:
A tavern menu item or a volcano menu item. Each menu item stores values for its name, description the base_type of item it is (room reference, menu reference, misc action) and then finally a special value that is used with the base_type.

I still don't quite understand you, but it seems like you could easily use something like this:

menu_item
var
name
desc
room_ref
menu_ref
misc_action
In response to Wizkidd0123
There's also this way:

var/List_Name["Blargh"]=list("Hello"=list(),"Mine!"=list())


In response to Wizkidd0123
Yes, I can. I think I was in some kind of weird daze, and that's why I was thinking I had to have it the other way.

=$=