Ok I'm trying to mess a less with othre people's code as I can and just try and to adapt. One thing I can't seem to do correctly is set the usr.gender variable.
I viewed all the documentation I could find and its about worthless. Unless you were never meant to set this?
Here is what I'm trying to do.
mob/male
icon = 'pc.dmi'
usr.gender = "male"
mob/female
icon = 'pc-girl.dmi'
usr.gender = "female"
this is giving me a error:usr.gender:bad var
how am I to do it then?
ID:150309
![]() Nov 7 2001, 8:17 pm
|
|
![]() Nov 7 2001, 8:27 pm
|
|
Try taking out the usr part.
|
Having usr in the mob decleration makes no sense. It's like a design for a car having "driver" as a part of the car, like the windshield. The driver gets put into the car after they buy it, not when the car is being designed... Similarly, the usr is put into the mob when a player logs in and is placed into the mob, not when the mob is being designed.
|
ah man.. thanks.. it was sooo easy too :-P
hmm ok looks like I'm a on roll.. if anyone reads anything about my bout with gender from before this message, ignore.. I'm moving on!!!!!!!!!1 |
Using usr and src
if(src==usr)
mob Using a proc mob Using a verb These both output the exact same thing using usr in a proc can cause some weird activity and vise versa using a verb. |
Looking it up in the reference is a good way to go too. I particularly like the line "The only time usr is assigned for you is when a player (in Dream Seeker) executes a verb, clicks something with the mouse, or any other such action."
|
GateGuardian wrote:
Looking it up in the reference is a good way to go too. I particularly like the line "The only time usr is assigned for you is when a player (in Dream Seeker) executes a verb, clicks something with the mouse, or any other such action." hmm :( Sad thing is I am looking in the Reference, FAQ, Guide, Quotes of people's code. But I see it from the eyes of someone new. To those of you who already know the basics it much easier, and you think, "Its soo easy!! You didn't understand that!?" LJR |
GateGuardian wrote:
Looking it up in the reference is a good way to go too. I particularly like the line "The only time usr is assigned for you is when a player (in Dream Seeker) executes a verb, clicks something with the mouse, or any other such action." Thing is, this is not exactly true. Usr is the caller of a verb or proc. It's just not documented that way. Try this: mob |
Nadrew wrote:
using usr in a proc can cause some weird activity and vise versa using a verb. Usr is useful in a proc if the proc is called from a mob within your game, and you know what you're doing. See my post below. |