Hi everyone,
I'm beginning to learn how to use RMMV and I'm currently working on creating an event-based battle system; atm, the only rules of my battle system are as follows:
My hero and enemies only have 4 parameters: HP / ATK / DEF / STAMINA
The turn are based on the character's stamina; at the beginning of the battle, the hero starts with a stamina value of 8 which allows him to attack straight away; the enemy starts with a random value of stamina between 1 and 8 and must wait until it reaches 8 to counter attack. I have no idea how it would develop in practice, but that is what I'm aiming to create for now.
However, I'm already stuck after 2 days of creation.
I'm using 2 common events; The first one I managed to create is the one that makes the battle menu appear on the map, with 2 options: Attack / Leave battle. The menu is working fine, I can move from one choice to the next, then the second common events that is supposed to handle the stamina system is launched when I press on "ok" while on the "Attack" button.
Here is the common event I use to display the menu, move through it, and press "ok"; it is working but if you see things that I could do differently, more efficiently with the same results, don't hesitate, I'm here to improve:
The real problem comes with the common event : Battle Stamina that starts when I press "OK"; 2 scenarios for now:
1 It allows me to attack and decrease the enemy's HP (as a side note, I use actors to represent my enemies), until the enemy is knocked out, then it makes me win the battle and go back to the next playable map.
2 it allows me to leave the battle if I choose to do so.
However, now that I want to add a condition to the ATTACK choice, namely, the hero can attack only as long as his stamina is bigger than 1; otherwise, the hero must wait for the enemy to attack, which allows him to recover as much stamina as was used by the enemy. i just can't find a way to make it work.
Right now, the code I'll show you allows me to have the stamina decrease by 2 everytime I attack; but when I reach a stamina value of 1; I'm still able to keep attacking. My additional condition that is supposed to prevent me from attacking is not taken into account. However, I noticed that if I win the first battle, with my stamina stuck to 1 (because it's the minimum); when I will start the next battle, my additional condition is the one taking into account and I really cannot attack during that second battle.
I hope you can picture my problem properly, so here is the 2nd common event that I use to handle attacking, decreasing HP, decreasing stamina and so on...:
I've tried to mix up or change the conditions around in many ways, but the best result I get is the one I described above. If you manage to understand my issue and come up with solutions I could try to implement; I'd be happy to learn from you all.
Thanks a lot!
I'm beginning to learn how to use RMMV and I'm currently working on creating an event-based battle system; atm, the only rules of my battle system are as follows:
My hero and enemies only have 4 parameters: HP / ATK / DEF / STAMINA
The turn are based on the character's stamina; at the beginning of the battle, the hero starts with a stamina value of 8 which allows him to attack straight away; the enemy starts with a random value of stamina between 1 and 8 and must wait until it reaches 8 to counter attack. I have no idea how it would develop in practice, but that is what I'm aiming to create for now.
However, I'm already stuck after 2 days of creation.
I'm using 2 common events; The first one I managed to create is the one that makes the battle menu appear on the map, with 2 options: Attack / Leave battle. The menu is working fine, I can move from one choice to the next, then the second common events that is supposed to handle the stamina system is launched when I press on "ok" while on the "Attack" button.
Here is the common event I use to display the menu, move through it, and press "ok"; it is working but if you see things that I could do differently, more efficiently with the same results, don't hesitate, I'm here to improve:
For it to work, I must have one event on the playable map, and one on the battle map, so that I can start the battle menu when transferring the player on the battle map, and hide it when the player comes back on a playable map; here they are:
Playable map event on parallel:
Battle map event on parallel:
The Battle Menu common event that is started when the player is transferred on a Battle Map:
Playable map event on parallel:
Battle map event on parallel:
The Battle Menu common event that is started when the player is transferred on a Battle Map:
The real problem comes with the common event : Battle Stamina that starts when I press "OK"; 2 scenarios for now:
1 It allows me to attack and decrease the enemy's HP (as a side note, I use actors to represent my enemies), until the enemy is knocked out, then it makes me win the battle and go back to the next playable map.
2 it allows me to leave the battle if I choose to do so.
However, now that I want to add a condition to the ATTACK choice, namely, the hero can attack only as long as his stamina is bigger than 1; otherwise, the hero must wait for the enemy to attack, which allows him to recover as much stamina as was used by the enemy. i just can't find a way to make it work.
Right now, the code I'll show you allows me to have the stamina decrease by 2 everytime I attack; but when I reach a stamina value of 1; I'm still able to keep attacking. My additional condition that is supposed to prevent me from attacking is not taken into account. However, I noticed that if I win the first battle, with my stamina stuck to 1 (because it's the minimum); when I will start the next battle, my additional condition is the one taking into account and I really cannot attack during that second battle.
I hope you can picture my problem properly, so here is the 2nd common event that I use to handle attacking, decreasing HP, decreasing stamina and so on...:
Here is the comon event:
I've tried to mix up or change the conditions around in many ways, but the best result I get is the one I described above. If you manage to understand my issue and come up with solutions I could try to implement; I'd be happy to learn from you all.
Thanks a lot!