not idle

jiam

Member
there is a script that the character is left in the last step.
as double dragon and not return to the idle position
 
One of the solutions that came into my mind is to duplicate walk anim and use it as idle anim.
Then, at the walk, you store the "animpos" on a variable and, at idle, use "updateframe" to go to the frame stored on that variable.
 
I am at my job so I can't test this:

At walk:

@script
{
void self = getlocalvar("self");
int aniFrame = getentityproperty(self,"animpos");
setlocalvar("ani", aniFrame);
}
@end_script

at IDLE

@script
{
void self = getlocalvar("self");
int ani = getlocalvar("ani");
if (!ani)
{
updateframe(self, getlocalvar("ani"));
}
}
@end_script
 
the game crashes when starting level .

you know why?

Code:
anim	idle
        loop	0
	delay	5
	offset	65 131
	bbox	58 71 18 58
@script
{
void self = getlocalvar("self");
int ani = getlocalvar("ani");
if (!ani)
   {
   updateframe(self, getlocalvar("ani"));
   }
}
@end_script
        frame	data/chars/billy/wk1.gif
		
anim	walk
	loop	1
	delay	13
	offset	66 131
	bbox	58 71 18 58
@script
{
void self = getlocalvar("self");
int aniFrame = getentityproperty(self,"animpos");
setlocalvar("ani", aniFrame);
}
@end_script
        frame	data/chars/billy/wk2.gif
	frame	data/chars/billy/wk3.gif
	offset	65 131
	frame	data/chars/billy/wk4.gif
	frame	data/chars/billy/wk1.gif

anim	up
	loop	1
	delay	13
	offset	66 131
	bbox	58 71 18 58
	frame	data/chars/billy/wku2.gif
        frame	data/chars/billy/wku3.gif
        offset	65 131
	frame	data/chars/billy/wku4.gif
        frame	data/chars/billy/wku1.gif

OpenBorLog:
There's an exception while executing script 'billy' data/chars/billy/billy.txt
 
hola yo tambien busco lo mismo se puede hacer que el jugador camine como en el double dragon??? paso a paso ???
hi i also look the same can make the player walks like in the double dragon ??? step by step ???
 
Back
Top Bottom