Is there a way to bring up a list of every object in the object tree? Like this:
mob/mob1
mob/mob2
mob/proc/mobs_in_tree(mob/M in mob_tree)
ID:178620
Apr 23 2002, 11:06 am
|
|
Apr 23 2002, 11:07 am
|
|
I think you're looking for typesof(). Look it up in the reference.
|
In response to Foomer
|
|
I just tried verbname(turf/T as turf in typesof(/turf)) but I do not get a list of turfs, in fact it does nothing. Am I doing something wrong?
|
In response to Loduwijk
|
|
mob/verb/create_turf() |
In response to Nadrew
|
|
Thank you, it would be useful if it worked as an arg in a proc though.
|
In response to Loduwijk
|
|
Loduwijk wrote:
Thank you, it would be useful if it worked as an arg in a proc though. I believe it does, but your parens were off: Change: (turf/T as turf in typesof(/turf)) To: (turf/T) in typesof(/turf) I took out "as turf" as it was redundant. |
In response to Skysaw
|
|
If I put that in instead for my verb it gives a "invalid proc definition" error. I suppose I will just have to do it in a list.
|
In response to Loduwijk
|
|
Loduwijk wrote:
If I put that in instead for my verb it gives a "invalid proc definition" error. I suppose I will just have to do it in a list. Don't give up. It will work. It sounds like you have an indentation error. Post the completed proc. |
I now have it working, but I put typesof(/atom), and that shows everything except mobs. Why does'nt that show mobs in the list?
|
In response to Loduwijk
|
|
Loduwijk wrote:
I now have it working, but I put typesof(/atom), and that shows everything except mobs. Why does'nt that show mobs in the list? hmm... that's an interesting question. Mobs are supposed to be derived from atom/movable, so it seems they should be in there. Perhaps there is some structural reason in the language that makes sense... time to ask Dantom. For now, I would use typesof(/mob) for that. |
In response to Skysaw
|
|
I tried typesof(/atom)+typesof(/mob) and that did not work. I used typesof(/mob) by itself to make sure that came up by itself, and it did, so I tried typesof(/mob)+typesof(/obj), which also worked. After doing all that I tried typesof(/mob)+typesof(/atom) which gave a list with mobs, but this time the areas were gone. I think that some are getting cut off because the list is too long. I am running some tests to see if that is the case.
|
In response to Skysaw
|
|
This is the way I have it now with the list:
mob/gm/verb/change_landscape() set category="GMcommands" var/build=input("What do you want to make?") in typesof(/atom)//it is called change landscape, but i change everything with it, not just turfs new build(usr.loc) This is the way I had it before that: mob/gm/verb/change_landscape(atom/A in typesof(/atom)) new A(usr) This is the way I had changed it to what you had: mob/gm/verb/change_landscape(atom/A) in typesof(/atom) new A(usr) I could only get the list one to work. |
In response to Loduwijk
|
|
Loduwijk wrote:
This is the way I have it now with the list: No wonder... that's not what I was suggesting at all. I brought up that syntax as a part of your input proc, before those changes, not as the argument string for the proc. |
In response to Skysaw
|
|
When you gave that example it was before anything was said about input, I had only mentioned proc args. You must have misunderstood me. I will right with more clarity next time. So, what is wrong with the way it is used as an argument (in the first one)?
<font size=1>[Edit]</font>I just went back over it, and you did post after the input was mentioned, but you were still refurring to the way I coded it, which was in a verb. |