Solved Antiwall Distz doesn't works with above and below walls at same time

Question that is answered or resolved.

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.

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.

 
Toranks

I will give 2 suggestions:

- use antiwall inside the @cmd finish/throw scripts
- remove upper/lower walls and use the level minZ/maxZ instead

A few months ago I sent some scripts, one of these is a modified version of the antiwall but only to use in grab scripts. Here's the code:
Code:
void antiWallG()
{//Checks distance from the walls, used for grab scripts only
 //If inside of the walls, entity will be moved away with defined movement
	void self 		= getlocalvar("self");
	void target 	= getentityvar(self, "grabbed");
	int direction 	= getentityproperty(self, "direction");
	int x 			= getentityproperty(self, "x");
	int Tx 			= getentityproperty(target, "x");
	int z 			= getentityproperty(self, "z");
	int Tz 			= getentityproperty(target, "z");
	int subWall		= getentityproperty(self, "subject_to_wall");
	float wall 		= checkwall(Tx, Tz);

	if(target != NULL()){
		if(wall){
			if(subWall == 1){
				changeentityproperty(target, "position", x, z+1);
				changeentityproperty(target, "velocity", 0, 0, NULL());
			}
		}
	}
}

Note that I'm using the entityvar to manage the opponent position as soon he is thrown/slammed, but you can use getlocalvar("target"+self) too.
Basically, this script will take the player's position (that is certainly in a safe place, outside of any wall) and define the target's position according to it. In other words if the target is inside any wall, he will be moved to the same player's position.

Another note, the opponent "Y" velocity will remain the same, only X/Z will be changed to zero. If you want to maintain both X/Z velocity, simply get the entityproperty "xdir" or "zdir" and apply to the script

Here's is an example of how the throw script will be, the same is for the slam script. The antiwall is at the end of the script:
Code:
void throw(int damage, int type, int Vx, int Vy, int Vz, int face)
{//Damage as throw finisher
	void self 	= getlocalvar("self");
	void target = getentityvar(self,"grabbed");
	int z 		= getentityproperty(self,"z");
	int tDir 	= getentityproperty(target,"direction");
	int vDir;
	
	if(face == 0){ //SAME FACING?
		vDir = tDir;
	}

	if(face == 1){ //OPPOSITE FACING?
		if(tDir == 0){ //FACING LEFT?
			vDir = 1;
		}else{
			vDir = 0;
		}
	}

	if(target == NULL()){
		target = getentityproperty(self, "grabbing");
		setentityvar(self, "grabbed", target);
	}
	
	if(target != NULL()){
		void atkType;
		void projectile;
		void eType = getentityproperty(target,"type"); //Get opponent's type
		int dir    = getentityproperty(target,"direction"); //Get opponent's facing direction

		if(dir == 0){ //FACING LEFT?
			Vx = -Vx;
		}
		
		if(type == 1){
			atkType = openborconstant("ATK_NORMAL8"); //1st Finisher
		}

		if(type == 2){
			atkType = openborconstant("ATK_NORMAL9"); //2nd Finisher
		}
		
		if(z > (openborconstant("PLAYER_MIN_Z")+openborconstant("PLAYER_MAX_Z"))/2){
			Vz = -Vz ;
		}
		
		if(eType == openborconstant("TYPE_PLAYER") || eType == openborconstant("TYPE_NPC")){
			changeentityproperty(target, "projectilehit", "type_player", "type_npc", "type_obstacle");
		}else if(eType == openborconstant("TYPE_ENEMY")){
			changeentityproperty(target, "projectilehit", "type_enemy", "type_obstacle");
		}
		
		damageentity(target, self, 0, 1, atkType);
		changeentityproperty(target, "direction", vDir);
		changeentityproperty(target, "aiflag", "projectile", 1);
		changeentityproperty(target, "damage_on_landing", damage); //RESET PROJECTILE STATUS TO 0 WHEN FALL ON THE GROUND, TOTAL DAMAGE
		tossentity(target, Vy, Vx, Vz); //TOSS OPPONENT
		antiWallG();
		setentityvar(self, "grabbed", NULL()); //CLEAR ENTITYVAR
	}
}
 
Yes, you show me that script in another previous thread with the same problem ( http://www.chronocrash.com/forum/index.php?topic=4876.0 ), before I understood how antiwall worked. I finally figured out how to configure antiwall correctly thanks to you and Bloodbane, but I can't get it to work for upper and lower walls at the same time.

Your method didn't work for me then. I've tried it again now, and it doesn't work for me either. I've changed getentityvar(self, "grabbed") for getlocalvar("Target" + self) and tried with position z+1 and z. None works....

Code:
void antiWallG()
{//Checks distance from the walls, used for grab scripts only
 //If inside of the walls, entity will be moved away with defined movement
	void self 		= getlocalvar("self");
    void target 	= getlocalvar("Target" + self);
	int direction 	= getentityproperty(self, "direction");
	int x 			= getentityproperty(self, "x");
	int Tx 			= getentityproperty(target, "x");
	int z 			= getentityproperty(self, "z");
	int Tz 			= getentityproperty(target, "z");
	int subWall		= getentityproperty(self, "subject_to_wall");
	float wall 		= checkwall(Tx, Tz);

	if(target != NULL()){
		if(wall){
			if(subWall == 1){
				changeentityproperty(target, "position", x, z);
				changeentityproperty(target, "velocity", 0, 0, NULL());
			}
		}
	}
}

Code:
void finish(int Damage, int Type, int x, int y, int z, int Face)
{ // Damage as slam finisher
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);
   int SDir = getentityproperty(target,"direction");
   int MDir;

   if(Face==0){ // Same facing?
       MDir = SDir;
   }

   if(Face==1){ // Opposite facing?

     if(SDir==0){ // Facing left?
       MDir = 1;
     } else { MDir = 0;}
   }

   if(target==NULL())
   {
     target = getentityproperty(self, "grabbing");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     int dir = getentityproperty(target,"direction"); //Get opponent's facing direction
     if(dir==0){ // Facing left?
       x = -x;
     }

     if(Type==1)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL")); // 1st Finisher
     }

     if(Type==2)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL9")); // 2nd Finisher
     }

     tossentity(target, y, x, z); // Toss opponent ;)
     changeentityproperty(target, "direction", MDir);
	 antiWallG();

     setlocalvar("Target"+self, NULL()); //Clears variable
   }
}
 
Toranks said:
Yes, you show me that script in another previous thread with the same problem ( http://www.chronocrash.com/forum/index.php?topic=4876.0 ), before I understood how antiwall worked. I finally figured out how to configure antiwall correctly thanks to you and Bloodbane, but I can't get it to work for upper and lower walls at the same time.

Your method didn't work for me then. I've tried it again now, and it doesn't work for me either. I've changed getentityvar(self, "grabbed") for getlocalvar("Target" + self) and tried with position z+1 and z. None works....

Code:
void antiWallG()
{//Checks distance from the walls, used for grab scripts only
 //If inside of the walls, entity will be moved away with defined movement
	void self 		= getlocalvar("self");
    void target 	= getlocalvar("Target" + self);
	int direction 	= getentityproperty(self, "direction");
	int x 			= getentityproperty(self, "x");
	int Tx 			= getentityproperty(target, "x");
	int z 			= getentityproperty(self, "z");
	int Tz 			= getentityproperty(target, "z");
	int subWall		= getentityproperty(self, "subject_to_wall");
	float wall 		= checkwall(Tx, Tz);

	if(target != NULL()){
		if(wall){
			if(subWall == 1){
				changeentityproperty(target, "position", x, z);
				changeentityproperty(target, "velocity", 0, 0, NULL());
			}
		}
	}
}

Code:
void finish(int Damage, int Type, int x, int y, int z, int Face)
{ // Damage as slam finisher
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);
   int SDir = getentityproperty(target,"direction");
   int MDir;

   if(Face==0){ // Same facing?
       MDir = SDir;
   }

   if(Face==1){ // Opposite facing?

     if(SDir==0){ // Facing left?
       MDir = 1;
     } else { MDir = 0;}
   }

   if(target==NULL())
   {
     target = getentityproperty(self, "grabbing");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     int dir = getentityproperty(target,"direction"); //Get opponent's facing direction
     if(dir==0){ // Facing left?
       x = -x;
     }

     if(Type==1)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL")); // 1st Finisher
     }

     if(Type==2)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL9")); // 2nd Finisher
     }

     tossentity(target, y, x, z); // Toss opponent ;)
     changeentityproperty(target, "direction", MDir);
	 antiWallG();

     setlocalvar("Target"+self, NULL()); //Clears variable
   }
}

As O Ilusionista said before, localvars aren't persistent and you will have less control over your target. Maybe the antiwall is not working because you are using localvars instead of globalvars or entityvars. I can confirm that this script works (I'm using entityvars), but maybe other scripts are affecting the antiwall.
I need to know more about how your character is built.
 
I'm sure getlocalvar("Target" + self) is working because if I change antiwall 80 -20 -10 for antiwall 80 -20 10 , antiwall works on the opposite corner of the stages.
What do you want to see of the character?
A peculiarity of the character is that he can move with the arrow keys while doing the grab... perhaps that could be influencing that
 
Toranks said:
I'm sure getlocalvar("Target" + self) is working because if I change antiwall 80 -20 -10 for antiwall 80 -20 10 , antiwall works on the opposite corner of the stages.
What do you want to see of the character?
A peculiarity of the character is that he can move with the arrow keys while doing the grab... perhaps that could be influencing that

I mentioned the localvar before, not for the "antiwall",but for "antiwallG", that doesn't need to add any value, it will take the player X/Y/Z values. If the player isn't stuck in walls, the grabbed entity will be moved to the same "safe" position. If the grabbed entity is not moving during the throw script, the antiwallG may be not retrieving the opponent by localvar.
 
Kratus said:
I mentioned the localvar before, not for the "antiwall",but for "antiwallG", that doesn't need to add any value, it will take the player X/Y/Z values. If the player isn't stuck in walls, the grabbed entity will be moved to the same "safe" position. If the grabbed entity is not moving during the throw script, the antiwallG may be not retrieving the opponent by localvar.

Oh, okay. But that would force me to define the entity variable in ALL slamstarts for hundreds of characters. I don't see it practical. However, I know the antiwall I am using works, but for upper and lower walls separately. Knowing that that works, I would like to understand why I cannot apply the negative and the positive value at the same time in the script I made above, as it would be a more practical solution for the game I am updating.
 
Toranks

I downloaded your game to make some tests. After some time with no solution, I discovered that the "Remuinho" character is using "escript.c", not the "grabscript.c" file for animation scripts.
After I changed and added the antiWallG, this is the result:

https://www.youtube.com/watch?v=wBEp-R_uS8c

I think maybe is this what you are looking for. In addition, I removed all "@cmd antiwall" lines from the entire "follow5" animation, only the antiwallG is working inside the "@cmd finish" script

This is the antiWallG I've used:
Code:
void antiWallG()
{//Checks distance from the walls, used for grab scripts only
 //If inside of the walls, entity will be moved away with defined movement
	void self 		= getlocalvar("self");
	void target 	= getlocalvar("Target" + self);
	int x 			= getentityproperty(self, "x");
	int Tx 			= getentityproperty(target, "x");
	int z 			= getentityproperty(self, "z");
	int Tz 			= getentityproperty(target, "z");
	float wall 		= checkwall(Tx, Tz);

	if(target != NULL()){
		if(wall){
			changeentityproperty(target, "position", x, z);
			changeentityproperty(target, "velocity", NULL(), 0, NULL());
		}
	}
}

And this is the @cmd finish using the antiWallG inside
Code:
void finish(int Damage, int Type, int x, int y, int z, int Face)
{ // Damage as slam finisher
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);
   int SDir = getentityproperty(target,"direction");
   int MDir;

   if(Face==0){ // Same facing?
       MDir = SDir;
   }

   if(Face==1){ // Opposite facing?

     if(SDir==0){ // Facing left?
       MDir = 1;
     } else { MDir = 0;}
   }

   if(target==NULL())
   {
     target = getentityproperty(self, "grabbing");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     int dir = getentityproperty(target,"direction"); //Get opponent's facing direction
     if(dir==0){ // Facing left?
       x = -x;
     }

     if(Type==1)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL")); // 1st Finisher
     }

     if(Type==2)
     {
       damageentity(target, self, Damage, 1, openborconstant("ATK_NORMAL9")); // 2nd Finisher
     }

     tossentity(target, y, x, z); // Toss opponent ;)
     changeentityproperty(target, "direction", MDir);
	 antiWallG();
     setlocalvar("Target"+self, NULL()); //Clears variable
   }
}

Here's the follow5 animation:
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	antiwall 50 -5 -1
	@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	antiwall 50 -5 -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	antiwall 50 -5 -1
	@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	antiwall 50 -5 -1
	@cmd	position 1 -85 110 1 1
	frame	data/chars/3remuinho/2grab08.gif
	attack	0 0 0 0
	@cmd	hurt 1
	#@cmd	antiwall 50 -5 -1
	@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	antiwall 50 -5 -1
	@cmd	position 11 0 130 -1 1
	frame	data/chars/3remuinho/2grab10.gif
	attack	0 0 0 0
	#@cmd	antiwall 50 -5 -1
	@cmd	position 0 65 135 -1 -1
	frame	data/chars/3remuinho/2grab11.gif
	@cmd	hurt 1
	sound	data/sounds/punch2.wav
	attack	100 90 140 55 20 1 1 0 9 15
	dropv	3 4 0
	#@cmd	antiwall 50 -5 -1
	@cmd	position 1 100 110 1 -1
	frame	data/chars/3remuinho/2grab12.gif
	delay	5
	#@cmd	antiwall 50 -5 -1
	@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	antiwall 50 -5 -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
	@cmd	hurt 1
	attack	-30 85 140 60 20 1 1 0 9 15
	dropv	3 4 0
	sound	data/sounds/punch2.wav
	#@cmd	antiwall 50 -5 -1
	@cmd	position 1 -85 110 1 1
	frame	data/chars/3remuinho/2grab08.gif
	attack	0 0 0 0
	#@cmd	antiwall 50 -5 -1
	@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	antiwall 50 -5 -1
	@cmd	position 11 0 130 -1 1
	frame	data/chars/3remuinho/2grab10.gif
	attack	0 0 0 0
	#@cmd	antiwall 50 -5 -1
	@cmd	position 0 65 135 -1 -1
	frame	data/chars/3remuinho/2grab11.gif
	sound	data/sounds/punch2.wav
	@cmd	hurt 1
	attack	100 90 140 55 20 1 1 0 9 15
	dropv	3 4 0
	#@cmd	antiwall 50 -5 -1
	@cmd	position 1 100 110 1 -1
	frame	data/chars/3remuinho/2grab12.gif
	@cmd	looper 12 30
	#@cmd	antiwall 50 -5 -1
	@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	antiwall 50 -5 -1
	@cmd	position 15 15 40 1 1
	frame	data/chars/3remuinho/2grab06.gif
	attack	0 0 0 0
	#@cmd	antiwall 50 -5 -1
	@cmd	position 12 -5 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	antiwall 100 -20 1
	@cmd	position 1 -85 110 1 1
	frame	data/chars/3remuinho/2grab08.gif
	attack	0 0 0 0
	#@cmd	antiwall 100 -20 1
	@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 100 -20 1
	@cmd	position 11 0 100 -1 1
	frame	data/chars/3remuinho/2grab10.gif
	attack	0 0 0 0
	#@cmd	antiwall 100 -20 1
	@cmd	position 0 0 80 1 -1
	frame	data/chars/3remuinho/2grab11.gif
	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

Now I can see the script working. I increased delays in the follow5 animation to see better what's happening. I hope it can help, please let me know if worked, I can send the files if you want
 
LOOOL A million of thanks!!! I just added it on my own and it goes perfect

I see you made minor changes on the antiwallG script.

About grabscript.c and escript.c, Is it important which one is used? They are almost identical, with minor differences. Grabscript.c is oriented to player characters, and escript.c to enemies, but because Remuinho it is also an enemy, he uses escript.c
I've changed easily one for another and copy spawngun4 and spawn03 scripts, the only two scripts Remuinho needs that the other characters don't have, but this not have influence on the results, with both it works fine, so I will also put it for the enemy characters, erasing all antiwalls on the game, avoiding the problem that many grabs have antiwall bad configured and it is very cumbersome to have to check them one by one. This saves me hours of work!

I'm going to play the full game from start to finish with some friends again to test this, as it definitely fixes the latest serious bug in the game. The rest of the remaining ones are irrelevant, and do not significantly alter the gameplay.

I am very happy today as I will be able to release version 2.4 finally. Thanks again!
 
I just added it on my own and it goes perfect
Great, it's good to know that the script worked!!

About grabscript.c and escript.c, Is it important which one is used?
This depends on the modder or the game. In my case I prefer to join all scripts in the same file and detect the entity type (player, enemy, npc, etc) before executing it. This can give more work to the engine but turns the code management more easier and will have less files in folders

On the other hand, I have other games that are completely necessary to let it separate because both player/enemy have a lot of different tasks.

erasing all antiwalls on the game, avoiding the problem that many grabs have antiwall bad configured and it is very cumbersome to have to check them one by one. This saves me hours of work!
Yeah, this  antiwallG saved me a lot of hours of work too. And having too much "@cmd antiwall" lines in the character's file, it's easy to forgot some adjustments. Using only one antiwall script for all entities, is better to manage the code if necessary

I see you made minor changes on the antiwallG script
Yes, I changed the "X" velocity from "0" to NULL() to not change the character's "xdir" when thrown. This is a kind of "double" security check, to avoid the character continue to flying against the wall and stuck again, but I think it's not necessary to add

Please, send the link when version 2.4 is ready, this is a great game.
 
Back
Top Bottom