• Alright. That's definitely what's happening, since stun is a status effect that includes Stop Movement, Block Abilities, and Block Items.

    Is there any way around that? Do I need to make separate stun status effects for the AI's?
  • edited June 2022
    In this case (i.e. not using the Block All Actions), the battle AI isn't blocked, but with abilities and items blocked it can't really do anything (find a usable action).

    Battle AIs don't have any wait times, they're purely for deciding which action to use.
    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!
  • So I'd need to introduce an AI with a requirement of the stunned status effect that basically just said, "wait a little bit"? but Battle AI's don't have a "wait" node as far as I can tell. am I barking up the wrong tree here?
  • Yeah - as said, battle AIs are purely for deciding the next actions, there are no wait times, animations or anything else involved.

    A workaround would be having a (hidden) wait ability that simply waits for some time, but that'd require you to only block certain abilities, as otherwise the wait ability can't be used as well.
    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 June 2022
    This is all still using ORK 2. We haven't updated to 3 yet. Waiting to be able to transfer over our progress. =)

    1) The Add Temporary Cell Event can add a cell event that uses an ability on the person who activates the cell event as though the ability had been used by a Combatant of your choice (of a faction of your choice).

    Is there a way to set the Faction and Combatant automatically based on who used the ability that created the temporary cell event in the first place?

    e.g. I have a consumable item that creates a persistent (stunning) poison cloud in a targeted aoe that's a circle 3 hexes across. The animating event for the consumable item includes an Add Temporary Cell Event to all the targeted hexes, with event type Ability, start type Move To, and the ability is "Coughing Gas" (which stuns). I'd like it to act as though the character who used the item was the one casting the poison, regardless of whether that character was a player or an NPC, an ally, or an enemy (so that it take status values from the user, and also uses the same friendly fire checks.)

    2) I'm trying to change the gridMoveCommand event that the AI's use so that if they get stunned in the middle of their move (such as by running into that caughing gas poison cloud above) it will end their move if they're in an available hex, or allow them to continue moving until they get to the first available empty hex. I believe this event is based on and still nearly the same as the grid move command from the original grid combat tutorial. During the loop, after the Check Grid Path Length node, it runs Grid Events for the cell the combatant just moved into. After that I've input a Check Status node to check if the AI controlled Combatant is now Stunned, continuing normally if it is not stunned, and if it is now stunned I put a Is Grid Cell Empty check for the cell they just moved into, if is not empty then continue with the loop normally to find a cell that is empty, and if it is empty then instead go directly to Enabling the Colliders/CharacterControllers/NavMeshAgents/etc of combatants along the path, and setting the users grid rotation appropriately as per at the end of the move.

    My problem is that this does not seem to end the AI's movement. What am I missing? (if you need more information on the event I can give a more thorough breakdown.)
    Post edited by Whatexists on
  • Currently not, but I can add options for that to the node in the next udpate.
    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!
  • Awesome. Thank you. Any ideas about ending the AI's movement?
  • You simply need to check the combatant's status before moving to the next cell.

    Since you already cycle through the path's cells this should be easy to add in there, e.g. before looping back to get the next cell, check the status and exit the loop if the combatant is stunned (or whatever else can end the movement).
    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!
  • That's what I thought but the combatant seems to be finishing their move while the cell event is firing, even though the check status node is detecting that they are stunned, which should end the event instead of continuing the loop.

    Currently my setup is:
    Check Grid Path Length (Is greater, value: 0)
    Store Grid Path (value: cell, change type set, cell selection all)
    Select Combatant (value: other, local, set, use all combatants, current combatant scope, combatant origin combatants, found objects, value, cell.)
    Enable Component (disable Collider)
    Enable Component (disable CharacterController)
    Enable Component (disable NavMeshAgent)

    Then the loop:
    Store Grid Path (value: cell, set, cell selection next, remove cell)
    Change Position (actor: user, wait between, to object: found objects: cell, move, wait, ignore height distance, controller move, apply gravity, face direction, stop distance 0, no combatant radius, move by speed, speed type sprint, speed 7, follow position.)
    Check Grid Path Length (is greater, value: 0) if successful continue loop, else exit loop (below).
    Grid Cell Event (move to, wait, found objects: cell, actor: user.)
    Check Status (actor: user, needs one, requirement type: status, status needed: status effect, status effect: Stunned, is applied.) If failed go back to store grid path at start of loop (above), else continue.
    Is Grid Cell Empty (object: found objects, value: cell) if failed go back to store grid path at start of loop (above), else go to first Enable Component (for the collider) in loop exit (below).

    Loop exit:
    Grid Cell Event (move to, wait, found objects: cell, actor: user.)
    Enable Component (Collider, Enable)
    Enable Component (CharacterController, Enable)
    Enable Component (NavMeshAgent, Enable)
    Grid Direction Rotation (nearest, actor: user, wait between.)

    According to my debug log the Check Status node is successfully detecting that the user has become stunned, the Is Grid Cell Empty node is detecting that they are in an empty cell, and so at that point the event should transition to re-enabling the components of combatants along their path and then end the event (and presumably their movement.) But what appears to be happening instead is that that the grid cell event fires, and once it's done the movement event ends and the user combatant appears in the final cell they were originally planning to move to. It's quick enough, and there are particle effects, so I can't quite tell if they actually continue moving to that point or just teleport there, but my impression is that they continue moving.
  • edited June 2022
    On a totally different front, I've got 2 more questions relating to stun (let's call the above post #1 for clarity):

    #2: I'm running into a strange glitch where if my player combatant receives too many stacks of stun they appear to stop getting turns (In particular: if their turn ends because they were stunned during their turn and that consumed their remaining action time). The initiative order will continue to determine that it is sometimes their turn, but then their turn start event won't fire, they're turn won't happen, and their initiative will be reset as though they finished their turn. Do you have any idea what could be causing that?

    #3: My patrolling AI's seem to only ever trigger a move-to event in any given cell once before not triggering the effect again. This doesn't happen with players controlled units. I can't figure out why that would be. Any ideas why that might happen off the top of your head?
    Post edited by Whatexists on
  • Ah, yeah - the end of a grid move action will consume costs and set the combatant to the final cell.
    To prevent that, use a Clear Grid Path node to remove the path. If you want to consume the costs, use the Consume Grid Path Cost node first.

    2) Hard to say without knowing details about your battle system and the effect's setup.
    My guess would be that their turn didn't end properly ... you can review that kind of information of a combatant in the inspector when selecting it's game object.

    3) Hm, no - as long as the event's start type matches the node's used start type and the combatant can cause the event (enemy/ally) it should fire.
    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 June 2022
    1) awesome. Thank you!

    2) As for what their battle information says, I've noticed two major things: the player's Receive Actions Per Turn is set to False, while all the NPCs is set to True; and they also seem to be accumulating far more turns then everyone else while their turn value isn't resetting. Everything else looks the same (or what I would predict for it to be.) Does that look like their turn didn't end properly? (I managed to get the AI to trigger the effect, it is absolutely when they've received so much stun during their turn that they run out of action time, and they have the same battle information discrepancies with other unites I described above.)

    In the event that their turn didn't end properly, should I be able to, in the event that reduces their action time (and applies the stun) would I be able to add a check to see if their action time is zero, and then if it is do an End Turn node? Would that tell it to end it's turn properly? And what node would I use to check their current action time? (a check status node seems to have an action bar check, but not an action time check that I can see.)

    3) Okay, I'll keep checking it out and see if I can make it happen more/figure out what's causing it.
    Post edited by Whatexists on
  • 2) As said, I'd need more information on your battle system and effect setup to do some tests.
    The action time running out will automatically and the combatant's turn (if it was selecting actions). Formulas have action time nodes, but battle AI (and schematics) are missing them - I'll look into adding them.
    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!
  • 2) I suspect that if I could Check Action time in a Game Event I could probably fix the problem by imputing a Check Action Time node before reducing action time and then if they have less then a certain amount just ending their turn instead. : ) So if you might add that in a future update then the rest of this message isn't really important.

    As for my setup, it's a little complicated. I could send you a stripped back test project, but with ORK 3 up and running I imagine you're extremely busy and I wouldn't want to impose.

    Currently it's a turn based grid battle using a multi-turn initiative setup. Players and Patroling AI's use abilities to move, rather then standard move commands. Idk what specifically on those fronts you need.

    For the effects: Currently I have a consumable item that applies temporary cell events to a ring of cells. The temporary cell events are Move-To (because all of my move events are mostly one step at a time and I don't use Move-Over triggers) and they fire an ability (Stunball) at the combatant that triggered them. The Stunball ability on hit applies the Status Effect Daze, which lasts for a few turns and goes away at the start of turn. Daze can stack, with additional stacks triggering separately, rather then stacking duration. Daze runs an On Turn Start event and an On Apply event. The On Turn Start event applies the Status Effect Stun. The On Apply event applies Stun, and reduces action time by 0.5 seconds. The Stun Status Effect blocks movement and all abilities and attacks but 1, which is a "Wait Patiently" ability the AI uses. It lasts 1 second and can stack, with additional stacks extending it's duration. At the start of a combatants turn a formula is run that determines their Action Time as equal to 4-(#ofDazeStacks). Thus if a Combatant is hit with Stunball 3 times they acquire 3 stacks of Daze, and at the start of their turn their action time will be calculated as 1 second, while they'll spend 3 seconds of being unable to act, thus simulating loosing 3 seconds of their actable time. If they get stunned during their turn the on apply event will trigger and immediately stop them from acting for 1 second, while reducing their action time by -0.5 (instead of a full 1 second because the animating the event that stunned them will take a little time as well.)

    The problem always happens when the on apply event of the Daze status effect results in them having no more action time, it doesn't happen at other times.

    Is there any other information you might need?
  • Whatexists said: I suspect that if I could Check Action time in a Game Event I could probably fix the problem by imputing a Check Action Time node before reducing action time and then if they have less then a certain amount just ending their turn instead. : ) So if you might add that in a future update then the rest of this message isn't really important.
    Actually, action time nodes are already available in both ORK 2 and 3 - Check Action Time and Change Action Time nodes to check and change the action time of a combatant.

    Let me know if that allows you to fix your setup issue. Otherwise I'd need a small Unity test project with your setup, as yeah, that's a pretty complex setup you've got there :)
    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.