block counter

DD Tokki

Well-known member
When the boss "Shiva" defends in "Street of Rage X", there is an attack that tries to counter. I saw this script, but I think it's code optimized for that game, so I'm wondering if there is a script that can easily be applied to other games.
 
I am having this same issue,

Instead of blocking my character has a doge type move, it's essentially like a typical block no axis movement, it just has no collision box on some frames so you can't be hit momentarily. very simple at the moment but does the job.

03.png

It works fine for the player but I can't get the enemy to perform it at all. I tried to copy these suggestions and adjust aggression etc.

Code:
aggression 40
attackthrottle 0.5 2
block_config active
guardpoints 20
guardrate 2
blockback 1
blockodds 1
nopassiveblock 1

I tried turning nopassiveblock on or off, I've increased/decreased aggression, I experimented with different ranges in the BLOCK anim. He just never does it. I was completely expecting him to spam the hell out of because whenever I've given enemies block before it's hard to make them NOT block. In another mod I made the block switch to random animations, like a backwards flip and dodging, and avoids to stop the spammy block.
 
It works fine for the player but I can't get the enemy to perform it at all. I tried to copy these suggestions and adjust aggression etc.
A workaround I did in some of my games was putting the dodge animation as "attack1", since its the firstmost attack an enemy will use - all the other attacks uses "attack2" and so on. Then I just set the proper range and they use it when they can use it.

You can see it at 42:30

The only downside of thisis: the dodge is active, not passive*.
But I can simply using a randomanim function on his block animation (as I used on another game) and it will randomly dodge instead of blocking

*if you think about it, the dodge is always active/reactive, not passive anyway.
 
Does having attack range in the player's attack necessary so the enemy reacts properly? I just realised I hadn't put any range in the player's attack

@Bloodbane - I'm guessing that's the problem for the most part

@O Ilusionista - In my TMNT mod I think you tried it out, the foot clan enemies would randomize to back flipping away from attacks etc to stop them over blocking. But this one seemed straight forward that basic block would just work. Replacing attack1 is a good idea thou and it makes sense I can add more random anim changes if it ends up spammy.


@DCurrent - Thanks I will have to play around with this, I had actually watched this video before. Because I'm simulating a turn based kind of fighting this would also be useful to prevent attack spam. I'm using mana as action points giving characters MP cost to every action and using mpset setting for quick recovery of MP. So they can't attack without mana/AP
 
@DCurrent

I added your ondoattackscript and added one line to perform a follow1 animation and it's working pretty good. Now I just need to make it more random and not all the time somehow.

Code:
changeopenborvariant("lasthitc", 0);
performattack(self, openborconstant("ANI_FOLLOW1"), 1);
 
@DCurrent

I added your ondoattackscript and added one line to perform a follow1 animation and it's working pretty good. Now I just need to make it more random and not all the time somehow.

Code:
changeopenborvariant("lasthitc", 0);
performattack(self, openborconstant("ANI_FOLLOW1"), 1);

I'm on the phone so I can't really write code samples, but they way I'd do it is come up with some percentage, and then generate a random number. If the random meets percentage, do the dodge. Otherwise, just exit the function and let hit take place normally.

You could fancy it up a little by changing the percentage based on certain conditions. Remaining HP, difficulty, the type of incoming attack, etc.

HTH,
DC
 
@DCurrent

I have done random function before so I can manage that, it will probably work just the same limiting him by his MP, because the player is limited to dodge by MP. But really in the long run I want to try to add some way of HIT CHANCE and CRIT CHANCE. So I will definitely add to this.

Thanks for the recommendation and tutorials. I really enjoy watching these types of videos and having you explain openbor engine, code, concepts and logic.
 
Back
Top Bottom