In my combat scenario the user is putting down waypoints (via the mouse). each waypoint will be a location the player combatant
will move to.

I would like to use an ability so it gets run at the end of the round like all other abilities (turn based (classic, dynamic)).

How to create a move (to location or object) ability?
Should I use the MoveAIComponent (the SetMoveAIWaypointsNode adds waypoints which looks interesting) in some way?

ORK: 3.5.0
Unity: 2021.3.7f1
turn based (classic, dynamic)

Thanks,
MMalone
  • It's pretty similar to a schematic for moving to target.

    The ability should use None target range and use raycast targeting for setting a position via mouse. The target is available as Starting Object in the schematic, i.e. you can just move to the position however you want, e.g. via Change Position node.
    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!
  • In my case the target (on the ground) has already been chosen. The ability doesn't do targeting. Just needs to execute a schematic.

    Even if I put the ability on the battle menu it still won't run.

    What schematic node do I use to run the ability? "Use Battle Action" node looks promising, but it didn't work either (may be because the ability isn't working).


    ORK: 3.5.0
    Unity: 2021.3.7f1
    turn based (classic, dynamic)

    Thanks,
    MMalone
  • I got things working somewhat. I copied an existing ability and played around with "Use Battle Action" node settings.

    The current issue I'm running into is that the default AI (I think?) is still run. i.e. my move command runs but so does "Attack", "Look At Me!", etc. depending on which one ORK picks.

    This is what I tried:
    * combatant (warrior): under "battle ai", set "replace default".
    * combatant (warrior): under "base attack", set "own base attack".

    Note: on the start of a combatants turn I run a schematic that looks for input (left button down) then uses "Use Battle Action" to start the move ability.


    ORK: 3.5.0
    Unity: 2021.3.7f1
    turn based (classic, dynamic)

    Thanks,
    MMalone
  • When using the Use Battle Action for this setup, I'd recommend the Next Action type for the Add Action setting (when added in the start turn schematic).
    How do you check for the input - are you waiting for player input or just check if the input is currently used?
    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!
  • "Next Action" didn't work - the combatant didn't do anything.

    Here are some pics of the schematic and the "Use Battle Action" node (still prototyping):

    image

    image

    image

    Would a tick machine work better? Would the schematic need to check who's turn it is or is there another way?

    ORK: 3.5.0
    Unity: 2021.3.7f1
    turn based (classic, dynamic)

    Thanks,
    MMalone
  • Situation is even worse. If I change "Actions Per Turn" to something greater than 1, after the first "Use Battle Action" the battle menu goes away leaving the player stuck in limbo.


    ORK: 3.5.0
    Unity: 2021.3.7f1
    turn based (classic, dynamic)

    Thanks,
    MMalone
  • Is the raycast successful and Use Battle Action is actually used? Also, is the combatant able to use the action (use costs, 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!
  • Yes, the raycast is succeeding. The battle action is being run because my "move" ability is used.

    I was doing more investigating last night and made a little more progress. I made the following changes which I think disabled the default battle ai.
    * check "Own Base Attack". no entries were added.
    * under "Battle AI", checked "Replace Default". no entries were added.

    The problems I'm running into is that the attack ability (I verified the attack schematic is run) is also run (before my ability is run).

    I'm using the 3D Playground tutorial as a base. Anything about the tutorial that might be interfering?


    ORK: 3.5.0
    Unity: 2021.3.8f1
    turn based (classic, dynamic)

    Thanks,
    MMalone
  • If a combatant is AI controlled and has no battle AI added (or the AI hasn't found a useable action), the combatant's base attack is used (if possible).

    If your schematic is running as the start turn schematic of the combatant, adding an action as next action via Use Battle Action node will definitely use that action as the first action.
    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 August 10
    The combatant is not AI controlled.
    Using "next action" via "Use Battle Action" doesn't work, I've already tried it.

    Here is a link to my project (I'm using URP so the colors are all messed up):
    Edit by gamingislove: Please don't post downloads to projects containing ORK :)

    To repro the issue:
    * using the mouse, click to move near the snake.
    * may take a bit because the snake has to have sight of you.
    * skip all turns except yours (the warrior).
    * when it's the warrior's turn the cursor will change to a "box".
    * click anywhere on navmesh.
    * again, skip other combatants turn.
    * this will end the round.

    Result:
    * look closely, noticed how the warrior does an "attack" before moving.

    More than one action per turn issue.
    Repro:
    * change "Actions Per Turn" to 2.
    * run the game and do the same steps as above (click to move when it's your turn).

    Result:
    * after you click to move the battle menu goes away and there is nothing else you can do.


    ORK: 3.5.0
    Unity: 2021.3.8f1
    turn based (classic, dynamic)

    Thanks,
    MMalone
    Post edited by gamingislove on
  • More info...
    * The schematic that does the work is called "SetWaypointsMachine".
    * Disable "Use Ability" node - I was experimenting with it. "Use Battle Action" will be used.
    issue still happens.
    * Change "Actions Per Turn" back to 1.

    ORK: 3.5.0
    Unity: 2021.3.8f1
    turn based (classic, dynamic)

    Thanks,
    MMalone
  • Downloaded the project and will check it out.
    However, please don't share downloads to projects (or other things) that contain ORK - next time send me the download link via PM or email (contact@orkframework.com), thanks :)
    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!
  • Got it!
  • I made a little progress...

    * I removed the "casting" animation by removing it from "Combatants\General Settings\Default Battle Animations\Ability Start Animation". Looks like the tutorial settings got in the way.

    Questions:
    * How to "own" default battle animations in specific combatants?
    * How to check if it's the combatant's turn?
    * How to check how many actions I have remaining?
    * If I have "Actions Per Turn" > 1 the battle menu closes after the move ability is used. How do I prevent this?
    * If I have "Actions Per Turn" > 1 only the last move ability is used. I tried different "Add Action" settings, but the issue remains. I need an "add" with the "try" I think (using "Next Action" isn't want I want - the move ability needs to be used in the current turn).

    Should I send you an updated version of my project?

    ORK: 3.5.0
    Unity: 2021.3.8f1
    turn based (classic, dynamic)
  • edited August 21
    Alright, checked your project and found the issue(s).

    As you already noticed, the 'attack' the warrior does is actually the default ability start animation that was set up in the tutorials. Either remove it or disable using it in the ability's Battle Animation settings.
    Why the whole setup doesn't work is due to the SetWaypoints schematic firing the Start Tagged Machine without having Wait enabled. This leads to the start turn schematic being done after this, opening the battle menu and not giving the tagged machine the time to get player input and add the action as the next action.
    In the SetWaypointsMachine schematic, don't use your custom node and use the Use Battle Action node, adding the action as Next Action. With the start turn schematic now waiting for this, it'll be used as the first action of the player.

    The 2 actions per turn now also work correctly with this setup. Previously it used the Move ability as the 2nd action due to that being scheduled as the next action to use.

    You can check the actions per turn via the Check Action Bar node (action bar is actions per turn in turn based and phase battles, and the timebar in active time battles). The Change Action Bar node can be used to change them as well :)

    You can check if it's a combatant's turn via the Check Status node (and all other status condition settings throughout the framework). Check for Turn State being In Turn.
    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!
Sign In or Register to comment.