• Here is demonstaration of what I want to achieve.
    image

    Player yells, and only combatants in 5-meter range are affected. Allies get a positive status effect, enemies get negative.

    I have already done and tested that I'm getting correct combatants around character. And what I need to acomplish with ORK is:
    1) Only cast spell on these specific combatants. Right now I'm using AbilityShortcut.Use() and feeding a list of combatants. But, not sure about what setting are correct in ability target ranges. Is it none, single, or group?

    2) In battle event filter list of targets by IsEnemy setting.
  • Not in the status effect cast, in the target changes (consisting of status value changes and effect casts) - you can define multiple of them and limit them to to enemies/allies. I'm not sure when this was added, but if you have one of the newer versions (2.28.0+) it should be in there :)

    The Target Range is mainly for the target selection - None doesn't target a combatant, but you can e.g. use raycasting for it instead. Single selects a single combatant in range, Group selects all combatants in range.

    1) I think Group is the way to go here, if you want to use it on multiple combatants at once. Although, if you get the targets in the ability's battle events it doesn't really matter.

    2) As said, either have the ability's target changes do that for you automatically, or use the Select Combatant node as you already posted it - for the calculation to use them, you'll have to either set them as action targets (Change Action Targets node) or use them as other targets in the Calculate node.


    If this is an ability that's always used on the user itself, I'd set it up like this:
    - ability target range Self
    - ability defines target changes for enemies and allies separately (with whatever you need done, e.g. damaging enemies, giving positive effects to allies, etc.)
    - battle event uses a Search Combatants node to get targets in range
    - Calculate node uses them as targets (other targets options), or sets them as targets via Change Action Targets node
    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 2020
    Thank you!
    #1) Hmm, I can't use in my setup battle event to search for targets. Hard to explain, but there are whole bunch of things going on with custom selections, shapes etc. It's easier to search targets by code.

    Ok I did some tests, if I select the Target as none, the ability is just not applied.
    If I set it as group than, the whole group of affected combatants gets the effects. So, for example if I feed player to AbilityShortcut.Use(), all the combatants that are group members of player get the effects.
    Here is a video demonstration:

    The female archer is not in a list of combatants in code debug, but she gets the effect anyway.
    So, group does not seem to work as a "more than one combatant", it seems to work as "Affect whole combatant group of the selected combatant".

    If I set it to Single, then everything just goes weird.
    Is it possible to somehow ignore the whole target settings and just use a custom list of targets?



    #2)Ahh I saw it! So the whole target change can be filtered. I missed that. That's neat.
    Post edited by hellwalker on
  • Hmm, the target settings seem to interfere somewhere on Action Level. Because I copied the abilityshortcut use function, and commented out the target checking code. So, during


    AbilityAction action = new AbilityAction(user, this);
    this.GetActiveLevel().targetSettings.SetTargets(action, user, targets);
    user.Actions.AddAccess(action, false);


    This part of the code, the targets are actually correct targets.

    Where is the Action code being executed? So, I can check if there is target check there?
  • Based on your video, the ability has an Execution affect range - i.e. when starting to execute the ability it'll add additional targets by using the affect range on all current targets.

    So, since your affect range seems to be set to without limits, it'll pretty much affect all 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!
  • I think that was it! Thanks !
    Must be from the time I was experimenting with grid combat.
  • edited June 2020
    #1) Is there a way to structure the turn order/initiative so It's like.
    Your party and enemies take turns one by one. Not the whole party but. Lets say we have 5 enemies, 3 players. Turn order would be:

    Enemy#1, Player#1, Enemy#2, Player#2, Enemy#3, Player#3, Enemy#4, Enemy#5.

    #2) If yes, is it possible for initiative inside faction to still be formula based? Like It's still Enemy/Player/Enemy/Player but if Player #2 has high speed skill he'll go first within his faction.

    #3) If not, where should I look to add this functionality? Which class is it better to modify?

    #4) What could cause Combatant.Battle.EndTurnCommand(false);
    Command to fail ending turn?

    #5) The problem where player turn was skipped happened to me again. I debugged the turnbasedbattle class and GetNextSelectingCombatant() when it comes to Player few things go wrong.

    A) ReceiveActionsPerTurn is set to false so as I am guessing AP don't get reset?
    B) CanChoose function returns false because IsChoosing is set to true, could it be because of my code character got stuck in IsChoosing state?
    Here is video demonstration:
    Post edited by hellwalker on
  • edited June 2020
    tmp
    Post edited by hellwalker on
  • 1-3) That'd need to be handled via the formula, i.e. either via status values or object variables on the combatants. I'm not sure if there's really an easy way to do this - since you already modify the source code, it's probably easier to do it in there.
    What you're looking for is the TurnBasedBattle class, the StartTurn function handles the ordering (with the GroupTurnInit function doing the calculations). The combatants' TurnValue is what's responsible for the ordering.

    4) Try passing on true instead of false, otherwise it'll still be restricted by action costs, etc.

    5) Seems like the combatant is still choosing and thus hasn't ended the turn - could be related to #4.
    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 you, I think those issues were resolved.

    I have one new question. I want to make a Attack of Opportunity feature with custom code, similar to how you have grid movement attack of opportunity.

    And the question is how could I make enemy attack player, on player turn without breaking the turn order? How does Grid Attack of Opportunity avoid breaking the turn order? Like it's still players turn and the enemy is performing the action?

    Maybe I should make AOO player cast skill, but just show it as enemy attacking the player visually? Like reverse User/Target in formulas and Battle Event?
  • The attack of opportunity from the grid project uses Use Battle Action nodes, adding the actions as Sub Action to the current action. This will use the action as part of the current action, not interfering with the battle order.

    For using that in custom scripting, you need to have the instance of the used action and use the AddSubAction function. This'll add and start the action.
    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 have an unusual status effect I want to attempt. And I wanted to consult on the best way to approach this.

    Hallucinations - Target sees extra fake enemies while under influence of this status effect.

    I'll probably write the custom code for spawning these dummies. But in terms of them joining the battle and being only visible to the affected combatant.

    #1) Should I spawn new combatants and call join the battle on them? Or was there like summon temporary ability functionality that I could use? I remember something about that.

    #2) To control this behavior, I was thinking of using Status Effect's game events. Turn Start/Turn End to call custom functions for spawning/despawning the decoys. Or is there a better approach?




  • This mainly depends on how the whole thing should behave - e.g. are the combatants only 'visually' there, or actually available as targets.

    If it's only visual, you can just spawn prefabs without any combatant spawning being part of that. If they should be available as target, you need to spawn combatants and make them join the battle.

    If they're only there for affected combatants, i.e. during their turn, using status effects with turn start/end events to handle spawning and removing them would be the best solution.
    When using combatants, you can use a Spawn Combatant node for spawning it and also add it to a (global) selected data to keep a reference to it for removal at the end of the turn.
    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 you!
    Yes they should be targets. I think I should be able to do most of it in ORK events then.
  • edited December 2020
    Is it possible to access a weapon variable of a weapon equipped in a specific slot?

    For example:
    image

    +

    image

    Would this give access to a variable WeaponDamage on Weapon equipped in the right hand?

    Post edited by hellwalker on
Sign In or Register to comment.