ID:159548
 
Okay...First question is would this work:
//Programming
list("Create" = newlist(/mob)|list(1,1,1))


...and how would I call the second list?

If there's any better way tell me T_T.
What exactly are you trying to accomplish?
The | operator is invalid there...? And you'd access it just how you would any associated value.
In response to Koshigia (#1)
I'm trying to use a list to make a new mob and locate it.
In response to Kaioken (#2)
Nope, you can't use newlist on numbers...So what I'm trying to do is make the mob and whatever. Gahhh..I confused myself...
In response to Choka (#3)
Choka wrote:
I'm trying to use a list to make a new mob and locate it.

So why do you need the list with a mob already inside of it? You could make the list and add mobs to it as necessary?
In response to Koshigia (#5)
It's in a proc definition. Also I may have found the fix:
list(newlist(/mob)),1,1,1))

EDIT:
Yet again my fix is found:
list(new /mob,1,1,1))
In response to Choka (#6)
So why would you define the list and the singular mob at the same time? What are you doing with the list and mob? Maybe we can help you sort out a better solution?
In response to Koshigia (#7)
Solution was found.
If you're trying to position a mob, the best way would be to use a datum that stores coordinates. I love using datums for handling coordinates, sizes, etc. when they just can't fit where you need them.

<dm>
coord_3d
var {x;y;z;}
New(x2,y2,z2)
x = x2
y = y2
z = z2

var/list/positioning = list(/mob/npc = new coord_3d(1,1,1))

mob/verb/Make_from_list()
for(var/X in positioning)
var/coord_3d/C3D = positioning[X]
if(!C3D) CRASH("Bad coord datum") //feel free to replace this with continue, I prefer CRASH for testing
new X(C3D.x,C3D.y,C3D.z)
In response to Jeff8500 (#9)
You can't store coords when you're using a completely customizable proc. For instance:
<dm>
Procname(list("Text WHOA REALLY!?" = 10, "Yeah! Here he comes now!" = 15, "Create" = list(new /mob/freak, 1,1,1), "Text I JUST WANNA BE LUV'D!" = 15, "Text Awww...it's sooo hideous..." = 5))
In response to Choka (#10)
I truly can't see what that code attempts to do, but yes you can.

C3DWithMob
var {x;y;z;mob/M;list/other_attributes}
New(x2,y2,z2,mob/Slavegirl)
//blah blah blah
var/list/X = args-x2-y2-z2-Slavegirl
if(X.len) other_attributes = X //cuts down on resources, just in case we don't need it

var/list/Stuff = list("And the Dog" = 3,"Pleasured" = 9001,"The slave girl" = new C3DWithMob(1,1,1,new/mob/Slavegirl),\
"Joke from my friends' Latin class, don't ask")

mob/verb/process()
for(var/X in Stuff)
world << X
var/C3DWithMob/C = Stuff[X]
if(istype(C,/C3DWithMob))
C.M.loc = locate(C.x,C.y,C.z)
for(var/X in C3DWithMob.other_attributes)
world << X
else Spawner(X)

var/turf/start = locate("start")

proc/Spawner(n)
for(var/X in n)
new /mob/Dog(start)
In response to Jeff8500 (#9)
Sure, a datum would work, but IMO using datums for mere coordinates is a little 'over-datumifized'. :P You might as well just use another list instead and spare yourself the object definition, maybe I'd just put the coords in a string or something which you could parse when needed; or you could include the coords directly in your list after the mob and read that. Or something else.
In response to Kaioken (#12)
I like 'over-datumizing'. It keeps things organized :P. Sure, it's overkill, but it keeps things laid out for you rather nicely; in that snippet, though, I kind of compacted etc. it to spare time.
In response to Jeff8500 (#11)
I fixed it already... Kaioken helped me, I just have to make the mob new while it's still in the list.

And no, you can't really define variables inside of the arglists/definitions of a proc. Predefining would just be a waste.

And I do see what you mean, but if I did that you'd have to make the new() for every object to spawn to a loc depending on it's New() functions. I was creating a create verb which could be accessed via list associations.
In response to Choka (#14)
For line #2: No, you don't predefine, you use a separate list for things I like to call "other_attributes" :P. My method may save a bit of memory, as well, depending on the size of a list vs. a datum internally.

For line #3: I didn't understand your first sentence at all. New() should not be involved in locating a movable atom, at all. Maybe I made a typo or something, but all you need is locate() and the coordinates to locate one. Also, that could be accessed via list associations, but you're also using objects, so you need to typecast.