edited March 2022 in ORK Support
image
I was having a problem with the Grid Move node Move Toward Target. With the set up above, the enemy should move away from the target if it's in 2 range distant and move toward the target if it's outside the attack range (+4 range). But the enemy never Moves Toward the target once I move the character outside the range of the attack. I was about ready to throw my PC out the window when I had an epiphany. What if the fail state of Check Move Distant is causing this problem. So I added a new Check Move Distant but made sure it succeeded before the next Grid Move.
image
Low and behold, it now works exactly as I expected.
Um...
Wat? I don't understand why it works now. Can you break down why the fail state of Check Move Distant causes Grid Move not the recognize the target anymore?

Edit: A separate question, is there a way to set the AI enemy to only move a specific numbers of time when they have a higher move range than 1? As of right now, the enemy always move the max amount when I use the Grid Move node. This causes the enemy to ignore some parameters on the Grid Move node like staying a certain distant from the target.
Post edited by Dre788 on
  • What's the setup of the In Use Range node?

    The Grid Move node has options to stop before the target (or rather, which cells around the target to use).
    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!
  • SK1SK1
    edited March 2022
    sorry
    Post edited by SK1 on
  • @gamingislove
    In Use Range checks for the range of an attack that hits 1 distant away from the caster. (see in the picture below)
    image
    I do use the option Grid Move to prevent the enemy from getting too close to the target so it can always attempt to be in range of the attack above.
    This works as long as the enemy moves 1 grid at a time. If I give the enemy more than 1 move range, they will always move the maximum amount even when they don't need to. I don't seem to have any control over the amount an AI can move at a time. Here is a video example of the problems this is giving me.
    https://dropbox.com/s/u1zu4au2hbibygh/2022-03-21%2016-50-03.mp4?dl=0
    Notice the snake enemy unable to move into attack range because he has to move the maximum amount every turn.
  • Can you show me your Grid Move node's setup?
    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!
  • I'll do some tests - in the video, is that the fleeing or moving toward target movement?
    Also, if the combatant should move into use range, you should probably also use target cell settings to reflect that - currently you want to move to a cell directly beside the target, which is not in the use range (circle). E.g. use the use range's tempalte instead.
    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, tested it and works fine if set up correctly :)
    Overall, your setup does more than it needs to and is conflicting with each other.

    First of all, the Grid Move node needs found targets, this is why your original setup didn't work - due to the In Use Range node storing the in-range targets and you continuing on out of range (i.e. no in-range targets) there are no found targets here. This is why you need another node to check for grid distance to get targets.

    Also, the Grid Move node will not move if already on valid target cell, so you can actually reduce the setup as you don't have to worry about this.

    All you need is:
    - Get Nearest node to get the nearest target (or any other node to get a found target you want to use)
    - Grid Move node using the range template for the target cells
    This setup will keep the combatant moving to a cell around the target based on the range template, so if the target is closer, it'll move away, if it's away, it'll move closer (based on the template you posted above).

    Your original setup will also work, but it had conflicting range stuff. E.g. your range template had cells at a dinstance of 2, but if the combatant has a distance of 2 or more it'll already flee from the target based on the first check.
    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 2022
    gamingislove said: All you need is:
    - Get Nearest node to get the nearest target (or any other node to get a found target you want to use)
    - Grid Move node using the range template for the target cells
    This setup will keep the combatant moving to a cell around the target based on the range template, so if the target is closer, it'll move away, if it's away, it'll move closer (based on the template you posted above).
    @gamingislove
    Oh thank you, thank you, that fixed it. I didn't even know Get Nearest was a thing. The setup is much simpler now but it works exactly as I expect it. The enemy moves into range and only moves the amount needed.
    gamingislove said: This setup will keep the combatant moving to a cell around the target based on the range template, so if the target is closer, it'll move away, if it's away, it'll move closer (based on the template you posted above)
    I thought that's how it worked but my original set up was causing it to malfunction. I should be able to produce better AI with this new information. Thanks again!

    Edit: While I'm here, let me ask what do you think is the best method for moving a character on a grid(Battle Grid on scene) with an ability? For example, an attack that pushes a character over 1 grid space? (if it's not occupied)

    Post edited by Dre788 on
  • Use a Select Grid Cells node to get the cell you want to move to - e.g. using a battle range template to get a cell in front or behind a combatant. The node can also get a path to the node.

    Afterwards, you just need to move to the cell and set it's combatant, like it's done in a regular grid move schematic. When you have multiple cells to move over, cycle through them like in a grid move schematic as well, just getting from selected data via a Select Selected Data node (or use a Set Grid Path node to set the path of the action and you can use a grid move schematic 1 to 1).
    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!
  • @gamingislove
    Oh cool. That did the trick. The solution was much simpler than I thought. It would have taken me much longer to figure out to use Select Grid Cell along with Set Combatant on Cell. I'm glad I asked you. Although, I did run into an error when I attempted to use a custom mask for Select Grid Cell.
    image
  • Ah ... yeah, I'll look into that - seems like grid masks don't work in the node editor.
    Use a battle range template instead for now.
    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 April 2022
    Hi @Dre788 !

    Would it be possible for you to post the complete schematic for your push ability?

    I'm trying to make a simple push ability and stumbled upon this post while searching in the forums. Following your conversation with GIL, I've tried to make my own push schematic, starting with the schematic Grid Move, like shown in the Ork Tutorials.

    However, when I use the skill, nothing happens, and worse, the game softlocks :s

    Here's what I did:

    image

    I simply added Rotate to Target so the target would face the user, then used Select Grid Cells with a battle template to select the cell directly the target. But when I use the ability, the target doesn't even rotate and the game softlocks... so maybe it's my ability that's the problem? (I'm rather new to tweaking with Schematics and Abilities, so maybe my problem is stupid, but I did a few abilities with custom schematics that worked....)

    Thank you!

    Post edited by max_power on
  • edited April 2022
    @max_power
    Try replacing the node Grid Rotate To Target to Gird Direction Rotation. Set Rotate to Target with Rotating Object to Starting Object and Target Object to Machine Object. See if that works better.

    What does Add Move 1 Cell Away look like? If this isn't set up correctly you won't get the behavior you're looking for.

    My set up works in 2d so all I have to worry about is X and Y coordinates. I believe for 3d all you need to know is what direction (rotation) the user is facing as they attack. You can store that information into a variable. Then with that information, you set up a variable fork using the user's direction based on the grid type you're using. For example, if it's the square grid then all you need is the rotation vector 3 for up, down, left and right. Once you have that set up, you can use the node Select Grid Cell with Starting Object (target) as the origin and a grid shape mask based on the direction in the fork. After that you just need to move the target as you've already shown in the screen shot. Before you move the target you can also check if the cell is empty with the node Is Grid Cell Empty.

    I hope this helps.
    Post edited by Dre788 on
  • @Dre788

    Thank you for the reply! It's really appreciated.

    I've solved my softlock issue, it was caused by something unrelated (badly set up prefab). Now, the target correctly turns to the caster, then does nothing. At least no softlock! (Progress, yay!)

    The idea behind my schematic is to make the target face the user, then select the cell behind the target, and have it move to that cell. My Add Move 1 Cell Away template looks like this:

    image

    (to the right in the image, the Select Grid Cells node using the template)

    I've tried checking and unchecking the origin cell, it doesn't change the outcome.

    I'll try what you described with the Vector 3 direction tomorrow. However, I have the feeling there's something else lacking in my schematic... I mean, the schematic should correctly be selecting the cell behind the target... then asks the target to move to that cell... no?

    I'm confused :s

    Anyway, I appreciate your time to help me. I'll test more tomorrow.

    Thanks!

  • Don't use the Check Grid Path Length and similar grid path nodes here - you just selected cells and stored them in selected data, they're not part of the action's grid path.

    If you want to go via grid path, you can use the Set Grid Path node to set a path for an action, but it's not needed, since you already have the cell to move to stored in selected data and just need to move to it :)
    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.