edited August 2017 in ORK Support
I want to put a move command in my battle menu, just like in the grid battle system, ie you click somewhere, it moves the character there and it checks for simple collisions.

Is the best way to do this to create an ability, make a move battle event similar to the one in the grid tutorial, then add that ability to the battle menu? What would you replace the Check Grid Path Length with?

Thanks
Post edited by UserName on
  • @gamingislove

    Here's what I'm thinking. When the player wants to move next to an enemy, I would just use the existing "hunt" AI, like in the real time battle tutorial. So when the player choose move and click on an enemy, I would put the player on AI control, activate the hunt AI, then when he's finished moving I would disable AI control. I assume this takes care of collision and path finding?

    But when the player wants to move on a specific position, not a target, I would use a "change position" event. I looked at the grid battle tutorial : http://orkframework.com/tutorial/gameplay/grid-battles-part-3/
    There are special nodes for grid battles like check grid path length and store grid path length, which I assume is to check the objects found in the trajectory of the movement. But the problem is I don't know how to do the same for non grid movement.

    So am I in the right direction , or is there a much better, simpler way to handle a move command? This is for ATB system by the way.
  • There are different ways to achieve that - the easiest would be using something similar to the move to target/base events. It's probably best to use NavMesh (or some other pathfinding solution), the Change Nav Mesh Target node can be used to set a target for a NavMesh agent.

    As for the position, you can use the Raycast To Variable node to store the position the player clicks in a local variable and use that in the navmesh node to move to.
    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 Thanks for the answer. I setup a navmesh etc, wasn't too hard (if anyone needs help on how to setup a navmesh, feel free to ask) but I encountered 2 problems.

    1- It does weird behavior, and it's not because of navmesh : depending on where I click, sometimes it's very accurate, sometimes not at all. And if I click in the center of the screen, it can't go there, like it's blocked.

    So I put a "change position" node instead of navmesh to make sure, and it does the same thing: can't go in the middle of the screen, which is a road in scene 2 - the field. Tried another battle a little farther, same thing, can't go on the road. Played with all the possible settings on the 2 nodes to no avail.

    This is my node setup :http://imgur.com/a/B0PaN

    2- I'm using ATB with dynamic combat but with "pause on menu", so when the menu pops up, everything is paused. However, change position and navmesh target nodes are not paused when the menu pops up, and I can't find a way to pause them.

    I know ORK has a way to do it, because when I set the AI move to hunt and enable it on evil pants, his movement pauses when the turn menu pops up, which is what I want. Do you know how I could do the same for the player?

    Thanks
  • 1) Make sure that the raycast distance is high enough, e.g. distance from the camera to a position far away might exceed the defined 100 world units. Also, check if there's something blocking the raycast, since you've selected Everything in the layer mask.

    2) Pause on Menu only pauses the timebar progression, i.e. actions that are already performing aren't affected by this.
    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) Thanks GIL, the problem was the layer mask in the raycast node. I changed it to default, now it works! You really know everything.

    2) Ok I see. I looked around a lot, and found that in Real time battle settings, there's an option called Freeze Action with the description: "The game freezes (animations, moves, etc. will stop) when the battle menu is called." That's exactly what I want, but for ATB. It's not readily available, but I thought this would be a simple line of code, so how do I enable this option for ATB, what line of code do I have to put and where?

    Thanks
  • 2) You'd have to change that in the ActiveBattleMenu class, where freezing the action is limited to real time battles - or wait for the next udpate, when I make the option also available for other battle systems :)
    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!
  • Thanks GIL, you're the best!
Sign In or Register to comment.