ID:169587
 
Okay here is my current problem I am in need of a trail coding for say a totaly custom dbz game made from scratch. I looked at the libary for trails and couldn't make heads or tails of it. So if anyone knows of a good trail demo in which i can learn off of i would greatly appreciate it , or if you know of a quick way to do it other then.
new/obj/trail(usr.loc)


I would really really appriecate it.

Smokymcpot(Gouent)
Alter the Move() proc of something leaving trails so that when it moves it creates a new object with the trail icon on the same square it is in. Then, in the New() proc for the trail objects, spawn() off a del call.
In response to Jp
okay heres what i did
 mob
Move()
if(usr.f==1)
return
else
..()//this is for my mr freeze proc
if(usr.buku ==1)
if(usr.dir == EAST)
usr.x += 0//this is at 0 but its to controll how many steps you take.
new/obj/line2(usr.loc)
sleep(50)
for(var/obj/line2/s)
del(s)
if(usr.dir == WEST)
usr.x -= 0
new/obj/line2(usr.loc)
sleep(50)
for(var/obj/line2/s)
del(s)
if(usr.dir == SOUTH)
usr.y -= 0
new/obj/line1(usr.loc)
sleep(50)
for(var/obj/line1/s)
del(s)
if(usr.dir == NORTH)
usr.y +=0
new/obj/line2(usr.loc)
sleep(50)
for(var/obj/line2/s)

okay this is what i had but all it did was make them it did make them in the direction i wanted them to but..it didnt connect them and i dont no all there is to coding so i dont no how to make it where it delete's it one by one. And im srry but could you possibly give me an example of what you are talking about?
In response to Smokymcpot
Well it would be tons more efficient if you made the lines delete themself using New() and del(src).

You also should use "src" in your coding.
In response to ITG Master
well true but see i dont understand what you mean cause f i were to make a proc for new how could i delete it one bye one and ITG i no u have this becuase i have heard about it so im kinda glad you answerd


Edited()
Maybe i should be more specific im not fimalr with all BYOND code maybe you could show me a good way to use new()
In response to Smokymcpot
obj
Trail
New()
..()
sleep(10)//You will have to change this or not
del(src)

In response to ITG Master
THANK YOU! combined with my coding and that it works you can close the post now.
In response to Smokymcpot
A better version would probably be something like this:

mob/Move()
if(Frozen) return 0 //Check if player is frozen
if(MakingTrail) //If player leaves a trail...
var/obj/o=new /obj/trail(loc) //Make a new trail object in the players location
o.icon=icon //Set the trail object's icon to the player's icon
..() // Do normal move stuff

obj/trail/New() //When the trail object is created...
..() //Do normal New() stuff
spawn(Delay) del src //When delay*10 seconds are past, delete the trail.


You'll have to customize variables and such, and this creates the trail object whether the player is successful in moving or not.