maxman
Well-known member
I'm trying to give an animation check on the values of the conditions. Even though I gave level wall checks of left and right corners for which side of walls the character will interact, a half of them doesn't exactly play like the script is telling the engine what to do. Instead, it reads two of them in the onblockwscript. Animations for fly and sonic tackle kick play, but not the remaining which I'm trying to make them play every time he interacts with wall corners/sides.
"jumpmovex" is used in anim jump for it.
Code:
onblockWscript data/scripts/spikesw3sbmcho.c
C:
void main()
{
void self = getlocalvar("self");
void Dir = getentityproperty(self, "direction");
void vAniID = getentityproperty(self,"animationID");
void wallt = getlocalvar("type");
int iPIndex = getentityproperty(self,"playerindex");
void iJump = playerkeys(iPIndex, 1, "jump");
void iLeft = playerkeys(iPIndex, 0, "moveleft");
void iRight = playerkeys(iPIndex, 0, "moveright");
void vSpawn;
int SFX = loadsample("data/sounds/beatxm2.wav");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "a");
int z = getentityproperty(self, "z");
int b = getentityproperty(self, "base");
int jumpMoveX = getentityproperty(self, "jumpmovex");
int WPos = 0;
int wDif = 0;
int wAdd = wDif*1;
int Windex = WPos + (wDif*1);
int xwall = getlevelproperty("wall", Windex, "x");
int zwall = getlevelproperty("wall", Windex, "z");
int ULCorner = getlevelproperty("wall", Windex, "upperleft");
int LLCorner = getlevelproperty("wall", Windex, "lowerleft");
int URCorner = getlevelproperty("wall", Windex, "upperright");
int LRCorner = getlevelproperty("wall", Windex, "lowerright");
int depth = getlevelproperty("wall", Windex, "depth");
int height = getlevelproperty("wall", Windex, "height");
int type = getlevelproperty("wall", Windex, "type");
if(wallt==1){
if(vAniID != openborconstant("ANI_FALL80")){
clearspawnentry();
setspawnentry("name", "Bflash");
vSpawn = spawn();
changeentityproperty(vSpawn, "position", x-5, z+2, y+51);
changeentityproperty(vSpawn, "direction", Dir);
spawn();
damageentity(self, self, 10, 1, openborconstant("ATK_NORMAL"));
changeentityproperty(self, "direction", 0);
tossentity(self, 1.3, 0.8, 0);
playsample(SFX, 0, 60, 60, 100, 0);
}
}else if(wallt==2){
if(vAniID != openborconstant("ANI_FALL80")){
clearspawnentry();
setspawnentry("name", "Bflash");
vSpawn = spawn();
changeentityproperty(vSpawn, "position", x+5, z+2, y+51);
changeentityproperty(vSpawn, "direction", Dir);
spawn();
damageentity(self, self, 10, 1, openborconstant("ATK_NORMAL"));
changeentityproperty(self, "direction", 1);
tossentity(self, 1.3, -0.8, 0);
playsample(SFX, 0, 60, 60, 100, 0);
}
}else if(wallt!=3){
if(vAniID == openborconstant("ANI_JUMP") || vAniID == openborconstant("ANI_FORWARDJUMP") || vAniID == openborconstant("ANI_RUNJUMP")){
if(iJump && y > b+15 && ULCorner && LLCorner && height > 0 && Dir == 0){ // Face left BEHIND left side of wall?
//changeentityproperty(self, "direction", 0);
changeentityproperty(self, "animation", openborconstant("ANI_freespecial46")); // Backwards jump attack
}else if(iJump && y > b+15 && URCorner && LRCorner && height > 0 && Dir == 1){ // Face right BEHIND right side of wall?
//changeentityproperty(self, "direction", 1);
changeentityproperty(self, "animation", openborconstant("ANI_freespecial6")); // Fly
}else if(iJump && y > b+15 && URCorner && LRCorner && height > 0 && Dir == 0){ // Face left TO right side of wall?
//changeentityproperty(self, "direction", 1);
changeentityproperty(self, "animation", openborconstant("ANI_freespecial4")); // Sonic Tackle Kick
}else if(iJump && y > b+15 && ULCorner && LLCorner && height > 0 && Dir == 1){ // Face right TO left side of wall?
//changeentityproperty(self, "direction", 0);
changeentityproperty(self, "animation", openborconstant("ANI_Freespecial13")); // Captain Swords
}
}
}
}
"jumpmovex" is used in anim jump for it.
Code:
anim jump
@cmd changeentityproperty getlocalvar("self") "jumpmovex" 4
cancel 1 7 0 b a1 freespecial46 #BACKWARDS JUMP ATTACK
cancel 1 7 0 f a1 freespecial46 #BACKWARDS JUMP ATTACK
cancel 3 6 0 u a1 freespecial9 #AIR COMBO 01
cancel 3 6 0 a2 freespecial4 #SONIC TACKLE KICK
cancel 3 6 0 a4 freespecial34 #AIR THROW - PILEDRIVER
cancel 2 6 0 u j freespecial6 #FLY
cancel 2 6 0 s freespecial13 #CAPTAIN SWORDS
delay 4
loop 0
offset 182 282
bbox 159 266 43 16
sound data/sounds/run01.wav
frame data/chars/sbmcho/ju01.gif
frame data/chars/sbmcho/ju02.gif
frame data/chars/sbmcho/ju03.gif
frame data/chars/sbmcho/ju04.gif
frame data/chars/sbmcho/ju05.gif
delay 15
frame data/chars/sbmcho/ju06.gif
frame data/chars/sbmcho/ju06.gif
delay 999
frame data/chars/sbmcho/ju06.gif
