ID:147383
 
I want my multi tile mobs to move with-out falling apart. I have come up with better solutions than most of the demos i've read. Is there a real way to do this? Can someone point me to a really good demo or lib?

The way i do it now is this. The mob has vars that point to objects that are the parts of his body. When he moves, I have overriden his Move() to move these parts with him. Usually it looks pretty good, but pretty often there will be separation between the parts. help?
Post the code, I have also found a way to do this. I think by overridding the Move() proc then doing another proc, if the mob is located like more then 1 tiles away it calls a proc to relocate it to the other one.
Use overlays, they will not get chopped up when you move. If you use overlays and want to limit the object's movement by the extended tiles as well, you can alter mob/Move() to do Enter, Entered, Exit and Exited on the tiles adjacent to NewLoc as well as on NewLoc.

Example movement alteration:
mob/Move(NewLoc,Dir=0)
var/turf/T=get_step(NewLoc,NORTH)
if(T.Enter(src))
.=..()
else .=0
if(.)T.Entered(src)//leave this line out if you don't
//want Entered called on the top tile

That would be for a mob with an extra tile to the north.

To make an overlay start off offset by a tile, just alter its pixel_x and pixel_y variables.
mob/proc/add_head()
var/obj/O=new
O.icon='head.dmi';O.pixel_y=32
overlays+=O;del(O)

If you have objects of many different multi tiled layouts, you should have a list that keeps track of all the locations besides the actual loc which the object is supposed to occupy.

Lastly, if you did all that you would probably also want to alter Move so that objects cannot move onto tiles which are under an extra tile that a multi-tiled object is on. You could do that by giving turfs a multi_tile_contents list variable that keeps track of all extra parts of objects which are supposed to be in the turf.