ID:1897567
 

Problem description:
So, im doing a Naruto game and need help with an trail.
The thing is, there's a jutsu that will make a mob go after someone, and i want that everytime the mob or the user moves, the trail between then be remade.

Is there any way to do this? :(
What jutsu are you referring to? I'm trying to understand what would require a trail to be recreated every time something moves. Try going into deeper detail with your goals.
Kage Shibari no Jutsu
I'll make so that when the jutsu is middle way the user can move, and when the jutsu gets someone, he can control who was hit
Ah. You don't have to rebuild the trails when the user or target moves, that would be inefficient and unnecessary. Rather, you could generate the new trails relative to the last location of the user/target (or where the head of the shadow is), depending on who's moving.

// shadow possession was used and the target is caught...

var turf/old_loc = target_location
// user triggers the target to move
var obj/trail = new(target_location)
// make sure to keep track of these so they can be removed later.
trails += trail
// update the trail's direction here, relative to old_loc


You should get the gist enough to take action.
The problem of doing it this way, is that if they move a lot, the trail gets all messed up.
Like this: http://imageshack.com/a/img538/951/7me9rY.jpg
That is why i want to remake the trail everytime it moves XD
In response to PatrickBR
Can I see how you did it?
Did it c:

I created an proc that runs everytime the mob or the user moves, which get the direction the mob is from user and delete the old trails and then create the new ones

c:
In response to PatrickBR
This demo does what you want in theory (I tested it myself a bit and it's not bad at all). You'll probably have to tweak it to fit your own requirements though. (My personal advice is to write your own solution, using the demo as a reference/example at most. This is only if you're worried about efficiency though.)
That demo is terrible, BTW. It generates an icon per trail per tile in the cache.

If you want a fast way to make your game unplayable, that demo is great advice.
That demo is really, really old. It used to be one of the more ideal methods, but it has been very obsolete for some time now.

animate() and some images for this doodad these days, I'd say. Could even cache the images so you don't create and delete images all the time, I might write up a little demo myself if I want a distraction when I get back to coding Monday.
Well, if you do write one, post it here. c:
I did make it work in the way i wanted, but i'm not sure if it is the best way to do it :c