Example:
A
verb/give_this_verb(mob/player/p in world)
p.verbs += typesof(/A/verb)
ID:264670
Feb 26 2010, 1:02 am
|
|
I'm having a little trouble doing something in a datum's verb. I'm am trying to give a player the ability to give a player verbs from that type that the verb is in. I seem to be getting an error though.
Example: A |
That looks like an actual compiler issue - the compiler might not be able to handle references to a verb within that verb.
You might be able to deal with it like this: var/list/A_verbs Obviously not ideal, but might be a functioning workaround. Note: I haven't tested this. |
In response to Jp
|
|
I was thinking of something else recently. I have multiple datums, each one parents the next. Say the last one is named C, could I do something like,
mob/verb/get_verbs() to gain all verbs in my datums? This would be the most ideal work around if possible. (I probably have to create a new instance of /C then delete after using it.) |
In response to Ulterior Motives
|
|
Is there an infinite cross-reference? If no, you can probably do it.
This compiles: mob This does not compile: mob This compiles: world/New() So does this, incidentally: mob So there are your workarounds. |
In response to Jp
|
|
Okay, I'll have to mess around with it some.
mob This will compile as well. ;) |
In response to Ulterior Motives
|
|
Yeah, but the workarounds I suggested will probably work. :P
Interestingly enough, this compiles: mob And so does this: mob Not this, though (should be analogous to verb situtation) mob Looks like it's something to do with the way typesof is compiled in and proc/verb definitions. Any proc or verb definition that contains a typesof() containing itself will throw the error. Procedures and verbs that recurse the definitions also don't compile: mob Probably those typesof() lists are generated at compile-time (Well, they're known at compile time) and it's done at the same time that the list of procedure definitions is compiled. (That code you've suggested doesn't actually compile. It crashes Dream Maker, actually. But I think you knew that.) And while we're talking about odd DM code that compiles: /?/proc/\((\"){var/\\\<;world<<\\\<<\"} EDIT: Replaced incoherent punctuation code with slightly different incoherent punctuation code. |
In response to Jp
|
|
I did this to get all the verbs I needed.
C And yes I knew that dream maker becomes non-responsive when entering that. Oddly enough giving a datum the same parent_type to which it's type is already, gives you an error instead. I've seen many weird things compile. For instance I decided to try to help someone out on this fangame they had. The indentation was all wrong through the whole code. Some things had tabs, some didn't, some had weirdly placed tabs like: somethingsomething else I changed one line an got over 90 indentation errors(all in one, longer than need procedure of course. =)). The whole thing fell apart like that, how it compiled before I have no clue. |
Maybe it would be easier to locate that ability within the mob itself.
Instead of datum/verb*give verb*
Mob/verb*give verb*