//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.
ID:159548
Feb 19 2009, 4:14 pm
|
|
Okay...First question is would this work:
//Programming ...and how would I call the second list? If there's any better way tell me T_T. |
Feb 19 2009, 4:19 pm
|
|
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
|
|
I'm trying to use a list to make a new mob and locate it.
|
In response to Kaioken
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
coord_3d |
In response to Jeff8500
|
|
You can't store coords when you're using a completely customizable proc. For instance:
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
|
|
I truly can't see what that code attempts to do, but yes you can.
C3DWithMob |
In response to Jeff8500
|
|
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
|
|
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
|
|
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
|
|
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. |