ID:271836
 
//To be exact, i dont kno exactly how i am gonna make an afterimage effect
//I got the idea after i made a character for M.U.G.E.N



/*
A quick introduction on how im gonna do this
I am gonna make an afterimage effect as you kno
But i dont kno how to do this, so im asking for help here

My first attempt was to create a loop that creates an obj for every afterimage amount
And place them between the first afterimage and the main thing or obj

but i didnt kno how to do that

my second atempt i tried to create a proc that runs everytime you move and creates an obj in
the same place as the obj but it didnt work out great


*/

mob/proc
Afterimage(r,g,b,mob/what,amount) //this is what i got so far
if(amount > 32) amount = 32 //if the amount ever surpassed 32 afterimages for what ever reason, put it back to 32
var/placement = 32/amount
if(what.dir == WEST)
for(var/i , placement < i , i++)
var/obj/M = new what
M += rgb(r/256,g/256,b/256)
M.pixel_x += what.x - 32 + (32/placement/2)


Afterimage_Handler(mob/T) //something to generate the after image
//Hmm, i wish i could create an something with a specific frame within an icon. Might as well request it.
//Might be better, for a smoother afterimage effect
var/obj/newMob = new /obj(T.loc)
newMob.icon=T.icon
newMob.overlays=T.overlays
newMob.density=0
newMob.dir=T.dir
spawn(15)
del newMob


Im trying to make an afterimage effect, which saves a icon and adds rgb and places it some amount of pixels away from an object that wants an afterimage, then deletes it after a certain amount of time. Soemthing like this is in Street Fighter Games and such.

http://erufenix.codesys.org/images/sf3ga.png

The blond dude named ken has an afterimage, im trying to make a similar effect in byond.
You're going to have to actually tell us what you're trying to do, here.
In response to Garthor
its commented in the code

But anyways, im trying to make an afterimage effect, which saves a icon and adds rgb and places it some amount of pixels away from an object that wants an afterimage, then deletes it after a certain amount of time. Soemthing like this is in Street Fighter Games and such.

http://erufenix.codesys.org/images/sf3ga.png

The blond dude named ken has an afterimage, im trying to make a similar effect in byond.
In response to Max Omega
Sorry, but "I am gonna make an afterimage effect as you kno" is not an adequate description of what you are trying to do.
In response to Max Omega
use the image proc.
In response to Obs
Its not what im talking about...
In response to Max Omega
Max i was gonna use a simular function in my game. i think as of right now, the only way to do this is like this.
var/obj/o=new obj(src.loc)
flick(o,o.loc)
for(var/xx,xx<5,xx++)
spawn(xx)o.icon+=rgb(0,0,0,5*xx)
spawn(xx)flick(o,o.loc)
In response to Tubutas
Im gonna go out and try this. Have you tested this way before? and would it be good if i made it so it had the same direction as the obj?
In response to Garthor
Garthor wrote:
Sorry, but "I am gonna make an afterimage effect as you kno" is not an adequate description of what you are trying to do.

After-image

After-image \Aft"er-im`age\, n. The impression of a vivid sensation retained by the retina of the eye after the cause has been removed; also extended to impressions left of tones, smells, etc.

I thought he explained it just fine, actually. :P

proc/afterImage(mob/targetMob,delay=50,color=rgb(0,0,155))
var/mob/afterImage = new
afterImage.dir = targetMob.dir
afterImage.icon = targetMob.icon
afterImage.icon_state = targetMob.icon_state
afterImage.icon += color
afterImage.loc=targetMob.loc
spawn(delay) del(afterImage)


You could do something like that. You could also use an object instead of a mob for the afterImage variable, in case you don't want the after-image to be able to interact with players (being attackable, for instance). I'm not sure if you can use the rgb() proc in the manner I did (I think I've done it before, but I can't remember offhand), but it should work. If not, it shouldn't be hard to remedy.