ID:809439
 
(See the best response by Keeth.)
Code:
    join()
set src in oview()
if(usr in src.group)
usr << "You're already in [src]'s group!"
else
view() << "[usr] joins [src]."


Problem description:
keep in mind that i am still a beginner at the dm language.

with this verb, the usr could join a group. can someone explain why the above code is not outputting anything. when i right click the usr, the join verb is not seen. in-addition, the else statement does not work. its as if the join verb is not executed
well first your code should look like this.

mob
verb
join()
set src in oview()
if(usr in src.group)
usr << "You're already in [src]'s group!"
else
view() << "[usr] joins [src]."
hi XIIIGaming, yes my code does look like that. i just did not paste and cut the full code.

does anyone else have any suggestions?
In response to Kalster
oview() excludes objects within the same tile as the object in question. Technically speaking, the only people that will have this verb are people within view of the mob you're trying to access, not including the tile they're on.

AKA, you won't be able to access your own join() verb, or the join() verb of anyone on the same tile as you.
yes, i understand but the src is not near the usr. iam trying to join the group of mob that is standing two tiles in front of me. the join verb is still not working. the verb "does not" work when clicking on a mob. please verify
In response to Kalster
Best response
When you said "when you right-click the user, the verb is not seen," I assumed you were right clicking yourself.

So tell me, is the verb showing up and not working, or is it not showing up at all?

If it's not working, how are you determining it's not working? Are you the one joining, or attempting to join? If you're the one attempting to join, usr << "blah" and oview() << "blah" should both result in the joiner receiving a message. However, if you are the one being joined, you will only see a message on a successful join.

I assume your verb's programming is exactly the same as it is here.

If you are still having trouble, replace usr << "blah" and view() << "blah" with world << "blah", just to ensure messages are going out. If you don't get either of those messages, then your code must not be what it says it is.

The other alternative is that you have a custom interface, and the output element is not set to "default," which is necessary for messages sent in this way to appear.
i replaced view() with usr and it works fine.