ID:165166
 
A naruto jutsu

//**** Move proc (it creates the trail) ****
Head
icon='icon.dmi'
density=1
Move()
var/obj/Trail/T=new/obj/Trail
T.loc = src.loc
T.dir = src.dir
..()



I want the above player's attack to be better visually.

It works by targeting a mob, then a 'head' obj is sent out with step_towards, each movement results in a 'trail' obj being left in its place.

I'll figure out the pixel art, no worries...
But as you can see, the corners are non existent.
I was wondering if someone could help me out with a proc to check if the obj turns; and if it does, put in the appropriate trail obj.

I'd rather it would only move in straight lines too...


Oh. And I want the head to pass through/over solid turfs and objs.
Bump(A)
if(ismob(A))
var/mob/M = A
if(src.target!=M)
src.loc=M.loc
else
src.density=0
M.ShadowCaptured(src)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
src.loc=T.loc
if(istype(A,/obj/))
var/turf/O = A
if(O.density)
src.loc=O.loc

But it doesnt work :|
Move proc:

You should first let the parent proc run, then check if movement actually succeeded before creating a trail.
Also, you should properly use new and use the location argument; also, be aware of the type shortcut; if you haven't specified a type and you are assigning the object into a var, the var's defined type is used. So your new line becomes:
var/obj/Trail/T = new(src.loc) //create an object of type /obj/Trail (and typecasted as that type as well), at the location 'src.loc'


I was wondering if someone could help me out with a proc to check if the obj turns; and if it does, put in the appropriate trail obj.

What's the problem? If an object turns, it usually means it has changed it's dir var (unless custom code made it otherwise). You can store the projectile's dir into a local var before calling the parent proc, then afterwards checking if it has changed - if it has, then the object has turned. You may then decide what icon to use for that trail,

I'd rather it would only move in straight lines too...

Err, you mean in the 4 cardinal directions, right? You need to write your own equivalent of step_towards() then, that doesn't use diagonals.

Oh. And I want the head to pass through/over solid turfs and objs.

Search around before posting...there have been a few topics about this, lately. You need to override Enter(), Bump() is definetely not the way to go. In there, you want to always allow the projectile entrance to turfs unless the turf is solid or it contains a solid mob; in this approach, Bump() may be called on a solid obj that was present in the turf (but didn't hamper entrance), so you should call another proc (in a spawn() call, spawn(-1) if wanted, so Enter() continues and returns so does the move proccess) such as projectile.Hit(dense_mob) from the Enter() and not use Bump() to damage.
In response to Kaioken
Move()
..() //<--- Tried with & without.
.=..()
if(.)
var/obj/Nara/KagemaneTrail/T = new(src.loc)
T.dir = src.dir
T.target=src.target
T.Gowner=src.Gowner

The above doesn't produce a trail at all :\
In response to CuriousNeptune
Sorry. but.... *bump* [see above post]
In response to CuriousNeptune
Wait atleast 24 hours before bumping your thread. also you should use new varibles and Move to do this I think there is a library on this somewhere.

- Miran94
http://developer.byond.com/hub/Kunark/ Real-TimeTile-BasedLineEffects

Hmm... you like, yes?

It's quite useful and can be used to do what you are trying to do.
In response to CuriousNeptune
I suggest you read the DM Guide, the DM Reference (mainly for procs and operators you're using) first before continuing. Really, don't just randomly try stuff. No reason to call '..()' twice, and you apparently think '. = ..()' is different in not calling it or whatnot.

Anyway, that will create the object on the projectile's CURRENT location, after it has moved, which isn't what you want. And you shouldn't need to copy/set any vars other than dir.