Need help with some enemy attacks.

Joshiro

Member
I have an enemy that runs up to you and performs a slam. I want the attack to not hit if the player is in the air.  Does anybody know the best way to script this?

Also, how do you make an enemy receive damage while blocking? I tried using blockratio but it doesn't work. 

 
I have an enemy that runs up to you and performs a slam. I want the attack to not hit if the player is in the air.  Does anybody know the best way to script this?

The simplest way is to check player's altitude at beginning of slam animation. If the altitude is more than 0, change to non slam animation

how do you make an enemy receive damage while blocking?

Won't that defeat the point of blocking?
Anyways, how much damage you want enemy to take in this blocking state?
 
The simplest way is to check player's altitude at beginning of slam animation. If the altitude is more than 0, change to non slam animation

Do you have a sample or can you give me an idea on how to make the script?

Won't that defeat the point of blocking?
Anyways, how much damage you want enemy to take in this blocking state?

Basically, I want the attack to receive damage but the animation be uninterrupted, unless hit by an attack with a certain amount of damage. So, I put the attack as a block animation and put the thold as 10.
 
Do you have a sample or can you give me an idea on how to make the script?

Let me look for sample first. But one thing for sure, I am using assumption that the slam is run from followup animation

[couple hours later]

Okay, I've found a good example and I've modified it for altitude check:
anim follow1
@script
    if(frame == 0){
      void self = getlocalvar("self");
      void target = getentityproperty(self, "opponent");
      int Alti = getentityproperty(target, "a");

      if(Alti > 0){
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
      }
    }
@end_script
...

Assuming your followup animation is FOLLOW1
This script checks latest's opponent's altitude and if it's more than 0 i.e in air, the script will change current animation to FOLLOW2
You can have run attack for FOLLOW2 to give impression that enemy didn't hit player

Basically, I want the attack to receive damage but the animation be uninterrupted, unless hit by an attack with a certain amount of damage

Ah, why not use damage normal 10 ? Setting this will give enemy endurance to attacks whose damage is less than 10. Endurance means any received attack will not stop current animation

BTW is this endurance applicable only on this attack?
 
Thanks for the script. I'll give it a try.

Is their a good guide somewhere so I know what each script variable is and what each of their values are? I kind of just look at different scripts and try to piece things together but I would like to understand openbor scripting better.

Ah, why not use damage normal 10 ? Setting this will give enemy endurance to attacks whose damage is less than 10. Endurance means any received attack will not stop current animation

BTW is this endurance applicable only on this attack?

When you mean use "damage normal 10" are you referring to the offense code?

Yes, I want it just for this attack. I want the enemy to receive maybe half damage during this move and only higher damaging attacks can make the enemy go into pain animation. 


 
The blocking thing you could try to have him change weapon modes before he blocks because in the other mode block doesn't work and you could make his hp higher or his defense higher in that mode so it appears he is taking less damage while he is blocking.  Or you could make another animation for the blocking that isnt block and make it appear that he is blocking when he is not. 
 
Yes, I want it just for this attack. I want the enemy to receive maybe half damage during this move and only higher damaging attacks can make the enemy go into pain animation.

Hmm... that would require script to temporarily increase defense just for that attack then reset the defense at end of attack and in other reaction animations
Just a minute...

[2 days later]

It turns out it took longer than just a minute
Anyways, here's the script to increase and decrease defense at defined frames:

anim attack1
@script
    if(frame == 0){ // 1st frame
      void self = getlocalvar("self");
      changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 1, 20);
    }
    if(frame == 5){ // 6th frame
      void self = getlocalvar("self");
      changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 1, 0);
    }
@end_script
...

You can change 6th frame above with other value. The last part of script decreases defense and should be run at last frame
 
Really late response but thanks Bloodbane. I completely forgot about this topic. I'm going to try the script out.

I'm currently having another issue. Since I gave enemies a get animation to pick up weapons, the enemies pick up health items too. I wasn't even aware of this feature. Is their some way to turn this off?






 
Back
Top Bottom