ID:2343197
 
(See the best response by Spunky_Girl.)
im making a technique that you summon a golem on you like a susano and i try to make that the golem do the same step as the usr .
this is the follow proc it suppose to make the golem do the same step as the usr but when i move the golem don't
maybe something is wrong with the followme proc.

Code:
        FollowMe() //this is the follow proc
var/GAME_MOB/M = usr
if(M.dead)
return
while(M.Golem)
if(M.moving)step(src,M.dir,17)
M << "asd"
sleep(world.tick_lag)


Bubble_Golem // this is the golem technique when you active it
name = "Bubble Golem"
icon = 'Art/Skill Icons/Non2.dmi'
icon_state = "non"
mouse_drag_pointer = "non"
s_cost = 6
s_cd = 31 /// make sure the cooldown is MORE than 30
s_level = 1
s_max_level = 1
chakra_cost = 875
signs = list("")
s_element = "Water"
Click()
var/GAME_MOB/P = usr
if(P.jutsus.Find(src))
if(src.s_uses >= 0)src.Activate(P)
Activate(GAME_MOB/M)
set hidden=1
if(M.in_safe_zone == 1)
M << "<font color=red><b>You're in a safe zone, you shouldn't be doing this."
return
if(M.CanUse()==FALSE)return
if(src.on_cd)return
if(M.BS==1 && src.s_level == src.s_max_level)
M.BSstop()
return
if(M.BS==1)
M << "You already have your golem summon!."
return
if(M.chakra>=src.chakra_cost)
// src.s_uses += 1
//// ADD EFFECT////
var/GAME_MOB/UltimateDefence/Bubble_Golem/jutsu = new/GAME_MOB/UltimateDefence/Bubble_Golem(M)
jutsu.step_x = M.step_x -30
jutsu.step_y = M.step_y -10
jutsu.loc = M.loc
M.Golem = TRUE
M.BS = 1
///////////////////
spawn(30)
M.Golem = FALSE
jutsu.loc = null
M << "your golem desactivate"
spawn()FollowMe() // make the followme proc stop because M.golem is false
src.skill_cooldown(M,src)
M.nin_exp += rand(3,6)
spawn()global.LevelStat(M,"Ninjutsu")
if(prob(5))
M.exp += 1
global.CheckLevel(M)
M.UpdateInfo()
else
M<<"<i><font color=aqua>Not enough chakra to use this. (Uses: [src.chakra_cost] chakra)"
return




Not sure why you'd need a loop for this type of thing. Just use the Move() proc and move the golem every time the player's Move() is successful.

Alternatively, you could just use the walk_to() proc and set and forget it until you need the golem to do some other movements.
I do not understand how to do it i try with move() and walk_to proc
Best response
With walk_to():
All you need to do, is call walk_to() after creating the golem object, preferrably within its New() proc somewhere.

With Move():
Just override mob/New() and check if src has a golem object, and move it when src successfully moves (assuming you're using a variable to hold onto your golem objects for referencing later on, like you should).