Toranks
Active member
I don't know if the script is wrong, or what the problem is. But this antiwall script does not work with both upper and lower walls at the same time, only one of them. If the value is negative, detect well the walls below. If the value is positive, detect well the walls above. But the script is not supposed to need to use negative or positive values. Both Hw and Hz should work each one detecting from above and below.
This is the concerned grab
This is an example of what happens. At minute 1:10 I go to the lower left corner, and the boss dies trapped in the lower wall. If I go to the center of the left wall, or to the upper left corner, antiwall works fine. If I change the value 10 to -10 (antiwall 80 -20 10 to antiwall 80 -20 -10), then in the lower left corner antiwall works fine, but in the upper left it is the same as in the video.
Code:
void antiwall(int Dist, int Move, int Distz)
{// Checks if there is wall at defined distance
// If there is wall, entity will be moved away with defined movement
void self = getlocalvar("self");
int Direction = getentityproperty(self, "direction");
int x = getentityproperty(self, "x");
int z = getentityproperty(self, "z");
float H;
float Hz;
float Hw;
if(Direction == 0){ //Is entity facing left?
Dist = -Dist; //Reverse Dist to match facing
Move = -Move; //Reverse Move to match facing
}
H = checkwall(x+Dist,z);
Hz = checkwall(x+Dist,z+Distz);
Hw = checkwall(x+Dist,z-Distz);
if(Hz > 0)
{
changeentityproperty(self, "position", x, z-Distz);
}
if(Hw > 0)
{
changeentityproperty(self, "position", x, z+Distz);
}
if(H > 0)
{
changeentityproperty(self, "position", x+Move);
}
}
This is the concerned grab
Code:
anim follow5
@script
void self = getlocalvar("self");
void plyr = getentityproperty(self, "playerindex");
float Vx = getlocalvar("x"+self);
float Vz = getlocalvar("z"+self);
if(frame >= 4 && frame <= 25 )
{
if( playerkeys(plyr, 0, "moveup"))
{
changeentityproperty(self, "velocity", Vx, -0.5);
}
if( playerkeys(plyr, 0, "movedown"))
{
changeentityproperty(self, "velocity", Vx, 0.5);
}
if( playerkeys(plyr, 0, "moveleft"))
{
changeentityproperty(self, "velocity", -1.5, Vz);
}
if( playerkeys(plyr, 0, "moveright"))
{
changeentityproperty(self, "velocity", 1.5, Vz);
}
if( playerkeys(plyr, 0, "attack"))
{
updateframe(self, 26);
}
}
@end_script
loop 0
delay 20
offset 100 191
bbox 0 0 0 0
fastattack 1
@cmd slamstart3
@cmd position 5 85 50 1 -1
frame data/chars/3remuinho/2grab01.gif
delay 12
@cmd position 0 100 60 1 -1
frame data/chars/3remuinho/2grab02.gif
@cmd position 1 85 70 1 -1
frame data/chars/3remuinho/2grab03.gif
@cmd position 2 85 55 1 -1
frame data/chars/3remuinho/2grab04.gif
delay 8
@cmd position 12 70 40 1 1
frame data/chars/3remuinho/2grab05.gif
attack 60 130 90 110 20 1 1 0 9 70
dropv 3 0 1
@cmd position 15 15 40 1 1
frame data/chars/3remuinho/2grab06.gif
@cmd spawnGun4 "torn2" 60 0 10 -1 1
@cmd spawnGun4 "torn2" -40 0 10 0 2
attack 0 0 0 0
@cmd position 12 -50 40 1 -1
frame data/chars/3remuinho/2grab07.gif
attack -30 85 140 60 20 1 1 0 9 15
dropv 3 4 0
sound data/sounds/punch2.wav
@cmd position 1 -85 110 1 1
frame data/chars/3remuinho/2grab08.gif
attack 0 0 0 0
@cmd position 0 -45 135 -1 1
frame data/chars/3remuinho/2grab09.gif
attack 60 40 90 120 20 1 1 0 9 70
dropv 3 0 -1
@cmd position 11 0 130 -1 1
frame data/chars/3remuinho/2grab10.gif
attack 0 0 0 0
@cmd position 0 65 135 -1 -1
frame data/chars/3remuinho/2grab11.gif
sound data/sounds/punch2.wav
attack 100 90 140 55 20 1 1 0 9 15
dropv 3 4 0
@cmd position 1 100 110 1 -1
frame data/chars/3remuinho/2grab12.gif
delay 5
@cmd position 12 70 40 1 1
frame data/chars/3remuinho/2grab05.gif
attack 60 130 90 110 20 1 1 0 9 70
dropv 3 0 1
@cmd position 15 15 40 1 1
frame data/chars/3remuinho/2grab06.gif
attack 0 0 0 0
@cmd position 12 -50 40 1 -1
frame data/chars/3remuinho/2grab07.gif
attack -30 85 140 60 20 1 1 0 9 15
dropv 3 4 0
sound data/sounds/punch2.wav
@cmd position 1 -85 110 1 1
frame data/chars/3remuinho/2grab08.gif
attack 0 0 0 0
@cmd position 0 -45 135 -1 1
frame data/chars/3remuinho/2grab09.gif
attack 60 40 90 120 20 1 1 0 9 70
dropv 3 0 -1
@cmd position 11 0 130 -1 1
frame data/chars/3remuinho/2grab10.gif
attack 0 0 0 0
@cmd position 0 65 135 -1 -1
frame data/chars/3remuinho/2grab11.gif
sound data/sounds/punch2.wav
attack 100 90 140 55 20 1 1 0 9 15
dropv 3 4 0
@cmd position 1 100 110 1 -1
frame data/chars/3remuinho/2grab12.gif
@cmd looper 12 30
@cmd position 12 70 40 1 1
frame data/chars/3remuinho/2grab05.gif
attack 60 130 90 110 20 1 1 0 9 70
dropv 3 0 1
@cmd position 15 15 40 1 1
frame data/chars/3remuinho/2grab06.gif
attack 0 0 0 0
@cmd position 12 -50 40 1 -1
frame data/chars/3remuinho/2grab07.gif
attack -30 85 140 60 20 1 1 0 9 15
dropv 3 4 0
sound data/sounds/punch2.wav
@cmd position 1 -85 110 1 1
frame data/chars/3remuinho/2grab08.gif
attack 0 0 0 0
@cmd antiwall 80 -20 10
@cmd position 0 -45 120 -1 1
frame data/chars/3remuinho/2grab09.gif
attack 60 40 90 120 20 1 1 0 9 70
dropv 3 0 -1
@cmd antiwall 80 -20 10
@cmd position 11 0 100 -1 1
frame data/chars/3remuinho/2grab10.gif
attack 0 0 0 0
@cmd antiwall 80 -20 10
@cmd position 0 0 80 1 -1
frame data/chars/3remuinho/2grab11.gif #26
sound data/sounds/punch2.wav
@cmd spawn02 "flashsc2" -10 200 190
@cmd depost 0
@cmd finish 100 2 -5 1 0 0
delay 5
move 6
@cmd stop
frame data/chars/3remuinho/2grab13.gif
@cmd killgun 1 0
@cmd killgun 2 0
frame data/chars/3remuinho/2grab13.gif
@cmd clearL
frame data/chars/3remuinho/2grab14.gif
attack 95 115 100 55 35 1 1 0 7 10
dropv 3 4 0
frame data/chars/3remuinho/2grab14.gif
frame data/chars/3remuinho/2grab15.gif
frame data/chars/3remuinho/2grab15.gif
frame data/chars/3remuinho/2grab16.gif
attack 0 0 0 0
frame data/chars/3remuinho/2grab16.gif
move 0
frame data/chars/3remuinho/2grab17.gif
delay 30
frame data/chars/3remuinho/2grab17.gif
delay 12
frame data/chars/3remuinho/rise4.gif
This is an example of what happens. At minute 1:10 I go to the lower left corner, and the boss dies trapped in the lower wall. If I go to the center of the left wall, or to the upper left corner, antiwall works fine. If I change the value 10 to -10 (antiwall 80 -20 10 to antiwall 80 -20 -10), then in the lower left corner antiwall works fine, but in the upper left it is the same as in the video.