verb
set category = "Speech"
say(mesg as text)
world << "[usr.key]: [mesg]"
Problem description:I don't understand why im getting an error. It says mobs.dm:14:error:set :invalid proc definition. Any help would be good thank you ^_^
ID:145980
Oct 18 2005, 2:39 pm
|
|
Code:set category
verb Problem description:I don't understand why im getting an error. It says mobs.dm:14:error:set :invalid proc definition. Any help would be good thank you ^_^ |
Obvously Nick hasnt contributed much to these forums and doesnt know that you have to explain what you are actually doing so newbies can understand.
Ok, well basically you have put set category in the wrong place. Here is what you should do. Oh and Nick, when you are posting code use '
' and '
verb I hope this can help you. |
In response to ADT_CLONE
|
|
ADT_CLONE wrote:
Obvously Nick hasnt contributed much to these forums and doesnt know that you have to explain what you are actually doing so newbies can understand.
' and '
> verb I hope this can help you. Bah, dont use usr. Use src, much better. I am sure many people have discussed this before. |
In response to XxDohxX
|
|
Bah, dont use usr. Use src, much better. I am sure many people have discussed this before. Actually usr in verbs are OKay! |
In response to Crzylme
|
|
Yes, they work. But using usr in verb will lead to usr in procs which is a no-no.
|
In response to Rky_nick
|
|
Thanks for the help :)
I was wondering if you could explain why you can't use [usr.key] and why you should use [src.key] |
In response to XxDohxX
|
|
XxDohxX wrote:
Yes, they work. But using usr in verb will lead to usr in procs which is a no-no. Yes but you telling him NOT to use usr in a verb when its okay to. I've had many problems in which I COULD NOT use src in a verb thus making the verb useless. |
In response to Seriphin
|
|
Seriphin wrote:
I was wondering if you could explain why you can't use [usr.key] and why you should use [src.key] http://www.byondscape.com/ascape.dmb/LummoxJR.2002-1104/ Try reading this. It'll tell you what you need to know. |
In response to Crzylme
|
|
no usr in verbs O.o
... Why you would like to know. because verbs can be procs. and procs can be verbs. At least I think... right XxDohxX? |
In response to Green Lime
|
|
The problem with using usr in procs is that usr is automatically set to the initiator of the verb that starts the thread of procs. What this means is demonstrated below:
mob This 'talk' verb will result in the following: Hazman: Hello Hazman: Hi Why? Here's why: mob Of course, when I say 'saying' I mean calling, but to make it more understandable I used |
In response to Crzylme
|
|
Crzylme wrote:
Seriphin wrote: Mind you all this is being done within a verb. usr is perfectly all right in verbs. The only case where you should avoid it is if you're going to be calling that verb as if it's a proc. For example, if to make NPCs talk you route everything through say(), then you'd want to use src instead of usr. As it is I'd leave it with usr.key. Lummox JR |
In response to XxDohxX
|
|
XxDohxX wrote:
Yes, they work. But using usr in verb will lead to usr in procs which is a no-no. Uh, no. You have no idea what you're saying. usr in verbs is not only okay; it's expected. You can use usr all you want in verbs. That has nothing to do with whether you misused it in a proc. The only time usr is unsafe in a verb is if you're treating that verb as a proc and manually calling it from other places in your code. As it is it's not wrong to use src.key, but it's just as valid as usr.key here unless that verb is going to be pulling double-duty as a proc. Lummox JR |
In response to Lummox JR
|
|
I think what he was getting at is that getting used to using usr (heh) in verbs might spread to accidentally using usr in procs as well... So, it's just better to be safe and never use usr at all, even when it's alright...
If you're paying attention, this isn't a problem, but these days, who's paying attention? lol |
In response to SuperSaiyanGokuX
|
|
SuperSaiyanGokuX wrote:
I think what he was getting at is that getting used to using usr (heh) in verbs might spread to accidentally using usr in procs as well... So, it's just better to be safe and never use usr at all, even when it's alright... Huh, what did you SuperSaiyanGokuX :P So I was right, right Lummox JR? |
Seriphin wrote:
Code:set category > verb Problem description:I don't understand why im getting an error. It says mobs.dm:14:error:set :invalid proc definition. Any help would be good thank you ^_^ You're putting the category before the defined verb. verb |
In response to Green Lime
|
|
Green Lime wrote:
So I was right, right Lummox JR? No, only if verbs are going to be used as procs, which is quite rare. And in those cases the author knows what they're doing. Putting usr in a verb is natural and shouldn't be given a second thought, unless you're doing the above in which case all bets are off, and you'd know it. Lummox JR |
set category = "Speech" <------------1
say(mesg as text)
world << "[usr.key]: [mesg]"
1: cant do that mister.
has to come AFTER you define the verb
example
mob/verb