ID:150038
 
i need someone to give me a sample code of some sort on how to have it where i click on a mob then click on a verb and then click on an obj which the mob goes to the obj(like a well, etc) and gathers something(like water) then goes to another obj to give it to that obj and if he has water then add it to the objs contents
Break it down into steps, if you can and repost it please.

Alathon
I'm really not a guru, but, from what I understand, you're not quite asking for something guru-level.. Anyway.

I didn't get your message.. try translating it into english for us? From what I understand, you want your mob to move to an object, perform an action, then move to another object and perform another action?

If that's true, then I suggest you take a look at walk_to().. You may be able to "check" if it's at the object by just putting in a spawn() but I doubt it. If you can't "check" like that, you can check by overriding Move(). There's probably a better way (Gurus.. enlighten me on this one. I just know I'm going to need it sooner or later.)

--Tarmas.
This lets you click on a verb, then click on a mob/obj and obj/mob, telling the mob to walk_to the obj.


mob/var/command = 0
mob/var/target1
mob/var/target2

mob/verb/Command()
src.command = 1
src << "Click on the target to command."

mob/Click()
if((usr.command) && (!src.client))
usr.target1 = src
if(usr.target2)
walk_to(usr.target1,usr.target2,1,0)
usr.target1 = null
usr.target2 = null
usr.command = 0

obj/Click()
if(!usr.command) return
usr.target2 = src
if(usr.target1)
walk_to(usr.target1,usr.target2,1,0)
usr.target1 = null
usr.target2 = null
usr.command = 0



Don't ask me if it works right though ;o)
Gu...ru?