ID:175253
 
How could I make it so a trail is left behind after a character goes over it (Ie:Moving in hyperspeed and a trail of dust is left behind) but after like a second it disapears?
It should be as simple as creating an object at the player's location every time he moves. Basically when they move, create an object, then move the player. Create a special object that automatically deletes itself when its created.

<code>obj/trail New() spawn(10) del(src)</code>

Create a trail behind the player like this:

<code>mob/Move() new obj/trail (src.loc) ..()</code>
In response to Foomer
thanks i would've never thought of that! :P
In response to Foomer
Somethings wrong, I tried to make it so the trail is the same direction as the usr but it didnt work. Here's what I tried:
obj/trail
icon = 'Planets.dmi'
icon_state = "Trail"
New()
spawn(10)
del(src)

mob/Move()
new/obj/trail(src.loc,src.dir)
..()
In response to Koolguy900095
When the obj is created, change its dir, you cant change it in the new.
In response to Magnus VI
Im comfused how do I do that, this wont work:

mob/Move()
var/So = new/obj/trail(src.loc)
So.dir = src.dir
..()

I get the errors: Main.dm:12:error:So.dir:undefined var
Main.dm:11:So :warning: variable defined but not used

How can I fix the errors but still make it work?
In response to Koolguy900095
Koolguy900095 wrote:
Im comfused how do I do that, this wont work:

mob/Move()

So.dir = src.dir
..()

I get the errors: Main.dm:12:error:So.dir:undefined var
Main.dm:11:So :warning: variable defined but not used

How can I fix the errors but still make it work?


var/obj/So = new/obj/trail(src.loc)


You just needed to tell it that So was an obj pointer, not just a variable. An obj can have a direction variable, but just a variable probably wouldn't.
In response to Koolguy900095
<code>mob/Move() var/obj/trail/T = new(src.loc) T.dir = src.dir ..()</code>
In response to DerDragon
Ok thanks, now i have a problem my auto-piolet doesnt work :(. Is there something conflicting with my auto-piolet coding:
mob
var/tmp
destination
next_walk_time // When is the next time for us to walk?
walking_delay = 0 // How long between movement?
movement_percent = 50 // What percentage of the time should it move?

base_EventCycle()
// This gets called once each tick.
if (next_walk_time <= world.time)
// It's time to walk if we clicked on something.
if (destination)
var/reached_dest = base_StepTowards(destination)
if (reached_dest)
// We're there!
src << "Reached destination!"
src.verbs -= new/mob/specials/verb/Stop
destination = null

// Set the next walk time.
next_walk_time = world.time + walking_delay
return



and the trail coding:
obj/trail
icon = 'Planets.dmi'
icon_state = "test"
New()
spawn(10)
del(src)

mob/Move()
var/obj/So = new/obj/trail(src.loc)
So.dir = src.dir
..()




If something is conflicting between the two, how can I fix it?
In response to Koolguy900095
Oh and if I take out the trail coding the auto piolet works fine. And here's te verb that calls auto piolet if it helps:
mob
verb
Auto_Pilot(mob/M as mob in world)
usr.destination = M
src.verbs += new/mob/specials/verb/Stop
return ..()