• edited April 30
    That was so much easier than I expected it to be. =)

    Another question, how do I set up a location so that if the player can get to it they win the battle (presumably get their entire party to it)?

    Also, for the same battle, how do I make it so that if even one member of the player group goes down the player is defeated?
    Post edited by Whatexists on
  • For the area, probably best use regular game events via trigger event interactions - the End Battle node can end the battle and lets you select which outcome (e.g. Victory) it has.
    For getting the entire party there, either do a count for each player combatant entering (i.e. Start By Other enabled in the interaction) until all are in there (also needs a Trigger Exit event removing the count when they leave), or use a Search Combatants node to get all player combatants within range of the event and check if that's all of them.

    The defeated thing has to be handled in the death event of your combatants.
    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!
  • Well I'm working on that and may have questions at some point. But in the mean time what's the right node for checking line of sight in a battle AI? the AI I'm using to get an enemies preferred target is currently:
    Clear Found Targets
    Check Status (check enemy, status requirement: status type status, status needed death, is dead disabled, combatant scope current)
    Get Nearest

    I'd like it to also ignore any enemies that aren't within line of sight, but aren't sure what the right nodes to do this are.
  • I think the best option is to go via the move AI's detection settings. Battle AI's can use the combatant's move AI detection via Check Move AI Detection nodes (and other nodes to check for hunting targets, etc.).

    Even if you don't use the move AI for movement, you can still use it in battle AI for detection.
    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. I must be doing something wrong with the victory location thing. I can't get the event to trigger in the first place. I'm using a box collider object with is trigger enabled and an event interaction componant for an event that currently just has an End Battle node. The event interaction has start type Trigger Enter, with Start by Collider enabled, Start by Trigger enabled, Start by other enabled, check name/tag enabled, is tag enabled, and name/tag "Ally", interaction type Any. the item is currently a child of the battle grid parent object because it's one of three battle grid prefabs that I've set up to be loaded into the scene based on a different event.
  • Try enabling In Blocked Control - also, if you're checking name or tag, make sure the combatant's game object is also named/tagged like that.
    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! That worked!
  • edited May 25
    Alright. I don't use move AI's currently and must have them set up wrong for this (or I put in the check move AI node wrong).

    For the battle AI that finds a target I currently have it set up with:
    Clear Found Targets >
    Check Status (found targets check, target enemy, don't add targets disabled, exclude found targets disabled, force knowledge disabled, status requirement Death with is dead disabled)
    if failed > nothing
    if successful >
    Check Move AI (found targets check, target enemy, don't add targets disabled, exclude found targets disabled)
    If failed > nothing
    if successful >
    Get Nearest (found targets check, target none, use grid distance enabled.)

    But I'm not sure how to set up my move AI's.
    The current move AI I'm using is basically the "default" settings except:
    Stop distance 1.5
    Add Component enabled
    Use Detection (enemy detection) enabled
    - detect only leader, detect on damage, use attack allies all disabled
    - timeout 0.5
    - detect group targets, detect individual targets both disabled
    - range 100
    - threshold 0.5
    - ignore height distance, no combatant radius both enabled
    - move detections needed one
    Move detection 0
    - detect combatants, detect points of interest both enabled
    - type sight
    - use reycast disabled
    - range 20
    - threshold 0
    - ignore height distance check
    - no combatant radius disabled
    - angle 360
    - angle offset 0
    - horizontal plane xz.
    then Target position checks at 0/0, 0.2/2, 0.5/5, 1/10, 2/20,

    Use Hunt, Use Flee, Use Caution, and Use Protection all disabled.

    On the combatant Use Move AI is enabled with the above move AI selected, and Use Battle Move AI is disabled.

    Enemies appear to pass their turn if a Player is not within 20. If an Player is within 20 and they have line of sight they will attack that player (or the closest one). If a player is within 20 and not within line of sight they... start shooting eachother targeting the closest enemy unit. They don't always do damage when targeting eachother, which is a whole other issue, but one I can deal with separately later since they're not really supposed to be shooting eachother at all, however scared of the presence of a hidden hero they might be!

    If there are Players within 20 and they have line of sight on one, but the closest enemy is behind a wall, they will prefer the hidden one over either the player they can see or another enemy, and will attempt to attack the hidden player.

    Any idea why that might be happening?
    Post edited by Whatexists on
  • Well, since your original goal was about line of sight and your move AI's detection has raycasting disabled, there's no line of sight check going on and you just use anyone that's within 20 world units and in 360 degree around the combatant.

    If line of sight is determined by blocked cells, you could also include that via the ability/item use ranges and the used range template, which has grid line of sight options.
    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!
  • Ah, yep. That fixed literally everything and now it's working perfectly. =)
Sign In or Register to comment.