Block command

16-bit Fighter

Active member
Please, I need help because I use the Block command for an enemy char but it doesn't work. The enemy is every time hurt by any attack when performing the anim below.

Code:
anim upper
        offset	74 102
	range	10 55
	rangez	-10 10
	bbox	63 44 19 58
	delay	199
	@cmd	block 1
	frame	data/chars/jean'/block.png
	delay	7
	@cmd	block 0
	frame	data/chars/jean'/idle01.png

Code:
void block(int Flag)
{// Turns blocking status
    void self = getlocalvar("self");
    changeentityproperty(self, "aiflag", "blocking", Flag);
}
 
Thank you but it's not because of that (I've checked it still). The enemies which have the automatic block can block the attack below but not the enemy I talked about in my first post.

Code:
attack2	74 55 21 20 5 0 0 0 5 10

Edit:
Would the Block command work just for players? I don't have this problem with players...
 
16-bit Fighter said:
Thank you but it's not because of that (I've checked it still). The enemies which have the automatic block can block the attack below but not the enemy I talked about in my first post.

Code:
attack2	74 55 21 20 5 0 0 0 5 10

Edit:
Would the Block command work just for players? I don't have this problem with players...

16-bit Fighter
I tested your code in SOR2X Abadede and had the same problem. But after adding the function "nopassiveblock 1" to him at the header, the block worked correctly. Also you will need to add the "bflash" function too.
 
Thanks Kratus this had solved an issue that I had with enemies blocking a stream of consecutive attacks even if the first attack wasn't blocked.

edit: huh, no. If I set nopassiveblock 1, even with blockodds 1, the enemy almost never block (or try to block a move that is still far away, but never a close attack).

Edit2: I've fixed my issue with this http://www.chronocrash.com/forum/index.php?topic=5073.msg71939#msg71939
 
O Ilusionista
edit: huh, no. If I set nopassiveblock 1, even with blockodds 1, the enemy almost never block (or try to block a move that is still far away, but never a close attack).
The enemy will never try to block a close attack, even if you add a "range" at the block animation?
 
O Ilusionista said:
Kratus no, I tried to add a range but he never blocks it.
It's good to know that. I made some tests on Barbon boss on SOR2X and thanks to your info I discovered that the blocking rate can be changed according to the "aimove" function.

Barbon blocking rate is very high and he will always try to block at any distance, close or far, using "aimove avoid". However, when I changed it to "aimove chase", the blocking rate is lower than "aimove avoid". If I remove the "aimove" completely, the rate drops a little, but is also lower than "avoid".

Here's how the animation's range is defined:
Code:
anim block
	range 0 100
	rangea 0 100
	rangez -50 50
	loop	0
	delay	96
	offset	143 192
	bbox 	122 108 33 86
	frame	data/chars/bosses/barbon/block00.gif
 
Kratus I tried to change the "blockodds 1" to another number (because blockodds 1 will make him try to block almost all attacks). But any other number that is not 1 makes the entity simply not trying to block at all.
 
O Ilusionista said:
Kratus I tried to change the "blockodds 1" to another number (because blockodds 1 will make him try to block almost all attacks). But any other number that is not 1 makes the entity simply not trying to block at all.
O Ilusionista
Yeah, it's true. I made the same test and can confirm that the "blockodds" function will not work if the value is any other than "1". It would be good to reduce the block usage by npc/enemies but unfortunately is not working
 
Player and/or entity can the chance of a successful or unsuccessful block be manipulated by certain parameters? In other words one character maybe be better at blocking than another and the success rate vary? Maybe a random system for an NPC's based on the character?
 
Back
Top Bottom