Help with shadow trails

  • Thread starter Thread starter Mr.Q!
  • Start date Start date
M

Mr.Q!

Guest
You know, the ones from Capcom games like SF alpha?  i need them just the color of my character but with alpha transparency or maybe a color I can also pick, like all of them to be blue, or something
 
Are you currently using entity solution or a script?

For entity, there are several ways to make transparency:

drawmethod alpha 6
drawmethod channel 0.25  # 25% transparency
frame data/chars/dd/1.gif

drawmethod tintmode 1
drawmethod tintcolor 0_0_64  # tint with a blue color using alpha mode 1
frame data/chars/dd/1.gif

For script, there has been an old trail script around, just you need to change several lines to meet your requirement. I don't know if you are using it, we'll continue the discussion if so.
 
I'm not using an entity solution for this. I remember back at lavalit there was this script for what I need, can I have it? :D
 
Thanks man!

After looking into these files, i think I can figure it out, but somehow is not working for me.

In trailer.c:

Code:
#include "data/scripts/trailer.h"

void main()
{
	int i, j, k;
	void spr;
	int facing, cd;
	float a, z, x;
	
	void ent = getlocalvar("self");
	int anim = getentityproperty(ent, "animationid");
	void map;
	int elapsed_time = openborvariant("elapsed_time");

	if(anim == openborconstant("ANI_FREESPECIAL1")){ map = getentityproperty(ent, "colourtable", 2);}
	if(anim == openborconstant("ANI_FREESPECIAL2")){ map = getentityproperty(ent, "colourtable", 0);}
	setglobalvar("blahblah.map", map);


	if(elapsed_time%trailerd==0)
	{
		if((anim == openborconstant("ANI_FREESPECIAL1")) || (anim == openborconstant("ANI_FREESPECIAL2")))
		{
		spr = getentityproperty(ent, "sprite");
		x = getentityproperty(ent, "x");
		z = getentityproperty(ent, "z");
		a = getentityproperty(ent, "a");
		facing = !getentityproperty(ent, "direction");
		for(k=1; k<=trailermax; k++) //find an empty trailer slot
		{
			if(getglobalvar("trailer"+k+".s")==NULL())
			{
				setglobalvar("trailer"+k+".s", spr);
				setglobalvar("trailer"+k+".x", x);
				setglobalvar("trailer"+k+".z", z);
				setglobalvar("trailer"+k+".a", a);
				setglobalvar("trailer"+k+".f", facing);
				setglobalvar("trailer"+k+".c", trailerc*trailerd);
				break;
			}
		}
	}
	}
}

I assume that in this line:
if((anim == openborconstant("ANI_FREESPECIAL1")) || (anim == openborconstant("ANI_FREESPECIAL2")))

I have to list which animations I want with shadow trails? I tested with those 2 animations but they're not working for my character. I loaded it with this line in my character .txt:
script            data/chars/1shaok/trailer.c

Any ideas?
 
you need put :

updatescript data/scripts/traileru.c

in every stage of your project, at least is what i used on my project and works fine
you also need to use everything that you already are using
 
also i forgot to tell
if((anim == openborconstant("ANI_FREESPECIAL1")) || (anim == openborconstant("ANI_FREESPECIAL2")))

those  animations need to be changed to the animations that you are using that will have the  shadow trails
for exemple ANI_RUN or any that you need
if you need only one animation to have trails:
if(anim == openborconstant("ANI_FREESPECIAL1"))  just change the ANI_FREESPECIAL1 to any ANI_ constants you need to play the desired animation with trails
 
Thaks for your help!

I tried what you said but now I have this error whenever I try my animations.

The error says:
There's an exception while executing script 'levelupdatescript' data/scripts/traileru.c

The traileru.c says:

Code:
#include "data/scripts/trailer.h"

void main()
{
	int i, j, k;
	void spr;
	int facing, cd;
	float a, z, x;
	void map = getglobalvar("blahblah.map");

	for(i=1; i<=trailermax; i++)
	{
		spr = getglobalvar("trailer"+i+".s");
		if(spr)
		{
			cd = getglobalvar("trailer"+i+".c");
			if(!cd) 
			{
				setglobalvar("trailer"+i+".c", NULL());
				setglobalvar("trailer"+i+".s", NULL());
				setglobalvar("trailer"+i+".x", NULL());
				setglobalvar("trailer"+i+".z", NULL());
				setglobalvar("trailer"+i+".a", NULL());
			}
			else
			{
				if(openborvariant("game_paused")==0)
				{
					setglobalvar("trailer"+i+".c", cd-1);
				}
				x = getglobalvar("trailer"+i+".x");
				z = getglobalvar("trailer"+i+".z");
				a = getglobalvar("trailer"+i+".a");
				facing = getglobalvar("trailer"+i+".f");

				setdrawmethod(NULL(), 1, 256, 256, facing, 0, 0, 6, 0, 0, 0, 0, 0, map);
				drawsprite(spr, x-openborvariant("xpos"), z-a-openborvariant("ypos"), z-i, 0);
				setdrawmethod(NULL(), 0, 256, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
			}
		}
	}
}

 
this is my traileru

is a little different

#include "data/scripts/trailer.h"

void main()
{
int i, j, k;
void spr;
int facing, cd;
float a, z, x;

for(i=1; i<=trailermax; i++)
{
spr = getglobalvar("trailer"+i+".s");
if(spr)
{
cd = getglobalvar("trailer"+i+".c");
if(!cd)
{
setglobalvar("trailer"+i+".c", NULL());
setglobalvar("trailer"+i+".s", NULL());
setglobalvar("trailer"+i+".x", NULL());
setglobalvar("trailer"+i+".z", NULL());
setglobalvar("trailer"+i+".a", NULL());
}
else
{
if(openborvariant("game_paused")==0)
{
setglobalvar("trailer"+i+".c", cd-1);
}
x = getglobalvar("trailer"+i+".x");
z = getglobalvar("trailer"+i+".z");
a = getglobalvar("trailer"+i+".a");
facing = getglobalvar("trailer"+i+".f");

setdrawmethod(NULL(), 1, 256, 256, facing, 0, 0, 6, 0);
drawsprite(spr, x-openborvariant("xpos"), z-a-openborvariant("ypos"), z-i, 0);
setdrawmethod(NULL(), 0, 256, 256, 0, 0, 0, 0, 0, 0);
}
}
}
}


in the one im using i dont have this line:
void map = getglobalvar("blahblah.map");
 
here you go: http://www.mediafire.com/download.php?fpf645736xqnnh2

maxima has the effect used on him you have to make a remap for the trail colour you want !
 
I tried the scripts you suggested me, but I get this error:


There's an exception while executing script 'levelupdatescript' data/scripts/traileru.c
 
you should have x3 trail scripts:

in scripts folder:trailer.h and traileru.c

in your characters folder:trailer.c

your character should have a reference to their trail script "script data/chars/mr.ninja/trailer.c" and each level that you want to use trails in should have this reference "updatescript data/scripts/traileru.c"

copy all these files from the demo i uploaded
 
Back
Top Bottom