I am trying to get the player to earn XP when killing a combatant but:

1) the player doesn't seem to earn XP on kill (even though the schematics console outputs some values)
2) the formula schematics console always only output the initial value of the formula

This is one of the killed combatants XP setup
image

And this is the formula driving the XP calculation.

image
image

This is the function in the static class

public static int CalculateObjectXP(GameObject target)
{
if(target!=null)
{
Combatant combatant = GamingIsLove.ORKFramework.ORKComponentHelper.GetCombatant(target);
return GetCombatantXP(combatant);
}
else
Debug.LogError("target not found GetObjectXP()");

return 0;
}


I have tried adding a non-static class component to the killed game objects and in the schematic function settings use Class Origin = Component, but with the same results :(
  • Is the exp calcualted correctly?

    In any case, keep in mind that the battle's gains (loot/exp) is depending on your gains collection settings, either the default ones defined in Battles > Battle End or your used battle system overriding those settings.
    When not using Collect Immediately, those gains are kept in the system until they're collected via the Collect Battle Gains node in a schematic.
    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!
  • That did it, the Collect Immediately was not enabled, thank you Nicholas!
Sign In or Register to comment.