ID:1887910
 
(See the best response by Kaiochao.)
If I have a bunch of objects in a list with different tags, is it possible for the list to reference the objects by their tags instead of their name?

Would be useful if you have a list of atoms with the same name but they're differentiated with their tag or some other var.
Best response
What do you mean by "reference the objects"? Lists don't use the "name" or "tag" variables.

Maybe you're talking about when you have an "input() in objects" where "objects" is a list of objects that may have the same name? In that case, you can use an associative list like so:
mob/verb/choose_poop()
// example setup: a list of 10 poops, each with a random tag
var objects[10]
for(var/n in 1 to objects.len)
var obj/poop = new
poop.tag = "poop [rand(1000, 9999)]"
objects[n] = poop

// problem: with an input() in objects, you can only choose "poop"
// solution: make all options unique
var object_choices[objects.len]
for(var/n in 1 to objects.len)
var datum/object = objects[n]
// e.g. "1. poop (1532)", "2. poop (4612)", "3. poop (7185)", etc.
object_choices["[n]. [object] ([object.tag])"] = object

var choice = input("pick something", "choice") in object_choices
if(choice)
var datum/object = object_choices[choice]
usr << "You chose [object] ([object.tag])."
Of course, it doesn't have to be "tag" and you can make it appear as whatever text you want.
I'd always add "as null|anything" to any input() from a list. Inputs should always be given a cancel option.