There are things that I would like to implement, for this I will describe the design of the mechanics. When one unit attacks another, it rolls 2 dice, these are two hit checks (one that the target is hit, the second that the target is broken). The idea is that the dice roll produces 3 results, not two. Success, half success, failure. If the success is half, then the damage is reduced by half. This is not a problem, I realized that I just need to use not the built-in hit chance, but write all this logic in calculating the damage. The second problem is that I want to visualize the dice rolls. That is, the result of the dropped dice should appear during the strike. What should I do in this case? Can I somehow extract the throw values from the formula? And if, for example, the first throw of the dice is a complete failure, I would like to highlight the phrase “miss”, and if the second throw, then highlight “no penetration”.
  • As an idea, I assume that each cube can have a separate value status. And he “roll” through the status change of ability. And after that, the damage subtraction formula itself is used, which reads the unit’s rolls. Is this possible? That is, technically, each skill changes not one status (health), but several. (first dice, then health)
  • edited November 24
    @BAO hmm hopefully I'm understanding correctly here.

    For the first part, I would just use a hit chance formula to determine the regular Hit or complete Miss and then you'll see on the ability a Miss schematic under hit chance. You can create a schematic to put there that does a Flying Text, console line, or whatever to say miss and it will only run the schematic on a Miss automatically.

    Now you know hit or miss, then in the Target Change where you are doing the damage the Change Value is set to Formula again and in that formula you can use a Chance node to see if it's full damage or half damage like you said write this logic in to calculating the damage.

    Now for the dice roll being displayed I'm not sure this is the best way but the first way that pops in to my head is that in the hit chance formula at the end of it when you have your final number (already did whatever math on whatever stats effect the hit chance) you can use a Change Variables node, set variable Value->Current Value (Formula) and that will grab the current numeric value of the formula. Then in the Battle Animation schematic you would display that variable however you were going to show the dice roll.

    Same for half damage dice roll, you set it to a variable in your damage formula to be displayed in the battle animation schematic after the hit/miss variable is displayed.

    Now I'm uncertain of the timing of how all of these go in order, but I would think that they execute in that order. Hit chance -> if hit then damage formula -> battle animation. It's possible though that the animation could play before the variables are set? Which if that's the case then it wouldn't work obviously. Might need to wait for the expert answer on this one.
    Post edited by GeneralK on
  • The Damage Multiplier node can be used to impact the damage of the action the schematic is animating.
    For the dice roll stuff you'll have to do that in the schematic, e.g. generating a random value (or via formula) and doing stuff based on that.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on!
Sign In or Register to comment.