Crouching on a normal level

esn23

Active member
I know how crouch works on a 2d level but on a 3d one or one where you can move up and down is what im looking for.. I need to find a script i guess that will alow me to hold block or freespecial (any one will do) and allow me to crouch.. I don't need to do any attacks from the crouch i just need to press an alt button and hold it down to be able to crouch on a level that goes up down left right and not just left to right.. I hope I made sense.. Please if someone can help it would be great and thanks in advance
 
You can use block script from Crime Busterv2.5 and replace it with crouching.
Using scripts from that mod, it should be like this:
Code:
anim	freespecial7
        delay	7
	offset	26 112
	frame	data/chars/kula/crouch01.gif
	bbox	14 11 40 102
	frame	data/chars/kula/crouch02.gif
	frame	data/chars/kula/crouch03.gif
        @cmd    keyflip 0
        @cmd    keyint "ANI_FREESPECIAL7" 2 "A2" 0 0
	frame	data/chars/kula/crouch03.gif
	frame	data/chars/kula/crouch02.gif
	frame	data/chars/kula/crouch01.gif

This could be expanded more but for static crouching this will do :)
 
Bloodbane said:
You can use block script from Crime Busterv2.5 and replace it with crouching.
Using scripts from that mod, it should be like this:
Code:
anim	freespecial7
        delay	7
	offset	26 112
	frame	data/chars/kula/crouch01.gif
	bbox	14 11 40 102
	frame	data/chars/kula/crouch02.gif
	frame	data/chars/kula/crouch03.gif
        @cmd    keyflip 0
        @cmd    keyint "ANI_FREESPECIAL7" 2 "A2" 0 0
	frame	data/chars/kula/crouch03.gif
	frame	data/chars/kula/crouch02.gif
	frame	data/chars/kula/crouch01.gif

This could be expanded more but for static crouching this will do :)
She should crouch though for as long as im holding down the button however she sorta teabags and gets back up.. lol
 
This is how I do - Captain America has this code on his freespecial6 animation

anim freespecial6
loop 1
delay 2
offset 68 96
bbox 54 54 26 42
@cmd block 1
frame data/chars/captain/bl.gif
frame data/chars/captain/bl.gif
frame data/chars/captain/bl.gif
frame data/chars/captain/bl.gif
frame data/chars/captain/bl.gif
@cmd aniNHoldSwitch "ANI_CANT" "A2"
frame data/chars/captain/bl.gif

Yes, the animation is looped. The code will detect if you not holding the attack2 button and then change to the CANT animation

Code:
void aniNHoldSwitch(char vAni, char keyCond){
	void vEnt = getlocalvar("self");
	int iIndex = getentityproperty(vEnt, "playerindex");
	
	if(keyCond == "A2"){ // Is A2 pressed?
		if(keyCond == "A2" && !(((playerkeys(iIndex, 0, "attack2")))
			)
		){
				changeentityproperty(vEnt, "animation", openborconstant(vAni));
		}
	}
	
	     
	
	else if(! (playerkeys(iIndex, 0, keyCond) && ! playerkeys(iIndex, 2, keyCond))){
		changeentityproperty(vEnt, "animation", openborconstant(vAni));
	}
}
 
Thank you, O Illusionista. Looking at that script, I had an idea for a "tactical crouch" akin to D&D games, where after a player's jump ceases, players can hold the jump button and enter their crouch, to perform DUCKATTACK, as well as a ducking special move. I wonder how that script could be tweaked so that it can be used that way?
 
Miru  That code works detecting if are NOT holding the button (hence the N), so this is why the animation is looped.
In your case, are you trying (by holding the button) before the jump or after the jump (when they jumpland)?
 
O Ilusionista said:
Miru  That code works detecting if are NOT holding the button (hence the N), so this is why the animation is looped.
In your case, are you trying (by holding the button) before the jump or after the jump (when they jumpland)?

The latter. The crouch should trigger after they jump.
 
O Ilusionista said:
This is how I do - Captain America has this code on his freespecial6 animation

anim freespecial6
loop 1
delay 2
offset 68 96
bbox 54 54 26 42
@cmd block 1
frame data/chars/captain/bl.gif
frame data/chars/captain/bl.gif
frame data/chars/captain/bl.gif
frame data/chars/captain/bl.gif
frame data/chars/captain/bl.gif
@cmd aniNHoldSwitch "ANI_CANT" "A2"
frame data/chars/captain/bl.gif

Yes, the animation is looped. The code will detect if you not holding the attack2 button and then change to the CANT animation

Code:
void aniNHoldSwitch(char vAni, char keyCond){
	void vEnt = getlocalvar("self");
	int iIndex = getentityproperty(vEnt, "playerindex");
	
	if(keyCond == "A2"){ // Is A2 pressed?
		if(keyCond == "A2" && !(((playerkeys(iIndex, 0, "attack2")))
			)
		){
				changeentityproperty(vEnt, "animation", openborconstant(vAni));
		}
	}
	
	     
	
	else if(! (playerkeys(iIndex, 0, keyCond) && ! playerkeys(iIndex, 2, keyCond))){
		changeentityproperty(vEnt, "animation", openborconstant(vAni));
	}
}


when you guys refer to using a script such as @cmd  aniNHoldSwitch "ANI_CANT" "A2"

what do I name the script above and where exactly does it go - in scripts?

 
PS VITA whenever you see a function been used inside an animation, the code must be used on a script file which is declared as ANIMATIONSCRIPT on your character header:

Code:
animationscript data/scripts/NAMEOFTHEFILE.C

Inside that file, you need to have the function "aniNHoldSwitch"
 
O Ilusionista said:
PS VITA whenever you see a function been used inside an animation, the code must be used on a script file which is declared as ANIMATIONSCRIPT on your character header:

Code:
animationscript data/scripts/NAMEOFTHEFILE.C

Inside that file, you need to have the function "aniNHoldSwitch"

Thanks
 
Back
Top Bottom