ID:141178
 

Egg
icon = 'Egg.dmi'
verb
Hatch()
usr << "[usr] makes the [src] hatch!"
new/mob/Chick(usr.)
new/obj/Egg_Shell(usr.loc)
del src



Okay do you guys see
new/mob/Chick(usr.)
I want to make the egg hatch and the shell come under my guy then have the Chick itself come infront of me. I dont know what I'm doing wrong.
Nickya2 wrote:
Egg
icon = 'Egg.dmi'
verb
Hatch()
usr << "[usr] makes the [src] hatch!"
new/mob/Chick(usr.)
new/obj/Egg_Shell(usr.loc)
del src



Okay do you guys see
new/mob/Chick(usr.)
I want to make the egg hatch and the shell come under my guy then have the Chick itself come infront of me. I dont know what I'm doing wrong.

IGNORE THIS PEOPLE...I'm going to make them both spawn on the same spot under me so when the NPC moves it wont really matter anymore.
In response to Nickya2
(locate(src.x,src.y-1,src.z))

Egg
icon = 'Egg.dmi'
verb
Hatch()
usr << "[usr] makes the [src] hatch!"
new/mob/Chick(locate(src.x,src.y-1,src.z))
new/obj/Egg_Shell(usr.loc)
del src


That does it if you want to use that you can because it will help you code a bit better and also you can edit where about in comparison to the mob it will be dropped.

P.S. if mob is at 1,1,1 and the egg hatchs I dont know what happens it might be a little bug so if you want just make the map not next the edges of the map.
In response to Chrislee123
Chrislee123 wrote:
P.S. if mob is at 1,1,1 and the egg hatchs I dont know what happens it might be a little bug

With that code, if the mob is at anywhere with a y coordinate of 1, the /mob/Chick will be created at null location (and most likely subsequently deleted by the garbage collector). Not really desirable. That's why safety checks are important.

so if you want just make the map not next the edges of the map.

You certainly could have written that better, but even if one does what I think you've said, he should still safety-check his locations to make his code truly robust.
In response to Kaioken
okie-dokie I doubt hes going to have read this anyways but hey I like this whole helping people business gives me satisfaction. =)