How to use 8-dirrections IDLE,WALK,ATTACK animations?

bWWd said:
i edited my post and you can download what i have
Thank You for files, it helped to understand that test openbor which I tryed to test is not compatable with script. Then I put this in my own openbor progect, rename name from "car" to "craw" (log says that cant spawn player from "craw" when character name is "car"), and loading and spawn is correct. Will test and trying to do something more complated what I need (man and car), to understand movies code can adapted it in similar tasks, will post result here later
 
Id try to do it in different engine if i were you, openbor is not made for this, it could be scripted but engines like godot ,construct or gdevelop would get you there faster .

There are dwcent tutorials for this for them, openbo has none cause not many people tried to do topview car racing and 8 directional walk ,pain and idles.
In godot i had 2 players split screen platfrormer done in 1day which is quite amazing.for beatemups openbor is unbeatable but other stuff can be done sometimes faster with other engines
 
bWWd said:
Id try to do it in different engine if i were you, openbor is not made for this, it could be scripted but engines like godot ,construct or gdevelop would get you there faster .

There are dwcent tutorials for this for them, openbo has none cause not many people tried to do topview car racing and 8 directional walk ,pain and idles.
In godot i had 2 players split screen platfrormer done in 1day which is quite amazing.for beatemups openbor is unbeatable but other stuff can be done sometimes faster with other engines
Yes, I khow it, and my mod is classic beatemup platformer game, and if Id try to use any platformer engine, Id cant realise all what I need.

You help me to realise a car-like transport movement, and it works greate (it not needed JUMP or ATTACK special animations or frames in my project, only UP to move forward, and DOWN to move backward), thank You.
But realising MAN animations is some confuse me:
Code:
name       craw
type	    		player
health				100
speed    2
mp  0
shadow				0
noquake				1
cantgrab			1
notgrab				1
nodieblink			1
makeinv				1	0
falldie				2
riseinv				1	1
jugglepoints		15
nolife				1

 animationscript    data/chars/car/script.c
 nopain  1
 nodrop  1
 subject_to_platform  1
 subject_to_screen  1
gfxshadow 1
 icon  	data/chars/car/micon.gif   










		
anim	idle
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	frame	data/chars/car/iu1.gif
	offset	10 19
	bbox	6 5 83 98
	drawmethod flipx 1
	frame	data/chars/car/iu2.gif
	offset	10 19






		

		

		


		

		
anim	follow2
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ( u1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( r1 ){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ( d1 ){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if ( l1 ){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	platform	8 25 -10 -10 11 11 8 24 
	frame	data/chars/car/iur1.gif
	frame	data/chars/car/iur1.gif
	@cmd	keyint "ANI_FOLLOW3" 2 "U" 0
	@cmd	keyint "ANI_FOLLOW2" 2 "UR" 0
	@cmd	keyint "ANI_FOLLOW9" 2 "R" 0
	@cmd	keyint "ANI_FOLLOW8" 2 "DR" 0
	@cmd	keyint "ANI_FOLLOW7" 2 "D" 0
	@cmd	keyint "ANI_FOLLOW6" 2 "DL" 0
	@cmd	keyint "ANI_FOLLOW5" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW4" 2 "UL" 0
	offset	10 19
	bbox	6 5 83 98		 
	frame	data/chars/car/iur2.gif
		

		
anim	follow3
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ( u1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( r1 ){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ( d1 ){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if ( l1 ){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script		
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	 
	frame	data/chars/car/iu1.gif
	frame	data/chars/car/iu1.gif
	offset	10 19
	bbox	6 5 83 98
	@cmd	keyint "ANI_FOLLOW3" 2 "U" 0
	@cmd	keyint "ANI_FOLLOW2" 2 "UR" 0
	@cmd	keyint "ANI_FOLLOW9" 2 "R" 0
	@cmd	keyint "ANI_FOLLOW8" 2 "DR" 0
	@cmd	keyint "ANI_FOLLOW7" 2 "D" 0
	@cmd	keyint "ANI_FOLLOW6" 2 "DL" 0
	@cmd	keyint "ANI_FOLLOW5" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW4" 2 "UL" 0
	frame	data/chars/car/iu2.gif
		

		
anim	follow4
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ( u1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( r1 ){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ( d1 ){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if ( l1 ){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	 
	frame	data/chars/car/iur1.gif
	frame	data/chars/car/iur1.gif
	@cmd	keyint "ANI_FOLLOW3" 2 "U" 0
	@cmd	keyint "ANI_FOLLOW2" 2 "UR" 0
	@cmd	keyint "ANI_FOLLOW9" 2 "R" 0
	@cmd	keyint "ANI_FOLLOW8" 2 "DR" 0
	@cmd	keyint "ANI_FOLLOW7" 2 "D" 0
	@cmd	keyint "ANI_FOLLOW6" 2 "DL" 0
	@cmd	keyint "ANI_FOLLOW5" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW4" 2 "UL" 0
	offset	36 19
	bbox	6 5 83 98
		 
	frame	data/chars/car/iur2.gif
		

		
anim	follow5
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ( u1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( r1 ){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ( d1 ){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if ( l1 ){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	 
	frame	data/chars/car/ir1.gif
	frame	data/chars/car/ir1.gif
	@cmd	keyint "ANI_FOLLOW3" 2 "U" 0
	@cmd	keyint "ANI_FOLLOW2" 2 "UR" 0
	@cmd	keyint "ANI_FOLLOW9" 2 "R" 0
	@cmd	keyint "ANI_FOLLOW8" 2 "DR" 0
	@cmd	keyint "ANI_FOLLOW7" 2 "D" 0
	@cmd	keyint "ANI_FOLLOW6" 2 "DL" 0
	@cmd	keyint "ANI_FOLLOW5" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW4" 2 "UL" 0
	offset	36 19
	bbox	6 5 83 98
		 
	frame	data/chars/car/ir2.gif

	


		
anim	follow6
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ( u1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( r1 ){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ( d1 ){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if ( l1 ){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	 
	frame	data/chars/car/ird1.gif
	frame	data/chars/car/ird1.gif
	@cmd	keyint "ANI_FOLLOW3" 2 "U" 0
	@cmd	keyint "ANI_FOLLOW2" 2 "UR" 0
	@cmd	keyint "ANI_FOLLOW9" 2 "R" 0
	@cmd	keyint "ANI_FOLLOW8" 2 "DR" 0
	@cmd	keyint "ANI_FOLLOW7" 2 "D" 0
	@cmd	keyint "ANI_FOLLOW6" 2 "DL" 0
	@cmd	keyint "ANI_FOLLOW5" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW4" 2 "UL" 0
	offset	36 19
	bbox	6 5 83 98
	 
	frame	data/chars/car/ird2.gif

	
	
	anim	follow7
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ( u1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( r1 ){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ( d1 ){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if ( l1 ){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	 
	frame	data/chars/car/id1.gif
	frame	data/chars/car/id1.gif
	@cmd	keyint "ANI_FOLLOW3" 2 "U" 0
	@cmd	keyint "ANI_FOLLOW2" 2 "UR" 0
	@cmd	keyint "ANI_FOLLOW9" 2 "R" 0
	@cmd	keyint "ANI_FOLLOW8" 2 "DR" 0
	@cmd	keyint "ANI_FOLLOW7" 2 "D" 0
	@cmd	keyint "ANI_FOLLOW6" 2 "DL" 0
	@cmd	keyint "ANI_FOLLOW5" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW4" 2 "UL" 0
	offset	10 19
	bbox	6 5 83 98
	 
	frame	data/chars/car/id2.gif
	
	
	anim	follow8
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ( u1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( r1 ){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ( d1 ){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if ( l1 ){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	 
	frame	data/chars/car/ird1.gif
	frame	data/chars/car/ird1.gif
	@cmd	keyint "ANI_FOLLOW3" 2 "U" 0
	@cmd	keyint "ANI_FOLLOW2" 2 "UR" 0
	@cmd	keyint "ANI_FOLLOW9" 2 "R" 0
	@cmd	keyint "ANI_FOLLOW8" 2 "DR" 0
	@cmd	keyint "ANI_FOLLOW7" 2 "D" 0
	@cmd	keyint "ANI_FOLLOW6" 2 "DL" 0
	@cmd	keyint "ANI_FOLLOW5" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW4" 2 "UL" 0
	offset	10 19
	bbox	6 5 83 98
	 
	frame	data/chars/car/ird2.gif
		

anim	follow9
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ( u1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( r1 ){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ( d1 ){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if ( l1 ){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	 
	frame	data/chars/car/ir1.gif
	frame	data/chars/car/ir1.gif
	@cmd	keyint "ANI_FOLLOW3" 2 "U" 0
	@cmd	keyint "ANI_FOLLOW2" 2 "UR" 0
	@cmd	keyint "ANI_FOLLOW9" 2 "R" 0
	@cmd	keyint "ANI_FOLLOW8" 2 "DR" 0
	@cmd	keyint "ANI_FOLLOW7" 2 "D" 0
	@cmd	keyint "ANI_FOLLOW6" 2 "DL" 0
	@cmd	keyint "ANI_FOLLOW5" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW4" 2 "UL" 0
	offset	10 19
	bbox	6 5 83 98
	 
	frame	data/chars/car/ir2.gif

	

		
anim	pain1
	loop	0
	offset	10 19
	bbox	6 5 83 98
	delay	50
	frame	data/chars/car/car.gif
	delay	15
	frame	data/chars/car/car.gif
		
anim	spawn
	loop	0
	@cmd	performattack getlocalvar("self") openborconstant("ANI_FOLLOW3")
	offset	10 19
	bbox	6 5 83 98
	delay	2
	frame	data/chars/car/car.gif
	frame	data/chars/car/car.gif

		
#|edited by openBor Stats v 0.67
In this animation text something wrong? (frames visually sometimes have a missing dirrection then character move or stops. When I press UP, for example, a frames is switching between follow3 and follow2)
 
It would be better if you make labels next to animation names so you wouldn't get yourself confused on which is for which.

Example:

Code:
anim follow2 #Upper right

I don't like to quote on the code but why is there an animation under the same animation? It's to keep button in momentum for the car to retain its direction til you turn to different directions?

anim follow2
@script
                void self = getlocalvar("self");
int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                if ( u1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
}
          if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
}
                if ( r1 ){
                changeentityproperty(self, "velocity", sped ,0);
}
                if ( d1 ){
                changeentityproperty(self, "velocity", 0 ,sped);
}
                if ( l1 ){
                changeentityproperty(self, "velocity", -sped ,0);
}
          if (( u1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
}
          if (( u1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
}
          if (( d1 )&&(r1)){
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
}
          if (( d1 )&&(l1)){
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
}
@end_script
loop 1 1
offset 10 19
bbox 6 5 83 98
delay 5
platform 8 25 -10 -10 11 11 8 24
frame data/chars/car/iur1.gif
frame data/chars/car/iur1.gif
@cmd keyint "ANI_FOLLOW3" 2 "U" 0
@cmd keyint "ANI_FOLLOW2" 2 "UR" 0
@cmd keyint "ANI_FOLLOW9" 2 "R" 0
@cmd keyint "ANI_FOLLOW8" 2 "DR" 0
@cmd keyint "ANI_FOLLOW7" 2 "D" 0
@cmd keyint "ANI_FOLLOW6" 2 "DL" 0
@cmd keyint "ANI_FOLLOW5" 2 "L" 0
@cmd keyint "ANI_FOLLOW4" 2 "UL" 0
offset 10 19
bbox 6 5 83 98
frame data/chars/car/iur2.gif
 
maxman said:
I don't like to quote on the code but why is there an animation under the same animation? It's to keep button in momentum for the car to retain its direction til you turn to different directions?

Hmm... intresting, something is changed.
 
If I deleted all animations under the same animations, then if character stops after move UP, a stopped ftames always has UR dirrection... I think it better if I return it back for now.
 
I noticed a certain incorrect logic for showing sprites:
if we hold down only the up key, or only up+right, then the sprites alternate between up and up-right directions.
if we hold down only the right key,or only down+right, then the sprites alternate between the directions to the right and down-right.
And so on in a circle ...
Why could this happen?
 
its a syntaxis error:
Diagonal keys in @cmd commands not working...
How can I use this command correct to openbor can understand it?
Tryed:
Code:
	@cmd	keyint "ANI_FOLLOW2" 2 (((playerkeys(iPIndex, 0, "moveup")&&(playerkeys(iPIndex, 0, "moveright"))) 0
not working...
just @cmd keyint "ANI_FOLLOW2" 2 "U"&&"R" 0
is not working too.
 
what you want to do? why U and R ? it doesnt work like that, it just detects one button and is changing  animation.
you would have to change this script.c for this.

Anyway i made new car entity, its just one animation and works quite well...

Code:
anim	follow3
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
				  setlocalvar("vsped",getentityproperty(self, "speed")); 
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "attack");
                void j1 = playerkeys(iPIndex, 0, "jump");
              	void right 	=  playerkeys(iPIndex, 0, "moveright");
	            void left 	=  playerkeys(iPIndex, 0, "moveleft");
				float rot;
				 changedrawmethod(self, "enabled", 1);
				 				           if (getlocalvar("rot") == NULL() ){
                  setlocalvar("rot",0); 
		}
						 				           if (getlocalvar("rot") > 305 ){
                  setlocalvar("rot",-30); 
		}
								 				           if (getlocalvar("rot") <= -40 ){
                  setlocalvar("rot",315); 
		}
                if ( getentityproperty(self, "zdir") > -sped && a1 && getlocalvar("rot")== 0 ){
                  changeentityproperty(self, "velocity", 0 , getentityproperty(self, "zdir")+0.3*-1.15);
		}
		                if ( a1 && getlocalvar("rot") == 15 ){
                changeentityproperty(self, "velocity", sped/3 ,-sped/1.15);
		}
				                if ( a1 && getlocalvar("rot") == 30 ){
                changeentityproperty(self, "velocity", sped/2.25 ,-sped/1.25);
		}
	
		if ( getentityproperty(self, "xdir") < sped/1.35 && getentityproperty(self, "zdir") > -sped/1.35 && a1 && getlocalvar("rot")== 45 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*+1.15, getentityproperty(self, "zdir")+0.3*-1.15);
		}
		
				                if ( a1 && getlocalvar("rot") == 60 ){
                changeentityproperty(self, "velocity", sped/1.25 ,-sped/2.25);
		}
				                if ( a1 && getlocalvar("rot") == 75 ){
                changeentityproperty(self, "velocity", sped/1.15 ,-sped/3);
		}
		
		                if ( getentityproperty(self, "xdir") < sped && a1 && getlocalvar("rot")== 90 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*1.15,0);
		}
		
		
					                if ( a1 && getlocalvar("rot") == 105 ){
                changeentityproperty(self, "velocity", sped/1.15 ,sped/3);
		}
					                if ( a1 && getlocalvar("rot") == 120 ){
                changeentityproperty(self, "velocity", sped/1.25 ,sped/2.25);
		}

		
				if ( getentityproperty(self, "xdir") < sped/1.35 && getentityproperty(self, "zdir") < sped/1.35 && a1 && getlocalvar("rot")== 135 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*+1.15, getentityproperty(self, "zdir")+0.3*+1.15);
		}
		
					                if ( a1 && getlocalvar("rot") == 150 ){
                changeentityproperty(self, "velocity", sped/2.25 ,sped/1.25);
		}
					                if ( a1 && getlocalvar("rot") == 165 ){
                changeentityproperty(self, "velocity", sped/3 ,sped/1.15);
		}
		
		                if ( getentityproperty(self, "zdir") < sped && a1 && getlocalvar("rot")== 180 ){
                  changeentityproperty(self, "velocity", 0 , getentityproperty(self, "zdir")+0.3*1.15);
		}

		                if ( a1 && getlocalvar("rot") == 195 ){
                changeentityproperty(self, "velocity", -sped/3 ,sped/1.15);
		}
				                if ( a1 && getlocalvar("rot") == 210 ){
                changeentityproperty(self, "velocity", -sped/2.25 ,sped/1.25);
		}
		
						if ( getentityproperty(self, "xdir") > -sped/1.35 && getentityproperty(self, "zdir") < sped/1.35 && a1 && getlocalvar("rot")== 225 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*-1.15, getentityproperty(self, "zdir")+0.3*+1.15);
		}
		
				                if ( a1 && getlocalvar("rot") == 240 ){
                changeentityproperty(self, "velocity", -sped/1.25 ,sped/2.25);
		}
				                if ( a1 && getlocalvar("rot") == 255 ){
                changeentityproperty(self, "velocity", -sped/1.15 ,sped/3);
		}
		
				                if ( getentityproperty(self, "xdir") > -sped && a1 && getlocalvar("rot")== 270 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*-1.15,0);
		}
						                if ( a1 && getlocalvar("rot") == 285 ){
                changeentityproperty(self, "velocity", -sped/1.15 ,-sped/3);
		}
					                if ( a1 && getlocalvar("rot") == 300 ){
                changeentityproperty(self, "velocity", -sped/1.25 ,-sped/2.25);
		}
				if ( getentityproperty(self, "xdir") > -sped/1.35 && getentityproperty(self, "zdir") > -sped/1.35 && a1 && getlocalvar("rot")== 315 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*-1.15, getentityproperty(self, "zdir")+0.3*-1.15);
		}
						if ( getentityproperty(self, "xdir") > -sped/1.35 && getentityproperty(self, "zdir") > -sped/1.35 && a1 && getlocalvar("rot")== -45 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*-1.15, getentityproperty(self, "zdir")+0.3*-1.15);
		}

					                if ( a1 && getlocalvar("rot") == -30 ){
                changeentityproperty(self, "velocity", -sped/2.25 ,-sped/1.25);
		}
					                if ( a1 && getlocalvar("rot") == -15 ){
                changeentityproperty(self, "velocity", -sped/3 ,-sped/1.15);
		}


		        if ( !a1 && !j1  ){
		        changeentityproperty(self, "velocity", getentityproperty(self, "xdir")/1.15 ,getentityproperty(self, "zdir")/1.15);
				changeentityproperty(self, "animpos", 1);
		}

                if ( getentityproperty(self, "zdir") < sped && j1 && getlocalvar("rot")== 0 ){
                  changeentityproperty(self, "velocity", 0 , getentityproperty(self, "zdir")+0.3*+1.15);
		}
		                if ( j1 && getlocalvar("rot") == 15 ){
                changeentityproperty(self, "velocity", -sped/3 ,sped/1.15);
		}
				                if ( j1 && getlocalvar("rot") == 30 ){
                changeentityproperty(self, "velocity", -sped/2.25 ,sped/1.25);
		}
	
		if ( getentityproperty(self, "xdir") > -sped/1.35 && getentityproperty(self, "zdir") < sped/1.35 && j1 && getlocalvar("rot")== 45 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*-1.15, getentityproperty(self, "zdir")+0.3*+1.15);
		}
		
				                if ( j1 && getlocalvar("rot") == 60 ){
                changeentityproperty(self, "velocity", -sped/1.25 ,sped/2.25);
		}
				                if ( j1 && getlocalvar("rot") == 75 ){
                changeentityproperty(self, "velocity", -sped/1.15 ,sped/3);
		}
		
		                if ( getentityproperty(self, "xdir") > -sped && j1 && getlocalvar("rot")== 90 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*-1.15,0);
		}
		
		
					                if ( j1 && getlocalvar("rot") == 105 ){
                changeentityproperty(self, "velocity", -sped/1.15 ,-sped/3);
		}
					                if ( j1 && getlocalvar("rot") == 120 ){
                changeentityproperty(self, "velocity", -sped/1.25 ,-sped/2.25);
		}

		
				if ( getentityproperty(self, "xdir") > -sped/1.35 && getentityproperty(self, "zdir") > -sped/1.35 && j1 && getlocalvar("rot")== 135 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*-1.15, getentityproperty(self, "zdir")+0.3*-1.15);
		}
		
					                if ( j1 && getlocalvar("rot") == 150 ){
                changeentityproperty(self, "velocity", -sped/2.25 ,-sped/1.25);
		}
					                if ( j1 && getlocalvar("rot") == 165 ){
                changeentityproperty(self, "velocity", -sped/3 ,-sped/1.15);
		}
		
		                if ( getentityproperty(self, "zdir") > -sped && j1 && getlocalvar("rot")== 180 ){
                  changeentityproperty(self, "velocity", 0 , getentityproperty(self, "zdir")+0.3*-1.15);
		}

		                if ( j1 && getlocalvar("rot") == 195 ){
                changeentityproperty(self, "velocity", sped/3 ,-sped/1.15);
		}
				                if ( j1 && getlocalvar("rot") == 210 ){
                changeentityproperty(self, "velocity", sped/2.25 ,-sped/1.25);
		}
		
						if ( getentityproperty(self, "xdir") < sped/1.35 && getentityproperty(self, "zdir") > -sped/1.35 && j1 && getlocalvar("rot")== 225 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*1.15, getentityproperty(self, "zdir")+0.3*-1.15);
		}
		
				                if ( j1 && getlocalvar("rot") == 240 ){
                changeentityproperty(self, "velocity", sped/1.25 ,-sped/2.25);
		}
				                if ( j1 && getlocalvar("rot") == 255 ){
                changeentityproperty(self, "velocity", sped/1.15 ,-sped/3);
		}
		
				                if ( getentityproperty(self, "xdir") < sped && j1 && getlocalvar("rot")== 270 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*+1.15,0);
		}
						                if ( j1 && getlocalvar("rot") == 285 ){
                changeentityproperty(self, "velocity", sped/1.15 ,sped/3);
		}
					                if ( j1 && getlocalvar("rot") == 300 ){
                changeentityproperty(self, "velocity", sped/1.25 ,sped/2.25);
		}
				if ( getentityproperty(self, "xdir") > -sped/1.35 && getentityproperty(self, "zdir") > -sped/1.35 && j1 && getlocalvar("rot")== 315 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*+1.15, getentityproperty(self, "zdir")+0.3*+1.15);
		}
						if ( getentityproperty(self, "xdir") > -sped/1.35 && getentityproperty(self, "zdir") > -sped/1.35 && j1 && getlocalvar("rot")== -45 ){
                  changeentityproperty(self, "velocity", getentityproperty(self, "xdir")+0.3*+1.15, getentityproperty(self, "zdir")+0.3*+1.15);
		}

					                if ( j1 && getlocalvar("rot") == -30 ){
                changeentityproperty(self, "velocity", sped/2.25 ,sped/1.25);
		}
					                if ( j1 && getlocalvar("rot") == -15 ){
                changeentityproperty(self, "velocity", sped/3 ,sped/1.15);
		}
		        if ( left ){
          
				rot =  setlocalvar("rot", getlocalvar("rot")-15); 
				
					        changedrawmethod(self, "rotate",getlocalvar("rot"));
								  settextobj(1, 150 , 100 , 1, 1,getlocalvar("rot"), openborvariant("elapsed_time")+2000);
		}
		        if ( right ){
              
				 rot = setlocalvar("rot", getlocalvar("rot")+15); 
				 
					    changedrawmethod(self, "rotate",getlocalvar("rot"));
							  settextobj(1, 150 , 100 , 1, 1,getlocalvar("rot"), openborvariant("elapsed_time")+2000);
		}
	@end_script		
	loop	1 
	offset	22 23
	bbox	6 5 83 98
	delay	7
	sound	data/chars/car/car.wav
	frame	data/chars/car/car.gif
	frame	data/chars/car/car.gif


I think that keyint script is not good for walking cahracter, you need to hold both keys to walk diagonally and this script doesnt detect that.
I think you should modify my new car script and just change animation instead of rotating by drawmethod.
 
bWWd said:
what you want to do?

Hello, I removed drawmetod from Your old version, 1 specified frame in each follow animation is works very great, thank You so mutch. And i change backward two keys (down+jump) to one down key, + add UP key to move too. This mechanic (16way rotation) and animation was most wanted for my mod too, and its working, look at the video:
https://drive.google.com/file/d/1Jqk7HWyffXzYhjBaBVM5eCqjszp0NtqE/view?usp=sharing
here is the modified and working script to my "car":
(it will needs to little correct some speeds)
Code:
name       rrr
type	    		player
health				100
speed    8
mp  0
shadow				0
noquake				1
cantgrab			1
notgrab				1
nodieblink			1
makeinv				1	0
falldie				2
riseinv				1	1
jugglepoints		15
nolife				1

 animationscript    data/chars/car/script.c
 nopain  1
 nodrop  1
 subject_to_platform  1
 subject_to_screen  1
gfxshadow 0
 icon  	data/chars/car/rrr/1.gif   
	
anim	idle
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	frame	data/chars/car/rrr/1.gif
	frame	data/chars/car/rrr/1.gif
	offset	10 19
	bbox	6 5 83 98
	frame	data/chars/car/rrr/1.gif

anim	follow1
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void u1 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( u1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	frame	data/chars/car/rrr/1.gif
	frame	data/chars/car/rrr/1.gif
	offset	10 19
	bbox	6 5 83 98
	@cmd	keyint "ANI_FOLLOW16" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW2" 2 "R" 0
	frame	data/chars/car/rrr/1.gif
		
anim	follow2
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void u1 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", sped/1.75 ,-sped/1.25);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( u1 ){
                changeentityproperty(self, "velocity", sped/1.75 ,-sped/1.25);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", -sped/1.75 ,sped/1.25);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	frame	data/chars/car/rrr/3.gif
	frame	data/chars/car/rrr/3.gif
	@cmd	keyint "ANI_FOLLOW1" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW3" 2 "R" 0
	offset	10 19
	bbox	6 5 83 98		 
	frame	data/chars/car/rrr/3.gif
		
anim	follow3
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void u1 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", sped/1.50 ,-sped/1.50);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( u1 ){
                changeentityproperty(self, "velocity", sped/1.50 ,-sped/1.50);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", -sped/1.50 ,sped/1.50);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	 
	frame	data/chars/car/rrr/4.gif
	frame	data/chars/car/rrr/4.gif
	offset	10 19
	bbox	6 5 83 98
	@cmd	keyint "ANI_follow2" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW4" 2 "R" 0
	frame	data/chars/car/rrr/4.gif
		
anim	follow4
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void u1 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", sped/1.25 ,-sped/1.75);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( u1 ){
                changeentityproperty(self, "velocity", sped/1.25 ,-sped/1.75);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", -sped/1.25 ,sped/1.75);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	frame	data/chars/car/rrr/5.gif
	frame	data/chars/car/rrr/5.gif
	@cmd	keyint "ANI_FOLLOW3" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW5" 2 "R" 0
	offset	10 19
	bbox	6 5 83 98
		 
	frame	data/chars/car/rrr/5.gif
		
anim	follow5
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void a11 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", sped ,0);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( a11 ){
                changeentityproperty(self, "velocity", sped ,0);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", -sped ,0);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	frame	data/chars/car/rrr/7.gif
	frame	data/chars/car/rrr/7.gif
	@cmd	keyint "ANI_FOLLOW4" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW6" 2 "R" 0
	offset	10 19
	bbox	6 5 83 98
		 
	frame	data/chars/car/rrr/7.gif

anim	follow6
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void a11 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", sped/1.25 ,sped/1.75);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( a11 ){
                changeentityproperty(self, "velocity", sped/1.25 ,sped/1.75);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", -sped/1.25 ,-sped/1.75);
		}
	@end_script	
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	 
	frame	data/chars/car/rrr/9.gif
	frame	data/chars/car/rrr/9.gif
	@cmd	keyint "ANI_FOLLOW5" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW7" 2 "R" 0
	offset	10 19
	bbox	6 5 83 98
	 
	frame	data/chars/car/rrr/9.gif
	
	anim	follow7
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void a11 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                 changeentityproperty(self, "velocity", sped/1.50 ,sped/1.50);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( a11 ){
                changeentityproperty(self, "velocity", sped/1.50 ,sped/1.50);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", -sped/1.50 ,-sped/1.50);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	 
	frame	data/chars/car/rrr/10.gif
	frame	data/chars/car/rrr/10.gif
	@cmd	keyint "ANI_FOLLOW6" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW8" 2 "R" 0
	offset	10 19
	bbox	6 5 83 98
	 
	frame	data/chars/car/rrr/10.gif
	
	
	anim	follow8
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void a11 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", sped/1.75 ,sped/1.25);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( a11 ){
                changeentityproperty(self, "velocity", sped/1.75 ,sped/1.25);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", -sped/1.75 ,-sped/1.25);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	 
	frame	data/chars/car/rrr/11.gif
	frame	data/chars/car/rrr/11.gif
	@cmd	keyint "ANI_FOLLOW7" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW9" 2 "R" 0
	offset	10 19
	bbox	6 5 83 98
	 
	frame	data/chars/car/rrr/11.gif
		
anim	follow9
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void a11 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( a11 ){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	 
	frame	data/chars/car/rrr/13.gif
	frame	data/chars/car/rrr/13.gif
	@cmd	keyint "ANI_FOLLOW8" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW10" 2 "R" 0
	offset	10 19
	bbox	6 5 83 98
	 
	frame	data/chars/car/rrr/13.gif

anim	follow10
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void u1 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", -sped/1.75 ,sped/1.25);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( u1 ){
                changeentityproperty(self, "velocity", -sped/1.75 ,sped/1.25);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", sped/1.75 ,-sped/1.25);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	frame	data/chars/car/rrr/11.gif
	frame	data/chars/car/rrr/11.gif
	offset	36 19
	bbox	6 5 83 98
	@cmd	keyint "ANI_follow9" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW11" 2 "R" 0
	frame	data/chars/car/rrr/11.gif
		
anim	follow11
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void u1 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", -sped/1.50 ,sped/1.50);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( u1 ){
                changeentityproperty(self, "velocity", -sped/1.50 ,sped/1.50);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", sped/1.50 ,-sped/1.50);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	frame	data/chars/car/rrr/10.gif
	frame	data/chars/car/rrr/10.gif
	@cmd	keyint "ANI_follow10" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW12" 2 "R" 0
	offset	36 19
	bbox	6 5 83 98		 
	frame	data/chars/car/rrr/10.gif
		
anim	follow12
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void u1 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", -sped/1.25 ,sped/1.75);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( u1 ){
                changeentityproperty(self, "velocity", -sped/1.25 ,sped/1.75);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", sped/1.25 ,-sped/1.75);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	frame	data/chars/car/rrr/9.gif
	frame	data/chars/car/rrr/9.gif
	offset	36 19
	bbox	6 5 83 98
	@cmd	keyint "ANI_follow11" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW13" 2 "R" 0
	frame	data/chars/car/rrr/9.gif
		
anim	follow13
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void u1 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( u1 ){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", sped ,0);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	frame	data/chars/car/rrr/7.gif
	frame	data/chars/car/rrr/7.gif
	@cmd	keyint "ANI_FOLLOW12" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW14" 2 "R" 0
	offset	36 19
	bbox	6 5 83 98
	frame	data/chars/car/rrr/7.gif
		
anim	follow14
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void a11 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", -sped/1.25 ,-sped/1.75);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( a11 ){
                changeentityproperty(self, "velocity", -sped/1.25 ,-sped/1.75);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", sped/1.25 ,sped/1.75);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	frame	data/chars/car/rrr/5.gif
	frame	data/chars/car/rrr/5.gif
	@cmd	keyint "ANI_FOLLOW13" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW15" 2 "R" 0
	offset	36 19
	bbox	6 5 83 98
	frame	data/chars/car/rrr/5.gif

anim	follow15
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void a11 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", -sped/1.50 ,-sped/1.50);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( a11 ){
                changeentityproperty(self, "velocity", -sped/1.50 ,-sped/1.50);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", sped/1.50 ,sped/1.50);
		}
	@end_script	
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	frame	data/chars/car/rrr/4.gif
	frame	data/chars/car/rrr/4.gif
	@cmd	keyint "ANI_FOLLOW14" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW16" 2 "R" 0
	offset	36 19
	bbox	6 5 83 98
	frame	data/chars/car/rrr/4.gif

	anim	follow16
		@script
                void self = getlocalvar("self");
				 int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void a1 = playerkeys(iPIndex, 0, "jump");
                void a11 = playerkeys(iPIndex, 0, "moveup");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                 if ( a1 ){
                changeentityproperty(self, "velocity", -sped/1.75 ,-sped/1.25);
		}
		           if ( !a1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ( a11 ){
                changeentityproperty(self, "velocity", -sped/1.75 ,-sped/1.25);
		}
		 if ( d1 ){
                changeentityproperty(self, "velocity", sped/1.75 ,sped/1.25);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	frame	data/chars/car/rrr/3.gif
	frame	data/chars/car/rrr/3.gif
	@cmd	keyint "ANI_FOLLOW15" 2 "L" 0
	@cmd	keyint "ANI_FOLLOW1" 2 "R" 0
	offset	36 19
	bbox	6 5 83 98
	frame	data/chars/car/rrr/3.gif

anim	pain1
	loop	0
	offset	10 19
	bbox	6 5 83 98
	delay	50
	frame	data/chars/car/car.gif
	delay	15
	frame	data/chars/car/car.gif
		
anim	spawn
	loop	0
	@cmd	performattack getlocalvar("self") openborconstant("ANI_FOLLOW1")
	offset	10 19
	bbox	6 5 83 98
	delay	2
	frame	data/chars/car/car.gif
	frame	data/chars/car/car.gif

#|edited by openBor Stats v 0.67
If You want to see what this mechanic finaly will do in my mod, i can send this spoiler in PM.
Now I need 8way (not rotation by 2 keys) movement mechanic to man, wich will use several frames to each dirrection (originals and flips, like in my car animation text), and understend now that frames shows missing with that code (from 24 july)

It cant understud UP and Right key is pressed, maybe we can change animation derrectly in script? Like in Your last car animtext rotate is changed by script.
OR maybe we can use separate two key is pressed detection metod wich detect "Jump" and "down" buttons is pressed in onetime?
 
UPD: 8-dirrections WALK animation is work very well
Moddified script:
Code:
name       mann
type	    		player
health				100
speed    2
mp  0
shadow				0
noquake				1
cantgrab			1
notgrab				1
nodieblink			1
makeinv				1	0
falldie				2
riseinv				1	1
jugglepoints		15
nolife				1

 animationscript    data/chars/car/script.c
 nopain  1
 nodrop  1
 subject_to_platform  1
 subject_to_screen  1
gfxshadow 0
 icon  	data/chars/car/micon.gif   
		
anim	idle
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	frame	data/chars/car/iu1.gif
	offset	10 19
	bbox	6 5 83 98
	frame	data/chars/car/iu1.gif
	offset	10 19
		
anim	follow2
		@script
                void self = getlocalvar("self");
				int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ((u1 )&&(!d1)){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ((r1 )&&(!l1)){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ((d1 )&&(!u1)){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if (( l1 )&&(!r1)){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)&&(!d1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW4"));
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)&&(!d1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW2"));
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)&&(!u1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW8"));
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)&&(!u1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW6"));
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	platform	8 25 -10 -10 11 11 8 24
	frame	data/chars/car/iur1.gif
	frame	data/chars/car/iur1.gif
	frame	data/chars/car/iur2.gif 
   @cmd   keyint "ANI_FOLLOW9" 2 "R" 0
   @cmd   keyint "ANI_FOLLOW7" 2 "D" 0
   @cmd   keyint "ANI_FOLLOW3" 2 "U" 0
   @cmd   keyint "ANI_FOLLOW5" 2 "L" 0
	offset	10 19
	bbox	6 5 83 98		
	frame	data/chars/car/iur2.gif
		
anim	follow3
		@script
                void self = getlocalvar("self");
				int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ((u1 )&&(!d1)){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ((r1 )&&(!l1)){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ((d1 )&&(!u1)){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if (( l1 )&&(!r1)){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)&&(!d1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW4"));
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)&&(!d1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW2"));
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)&&(!u1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW8"));
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)&&(!u1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW6"));
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script		
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	
	frame	data/chars/car/iu1.gif
	frame	data/chars/car/iu1.gif
	frame	data/chars/car/iu2.gif
   @cmd   keyint "ANI_FOLLOW9" 2 "R" 0
   @cmd   keyint "ANI_FOLLOW7" 2 "D" 0
   @cmd   keyint "ANI_FOLLOW5" 2 "L" 0
	offset	10 19
	bbox	6 5 83 98
	frame	data/chars/car/iu2.gif
		

		
anim	follow4
		@script
                void self = getlocalvar("self");
				int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ((u1 )&&(!d1)){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ((r1 )&&(!l1)){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ((d1 )&&(!u1)){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if (( l1 )&&(!r1)){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)&&(!d1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW4"));
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)&&(!d1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW2"));
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)&&(!u1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW8"));
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)&&(!u1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW6"));
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	
	frame	data/chars/car/iur1.gif
	frame	data/chars/car/iur1.gif 
	frame	data/chars/car/iur2.gif 
   @cmd   keyint "ANI_FOLLOW9" 2 "R" 0
   @cmd   keyint "ANI_FOLLOW7" 2 "D" 0
   @cmd   keyint "ANI_FOLLOW3" 2 "U" 0
   @cmd   keyint "ANI_FOLLOW5" 2 "L" 0
	offset	36 19
	bbox	6 5 83 98
		
	frame	data/chars/car/iur2.gif
		

		
anim	follow5
		@script
                void self = getlocalvar("self");
				int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ((u1 )&&(!d1)){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ((r1 )&&(!l1)){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ((d1 )&&(!u1)){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if (( l1 )&&(!r1)){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)&&(!d1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW4"));
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)&&(!d1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW2"));
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)&&(!u1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW8"));
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)&&(!u1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW6"));
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	
	frame	data/chars/car/ir1.gif
	frame	data/chars/car/ir1.gif 
	frame	data/chars/car/ir2.gif 
   @cmd   keyint "ANI_FOLLOW9" 2 "R" 0
   @cmd   keyint "ANI_FOLLOW7" 2 "D" 0
   @cmd   keyint "ANI_FOLLOW3" 2 "U" 0
	offset	36 19
	bbox	6 5 83 98
		
	frame	data/chars/car/ir2.gif

	


		
anim	follow6
		@script
                void self = getlocalvar("self");
				int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ((u1 )&&(!d1)){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ((r1 )&&(!l1)){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ((d1 )&&(!u1)){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if (( l1 )&&(!r1)){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)&&(!d1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW4"));
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)&&(!d1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW2"));
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)&&(!u1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW8"));
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)&&(!u1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW6"));
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	36 19
	bbox	6 5 83 98
	delay	5
	drawmethod	flipx 1
	
	frame	data/chars/car/ird1.gif
	frame	data/chars/car/ird1.gif 
	frame	data/chars/car/ird2.gif 
   @cmd   keyint "ANI_FOLLOW9" 2 "R" 0
   @cmd   keyint "ANI_FOLLOW7" 2 "D" 0
   @cmd   keyint "ANI_FOLLOW3" 2 "U" 0
   @cmd   keyint "ANI_FOLLOW5" 2 "L" 0
	offset	36 19
	bbox	6 5 83 98
	
	frame	data/chars/car/ird2.gif

	
	
	anim	follow7
		@script
                void self = getlocalvar("self");
				int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if ((u1 )&&(!d1)){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if ((r1 )&&(!l1)){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if ((d1 )&&(!u1)){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if (( l1 )&&(!r1)){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)&&(!d1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW4"));
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)&&(!d1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW2"));
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)&&(!u1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW8"));
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)&&(!u1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW6"));
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	
	frame	data/chars/car/id1.gif
	frame	data/chars/car/id1.gif 
	frame	data/chars/car/id2.gif 
   @cmd   keyint "ANI_FOLLOW9" 2 "R" 0
   @cmd   keyint "ANI_FOLLOW3" 2 "U" 0
   @cmd   keyint "ANI_FOLLOW5" 2 "L" 0
	offset	10 19
	bbox	6 5 83 98
	
	frame	data/chars/car/id2.gif
	
	
	anim	follow8
		@script
                void self = getlocalvar("self");
				int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if (( u1 )&&(!d1)){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if (( r1 )&&(!l1)){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if (( d1 )&&(!u1)){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if (( l1 )&&(!r1)){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)&&(!d1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW4"));
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)&&(!d1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW2"));
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)&&(!u1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW8"));
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)&&(!u1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW6"));
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	
	frame	data/chars/car/ird1.gif
	frame	data/chars/car/ird1.gif 
	frame	data/chars/car/ird2.gif 
   @cmd   keyint "ANI_FOLLOW9" 2 "R" 0
   @cmd   keyint "ANI_FOLLOW7" 2 "D" 0
   @cmd   keyint "ANI_FOLLOW3" 2 "U" 0
   @cmd   keyint "ANI_FOLLOW5" 2 "L" 0
	offset	10 19
	bbox	6 5 83 98
	
	frame	data/chars/car/ird2.gif
		

anim	follow9
		@script
                void self = getlocalvar("self");
				int sped = getentityproperty(self, "speed");
                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void u1 = playerkeys(iPIndex, 0, "moveup");
                void r1 = playerkeys(iPIndex, 0, "moveright");
                 void d1 = playerkeys(iPIndex, 0, "movedown");
                void l1 = playerkeys(iPIndex, 0, "moveleft");
                 if (( u1 )&&(!d1)){
                changeentityproperty(self, "velocity", 0 ,-sped);
		}
		           if ( !u1 ){
                changeentityproperty(self, "velocity", 0 ,0);
		}
                 if (( r1 )&&(!l1)){
                changeentityproperty(self, "velocity", sped ,0);
		}
                 if (( d1 )&&(!u1)){
                changeentityproperty(self, "velocity", 0 ,sped);
		}
                 if (( l1 )&&(!r1)){
                changeentityproperty(self, "velocity", -sped ,0);
		}
		           if (( u1 )&&(l1)&&(!d1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW4"));
                changeentityproperty(self, "velocity", -sped/1.35 ,-sped/1.35);
		}
		           if (( u1 )&&(r1)&&(!d1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW2"));
                changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
		}
		           if (( d1 )&&(r1)&&(!u1)&&(!l1)){
				performattack(self, openborconstant("ANI_FOLLOW8"));
                changeentityproperty(self, "velocity", sped/1.35 ,sped/1.35);
		}
		           if (( d1 )&&(l1)&&(!u1)&&(!r1)){
				performattack(self, openborconstant("ANI_FOLLOW6"));
                changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
		}
	@end_script	
	loop	1 1
	offset	10 19
	bbox	6 5 83 98
	delay	5
	
	frame	data/chars/car/ir1.gif
	frame	data/chars/car/ir1.gif 
	frame	data/chars/car/ir2.gif
   @cmd   keyint "ANI_FOLLOW7" 2 "D" 0
   @cmd   keyint "ANI_FOLLOW3" 2 "U" 0
   @cmd   keyint "ANI_FOLLOW5" 2 "L" 0
	offset	10 19
	bbox	6 5 83 98
	
	frame	data/chars/car/ir2.gif

	

		
anim	pain1
	loop	0
	offset	10 19
	bbox	6 5 83 98
	delay	50
	frame	data/chars/car/car.gif
	delay	15
	frame	data/chars/car/car.gif
		
anim	spawn
	loop	0
	@cmd	performattack getlocalvar("self") openborconstant("ANI_FOLLOW3")
	offset	10 19
	bbox	6 5 83 98
	delay	2
	frame	data/chars/car/car.gif
	frame	data/chars/car/car.gif

		
#|edited by openBor Stats v 0.67
Here is the test video with test sprites in test scene:
https://drive.google.com/file/d/168MMgbqa7cIHtlzljcvJhZ11KyYJWKHt/view?usp=sharing

My character (in final variant) will use 3 frames to WALK animations, and this 3 frames will be used when it not move, - in my way it is not needed to create addition 8-dirrection IDLE animations at all.
Now i will trying to add another 8-dirrections ATTAK animations to it, and want to teach it stops its speed not momentally after keys is not pressed.
 
Good, now you have to set entityvar for each direction so when character will get pain animation then it goes to correct pain from correct angle by forcing them from normal pain animation and entityvar detection, or from onpain script and then back to correct standing animation from pain.

IF you want character not to stopp immediately but move like mario, kinda like on ice then you have to decimate velocity slowly until its zero instead of changing it to 0.

Try to use this, modify it and use entityvar in walk or run, then put this script in idle
In your  run animation set an entityvar for example and instead of performattack just pefrorm velocity deduction based on getentityproperty (self,"xdir") which is current velocity , decimate it by one each time script runs or smaller /bigger number than one, experiment.
You can change running variable back to null when xdir is 0 so it stops applying that extra slide.
Code:
setentityvar(self,"running",1);  -- this goes to run or walk to let it know it was walking 

then in idle animation insert this script to read walking variable and apply extra slide then change variable back to NULL which is nothing:
			@script
                void self = getlocalvar("self");
if ( getentityvar(self,"running") == 1 ) {
   setentityvar(self,"running",NULL());
   performattack(self,openborconstant("ANI_FOLLOWXX"),1);
}
	@end_script


Something like this 


			@script
                void self = getlocalvar("self");
if ( getentityvar(self,"running") == 1 ) {
 changeentityproperty(self, "velocity",  getentityproperty(self, "xdir")/1.15);
}
if (  getentityproperty(self, "xdir") == 0 )  {
   setentityvar(self,"running",NULL());
}
	@end_script



 
Back
Top Bottom