edited June 2019 in ORK Support
Hi Gil,
I want to start a custom battle that only have enemy group and ally group and they attack each other automatically in a real time battle.
I reuse the project "Mission Grid Battle" in the tutorial: http://orkframework.com/showcase/mission-grid-battles/
I have my own list of enemy combatants and list of ally combatants and also have the list of their positions.
I use CallFunctionStep node to call my static function to create and put the combatants in my lists on the grid correctly.
The problem is that the enemy group does not attack ally group.

If I use a BatttleComponent that already have defined group ( that is not I want ) then my combatants in the lists spawned with the combatants in BattleComponent and they attack each other.
If I remove the combatants in defined group of the BattleComponent, then my combatants in my lists don't fight each other.
What's I need to do when I want to start a battle with my enemy group and ally group fighting each other ?

There is my battle start event
https://drive.google.com/file/d/1QYUfNmirUH9ptgw39q_cKi9C93GJEIc2/view
Post edited by vivu on
  • Hm, hard to say without seeing your custom code - might be that the issue is in there.
    Are your created combatants part of the correct faction?
    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 2019
    I've attached the project there:
    link removed

    To see the issue , you run a new game and use mouse to move a few steps a head to start the battle. (I don't know why the AutStart does not work but start with trigger works)

    To avoid the issue, you can comment or remove the codes that removed defined combatants on Asset/_MyScript/MyCustomBattle.cs ( line 41->46).
    Post edited by gamingislove on
  • I've downloaded it and will check it out (also removed your link).
    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 - your stuff works, you just have an issue in your battle system setup :)

    Go to Battle System > Battle Settings and disable Use Battle Range, Use AI Range and Use Move AI Range.

    Since your battle takes place without a player (and there is no player spawned), all these range checks will fail, resulting in e.g. the combatants not using their battle AI to decide their actions.
    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!
  • Thank Gil for updating.
    I've disabled Use Battle Range, Use AI Range and Use Move AI Range and the ally group and enemy group moving forward each other but they don't fight, just standing ( you might try to check several times if the first time work for you )

    When I reduce the number of member in a group ( e.g , from 10 combatants to 5 combatants ) then a few of combatants fight , not all.

    Is there any limitation about number of combatants or something I missed ?
    My battle must supports at least 20 AI combatants (10 for each group) fighting each other.
  • Only the player's group has a limit (the battle group size), but that's only for group management to select which combatants are in battle and which aren't.

    I've tested it again and can also see this behaviour - but that's due to the combatants (physically) blocking each other when moving on the grid. Disabling their colliders when moving will allow them to pass each other.
    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 2019
    I've turn off the collision of Rigidbody component for all combatants but only some of them fight. A lot of them move foward but don't attack the enemies. Have you see that issues or all the combatants attacking their enemy when you trying ?
    There is my code for disable collision:

    var rigidbody = combatant.GameObject.GetComponent<Rigidbody>();
    if(rigidbody!=null)
    {
    rigidbody.isKinematic = true;
    rigidbody.detectCollisions = false;
    }
    Post edited by vivu on
  • That doesn't help - as I said, you need to disable the collider/character controller.
    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.