I'm trying to create 2 different, but related, types of abilities for combatants in my game and I'm wondering if ORK can do these types of abilities and if so how to start.

The first type of ability is a always on passive ability that might react to specific triggers. An example of this might be,
- "Whenever this combatant takes damage from a Fire attack, they release a wave of fire dealing Fire damage to all adjacent enemies. This effect can be triggered at most once per turn."
- or alternatively the classic "reflect fire" trait: "Whenever this combatant is attacked by a fire attack, they reflect the damage of the attack back to the attacker."
- or for a third example, "Whenever this combatant takes damage from a fire attack, they become Enraged." (assume "enraged" is a standard status effect that increases the characters damage status' but reduces their defensive status'.)
So basically abilities that trigger automatically based on a condition being met, rather then needing to be actively used.

The second type of ability is one that temporarily grants the target this type of reactive ability.

As can be probably seen from my examples, the main things I'd like to be able to have passive abilities trigger off of is being attacked or taking damage, especially if I can be particular about what type of attack and/or defense attributes the attacker/attack has.

The primary two things I'm actually trying to do with this are both for one character.
1) The game has an "elemental damage" system with resistances, etc. I want the character to get a status effect based on whatever the most recent elemental damage they've been hit with was. So, for example (using typical video game elements of fire, lighting, cold, poison, etc) if they get attacked by a fire ability they would gain the "Fire" status effect until they get attacked by a different element, then the "Fire" status effect would be replaced by a "Lighting" or "Cold" or "Poison" status based on what they were attacked by. For this particular character I intend to have their abilities check what status they have and behave differently based on what status they have (and sometimes consume that status as a use cost, but not always.) NOTE: Only this one character has this mechanic. I know I could make every attack in the game check to see if they're attacking that one combatant and apply the right status if they are, but since it's just this one character who has the status I would rather give them one ability that checks the attack attribute of incoming attacks and changes the status accordingly.

2) The character should also have a "Reflect" type ability, and a "thorns aura" type ability. The first one would be like, you activate it on your turn and it reflects the damage of the first attack you get hit by back at the attacker. And the second one would be like, you activate it and for the next 10 turns whenever you take damage the attacker takes a little damage (based on this ability, rather then the attack the attacker used.)

But I don't really know how to set up passive abilities that trigger when the combatant gets attacked, or to set up abilities that temporarily grant such an ability. Any ideas or help?
  • 1) Doesn't really matter if you check it in the events of all abilities or want to handle it via an ability on the combatant - you still have to do that in the battle events of abilities that can trigger it.

    The best way to somewhat automate this and also be open for adding more such features in the future would be to use Custom Events on your abilities.
    E.g. your combatant's passive ability has custom events added to it that do whatever you want handled. The battle events of your other abilities use a Select Ability node to get the passive abilities (or just all abilities) of the target and a Custom Selected Data Event node to start custom events from those abilities.

    2) Probably best to have an active ability to use, which toggles a status effect on/off. The status effect would be used instead (e.g. status checks to determine if damage should be reflected, etc.).
    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!
  • 1.A.) Alright, so, let me just repeat back to make sure I understand:
    The combatant in question (let's say Combatant A) has a passive ability with a bunch of custom events. There is one such custom event per element, and each such custom event just checks the combatant to see if they have the elemental status effect for the element of the event, or if they have a different elements status effect, or no elemental status effect. And then either does nothing, removes the other elements status effect and applies it's own, or just applies it's own as appropriate.

    Then, all elemental abilities have nodes in their battle events that ask if the target has that particular passive ability, and if they target does have that ability, triggers the custom event for the element of the ability?

    2) How do you get a status effect to check to determine if damage should be reflected? And in a similar vain, can you make a status effect just do damage to people who attack the subject of the status effect based on a formula.
    2b) for status effects that do damage based on a formula, is the "user" in the formula the combatant who applies the status effect?

    3) I just discovered the "status effect settings" under combatants in the process of writing what is already a very long post and I have a few questions about them:

    3a) For defense status effects who is considered the "user" and who is considered the "target" by default? E.G. if Combatant A attacks Combatant B with an ability that has "use defense effects" enabled and Combatant B has a Defense Status Effect that adds the "stun" status effect with a "user" use requirement of being above 50% hp, which of combatant A and Combatant B would need to be above 50% hp for the status effect to go off? and which of Combatant A and Combatant B would then be stunned?

    3b) is there a way for the use requirements of either attack or defense status effects to check the attack attributes being used by the target changes of the ability that triggers the attack/defense effects?
    (3b1)e.g. could I have a "fire elemental" combatant with a defense attribute that applies the "stun" status effect to themselves whenever attacked by a water attack (an attack that deals damage with the "water" attack attribute.)
    (3b2)e.g. could I have a consumable item that gives a "contact poison" status effect to the user that makes all of their melee attack abilities (abilities of the "melee attack" ability type) apply the poison status effect? (presumably giving them a "status effect" that grants an "attack status effect" that adds the poison status effect, but only applies to abilities of the "melee attack" type?)
  • 1A) Status effects can also remove other effects when they're applied - i.e. you'd just have to add the effect for that element and let the effect remove the others. Probably makes it easier for future changes to keep it on the effect.

    The elemental abilies don't really need to check for the ability being on the target, just get it via Select Ability (or simply all abilities) and fire custom events for the element. That keeps it open to set up similar features in the future. If no ability is found or none has a matching event, nothing will happen anyway :)

    2) The effect itself can't do that, but your events can check for the effect being there or not and do things based on that. E.g. calculating the outcome for the user instead of the target, or doing damage via Change Status Value node, etc.

    2b) Yes, the user is the combatant who casted the effect, the target is the combatant with the effect applied.

    3a) Defence effects come from the target of an attack, i.e. if combatant A attacks combatant B, B's defence effect will be caused on combatant A. The user of the effect is combatant B, so B's HP have to be above 50%.

    3b) No, the conditions can't check the ability that's used.
    3b1) Well, your water abilities can check the target for conditions and apply the effect.
    3b2) Yes, if those melee attacks are set up to use attack effects.
    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 February 2023
    all of that is pretty clear, I do have a question about 3b2 though. Would the poison apply on all of the users attacks that were set up to use attack effects? Is there a way to designate only some of their attacks as appropriate for the effect? For example, if they also have spells, and may have a similar consumable item "essence of fire" that does basically the same thing, but using the "burning" status effect applied to all "spell" type abilities. Then I'd probably want all melee attacks and spells to be set up to use attack effects, but I'd also want to be able to say, on an attack effect by attack effect basis, which abilities or ability types it can effect. Is there a way to do that? seems like there isn't for defense effects so I'm guessing no?

    EDIT:
    Also, 4) for a game variable type requirement for a status effect target change of an ability, are the target changes "local" to the animating event of the ability? (and if so, would you want the use requirement to be 'user' or 'target'?) My animating events include Quick Time Events for "blocking" and they include a local bool variable for whether the block is successful or failed. I know that damage calculations can take that variable into account through their formulas, but I'm wondering if I could use that bool variable in a game variable type use requirement for whether or not to apply a status effect. Like, if you fail your QTE defense you get stunned, but if you succeed it you're not stunned sort of scenario.
    4a) Also, while I'm asking about it and Attack Effects and Defense Effects, would Attack and Defense effects be able to check that local variable during the animation of the ability as well?
    Post edited by Whatexists on
  • 3b2) Yes, all attack effects are used if an ability uses attack effects.
    For any specific mechanic, you'd need to use the ability's status changes with conditions - e.g. using the Switch User/Target option in target changes allows you do do changes on the user based on conditions of the target (e.g. not possible in user changes).

    4) I think it uses global variables, unless the Use Object Variables setting is enabled, in which case it uses the object variables of the user or target (depending on who's checked). So, if your QTE variable is global or an object variable (e.g. on the target), this'll work.

    4a) No, attack/defence effects don't have access to the local variables, but they can use object variables of the user/target.
    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!
  • 4b) The QTE is contained within a battle event that I call from within the animating event of various abilities. I know it shares local variables with the animating event that calls it. Would it also share "users" and "targets"?

    4c) Also, if I stored a combatant via a "store grid cells" node during the animating event, would the QTE battle event I call be able to use the same object key to get the same combatant? I.e. would the QTE battle even use the same found objects as the battle event that calls it?

    Basically, it the QTE currently sets a local bool variable that the animating events check to determine whether to play various animations. They also set that local variable before the QTE. These questions are all basically along the lines of wondering if I could change that local variable to an object variable instead without breaking anything.

    4d) It seems like if the answer of the above questions is yes, the major issue would then be with area of effect abilities that hit multiple targets. Currently the player does one QTE to determine if all player controlled combatants succeed their active defense. My AOE abilities currently store all potential targets via a single store grid cells node using the same Object Key. I assume I could still edit an object variable on all combatants stored under a single key with a single change game variable node with the settings: Variable - Origin Object, Use Object true, Object - Found Objects, Value (object key in question)?

    4e) Related to 4d, if I used a Check Status to check whether the combatants stored as found objects to a particular key had a certain status effect applied, and used the "Store Combatants" option to store them to a different key, could I filter through all the combatants stored by the initial store grid cells node and store only the ones affected by a particular status effect to a new key that could be used separate from the main group?
    (for example, I have one character who has a "shield block" ability that I'd like to make them automatically succeed the QTE event, so I need to be able to set their block object variable bool based on the status effect instead of based on the QTE, so I'd want to use the check status node to find anyone with "shield block" status effect and add them as a found object with their own key, then I could run the QTE for the general group, and then afterwords set the variable for them personally using their own key.)
  • 4b) Using a Call Battle Event node?
    Yes, that shares the same user and targets as the battle event calling it.

    4c) If selected data is shared, yes - this also has all changes made in the called event available in the calling event (after the Call Battle Event node).

    4d) If there is one QTE that affects all players, you could just use a global variable isntead of tying it to the combatants (object variables).
    But yes, the Object origin can also change it on multiple objects at once, e.g. via found objects or selected data, or if there are multiple targets.

    4e) Yes.
    You can also use the Select Combatant node to select combatants based on defined conditions - and this can also select combatants from selected data :)
    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!
  • Thank you so much!
  • If a status effect (let's call it "super defense") grants status conditions (let's say a bonus to the "defense" status), and also a 'defense status effect' that removes the "super defense" status effect itself From the user (change: remove, switch user/target true, status effect "super defense"), would the status conditions still apply to the subject of the status effect during the calculation step of the attack that triggers the defense status effect?
  • The status conditions are only used while the effect is added to the combatant, so if the effect is removed, the status condition from the effect are gone as well.

    If the effect is sill applied while e.g. calculating damage depends on the order of the status changes. E.g. if damage to HP is done first, the effect removed afterwards, the effect will still apply during damage to HP.
    If the effect is removed first, the damage to HP afterwards will no longer have that effect added.

    So, order of status changes is important :)
    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!
  • Is there a way to determine order of status changes? and how defense status effects fit into that order?
  • They happen in the order you add them to an ability or item's user/target status changes. Order of changes:
    - use costs
    - target changes
    - user changers

    Each of them perform their status changes in the order they where added there, i.e. status change 0 before status change 1, etc.
    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!
  • Alright. So. Say Combatant 1 has an ability "Firebolt" it's Target Change 0 subtracts a certain amount from the targets "HP" status based on a formula and has "Use Defense Effects" enabled. Combatant 1 uses Firebolt on Combatant 2.

    Combatant 2 has a Status Effect on them called "Shielded" that gives them a bonus to their "Defense" status, and also grants a Defense Status Effect change that removes the "Shielded" Status effect (with switch user/target enabled so it removes it from Combatant 2, instead of from their attacker.)

    When Firebolt is used on Combatant 2, and target change 0 happens, will it calculate the HP status change for Combatant 2 before or after it triggers the Defense Effects that remove the "Shielded" status effect? Since they're all part of Target Change 0 of the ability.
  • edited March 2023
    Ah, no - attack/defence effects of a status change are used before the actual status change.

    But you can move around that by adding a 2nd status change that e.g. does 0 damage and uses attack/defence effects. I'll probably add new status change types for using attack/defence effects specifically :)

    Edit: Correction - you can just add a 2nd Target Change that uses the attack or defence effects without any status changes.
    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!
  • Ah, I was wondering if that would work and if I would need to do it. Thank you so much for all your help!
Sign In or Register to comment.