Hey guys im trying to make traces on snow but using drawsprite to save some cpu cycles instead of using new entity for each trace.
So theres like 10 copies of the same trace image , they need to be drawn one next to another, im trying to figure out a way to do that bu so far i cant find examples how to draw multiple copies with specific delay/space between them.
So they cant be spawned all at once at the same time, they need delay like 4 or 5.
Heres what i have in script, i have facing and all working, just need to spawn copies with slight delay.Then ideally id apply drawmethod scale to shrink them and disappear after like 6 seconds.
So theres like 10 copies of the same trace image , they need to be drawn one next to another, im trying to figure out a way to do that bu so far i cant find examples how to draw multiple copies with specific delay/space between them.
So they cant be spawned all at once at the same time, they need delay like 4 or 5.
Heres what i have in script, i have facing and all working, just need to spawn copies with slight delay.Then ideally id apply drawmethod scale to shrink them and disappear after like 6 seconds.
Code:
void main()
{
if(openborvariant("in_level"))
trace();
}
void trace()
{//Simulates a "Snow" effect
void self = getlocalvar("self");
void tra = loadsprite("data/sprites/font3.gif");
float xpos = openborvariant("xpos");
float ypos = openborvariant("ypos");
float x = getentityproperty(self, "x");
float z = getentityproperty(self, "z");
float a = getentityproperty(self, "a");
int facing = getentityproperty(self, "direction");
int layer = getentityproperty(self, "setlayer")+2;
int drawn1 = getentityvar(self, "drawn1");
int etime = openborvariant("elapsed_time");
//DEBUG INFO ONLY, ERASE WHEN ALL TESTS ARE DONE
drawstring(50, 144, 1, "tracejest___");
drawstring(50, 244, 1,etime);
drawstring(50, 294, 1,drawn1);
if ( tra != NULL() && drawn1 == NULL() ) {
if (facing == 1) facing = 0;
else facing = 1;
setdrawmethod(NULL(), 1, 256, 256, facing);
drawsprite( tra, x-xpos, z-a-ypos-4, z+2);
changedrawmethod(NULL(), "enabled", 1);
changedrawmethod(NULL(), "reset", 1);
setdrawmethod(NULL(), 0);
setentityvar(self, "drawn1", 1);
}
}