ID:178455
 
Yea its me again with another question with my code. When a new skeleton is created by a person, how would you make the skeleton follow the usr and that usr only?
in your create skeleton code...
after var/S= new /mob/skeleton(usr.loc) blah blah blah... put S.owner==usr.owner

then make a proc, and look up
walk_towards... or walk_to in reference.
In response to Jon Snow
it didnt work heres my code

client
Northwest()
if(usr.icon_state == "Necromancer")
var/obj/Corpse/O
for(O in oview(7))
usr.MP -= 5
new /mob/Ally/Skeleton(O.loc)
del(O)
else
return
In response to Tazor07
Tazor07 wrote:
it didnt work heres my code

client
Northwest()
if(usr.icon_state == "Necromancer")
var/obj/Corpse/O
for(O in oview(7))
usr.MP -= 5
<--- var/S
S= new /mob/Ally/Skeleton(O.loc)
<--- S.owner=usr.owner
del(O)
else
return

client/verb/follow()
for(var/mob/M as mob in oview(7))
if(istype(M,/mob/Ally/Skeleton)
if(M.owner==src.owner)
walk_towards(M,src,M.walkspeed)
client/var/owner
In response to Jon Snow
i still seem to be getting errors

client
Northwest()
if(usr.icon_state == "Necromancer")
var/obj/Corpse/O
for(O in oview(7))
usr.MP -= 5
var/S
S = new /mob/Ally/Skeleton(O.loc)
S.owner=usr.owner
del(O)
else
return
Northeast()
return
Southwest()
return
Southeast()
return
Center()
usr.PAttack()
client/verb/follow()
for(var/mob/M as mob in oview(7))
if(istype(M,/mob/Ally/Skeleton)
if(M.owner == src.owner)
walk_towards(M,src,M.walkspeed)
client/var/owner

it says if is missing a ' or ) it wont tell me the other errors.
In response to Tazor07
if(istype(M,blah)<font size=4>)</font>

it's missing a ) on the end, sorry, bad habit of mine :(
In response to Jon Snow
client
Northwest()
if(usr.icon_state == "Necromancer")
var/obj/Corpse/O
for(O in oview(7))
usr.MP -= 5
var/S
S = new /mob/Ally/Skeleton(O.loc)
S.owner=usr.owner
del(O)
else
return
Northeast()
return
Southwest()
return
Southeast()
return
Center()
usr.PAttack()
client/verb/follow()
for(var/mob/M as mob in oview(7))
if(istype(M,/mob/Ally/Skeleton))
if(M.owner == src.owner)
walk_towards(M,src,M.walkspeed)
client/var/owner

now i have 4 errors and 1 warning, it says S is defined but not used and usr.owner and S.owner are undefined and so is walkspeed
In response to Tazor07
That's because you haven't defined them, silly. When you're copying code someone else has given you, there's a good chance you'll have to change it (or your code) around a bit in order to get everything working. You'll have to define those vars (minus the usr.) somewhere else. Or just take them out of the code.
In response to Garthor
Northwest()
if(usr.icon_state == "Necromancer")
var/obj/Corpse/O
var/S
for(O in oview(7))
usr.MP -= 5
S = new /mob/Ally/Skeleton(O.loc)
S.owner=usr.owner
del(O)

1 error and 1 waring i dont get, it says S.owner is undefined, i dont get it. It also says S is undefined, will this code still create a new skeleton?
In response to Tazor07
ok oops sorry
been coding my game for too many hours hehe...

S.owner="[usr.ckey]"

if(S.owner="[usr.ckey]"

etc...

there you go
that's just an example

also
try changing
var/S to var/mob/S I'm not sure but that should do the trick...
In response to Jon Snow
it still says S is undefined
In response to Tazor07
read what I said again and try that

try changing
var/S to var/mob/S I'm not sure but that should do the trick...

if you have any coding questions just im me at jonsnow1313

good night...
going to bed ;)
In response to Tazor07
Tazor07 wrote:
it still says S is undefined

Try this:

client/Northwest()
if(usr.icon_state == "Necromancer")
var/obj/Corpse/O
var/mob/S
for(O in oview(7))
usr.MP -= 5
S = new /mob/Ally/Skeleton(O.loc)
S.owner=usr.owner
del(O)


-Kappa the Imp

this is a total rip off of silk's game.
In response to ShadowSiientx
ShadowSiientx wrote:
this is a total rip off of silk's game.

Uh huh, so Everquest was a total ripoff of it because it has necromancers. So was DnD, because there were necromancers (evil clerics) in it...
In response to ShadowSiientx
Is Silk ripping off skeletons? is he ripping off resurection?

Those things can not be ripped off because they are not copyrighted.

Plus, you cant rip off coding, hes just asking how to make a mobnpc follow a user, is this abuserd?
In response to Garthor
I am not talking like that.. it is just like silk's game.. you make skelestons with peoples corpes and u have to be a necro. and then they follow.! that is what it does it silk's game!