Solved Crouch in specific levels

Question that is answered or resolved.

dantedevil

Well-known member
Hello my friends!

Lately I have very little free time, since I started studying Graphic Design. And between work and study I have very little free time.
But I still try to make time to work on the mod.
Now I am working on a new feature to use in some levels of stealth and traps.
The idea is that in some levels where there are no enemies and only traps or stealth tests, the BLOCK button will pass like the CROUCH button.
To make this possible, I used the method of this thread:

The CROUCH button works the same as the BLOCK button, while keeping it pressed the hero stays crouched.
Everything works correctly, but there is a problem when I release the button. The hero does not play the rest of the animation.

Example during BLOCK:

During the BLOCK when I release the button, the hero plays the last two frames (blue).

anim block
loop 0
offset 82 177
bbox 69 67 45 110
delay 4
@script
if(frame == 0){
void self = getlocalvar("self");
char branch = openborvariant("current_branch");

if(branch=="Stage9-2-1"){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW48"));
} else if(branch=="Stage9-2-1"){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW48"));
}
}
@end_script
frame data/chars/tusk/block0.png
frame data/chars/tusk/block1.png
@cmd anichange "ANI_FOLLOW30" 0
frame data/chars/tusk/block2.png

anim follow30
loop 0
delay 4
offset 82 177
bbox 66 74 44 104
@cmd block 1
frame data/chars/tusk/block2.png
@cmd keyflip 0
@cmd keyint "ANI_FOLLOW30" 0 "S" 0 0
frame data/chars/tusk/block2.png
frame data/chars/tusk/block1.png
@cmd block 0
frame data/chars/tusk/block0.png



Example during CROUCH:

During the CROUCH when I release the button, the hero don't plays the last two frames (red).

# ANIM CROUCH
anim follow48
loop 0
offset 98 173
delay 6
frame data/chars/caro/rise2.png
offset 98 176
delay 4
frame data/chars/caro/rise1.png
@cmd anichange "ANI_FOLLOW49" 0
offset 98 173
delay 6
frame data/chars/caro/rise2.png

# STAY CROUCH
anim follow49
loop 0
delay 4
offset 98 176
bbox 88 143 23 36
frame data/chars/caro/rise1.png
@cmd keyflip 0
@cmd keyint "ANI_FOLLOW49" 0 "S" 0 0
frame data/chars/caro/rise1.png
delay 7
offset 98 173
frame data/chars/caro/rise2.png
frame data/chars/caro/rise3.png



Obviously this does not look good, because when you release the button the hero appears standing up, without showing how he gets up.
 
Last edited:
Solution
I've just made some tests to see what's wrong and looks like this problem is caused by holdblock 1. Tusk is already using script based block holding so there's no need to use that command. IOW just remove holdblock
I've just made some tests to see what's wrong and looks like this problem is caused by holdblock 1. Tusk is already using script based block holding so there's no need to use that command. IOW just remove holdblock
 
Solution
Bloodbane said:
I've just made some tests to see what's wrong and looks like this problem is caused by holdblock 1. Tusk is already using script based block holding so there's no need to use that command. IOW just remove holdblock

You're right, my dear friend!

Now it works perfect!

Thanks!  ;D ;D ;D

;)
 
Back
Top Bottom