Check wall in Z coords and change animation

dantedevil

Well-known member
Beyond that I have almost everything ready to launch the demo and I can only wait for the translation of the dialogues that a friend is making me, I miss a movement of Vega that I could not incorporate or not have an effective solution.
Lately I came up with an idea to do it, but for that I need to modify a script, I have tried to do it on my own for many days, but I did not succeed.

The idea is to modify this script to verify the Z coords and if it is within the distance, change the animation:
Code:
void wallhit2(int Dist, void Ani)
{// Checks if there is wall/platform at defined distance change animation
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   int x = getentityproperty(self, "x");
   int y = getentityproperty(self, "y");
   int z = getentityproperty(self, "z");
   int Hy = -1; int Py = -1;

   if(Direction == 0){ //Is entity facing left?                 
     Dist = -Dist; //Reverse Dist to match facing
   }

   float H = checkwall(x+Dist,z);
   void Plat = checkplatformbelow(x+Dist,z, y+20);

   if(Plat){
     Hy = getentityproperty(Plat, "grabforce"); 
     Py = getentityproperty(Plat, "y"); 
   }

   if(H > y || Py+Hy > y){
     performattack(self, openborconstant(Ani));
   }
}

It would be something like this:
void wallhit3(int Distz, void Ani)

My idea is to place a wall against the background of the screen, so that when Vega jumps on the fence of the background, use the script and when found at a specific distance, there would change animation to walk on the fence and then jump on the player . In this way he would perform the classic Street Fighter 2 attacks.
I have already edited the animations to walk on the fence, so I just need the script to make it come true ...
 
I can see your idea of finding walls then jump there if decent wall is found
My questions are:
1. Will Vega only jump to walls only? what about platforms?
2. Will Vega jump to wall in front of field?
 
Bloodbane said:
I can see your idea of finding walls then jump there if decent wall is found
My questions are:
1. Will Vega only jump to walls only? what about platforms?
2. Will Vega jump to wall in front of field?

1. Yes, only walls.
2. Not, to the background.

Here the animations:

Code:
anim attack4
	range	200 300
	loop	0
	delay	20
	offset	82 177
	bbox	71 68 39 109
        @cmd    leaper 0 3.5 -6
        landframe 2
	frame	data/chars/Sfighter/vega/wfence01.png
	delay	999
	@cmd	wallhit3 1 "ANIM_FOLLOW7"
	frame	data/chars/Sfighter/vega/wfence02.png
	delay	12
	frame	data/chars/Sfighter/vega/rise3.png



anim follow7
	loop	0
	delay	1000
	offset	82 177
	frame	data/chars/Sfighter/vega/wfence10.png

As you se he jumps to the background, if he detect a wall when is close (1) to the background, the change the animation.
The next animation is when he cllimb the fence.

To work properly
i have a level with this settings:

z 300 375 300
file data/levels/stage8-6.txt

A with this wall:
Wall 0 299 -500 -500 1200 1200 45 5000

As you see the wall in in 299, an the stage is 300 min.
 
Well, if the wall is supposed to be behind the z min and its only purpose is to make vega perform its spiderman animation, then you don't need the wall at all. Just the climbing script by Bloodbane i'm using on my game is enough for this.
He should give you and explain only this i would say..
The only thing i would worry, is how to make vega moving left right automaticaly for a while following the player before he performs his jump attack animation.
 
Back
Top Bottom