edited April 2016 in ORK Support
I'm trying to set up the following (in a real-time battle system):

A combatant has an ability, Guardian, that he can toggle on and off

When it's on, any combatant that is his Individual Target gains a status effect. If he changes targets the original target loses the status effect and the new target gains it without re-using the ability. He can also turn the ability off at any time.

The goal here is to make an ability where the user 'guards' his target. That is, he takes some percentage of the target's damage. I've gotten pretty far in setting some of this up - right now the ability gives the user a status effect (Guardian) target another status effect (Guarded). Damage formulas check for the 'Guarded' effect and if they find it they reduce the damage. A battle event used by damage abilities also checks for this effect on the target, and if it's found it damages the player combatant that used the Guardian ability (there is only one so I can just look for him by name - though this is a bit clunky and not generalizable - but it's fine for now).

But I'm not sure how to move the status effect around based on who the current target is. I tried to do something where the 'Guarded' status effect expires every second and to set up some event that repeats every 0.5s that looks for the 'Guardian' status effect on the player combatant with that ability and if it finds it it applies 'Guarded' to his target.

One thought was to have an Event interaction on the user combatant that runs every 0.5s and checks if 'Guardian' is on him, and if so applies 'Guarded' on his target. But I'm not sure how or of it's possible to get the Individual targets of the combatants who used the ability.

I'm also not sure what else could potentially be possible - my approach may be wrong :)
Post edited by Juryiel on
  • I don't think this is currently possible without writing your custom event steps or a custom script that handles 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 patreon.com!
  • So then I would make a script to attach to the combatant user of the ability that has a trigger for whenever he switches individual targets - that will trigger check for the 'Guardian' status and if it exists it will apply the 'Guarded' status.

    So I guess for that I would need:

    1. Listener for when individual target changes (optional I guess, I can also just run the script repeatedly)
    2. Grab a combatant's individual target
    3. Grab status effects applied to a combatant
    4. Apply a status effect to a combatant

    If you could point me to these in the API that would be great :) (And possibly this should now go into the scripting area)
  • Since status effects can spawn prefabs (and attach them to the combatant), you could use a prefab to keep the script on the combatant.

    You can access the combatant's individual target like this:
    combatant.SelectedTarget[int index]
    index is the index of the Target Settings (set up in Battle System > Battle Settings in the Individual Target Settings). E.g. Target Settings 0 is index 0.
    This will directly get you the combatant that is selected (also allows setting a different target).

    The group targets can be accessed like this:
    combatant.Group.SelectedTarget[int index]
    Here, index is the index of the group target's settings.

    There's currently no event handler you can listen to for changes, so you'd have to check the targets repeatedly.
    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.