join(mob/M) |
Problem description:
at runtime, when right click the mouse on usr, the join verb is displayed. how to stop that from happening because i don't want usr joining its own usr group. i have tried -usr but that does not work
ID:809365
Jun 10 2012, 9:38 pm
|
||
Code:
Problem description: at runtime, when right click the mouse on usr, the join verb is displayed. how to stop that from happening because i don't want usr joining its own usr group. i have tried -usr but that does not work | ||
#1 Jun 10 2012, 9:42 pm
|
|
It will appear regardless. Just add a check in the verb to rule out the possibility of the user joining.
| |
#2 Jun 10 2012, 10:06 pm
|
||
What you could also do:
| ||
#3 Jun 10 2012, 10:08 pm
|
||
to verify that the mob has joined the usr group, i have added an input statement. the input statement will only work and display the usr group if the "if" statement is commented. the code is acting as if the "if" statement is executed before the "input" statement. could someone please explain this strange behavior. thank you Kaiochao. i will study your code | ||
#4 Jun 10 2012, 10:11 pm
|
|
input() is not used this way. I suggest you use the DM Reference and/or F1 in Dream Maker and learn some more about DM's syntax.
| |
input() can be used that way if you're just displaying information. It's not often used like that, since usually you expect to use an input to get... input. But it's the same as calling any other proc. For example, some people call step() in its own line by itself, but it actually returns a value that people don't often care about.
I'm not sure what the actual issue is, though. The input() proc is supposed to pause the procedure at the line it's called in, and resume after the input has been resolved. | |
#6 Jun 10 2012, 10:22 pm (Edited on Jun 10 2012, 10:34 pm)
|
|
Albro1. whats wrong with the syntax. i pressed f1 and read the input statement and it should work. it is very similar to any other list in an input statement.
| |
#7 Jun 10 2012, 10:34 pm (Edited on Jun 11 2012, 12:02 am)
|
||
to make my point clear. the following will work but the usr.group will not
| ||
#8 Jun 11 2012, 2:57 am
|
||
Did some testing, it seems as though as though it won't work if there's only one object in the list or if all the objects in the list are the same object, if you catch my drift.
This is presumably because with "input()", you generally want to make the user make a choice, and therefore input something. It's not normally used to display information. My advice if you're set on using input() to add at the top of your list usr.group "Group members:", so as to provide an alternate option. However, he's right that if you're not wanting feedback, then don't really use input. Use a browse() proc and HTML to produce only readable output. You can make it look prettier too. Something like:
| ||
I hadn't considered that the input() was closing because there was only one member in the group. I forgot that you yourself aren't in your own group, haha.
The way to fix this is to "add a Cancel button to the input."
In this case, List is src.group. | ||