Ok here is my code
mob/Daemon
icon='dragons.dmi'
icon_state="daemon"
HP=15
HPM=15
MP=0
MPM=0
str=2
proc/move()//Now, this proc handles NPC movement
walk_to(usr,owner,0)
proc/attackplayer()//Handles attacking
for(var/mob/M in oview(1))//Within one space this time
if(get_step_away(src,M,1))
if(!M.client)
continue
else
src.Attack(M)//Calls the attack proc
else
return..()
spawn(20) attackplayer()
New()
move()
attackplayer()
Now here is the verb that summons the monster
mob/verb/Test4545()
new/mob/Daemon(usr.loc)
for(var/mob/Daemon/M in oview(0))
M.owner=usr
ID:261510
May 23 2002, 2:24 pm
|
|
May 23 2002, 7:39 pm
|
|
Telling us the problem would help.
|
In response to Garthor
|
|
Ok, you must be stupid duh the problem is that the MOB DOSN'T WALK WITH YOU!
|
In response to Strange Kidd
|
|
Strange Kidd wrote:
Ok, you must be stupid duh the problem is that the MOB DOSN'T WALK WITH YOU! To be honest, it wasn't that clear. The topic was fine, but in the future it would be better to also include a few lines concerning what you need. Topics are short and a slightly longer explanation is often helpful. A page of code doesn't do much. (Actually, too much code can make some people less willing to help.) |
You use usr in move(). It is unwise to use usr inside a proc. (Using usr in verbs is fine if you are careful.) Use src. I believe you are trying to get the daemon to walk.
Also, in this code, the only time move() is called is when the daemon is created. In your test verb, you create a daemon with new and then you set the owner var. move() has already been called before there was an owner to follow. You are setting targets, but not reminding the daemon to move again. BTW, should move() be Move()? I'm not sure how your code is designed but I thought I'd point out the capitalization in case it caused you any trouble. I see you have created your own movement proc while Move() is built-in. (Sometimes this is desirable.) |