edited January 2023 in ORK Support
Hi Gil there is currently an integration being spearheaded by Andy and Santi based on Tikal’s previous integration progress and testing videos and advice from Rusted. The progress is on the GKC discord server

https://discord.com/channels/504429042825429023/1002459850669838376/1066225115546779808

Andy has almost got the integration working. He just has an Ork question that no ork user has yet come forward to answer. So I’ll ask it on his behalf and pass through your response to them.


This is Andy’s question:

In my project, the only way I managed to gain ORK EXP after killing an enemy, was by triggering a schematic that has the `Change Status Value` node,
and then setting the player's EXP value directly
(ignoring the combatant's Experience Reward settings, ORK's battle system/battle end settings, etc.)

This doesn't seem like the intended way to do this at all, as ORK has quite some features for setting up and giving rewards after battle (I didn't got them to work, for some reason)
Setting up specific rewards for each enemy combatant. etc

https://media.discordapp.net/attachments/1002459850669838376/1066225157586305106/capture_20230121_020809_030.png

Of course, the new ORK EXP value was sent to the GKC playerStatsSystem via the status bridge system

I use an Auto Machine containing this schematic, that is triggered (by notification) when the enemy dies and raises the `Event On Reward` of its ObjectExperienceSystem component

The GKC "enemy death reward event" is working perfectly
Post edited by GuSt on
  • Here is additional information that here provided to me to ask

    What's the correct way of setting up battle rewards (mainly EXP) for a Real Time/Action RPG-based ORK project?
    I'm making some tests based on the "3D Action RPG" tutorial project, but I'm actually using Game Kit Controller as the character controller

    I already tried setting up many EXP/rewards-related settings (added EXP StatusValue to player character combatant; added Experience Reward to enemy combatant; Battle End -> Collect Immediately = true; added a Status Value Development for the EXP, etc)

    As of now, the only way I managed to gain ORK EXP after killing an enemy in my project, was by triggering (on enemy's "death reward event" in GKC) a schematic that has the Change Status Value node, and then setting the player's EXP value directly
    (ignoring all the enemy combatant's Experience Reward settings, ORK's battle system/battle end settings, etc.)

    This doesn't seem like the intended way to do this at all

    I also tried adding to my scene a Real Time Battle Area component, a Battle component, starting the battle manually, using "Collect Battle Gains" node when killing the enemy, etc.
    But this didn't make any difference

    As I mentioned, I'm using GKC as my character controller, with a custom stats bridge script (for the stats to communicate between both GKC and ORK)
    So, when I attack the enemy, its Combatant Health value *is* dropping (as I'm sending the GKC stat value to the ORK stat value), eventually reaching 0

    From what I understood, if Collect Immediately is set to true, this should already give my player the EXP reward when the enemy is defeated (when its Combatant's health reaches 0?)
    Or maybe that isn't the behavior of Collect Immediately = true?

    Anyway, I also tried setting Collect Immediately = false, and then using Collect Battle Gains node, but that also didn't work
    I'm probably missing some step regarding the (Real Time?) battle system
  • ORK collects the battle gains of a combatant according to the Battle Gains Collection settings of your used battle system, i.e. either immediately on death or at the end of the battle (via battle end schematic).
    For real time battle areas, you need an immediate collection setup, as there is no battle end schematic going on.

    A combatant's loot and exp rewards should be collected automatically on death, so I don't think there needs to be anything done manually.
    There is the Get Combatant Gains node to trigger the collection via schematic, or you can use this code to collect gains from a combatant:
    ORK.Battle.Loot.GetGainsFrom(combatant);
    Or funneling it via the access handler (calls the above code):
    ORK.Access.Battle.GetGainsFrom(combatant);
    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 January 2023
    Thanks for the detailed answer! :D

    Earlier, I tried to use the Collect Battle Gains node in my schematic. The Auto Machine which runs that schematic is triggered by a GKC event when the enemy dies.

    But turns out I needed to use the Get Combatant Gains node instead!
    This node worked as I expected, getting the EXP reward I had set on the enemy combatant and then sending it to the player. Thanks for pointing me to this node. :)

    The "ORK.Battle.Loot.GetGainsFrom(combatant);" code also worked correctly on my end, thanks!


    You have mentioned that:
    "A combatant's loot and exp rewards should be collected automatically on death"

    But it seems this isn't happening automatically in my case. Maybe there's some conflict with GKC and the enemy combatant is not really dying even when its CombatantComponent health drops to 0, I don't know...

    Anyway, the Get Combatant Gains node, and the code you listed above worked perfectly for my needs. :D
    Post edited by andymiira on
  • edited January 2023
    Maybe the "auto-loot on death" isn't happening because I'm not dealing damage to the enemy using conventional ORK components.
    For instance, I didn't add a Damage Zone component on the enemy, and I haven't added a Damage Dealer component to the player character's weapon/bullets, etc.

    Instead, I'm dealing damage via GKC's damage system and directly setting the ORK value: When the "GKC Health value" changes, I send it to the "ORK Health value" in the combatant's stats, using the combatant.Status[].SetValue() function.


    I just made a new test on a clean "3D Action RPG" project:

    - I added an Experience Reward to the Chomper combatant.
    - I set Collect Immediately to true (on Battle End settings)
    - I set up a Value Development for the EXP stat
    - I ticked Has Status Development on the Ellen combatant.
    - I ensured the settings for the Loot Dialogues were correctly set up.

    After this setup, if I kill a Chomper, Ellen gains the EXP reward I defined from the killed enemy combatant.
    And I didn't need to run the Get Combatant Gains node, or the ORK.Battle.Loot.GetGainsFrom(combatant) method.

    But if I directly set the Chomper's Health value to 0, via the CombatantComponent inspector, the enemy dies (plays its death animation, etc.), but Ellen doesn't gain the EXP reward. That makes me realize...

    I think I understand the issue now. In my GKC project, the SetValue() function I'm using isn't passing the player's combatant on its arguments. Could I use the "StatusValueChangeSource source" parameter for this?
    Post edited by andymiira on
  • Just chiming in that I've similarly tried instant collection of exp and it wasn't working. I used the 3d action rpg template files as a start, then I followed the steps in the status system tutorials to, for example, create the experience value, develop it with curve, and assign experience values to both Ellen and chompers. Also gave chompers the exp reward. Gaining nothing when killed. Any help would be greatly appreciated!
  • @VictryForWA The bullet points I described in my post above should be enough to make the chompers drop EXP in the 3D Action RPG tutorial. Have you tried them all?

    I'll quote them again here:


    I made a new test on a clean "3D Action RPG" project:

    - I added an Experience Reward to the Chomper combatant.
    - I set Collect Immediately to true (on Battle End settings, but also check if your Battle System's settings aren't overriding those)
    - I set up a Value Development for the EXP stat
    - I ticked Has Status Development on the Ellen combatant.
    - I ensured the settings for the Loot Dialogues were correctly set up.

    After this setup, if I kill a Chomper, Ellen automatically gains the EXP reward I defined from the killed enemy combatant.

    And I didn't need to run the Get Combatant Gains node, or the ORK.Battle.Loot.GetGainsFrom(combatant) method.
    Of course, these are still very useful in certain cases, to manually trigger the reward/EXP collection.
  • edited January 2023
    A combatant's battle gains are only collected if it was at some point attacked by the player - ORK handles this automatically when using battle actions.
    If you only do damage directly via changing status values, you'll probably need to register the player manually to have attacked the combatant:
    combatant.Battle.SetAttackedBy(attackerCombatant, true);
    Post edited by gamingislove on
    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, thank you both! It works now.
Sign In or Register to comment.