Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Problem with enemies attack conditions.

I have a certain enemy only do an attack when it has 90%+ of his total HP, and another one if he has less than that, the point being that you have to hit it first so it doesn't use his more powerful attack.(the one with 90%+ of HP)
but it doesn't do what I tell him to do, even with less that 90% he STILL uses the powerful attack. Actually the problem seems to be that the program checks the attack conditions, BEFORE the turn starts, so if he has 100% of his HP and then I hurt him and THEN he attacks, the program still checked that it had full HP... I know this because for the next turn, he doesn't do it anymore, and all the attack conditions work, but 1 turn later...
Is there any way to make the program check the attack conditions not before the turn, but just before the enemy attacks?
 
Do this:
1)  Give the enemy 2 attacks.  Set one to have condition "HP - 90%-100%" and the appropriate skill and set the other attack to have condition "HP - 0% - 90%."

I'm assuming that is probably all you have. So, to fix the problem of the game checking the enemies HP before your character's damage is dealt you need to do this.

2)  Go to the "Troops" tab and find the appropriate one.  In the battle events box check ONLY the Enemy box and set the condition to "(insert enemy name here)" HP is "90%" or below.
3) The 'Span' should at default be 'Battle' but if it's not change it accordingly, unless you would prefer one of the other choices.
4)  Make a new Event Command, go to tab 3, and under the Battle Event box pick the 'Force Action...' choice.
5)  For Action Subject pick the same enemy as before and then pick the appropriate Skill and finally choose what kind of targeting it will do (probably random).

I tested this myself and it worked perfectly so hopefully it does the same for you!  Good luck!
 
Hmm, only reasons I can think of why they enemy would attack first is if the Span is set to "Turn" and not "Battle" or if the enemy is just faster which would have nothing to do with the eventing.  But I'm glad it worked!  Good luck with your game!
 
I have it set to turn, because the enemy can heal himself, and then the event would be needed more than once per battle. but it's not really important that they attack first.
Thanx again.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top