ID:142721
 
Code:
 Zabimaru
icon = 'renjibankai.dmi'
density = 1
zab = 1
rundelay = 0
layer = 50
Bump(atom/M)
if(istype(M,/obj/zabtrail/))
src.loc = M.loc
Bump(mob/D)
..()
var/mob/M = D
if(istype(M,/mob/))
if(M&&M == owner)
return
else
src.loc = M.loc
M.health -= src.attack * 1.5
view(src,8) << "<b><font color = red>[src.owner] hit [M] with his [src] for [src.attack * 1.5] damage!"
M.Death(src.owner)
var/mob/O = src.owner
if(M.enemy)
O.hollowprotection = 0
O.banmastery(15)
Del()
for(var/obj/zabtrail/M in world)
if(M.owner == src)
del M
..()
Move()
..()
var/obj/zabtrail/M = new/obj/zabtrail
if(src.dir == NORTH)
M.loc = locate(src.x,src.y-1,src.z)
M.dir = NORTH
if(src.olddir == WEST)
M.dir = NORTHWEST
if(src.olddir == EAST)
M.dir = SOUTHWEST
if(src.dir == SOUTH)
M.loc = locate(src.x,src.y+1,src.z)
M.dir = SOUTH
if(src.olddir == WEST)
M.dir = NORTHEAST
if(src.olddir == EAST)
M.dir = SOUTHEAST
if(src.dir == EAST)
M.loc = locate(src.x-1,src.y,src.z)
M.dir = EAST
if(src.olddir == NORTH)
M.dir = NORTHEAST
if(src.olddir == SOUTH)
M.dir = NORTHWEST
if(src.dir == WEST)
M.loc = locate(src.x+1,src.y,src.z)
M.dir = WEST
if(src.olddir == NORTH)
M.dir = SOUTHEAST
if(src.olddir == SOUTH)
M.dir = SOUTHWEST
M.owner = src
src.olddir = src.dir


Problem description:

Umm "inconsistent Indentation"
on lines

if(istype(M,/obj/zabtrail/))
src.loc = M.loc

closest to top (near Zabimaru)
If you take a look at your code the way it appears in this forum, it has an unhealthy mix of tabs and spaces. You should generally use only tabs to indent, but if you prefer spaces then you should use only spaces--and then only a certain number of them.

Use Ctrl+T in Dream Maker to show where you have tabs. Then on any of the lines that are indented with spaces, reindent them properly with tabs.

Also, the code you're using for that trail needs to be removed entirely. You shouldn't have to use a zillion if() blocks for a simple "put something behind me" piece of code. How that should look instead is:

Move(newloc, newdir)
var/oldloc = loc
. = ..()
if(.)
var/obj/zabtrail/O = new(oldloc, src)
olddir = newdir


Also that means your trail object should be initialized like so:

obj/zabtrail
New(newloc, mob/M)
owner = M
dir = (M.dir != turn(M.olddir,180)) ? (M.dir | M.olddir) : M.dir


I'm not 100% sure what that stuff with olddir is supposed to do because it doesn't look like it's consistent. It looks like the goal is to get a nice diagonal trail when the mob switches from one cardinal direction to another.

Lummox JR
In response to Lummox JR
where would i put that stuff in (btw, when i fix the spaces to
tabs, # of errors goes to 193 instead of 2 :/)
In response to RanEsu
RanEsu wrote:
where would i put that stuff in

I showed you a Move() proc, so naturally that would go in place of the Move() in your code snippet.

The other piece of code would go in wherever you defined that trail object.

(btw, when i fix the spaces to tabs, # of errors goes to 193 instead of 2 :/)

That's okay; the important thing is first to be using all tabs, and then to fix the indentation issues.

It looks like you've been putting your code together by pasting in pieces from a bunch of different sources. While that's not necessarily terrible, you need to make sure the code that you paste has the proper indentation. You'd actually be better off writing all your code from scratch, or at least just using these other pieces of code as a reference but typing it in yourself, so you can get more familiar with how BYOND handles indentation.

Lummox JR