Hi,

I'm developing a turn base battle system which has 5 combatants vs 5 enemies.
I want to create an ability that hit up to 3 out of those 5 enemies that are alive randomly.
How can i achieve that using the status system?
  • Use the Group target range in the ability's target settings, optionally limiting it using a use range. This will target all enemy combatants (when using Enemy target type).

    To only randomly hit 3 out of the 5 enemies, you need to change the targets in the battle event of the ability. You can do this via selected data:
    - use a Select Combatant node to select all targets (enable Use All Combatants and use the Target actor)
    - use a Select Selected Data as many times as you need targets, using the Random select type with Remove enabled to get a random target each time
    - in the Calculate node, use the Other Targets options to use the randomly selected targets
    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 July 2020
    Thank you for the answer @gamingislove I will give it a go soon.

    i'm sorry for all the questions but i am fairly new to this framework.

    I have 3 other questions:
    1. I want the user to select which enemy the combatant attacks and use an ability that does damage to that enemy and apply "poison" to 3 out of 5 of the enemies. Is that possible?

    2. If i want to have a turn base battle system where in each turn the player can choose the order that the combatants attack and then all the enemies attack my team. Do i need to use "Use Dynamic Combat" in the Turn Based Settings and switch to Active in Turn Base Mode? if not how is that can be done?

    3. I am very interested in creating similar behaviour of turn base battle as in RAID Shadow Legends (just not combatant speed depended) I want to have the player team standing in battle scene vs enemies team and the player team to have the first move then the enemies then the player again, what is the best setup for that? Also is it possible that they will stay still in their spawn position and only run to the enemy to hit and go back to their place? (I know this question might collide with the previous one (2))
    Like that:
    https://cdn-bluestacks.com/bs-images/Raid_CombatMechanics_S3.jpg

    Post edited by tushtush on
  • 1) Similar to your previous question, with some small changes:
    - in the Select Combatant node, use the All Enemies actor
    - instead of a Calculate node to damage the random targets, use a Change Status Effect node to apply poison to the random targets (still use the Calculate node to damage your actual target, though)

    2) Not entirely sure what you want to do, but chosing the order in which combatants attack is only possible in Phase battles. Turn based battles will have the order based on the Turn Calculation formula.

    3) If you want 1 player combatant, 1 enemy combatant, next player, next enemy, etc. - that'd have to be achieved by the turn order calculation (formula). If it just the whole player group, whole enemy group, whole player group again, etc., that's just phase battles.
    Combatants usually stay on their positions and only move when their actions make them (i.e. the battle events used to animate the action). The combatants would only move if you use (and allow) move AI during combat.
    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 @gamingislove!

    Looks like Phase Battles is what i was looking for.

    1 more question:

    I am using my own ui for the battle actions and display stats. I saw that i can access the combatant status values via combatant.Status[STATUS_ID].GetValue()
    if i use an ability that changes the current value of that stat does this line of code give me the current value of the status after it changed?
  • Yes, that'll give you the current value - there's also the GetDisplayValue function, e.g. if you use Count To Value options in your status value.

    You can only register to get notified by changes of a status value, to only update your HUD/UI when a value changed.
    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!
  • Perfect! Thank you so much for the help!
Sign In or Register to comment.