Battlesystem - Predict Enemy Action

● ARCHIVED · READ-ONLY
Started by Kay007 3 posts View original ↗
  1. Hi everyone!

    I'm trying to implement a battle system where the enemy says or does something, before they attack and the player gets a hint on what the next action will be, so they can try to react accordingly.

    The player has the action "Attack", "Defend", "Mean" (like throwing sand in the enemys eyes).

    - "Attack" beats "Mean" and loses to "Defend"

    - "Defend" beats "Attack" and loses to "Mean"

    - "Mean" beats "Defend" and loses to "Attack"

    (I know that this is very basic at the moment and needs a lot of refinement to get interesting :) )

    My question is, if this is actually possible.

    An example of how this should work:

    > Round starts

    > "Enemy takes a step back" -> means the enemy will use "Defend"

    > Player choses action "Mean"

    > Both actors take their turns, in this case the player would damage the enemy

    > New round starts

    Of course the hints become less and less clear, so the player has to do more thinking while progressing or just wander the "Try and Error" path.

    For this to work I need to know if there is a way to determine, which attack the enemy will use in his next turn. Is the enemy action chosen only after the player choses his own action or beforehand?

    Thanks for all your help!
  2. You'll need a skill charge script.

    I think Tsukihime made one where you can have different text show when someone charges a particular skill.
  3. Bumping this topic, as it is still an issue. I looked for scripts, but all I found were scripts setting a limit to how often one can use a skill - or just dead links...

    I tried a different approach by using the build in combat engine. It does not work as for now, but I guess I'm on the right way.

    The enemy has 6 different possible actions (as the base set):

    1. Charge Attack  ->          Adds state "Attack"

    2. Charge Defend ->          Adds state "Defend"

    3. Charge Special ->         Adds state "Special"

    4. Attack               ->          Does damage to a player who uses Attack/Special, removes state "Attack"

    5. Defend             ->          Does damage to a player who uses Attack/Defend, removes state "Defend"

    6. Special             ->          Does damage to a player who uses Special/Defend, removes state "Special"

    The player has the following actions available:

    1. Attack              ->          Does damage to an enemy with the state " Attack " or "Special" active. Adds state "Attack" to the player 

    2. Defend            ->          Does damage to an enemy with the state " Attack " or "Defend" active. Adds state "Defend" to the player 

    3. Special            ->          Does damage to an enemy with the state " Defend " or "Special" active. Adds state "Special" to the player 

    Attack/Defend/Special have a rating of 10, while the Charge A/D/S have a rating of 1. The enemy will only be able to use A/D/S when the specific state is active on him. The ratings should guarantee the execution of the A/D/S action rather then the charge action when both are possible.

    An example of how I imagine the combat system to work:

    Round 1 starts. The player can use first blow (because I have no idea yet how to let the enemy do his turn, before the player can chose his action). No state active on the enemy, so he can only use a Charge-Action. Round 1 ends.

    Round 2 starts. The player has the information from round 1, which action has been charged, so he can chose his action accordingly. Player gains his chosen state and attacks/defends/uses his special. The enemy executes his A/D/S action, loses his state from the previous round. Before the round ends he charges again for the following round.

    Problems so far:

    How do I let the enemy use two actions in one turn (A/D/S + charge)? I only found an option to give a %chance for a second attack or a double attack with the same action. In the same time, he is only allowed to have 1 action on the first round. Else he would charge and instantly attack, which would destroy the whole order.

    Second problem would be to remove the state on the enemy after using A/D/S. As far as my understanding goes, actions against an enemy may only add/remove states to/of this enemy and not to the executing party? Maybe this is possible via the attack-formula, like a.remove_state(x) perhaps?

    Those are probably only two of a bunch of problems yet to come before this system finally works...

    If someone has a working link to a attack-charge-script, it could spare me a lot of work. :)

    Thanks in advance for any help! :)

    Greetings,

    Kay