ID:157874
 
Can anybody tell me (if you can) how to access a mob's property like name, desc, dir, etc. without actually being indented under the mob. Please don't tell me to use usr because the thing I'm trying to do is to not only have the usr's mob move around, but also be able to trigger another mob's actions with its moving around. Something like this:

mob
icon = 'player.dmi'
ControlledGuy
icon = 'guy.dmi'


And referring to the ControlledGuy's properties like this:

verb
Wall_Walker()
ControlledGuy.density = 0


Is there a way to do that?
Sure, but you need to actually have a reference to an object instance in order to access its properties. Otherwise, if there's no object, you can access its properties...
Vars like usr and src contain references to objects (when they don't contain null), which can be used to access a specific object instance. To do something with an object, you need a var like that that's set to it.
In your example verb, the symbol "ControlledGuy" is meaningless (it's no different from typing "dsghasd"), as it doesn't refer to a variable name or anything at all, and so would give you an undefined var error. The closest thing to it that's meaningful would be the type path /mob/ControlledGuy, but that's not an object instance either, therefore you can't do much with it.
There are various ways to get a reference to an object. You could search for one, or create one, or have the player pick one by using something like verb arguments or input().
mob/verb/Kill_Mob_In_Front()
var/X = locate(/mob) in get_step(src,src.dir) //look for a mob in front of the player
if(X) del X
else src << "There is no mob in front!"

mob/verb/Kill_Mob(mob/M as mob in oview(src)) //require the player picking a mob in his view (other than himself) to activate the verb
if(M) del M

mob/verb/Create_Mob(mobname as text)
var/mob/M = new /mob(src.loc) //create a new mob instance
M.name = mobname


Since this is a fundamental concept you need to be aware of, before jumping into programming I recommend reading some tutorials and working with the DM Guide so you're comfortable with the language and know how to work with it. You can find an index of resources here.
In response to Kaioken
mob
icon = 'Player.dmi'
icon_state = "Player"
Player2
icon = 'Player.dmi'
icon_state = "Player2"
var/mob/Player2 = /mob/Player2
verb
activate()
Player2.Move(locate(2,2,1))

Did you mean like that? Well, if you did, I get no compiler errors, but when I execute the verb activate I get this in-game error:

runtime error: Cannot execute null.Move().
proc name: activate (/mob/verb/activate)
usr: Railon (/mob)
src: Railon (/mob)
call stack:
Railon (/mob): activate()
In response to Railon
/mob/Player2 is a typepath, not an actual instance of an object. You would need to either find an instance of /mob/Player2 by using locate(), or create one by using new(), before you could do anything with it.
In response to Garthor
Ya I got it, thanks for the help