I'd like to implement something like evasion and parry, which are similar to block but the target takes some Stamina damage instead of HP damage (preferably proportional to the damage that would have been taken). This seems like blocking, but blocking doesn't seem to allow schematics to inject custom behavior.

I tried making a evasion status effect that would auto-apply itself and end on receiving any ability. I can then run a schematic there, which runs before HP is deducted. The problem is, I can't figure out how to get the damage from that ability in the schematic. Is there a way to fetch this? Or else what's the best approach to implement something like this?
  • Consumable status values have the Barrier Settings that could be of use here. E.g. you could set up a conditional barrier for your health stat that consumes stamina under certain conditions (e.g. a status effect being applied).

    Alternatively, status values also have Change Schematics available that are automatically used when their value is changed - and can be limited to e.g. only negative changes or only coming from abilities, etc.
    Those schematics will have all that information available as local variables, see the help text of the Change Schematic settings in the status value for details.
    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 patreon.com!
  • edited March 10
    Change schematics seems to be the closest hit here, containing both the combatant making the change and the value for the change...perhaps I can also make evasion avoid other status changes by adding a status effect to the target and make others don't apply if that buff is present? Kind of a long way around since I need to add this condition to every ability but workable I guess? Doesn't seem to work with non-damage dealing abilities either I guess...

    If I want to add this to the source code or access handlers, which class should I look at to add this?
    Post edited by Flying_Banana on
  • I still think barriers would be better suited for this, at least if I understood what you want to do correctly - i.e. damaging stamina instead of health under certain conditions.

    It'd be easiest to go the access handler route via a custom combatant access handler, which has 4 status value related functions to override (responsible for setting/adding values to the status value or it's base value).
    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 patreon.com!
  • The problem with pure barriers is that it's quite limited - e.g. I want to also damage the attacker's Stamina on a successful parry, or determine the Stamina damage based on the ratio of Strength of the attacker and defender.

    For the CombatantAccessHandler, I don't see a method to handle adding a status effect - is that somewhere else?
  • You can add status effects to the combatant directly without going through an access handler. They're handled by a combatant's Status.Effects attribute.
    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 patreon.com!
  • edited March 12
    I mean, is there a handler for Status Effect so I can intercept incoming status effects and do something custom there?

    E.g. if an attack that doesn't do damage at all but adds a status effect, I might want to check for evasion there as well.

    ...essentially what blocking does, but with extra schematics for a blocking "cost".
    Post edited by Flying_Banana on
  • edited March 14
    No, there's currently no access handler feature for status effects.

    The only way to do that currently is using schematics for your status effect changes and handling everything in there (chance check, etc.). Status changes for your targets can also use schematics, so you can set up a reusable per-effect schematic setup.
    Post edited by gamingislove on
    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 patreon.com!
  • edited March 15
    @Flying_Banana when you mention adding it to every ability, what I did to make a Dodge stat separate from the built in block is to do it in my hit chance formulas. I only put it on melee and ranged formulas because doing resists for spells.

    So I made a status value for dodge chance.
    Then in the hit chance formula I used a Chance node that the max range of the chance is set to the status value, so dodge is a % chance.
    Success ->
    Formula set value to zero (so it's a miss)
    Set a global Bool to dodge = true
    Miss schematic (in the miss slot on abilities) play a whoosh miss sound, checks the global bool for Dodge = True, plays dodge animation, add console line, flying text, then sets bool to False.

    I realize that if you want to damage Stamina then you don't want it to be a miss, but if it's just a "cost".. hope that helps brainstorm

    Post edited by GeneralK on
  • edited March 15
    Using formulas for something like this is not recommended, though. The formulas are not just used one time when calculating hits - depending on your setup (e.g. target information displays with hit chance), the formulas can be used multiple times just for UI updates. This mostly relates to stuff like use costs (e.g. which are calculated for displaying the costs of an action in a button), but can also affect other formulas used by hit chance, critical chance, etc.

    As said, it depends on the setup, though - it can be completely fine :)
    Post edited by gamingislove on
    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 patreon.com!
  • @GeneralK That's a really good place to add this and I totally missed it!

    It does seem like I won't be able to display hit chance with this set up, but I think that's acceptable :)
  • edited March 17
    Thanks for clarifying

    That did not even occur to me since I'm not using the chance preview or separate formulas for crit, use costs are the same for a miss etc.

    Couple things if you're going to use it,

    I made a separate flying text schematic for miss to check variable and not double up on saying miss/dodge, but I think I saw a miss get suppressed when multiple attacks happened from multiple enemies. Probably need a wait 0 at the end of miss schem to give a frame for variable change.

    Anyway that makes me think it would need to be set up with object variable instead for the dodge bool, and for area affect abils especially probably need per combatant flag, even tho I think the hit chancd is separate on AE per combatant.

    Edit, then I realized I can just turn off the Miss flying text in Battle Text ->flying text settings and play it in the miss schematic where I play the dodge flying text, problem solved oops!



    Post edited by GeneralK on
  • I ran into a minor problem with Status Effect/End on Ability. Since that doesn't decrement if an ability misses, I don't have an easy way to code a status effect that should be removed after n parries/evasions.

    But then again I suppose it's not possible normally if we want to make something like "remove after successfully dodging 5 attacks".

    Add a boolean there to conditionally allow counting missed abilities maybe? :P
  • Hit or miss isn't really tracked in that way - you could instead use Custom end type and have full control over when to reduce the duration.
    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 patreon.com!
Sign In or Register to comment.