ShovelToad
New member
Please give any simple example.
Yes, something like RockNRoll Racing ingame camera...Bloodbane said:Let me confirm this: are you making top down view game?
Thanks to trying to help, I already use 4 dirrections to walk, but it needs more...oldyz said:so by default openBOr can do 4 directions,
Yes, it needs to use 8 dirrections to IDLE, 8 to WALK, 8 to JUMP, 8 to ATTACK and 2 to PAIN (left&right, its already done)... and it needs to make soft turn to all 8 dirrectionsbWWd said:ITs not just that, he will need idle different for each direction, then pain different for each direction if used and attack different for each direction, all animations, and you need to make a lot of variables to prevent default behaviours jumping in.
@cmd setlocalvar("down", 1)
@cmd setlocalvar("downleft", 1)
@cmd setlocalvar("left", 1)
@cmd setlocalvar("leftup", 1)
@cmd setlocalvar("up", 1)
@cmd setlocalvar("upright", 1)
@cmd setlocalvar("right", 1)
@cmd setlocalvar("rightdown", 1)
name carw
type none
health 100
speed 0
mp 0
shadow 0
noquake 1
cantgrab 1
notgrab 1
nodieblink 1
makeinv 1 0
falldie 2
riseinv 1 1
jugglepoints 15
nolife 1
atchain 0
modelflag 3
weaploss 3
weapnum 1
nomove 1 1
candamage enemy
animationscript data/sprites/script.c
nopain 1
nodrop 1
subject_to_platform 1
subject_to_screen 1
gfxshadow 1
icon data/sprites/micon.gif
anim follow10
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -3 ,1);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", 2 ,-0.5);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate -120
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW11" 1 "L" 0
@cmd keyint "ANI_FOLLOW9" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW11" 2 "L" 0
@cmd keyint "ANI_FOLLOW9" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow11
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -2.5 ,2.5);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", 1.5 ,-1.5);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate -135
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW12" 1 "L" 0
@cmd keyint "ANI_FOLLOW10" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW12" 2 "L" 0
@cmd keyint "ANI_FOLLOW10" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow12
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -1 ,3);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", 0.5 ,-2);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate -160
frame data/sprites/car.gif
@cmd keyint "ANI_follow13" 1 "L" 0
@cmd keyint "ANI_FOLLOW11" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW13" 2 "L" 0
@cmd keyint "ANI_FOLLOW11" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow13
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 0 ,4);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", 0 ,-2.5);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 180
frame data/sprites/car.gif
@cmd keyint "ANI_follow14" 1 "L" 0
@cmd keyint "ANI_FOLLOW12" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW14" 2 "L" 0
@cmd keyint "ANI_FOLLOW12" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow14
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 1 ,3);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -0.5 ,-2);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 160
frame data/sprites/car.gif
@cmd keyint "ANI_follow15" 1 "L" 0
@cmd keyint "ANI_FOLLOW13" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW15" 2 "L" 0
@cmd keyint "ANI_FOLLOW13" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow15
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 2.5 ,2.5);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -1.5 ,-1.5);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 135
frame data/sprites/car.gif
@cmd keyint "ANI_follow16" 1 "L" 0
@cmd keyint "ANI_FOLLOW14" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW16" 2 "L" 0
@cmd keyint "ANI_FOLLOW14" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow16
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 3 ,1);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -2 ,-0.5);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 120
frame data/sprites/car.gif
@cmd keyint "ANI_jumpdelay" 1 "L" 0
@cmd keyint "ANI_FOLLOW15" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_jumpdelay" 2 "L" 0
@cmd keyint "ANI_FOLLOW15" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow2
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 3 ,-1);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -2 ,0.5);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
platform 8 25 -10 -10 11 11 8 24
drawmethod rotate 70
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW3" 1 "L" 0
@cmd keyint "ANI_JUMPDELAY" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW3" 2 "L" 0
@cmd keyint "ANI_JUMPDELAY" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow3
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 2.5 ,-2.5);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -1.5 ,1.5);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
drawmethod rotate 45
delay 6
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_follow4" 1 "L" 0
@cmd keyint "ANI_FOLLOW2" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
offset 47 58
bbox 6 5 83 98
@cmd keyint "ANI_follow4" 2 "L" 0
@cmd keyint "ANI_FOLLOW2" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
anim follow4
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 1 ,-3);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -0.5 ,2);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 20
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_follow5" 1 "L" 0
@cmd keyint "ANI_FOLLOW3" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
offset 47 58
bbox 6 5 83 98
@cmd keyint "ANI_follow5" 2 "L" 0
@cmd keyint "ANI_FOLLOW3" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
anim follow5
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 0 ,-4);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", 0 ,2.5);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_follow6" 1 "L" 0
@cmd keyint "ANI_FOLLOW4" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_follow6" 2 "L" 0
@cmd keyint "ANI_FOLLOW4" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow6
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -1 ,-3);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", 0.5 ,2);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
platform 8 25 -10 -10 11 11 8 24
drawmethod rotate -20
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW7" 1 "L" 0
@cmd keyint "ANI_FOLLOW5" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW7" 2 "L" 0
@cmd keyint "ANI_FOLLOW5" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow7
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -2.5,-2.5);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", 1.5 ,1.5);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
platform 8 25 -10 -10 11 11 8 24
drawmethod rotate -45
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW8" 1 "L" 0
@cmd keyint "ANI_FOLLOW6" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW8" 2 "L" 0
@cmd keyint "ANI_FOLLOW6" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow8
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -3 ,-1);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", 2 ,0.5);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate -70
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW9" 1 "L" 0
@cmd keyint "ANI_FOLLOW7" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 46 58
bbox 6 5 83 98
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW9" 2 "L" 0
@cmd keyint "ANI_FOLLOW7" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow9
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -4 ,0);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", 2.5 ,0);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate -90
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW10" 1 "L" 0
@cmd keyint "ANI_FOLLOW8" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW10" 2 "L" 0
@cmd keyint "ANI_FOLLOW8" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim idle
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 4 ,0);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -2.5 ,0);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 90
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW2" 1 "L" 0
@cmd keyint "ANI_FOLLOW16" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 46 58
bbox 6 5 83 98
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW2" 2 "L" 0
@cmd keyint "ANI_FOLLOW16" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim jump
loop 1
offset 9 12
bbox 5 1 4 9
delay 2
drawmethod rotate 90
drawmethod fliprotate 1
frame data/sprites/car.gif
anim jumpdelay
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 4 ,0);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -2.5 ,0);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 90
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW2" 1 "L" 0
@cmd keyint "ANI_FOLLOW16" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 46 58
bbox 6 5 83 98
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW2" 2 "L" 0
@cmd keyint "ANI_FOLLOW16" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim pain1
loop 0
offset 46 58
bbox 6 5 83 98
delay 50
frame data/sprites/mark.gif
delay 15
frame data/sprites/mark.gif
anim spawn
loop 0
@script
void self = getlocalvar("self");
int x = getindexedvar(0); //Get respawn x coordinate
int z = getindexedvar(1); //Get respawn a coordinate
if(frame >= 0 ){
changeentityproperty(self, "position", x, z);
}
@end_script
offset 46 58
bbox 6 5 83 98
delay 2
frame data/sprites/0.gif
frame data/sprites/0.gif
#|edited by openBor Stats v 0.67
bWWd said:You would need variables enabled when being in all 8 directions , then do checks in onpainscript to go to correct pain, of course if you have more than 1 player you need playerindex to separate them so each player has his own variable.
DC said globalvars arent needed most of the time , i guess you could use local.
Code:@cmd setlocalvar("down", 1)Code:@cmd setlocalvar("downleft", 1)Code:@cmd setlocalvar("left", 1)Code:@cmd setlocalvar("leftup", 1)Code:@cmd setlocalvar("up", 1)Code:@cmd setlocalvar("upright", 1)Code:@cmd setlocalvar("right", 1)Code:@cmd setlocalvar("rightdown", 1)
Varialbes are required to read by onpainscript for example so they change anim immediately to correct one.
So... IF you would have downloadable very small demo with only 1 player and required frames for all directions, and one empty enemy so stage wouldnt close, then maybe people would be willing to tinker with it and create it, but helping with this remotely without actually trying what works, would be hard.
// Script for players
void keyint(void Ani, int Frame, void Key, int Hflag, int Vx, int Vz)
{// Change current animation if proper key is pressed or released
// Animation is changed to attack mode
void self = getlocalvar("self");
int Dir = getentityproperty(self, "direction");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void iRKey;
if (Key=="U"){ //Up Required?
iRKey = playerkeys(iPIndex, 0, "moveup"); // "Up"
} else if (Key=="D"){ //Down Required?
iRKey = playerkeys(iPIndex, 0, "movedown"); // "Down"
} else if (Key=="L"){ //Left Required?
iRKey = (playerkeys(iPIndex, 0, "moveleft")&&playerkeys(iPIndex, 0, "jump")); // "Left"
} else if (Key=="R"){ //Right Required?
iRKey = (playerkeys(iPIndex, 0, "moveright")&&playerkeys(iPIndex, 0, "jump")); // "Right"
} else if (Key=="F"){ //Forward Required?
if (Dir == 0){ // Facing Left?
iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left"
} else { // Facing Right
iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right"
}
} else if (Key=="B"){ //Backward Required?
if (Dir == 1){ // Facing Right?
iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left"
} else { // Facing Left
iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right"
}
} else if (Key=="J"){ //Jump Required?
iRKey = playerkeys(iPIndex, 0, "jump"); // "Jump"
} else if (Key=="A"){ //Attack Required?
iRKey = playerkeys(iPIndex, 0, "attack"); // "Attack"
} else if (Key=="S"){ //Special Required?
iRKey = playerkeys(iPIndex, 0, "special"); // "Special"
}
if (Hflag==1){ //Not holding the button case?
iRKey = !iRKey; //Take the opposite condition
}
if (iRKey){
dasher( Vx, 0, Vz, 1 ); //Move!
if (Ani=="ANI_IDLE"){ // Going idle?
setidle(self, openborconstant("ANI_IDLE")); //Be idle!
} else {
performattack(self, openborconstant(Ani)); //Change the animation
}
// updateframe(self, Frame); //Change frame
changeentityproperty(self, "animpos", Frame); //Change frame
}
}
void dasher( float Vx, float Vy, float Vz, int Flip)
{// Dash with desired speed!
void self = getlocalvar("self");
int dir = getentityproperty(self,"direction");
if(dir==0 && Flip==1){ // Facing left?
Vx = -Vx ;
}
changeentityproperty(self, "velocity", Vx, Vz, Vy); //Move!
}
bWWd said:animscript c:
Oldyz its generally better to justcode it like it is, detect correct states and change anims accordingly instead of faking it around with invisible stuff.Its bindentity, it could work but its strange way to do it, you would have to take into account what will happen when that other entity disappears in some circumstances .Code:// Script for players void keyint(void Ani, int Frame, void Key, int Hflag, int Vx, int Vz) {// Change current animation if proper key is pressed or released // Animation is changed to attack mode void self = getlocalvar("self"); int Dir = getentityproperty(self, "direction"); int iPIndex = getentityproperty(self,"playerindex"); //Get player index void iRKey; if (Key=="U"){ //Up Required? iRKey = playerkeys(iPIndex, 0, "moveup"); // "Up" } else if (Key=="D"){ //Down Required? iRKey = playerkeys(iPIndex, 0, "movedown"); // "Down" } else if (Key=="L"){ //Left Required? iRKey = (playerkeys(iPIndex, 0, "moveleft")&&playerkeys(iPIndex, 0, "jump")); // "Left" } else if (Key=="R"){ //Right Required? iRKey = (playerkeys(iPIndex, 0, "moveright")&&playerkeys(iPIndex, 0, "jump")); // "Right" } else if (Key=="F"){ //Forward Required? if (Dir == 0){ // Facing Left? iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left" } else { // Facing Right iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right" } } else if (Key=="B"){ //Backward Required? if (Dir == 1){ // Facing Right? iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left" } else { // Facing Left iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right" } } else if (Key=="J"){ //Jump Required? iRKey = playerkeys(iPIndex, 0, "jump"); // "Jump" } else if (Key=="A"){ //Attack Required? iRKey = playerkeys(iPIndex, 0, "attack"); // "Attack" } else if (Key=="S"){ //Special Required? iRKey = playerkeys(iPIndex, 0, "special"); // "Special" } if (Hflag==1){ //Not holding the button case? iRKey = !iRKey; //Take the opposite condition } if (iRKey){ dasher( Vx, 0, Vz, 1 ); //Move! if (Ani=="ANI_IDLE"){ // Going idle? setidle(self, openborconstant("ANI_IDLE")); //Be idle! } else { performattack(self, openborconstant(Ani)); //Change the animation } // updateframe(self, Frame); //Change frame changeentityproperty(self, "animpos", Frame); //Change frame } } void dasher( float Vx, float Vy, float Vz, int Flip) {// Dash with desired speed! void self = getlocalvar("self"); int dir = getentityproperty(self,"direction"); if(dir==0 && Flip==1){ // Facing left? Vx = -Vx ; } changeentityproperty(self, "velocity", Vx, Vz, Vy); //Move! }
bWWdbWWd said:bWWd said:animscript c:
Oldyz its generally better to justcode it like it is, detect correct states and change anims accordingly instead of faking it around with invisible stuff.Its bindentity, it could work but its strange way to do it, you would have to take into account what will happen when that other entity disappears in some circumstances .Code:// Script for players void keyint(void Ani, int Frame, void Key, int Hflag, int Vx, int Vz) {// Change current animation if proper key is pressed or released // Animation is changed to attack mode void self = getlocalvar("self"); int Dir = getentityproperty(self, "direction"); int iPIndex = getentityproperty(self,"playerindex"); //Get player index void iRKey; if (Key=="U"){ //Up Required? iRKey = playerkeys(iPIndex, 0, "moveup"); // "Up" } else if (Key=="D"){ //Down Required? iRKey = playerkeys(iPIndex, 0, "movedown"); // "Down" } else if (Key=="L"){ //Left Required? iRKey = (playerkeys(iPIndex, 0, "moveleft")&&playerkeys(iPIndex, 0, "jump")); // "Left" } else if (Key=="R"){ //Right Required? iRKey = (playerkeys(iPIndex, 0, "moveright")&&playerkeys(iPIndex, 0, "jump")); // "Right" } else if (Key=="F"){ //Forward Required? if (Dir == 0){ // Facing Left? iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left" } else { // Facing Right iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right" } } else if (Key=="B"){ //Backward Required? if (Dir == 1){ // Facing Right? iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left" } else { // Facing Left iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right" } } else if (Key=="J"){ //Jump Required? iRKey = playerkeys(iPIndex, 0, "jump"); // "Jump" } else if (Key=="A"){ //Attack Required? iRKey = playerkeys(iPIndex, 0, "attack"); // "Attack" } else if (Key=="S"){ //Special Required? iRKey = playerkeys(iPIndex, 0, "special"); // "Special" } if (Hflag==1){ //Not holding the button case? iRKey = !iRKey; //Take the opposite condition } if (iRKey){ dasher( Vx, 0, Vz, 1 ); //Move! if (Ani=="ANI_IDLE"){ // Going idle? setidle(self, openborconstant("ANI_IDLE")); //Be idle! } else { performattack(self, openborconstant(Ani)); //Change the animation } // updateframe(self, Frame); //Change frame changeentityproperty(self, "animpos", Frame); //Change frame } } void dasher( float Vx, float Vy, float Vz, int Flip) {// Dash with desired speed! void self = getlocalvar("self"); int dir = getentityproperty(self,"direction"); if(dir==0 && Flip==1){ // Facing left? Vx = -Vx ; } changeentityproperty(self, "velocity", Vx, Vz, Vy); //Move! }
bWWd said:You would need variables enabled when being in all 8 directions , then do checks in onpainscript to go to correct pain, of course if you have more than 1 player you need playerindex to separate them so each player has his own variable.
DC said globalvars arent needed most of the time , i guess you could use local.
Code:@cmd setlocalvar("down", 1)Code:@cmd setlocalvar("downleft", 1)Code:@cmd setlocalvar("left", 1)Code:@cmd setlocalvar("leftup", 1)Code:@cmd setlocalvar("up", 1)Code:@cmd setlocalvar("upright", 1)Code:@cmd setlocalvar("right", 1)Code:@cmd setlocalvar("rightdown", 1)
Varialbes are required to read by onpainscript for example so they change anim immediately to correct one.
So... IF you would have downloadable very small demo with only 1 player and required frames for all directions, and one enemy so stage wouldnt close, then maybe people would be willing to tinker with it and create it, but helping with this remotely without actually trying what works, would be hard.
In short - this is something you would have to code from ground up and actually not use default openbor mechanics that much besides header c scripts to detect correct directions and switch.
I also made this with help of bloodbanes method for contra long time ago, its like a racing car movement
Here is a test Openbor:bWWd said:I posted solution for you , check my posts above with code in them, this is animation txt file for a car entity, just replace images with your own, and check if its what you wanted.
name carw
type player
health 100
speed 20
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/sprites/script.c
nopain 1
nodrop 1
subject_to_platform 1
subject_to_screen 1
gfxshadow 1
icon data/sprites/car.gif
anim idle
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
int sped = getentityproperty(self, "speed");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", sped ,0);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -sped ,0);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 90
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW2" 1 "L" 0
@cmd keyint "ANI_FOLLOW16" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 46 58
bbox 6 5 83 98
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW2" 2 "L" 0
@cmd keyint "ANI_FOLLOW16" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow10
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
int sped = getentityproperty(self, "speed");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -sped ,1);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", sped ,-sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate -120
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW11" 1 "L" 0
@cmd keyint "ANI_FOLLOW9" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW11" 2 "L" 0
@cmd keyint "ANI_FOLLOW9" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow11
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
int sped = getentityproperty(self, "speed");
if ( a1 ){
changeentityproperty(self, "velocity", -sped ,sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", sped ,-sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate -135
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW12" 1 "L" 0
@cmd keyint "ANI_FOLLOW10" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW12" 2 "L" 0
@cmd keyint "ANI_FOLLOW10" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim follow12
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
int sped = getentityproperty(self, "speed");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -sped ,sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity",sped ,-sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate -160
frame data/sprites/car.gif
@cmd keyint "ANI_follow13" 1 "L" 0
@cmd keyint "ANI_FOLLOW11" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW13" 2 "L" 0
@cmd keyint "ANI_FOLLOW11" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 0 ,sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", 0 ,-sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 180
frame data/sprites/car.gif
@cmd keyint "ANI_follow14" 1 "L" 0
@cmd keyint "ANI_FOLLOW12" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW14" 2 "L" 0
@cmd keyint "ANI_FOLLOW12" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", sped ,sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -sped ,-sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 160
frame data/sprites/car.gif
@cmd keyint "ANI_follow15" 1 "L" 0
@cmd keyint "ANI_FOLLOW13" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW15" 2 "L" 0
@cmd keyint "ANI_FOLLOW13" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", sped ,sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -sped ,-sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 135
frame data/sprites/car.gif
@cmd keyint "ANI_follow16" 1 "L" 0
@cmd keyint "ANI_FOLLOW14" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW16" 2 "L" 0
@cmd keyint "ANI_FOLLOW14" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", sped ,sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -sped ,-sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 120
frame data/sprites/car.gif
@cmd keyint "ANI_jumpdelay" 1 "L" 0
@cmd keyint "ANI_FOLLOW15" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_jumpdelay" 2 "L" 0
@cmd keyint "ANI_FOLLOW15" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", sped ,-sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -sped ,sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
platform 8 25 -10 -10 11 11 8 24
drawmethod rotate 70
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW3" 1 "L" 0
@cmd keyint "ANI_JUMPDELAY" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW3" 2 "L" 0
@cmd keyint "ANI_JUMPDELAY" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", sped ,-sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -sped ,sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
drawmethod rotate 45
delay 6
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_follow4" 1 "L" 0
@cmd keyint "ANI_FOLLOW2" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
offset 47 58
bbox 6 5 83 98
@cmd keyint "ANI_follow4" 2 "L" 0
@cmd keyint "ANI_FOLLOW2" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", sped ,-sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -sped ,sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 20
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_follow5" 1 "L" 0
@cmd keyint "ANI_FOLLOW3" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
offset 47 58
bbox 6 5 83 98
@cmd keyint "ANI_follow5" 2 "L" 0
@cmd keyint "ANI_FOLLOW3" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", 0 ,-sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", 0 ,sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_follow6" 1 "L" 0
@cmd keyint "ANI_FOLLOW4" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_follow6" 2 "L" 0
@cmd keyint "ANI_FOLLOW4" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -sped ,-sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", sped ,sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
platform 8 25 -10 -10 11 11 8 24
drawmethod rotate -20
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW7" 1 "L" 0
@cmd keyint "ANI_FOLLOW5" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW7" 2 "L" 0
@cmd keyint "ANI_FOLLOW5" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -sped,-sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", sped ,sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
platform 8 25 -10 -10 11 11 8 24
drawmethod rotate -45
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW8" 1 "L" 0
@cmd keyint "ANI_FOLLOW6" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW8" 2 "L" 0
@cmd keyint "ANI_FOLLOW6" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -sped ,-sped);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", sped ,sped);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate -70
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW9" 1 "L" 0
@cmd keyint "ANI_FOLLOW7" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 46 58
bbox 6 5 83 98
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW9" 2 "L" 0
@cmd keyint "ANI_FOLLOW7" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.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 d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", -sped ,0);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", sped ,0);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate -90
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW10" 1 "L" 0
@cmd keyint "ANI_FOLLOW8" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW10" 2 "L" 0
@cmd keyint "ANI_FOLLOW8" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim jump
loop 1
offset 9 12
bbox 5 1 4 9
delay 2
drawmethod rotate 90
drawmethod fliprotate 1
frame data/sprites/car.gif
anim jumpdelay
@script
void self = getlocalvar("self");
int sped = getentityproperty(self, "speed");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
int sped = getentityproperty(self, "speed");
void d1 = playerkeys(iPIndex, 0, "movedown");
if ( a1 ){
changeentityproperty(self, "velocity", sped ,0);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", -sped ,0);
}
@end_script
loop 1 1
offset 46 58
bbox 6 5 83 98
delay 6
drawmethod rotate 90
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW2" 1 "L" 0
@cmd keyint "ANI_FOLLOW16" 1 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 46 58
bbox 6 5 83 98
frame data/sprites/car.gif
@cmd keyint "ANI_FOLLOW2" 2 "L" 0
@cmd keyint "ANI_FOLLOW16" 2 "R" 0
platform 8 25 -10 -10 11 11 8 24
offset 47 58
bbox 6 5 83 98
frame data/sprites/car.gif
anim pain1
loop 0
offset 46 58
bbox 6 5 83 98
delay 50
frame data/sprites/car.gif
delay 15
frame data/sprites/car.gif
anim spawn
loop 0
@script
void self = getlocalvar("self");
int x = getindexedvar(0); //Get respawn x coordinate
int z = getindexedvar(1); //Get respawn a coordinate
if(frame >= 0 ){
changeentityproperty(self, "position", x, z);
}
@end_script
offset 46 58
bbox 6 5 83 98
delay 2
frame NONE
frame NONE
#|edited by openBor Stats v 0.67
// Script for players
void keyint(void Ani, int Frame, void Key, int Hflag, int Vx, int Vz)
{// Change current animation if proper key is pressed or released
// Animation is changed to attack mode
void self = getlocalvar("self");
int Dir = getentityproperty(self, "direction");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void iRKey;
if (Key=="U"){ //Up Required?
iRKey = playerkeys(iPIndex, 0, "moveup"); // "Up"
} else if (Key=="D"){ //Down Required?
iRKey = playerkeys(iPIndex, 0, "movedown"); // "Down"
} else if (Key=="L"){ //Left Required?
iRKey = (playerkeys(iPIndex, 0, "moveleft")&&playerkeys(iPIndex, 0, "jump")); // "Left"
} else if (Key=="R"){ //Right Required?
iRKey = (playerkeys(iPIndex, 0, "moveright")&&playerkeys(iPIndex, 0, "jump")); // "Right"
} else if (Key=="F"){ //Forward Required?
if (Dir == 0){ // Facing Left?
iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left"
} else { // Facing Right
iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right"
}
} else if (Key=="B"){ //Backward Required?
if (Dir == 1){ // Facing Right?
iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left"
} else { // Facing Left
iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right"
}
} else if (Key=="J"){ //Jump Required?
iRKey = playerkeys(iPIndex, 0, "jump"); // "Jump"
} else if (Key=="A"){ //Attack Required?
iRKey = playerkeys(iPIndex, 0, "attack"); // "Attack"
} else if (Key=="S"){ //Special Required?
iRKey = playerkeys(iPIndex, 0, "special"); // "Special"
}
if (Hflag==1){ //Not holding the button case?
iRKey = !iRKey; //Take the opposite condition
}
if (iRKey){
dasher( Vx, 0, Vz, 1 ); //Move!
if (Ani=="ANI_IDLE"){ // Going idle?
setidle(self, openborconstant("ANI_IDLE")); //Be idle!
} else {
performattack(self, openborconstant(Ani)); //Change the animation
}
// updateframe(self, Frame); //Change frame
changeentityproperty(self, "animpos", Frame); //Change frame
}
}
void dasher( float Vx, float Vy, float Vz, int Flip)
{// Dash with desired speed!
void self = getlocalvar("self");
int dir = getentityproperty(self,"direction");
if(dir==0 && Flip==1){ // Facing left?
Vx = -Vx ;
}
changeentityproperty(self, "velocity", Vx, Vz, Vy); //Move!
}
// Script for players
void keyint(void Ani, int Frame, void Key, int Hflag, int Vx)
{// Change current animation if proper key is pressed or released
// Animation is changed to attack mode
void self = getlocalvar("self");
int Dir = getentityproperty(self, "direction");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void iRKey;
if (Key=="U"){ //Up Required?
iRKey = playerkeys(iPIndex, 0, "moveup"); // "Up"
} else if (Key=="D"){ //Down Required?
iRKey = playerkeys(iPIndex, 0, "movedown"); // "Down"
} else if (Key=="L"){ //Left Required?
iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left"
} else if (Key=="R"){ //Right Required?
iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right"
} else if (Key=="F"){ //Forward Required?
if (Dir == 0){ // Facing Left?
iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left"
} else { // Facing Right
iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right"
}
} else if (Key=="B"){ //Backward Required?
if (Dir == 1){ // Facing Right?
iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left"
} else { // Facing Left
iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right"
}
} else if (Key=="J"){ //Jump Required?
iRKey = playerkeys(iPIndex, 0, "jump"); // "Jump"
} else if (Key=="A"){ //Attack Required?
iRKey = playerkeys(iPIndex, 0, "attack"); // "Attack"
} else if (Key=="S"){ //Special Required?
iRKey = playerkeys(iPIndex, 0, "special"); // "Special"
}
if (Hflag==1){ //Not holding the button case?
iRKey = !iRKey; //Take the opposite condition
}
if (iRKey){
dasher( Vx, 0, 0, 1 ); //Move!
if (Ani=="ANI_IDLE"){ // Going idle?
setidle(self, openborconstant("ANI_IDLE")); //Be idle!
} else {
performattack(self, openborconstant(Ani)); //Change the animation
}
// updateframe(self, Frame); //Change frame
changeentityproperty(self, "animpos", Frame); //Change frame
}
}
void dasher( float Vx, float Vy, float Vz, int Flip)
{// Dash with desired speed!
void self = getlocalvar("self");
int dir = getentityproperty(self,"direction");
if(dir==0 && Flip==1){ // Facing left?
Vx = -Vx ;
}
changeentityproperty(self, "velocity", Vx, Vz, Vy); //Move!
}
@script
void self = getlocalvar("self");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void a1 = playerkeys(iPIndex, 0, "jump");
void d1 = playerkeys(iPIndex, 0, "movedown");
settextobj(1, 150 , 100 , 1, 1, "foll11", openborvariant("elapsed_time")+2000);
int sped = getentityproperty(self, "speed");
if ( a1 ){
changeentityproperty(self, "velocity", -sped/1.35 ,sped/1.35);
}
if ( !a1 ){
changeentityproperty(self, "velocity", 0 ,0);
}
if (( d1 )&&(a1)){
changeentityproperty(self, "velocity", sped/1.35 ,-sped/1.35);
}
@end_script
bWWd said:OK, Youre not reading what im posting, you used old text file with animations that i posted as first one, use new one that i posted later.
Come on, put some effort into it.
This stuff, what youre trying to do is pretty complex , im not sure if you wille be able to pull it off with this kind of "effort".
I dont think anyone did this before in openbor.So this task is probably too big for you.
I managed to make 8 directional walk and idles with help of bloodbanes contra scripts and i made it into 12 directions but thres still a lot missing.
The issue is file mark.gif and 0.gif , you dont have them in folder and its shutting down but my new version already took care of this problem and i posted it for you a few days ago.
So my advice would be, lower your expectations and maybe use something like rpgmaker ?
I know its harsh but thats just too big of a task for You to be able to control it from what i see.
Its kinda similar thing if you would go to adventure game maker forums and ask how you can make platformer mario clone, its just not what it was made for, you could probably do it if you would be advanced user with scripting knowledge and you would be able to control it but i think its just misunderstanding, You want gameplay mechanics that you would have to code in from ground up.We could probably crack if if you had better understanding of scripting and debugging but at this moment i dont think thats the case.