edited May 4 in ORK Support
Hi, there is a bug that occurred while servicing the game for 3 weeks.

1. Two opposite status effects

-1 status effect that increases a specific status value and consumes 10 mana per second.

-2 status effect that restores 3 mana per second
then mana should be 0 sometime

but when i run these code simultaneously.
(ORK.Game.ActiveGroup.Leader.Shortcuts.Current[0] as AbilityShortcut).AutoUse (ORK.Game.ActiveGroup.Leader);
(ORK.Game.ActiveGroup.Leader.Shortcuts.Current[1] as AbilityShortcut).AutoUse (ORK.Game.ActiveGroup.Leader);

the mana does not become 0

i.e, the mana should finally be 0, but it stops at 2.
But, it will work if the times of the two status effects are different. For example 1 second / 1.1 second (not match)

2. 'Check Game Variable' node does not work properly.
In the node editor, after declaring the local variables 'max' and 'count', it was set to execute the next action when 'max' is greater than 'count' through the 'Check Game Variable' node.
even I set that node to origin to 'local', but it doesn't work.

so Instead, i solved it by using the 'Check Value'node ( local , local).

3. to create new combatant through dataobject(saved data)
new Combatant (DataObject, false, new Group (2)); //enemy
Through the code above, the current player combatant and summoned combatant have the same guid
They do not recognize each other and do not attack each other (not recognizable).
If i create my own combatant made with the same 'save dataObject', the string guid is inevitably the same.
What to do in this case?

4. Editor copy bug
To set the targetCriticalChange from level 1 to 30 of each ability, the following code was written.
(Because it takes a very long time to do it manually)


for (int i = 3; i < ORK.Abilities.Get (abilsettingindex).level.Length; i++) {
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange = new TargetStatusChange[1] {
new TargetStatusChange ()
};
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange[0].isEnemy = Consider.Yes;
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange[0].consume = new ValueChange[1] { new ValueChange () };
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange[0].audioSetting = new PlayAudioCombatant ();
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange[0].audioSetting.audioClip = new AssetSource<AudioClip>();
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange[0].audioSetting.audioClip.settings.EditorAsset = _clip;
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange[0].consume[0].statusID = 1;
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange[0].consume[0].showFlyingText = false;
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange[0].consume[0].showConsole = false;
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange[0].consume[0].simpleOperator = SimpleOperator.Sub;
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange[0].consume[0].valueOrigin = ValueOrigin.Formula;
ORK.Abilities.Get (abilsettingindex).level[i].active.targetCriticalChange[0].consume[0].formulaID = abilformulaindex;
}


However, when the critical was activated in the in-game, the following error occurred.


NullReferenceException: Object reference not set to an instance of an object
ORKFramework.ActiveAbility.Use (ORKFramework.AbilityShortcut ability, ORKFramework.Combatant user, System.Collections.Generic.List`1[T] target, System.Boolean fromAction, System.Boolean animate, System.Boolean doCounter, System.Boolean doUseCosts, System.Single damageFactor, System.Single damageMultiplier, ORKFramework.VariableHandler localVariables, ORKFramework.SelectedDataHandler selectedData, ORKFramework.ActionCalculationFinished notify) (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.ActionAccessHandler.UseAbility (ORKFramework.AbilityShortcut ability, ORKFramework.Combatant user, System.Collections.Generic.List`1[T] target, System.Boolean fromAction, System.Boolean animate, System.Boolean doCounter, System.Boolean doUseCosts, System.Single damageFactor, System.Single damageMultiplier, ORKFramework.VariableHandler localVariables, ORKFramework.SelectedDataHandler selectedData, ORKFramework.ActionCalculationFinished notify) (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.ActiveAbility.UseAccess (ORKFramework.AbilityShortcut ability, ORKFramework.Combatant user, System.Collections.Generic.List`1[T] target, System.Boolean fromAction, System.Boolean animate, System.Boolean doCounter, System.Boolean doUseCosts, System.Single damageFactor, System.Single damageMultiplier, ORKFramework.VariableHandler localVariables, ORKFramework.SelectedDataHandler selectedData, ORKFramework.ActionCalculationFinished notify) (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.AbilityAction.Calculate (System.Collections.Generic.List`1[T] ts, System.Single damageFactor, System.Boolean animate, ORKFramework.ActionCalculationFinished notify) (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.DamageDealerAction.Calculate (System.Collections.Generic.List`1[T] ts, System.Single damageFactor, System.Boolean animate, ORKFramework.ActionCalculationFinished notify) (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.Events.Steps.CalculateStep.Execute (ORKFramework.Events.BaseEvent baseEvent) (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.Events.BattleEvent.ExecuteNextStep () (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.Events.BaseEvent.StartEvent () (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.Events.BattleEvent.StartEvent (ORKFramework.Events.IEventStarter s, System.Object startingObject) (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.DamageDealerAction.PerformAction () (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.Behaviours.DamageZone.Damage (ORKFramework.BaseAction action) (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.Behaviours.DamageDealer.DoDamage (UnityEngine.GameObject obj, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) (at <0dab100445ba44d186f30023d5c3393f>:0)
ORKFramework.Behaviours.DamageDealer.OnTriggerStay (UnityEngine.Collider other) (at <0dab100445ba44d186f30023d5c3393f>:0)


When setting each level by clicking'Add Target Change'-'Add Value Change' directly, it works normally. Is there a problem with my code?
I need help setting targetCriticalChange for each level through code.

5. The status effect bonus is not reflected in the preview.

I wrote the following code to express the preview in my custom ui panel.


public StatusPreview GetPreview (
Combatant combatant,
PreviewSelection selectedPreview) {

StatusPreview statusPreview = (StatusPreview) null;

StatusPreviewInformation info = new StatusPreviewInformation (combatant);

info.statusValue[4] += statTemp1 - combatant.Status[4].GetBaseValue (); //STR
info.statusValue[9] += statTemp2 - combatant.Status[9].GetBaseValue (); //DEX
info.statusValue[8] += statTemp3 - combatant.Status[8].GetBaseValue (); //INT

combatant.Status.GetStatusChanges (ref info);
// combatant.Status.get
statusPreview = combatant.Status.GetPreviewChanges (info);
statusPreview.statusValue.CheckValues ();

return statusPreview;
}

Each time the stat is manually increased, the statTemp value increases and the previewvalue is expressed.

The equipment bonus is applied normally, but the value is not added when the status effect that increases the stat is applied.

ORK.Game.ActiveGroup.Leader.Status[5].GetPreviewValue (false);
i.e This code return value does not include the status effect bonus.

Is there a code that brings the status bonus?

combatant.Status.GetStatusChanges (ref info);
// combatant.Status.get
statusPreview = combatant.Status.GetPreviewChanges (info);
statusPreview.statusValue.CheckValues();

It seems that the above code doesn't bring all the bonuses.

Before calling GetPreview(), it prints out the value including the bonus of the status effect, but I wonder why it is not included in my custom.

6.Player combatant auto-attack and delay in all actions.
in reatime battle/ When the player fights a monster, all actions intermittently stop or feel lagging.
As a result of numerous tests, there was a problem of persistence when the ai decision time of the realtime battle setting is 0.
This solved after changing this to something like 0.2.
Is it because of the use of 0?

7.meaning of 'block move ai' option of startnode of battle event
Even when the block move ai of the start node of the battle event is unchecked, the move ai custom> Stop function is called.
What is the function of the block move ai option of the start node of the battle event? Even if unchecked, the stop function of move ai is still called.

Can the above bugs be solved?
I'll let you know when I discover something new.
Post edited by KESHYAS on
  • 1) Applied status effects are sorted based on their Priority, and if the priority is the same, based on their ID/index. If both are applied at the same time and use status conditions at the same time, one will be used before the other, so if -10 comes first, it'll always lead to some MP being added afterwards if the other adds MP again afterwards.

    2) The Check Game Variables node will check the defined variable from the defined origin, but if e.g. the check value is also a variable, it'll be a global variable.
    Using the Check Value node is the right one to use here.

    3) If they use the same data, their GUID will naturally match - but that isn't really an issue.
    Once you spawn the combatant, it'll register when the global combatant handler, getting a new GUID and also being able to be recognized by the player (e.g. for targeting).
    Instead of spawning, you can also add it manually:
    ORK.Game.Combatants.Add(combatant, false);
    You can also pass on true in case the combatant should join an ongoing real time area battle.

    4) Since this is happening in the ActiveAbility.Use function, it's probably not in the critical target changes, but in some other related setup, e.g. the critical chance of the level not being initialized.
    Just opening that level in the editor could already have fixed the issue due to the editor's auto initializations.

    5) Status previews don't include potential bonuses from effects that could be added/removed by the previewed content.
    combatant.Status.GetStatusChanges will get all currently applied bonuses/changes.
    combatant.Status.GetPreviewChanges will create the actual preview with the current base values of the combatant.
    So, combined, without anything else, they'd reflect the current stats of the combatant.

    6) Depends on a lot of things - a decision time of 0 just means that actions are selected immediately, which usually isn't an issue. Though, if the actions don't have any wait times in their animation, the combatant will spam actions each frame, which will be pretty heavy on performance.
    The combatant's AI settings also have a Timeout setting for real time battles to prevent this (was from before the AI decision time was available).

    7) As the setting's help text explains, Block Move AI will block the complete move AI (for all combatants) while the event is running. Block Actor Move AI will block the move AI only of the actors (i.e. in battle events the user and targets).
    While using an action, a combatant's move AI is blocked in any case.
    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 May 5
    Thanks for the detailed answer!!

    1. If so, I'm not going to run both effects at the same time, or I'll have to adjust the time.

    3. thanks!
    My code is like this.

    enemyCombatant = new Combatant (enemy, false, new Group (2));
    enemyCombatant.Object.Spawn(enemyPosition, false, 0, false, Vector3.one);
    ORK. Battle. Join (enemyCombatant);


    so, should I change the code above to the following?
    Is there no need to join?

    enemyCombatant = new Combatant (enemy, false, new Group (2));
    ORK.Game.Combatants.Add(combatant, false);


    4. after click each level tab, it solved thanks!.
    so After setting through the code, do I have to press each level tab? I didn't know if the editor's auto setup function existed.
    so, Do I have to press each related tab after setting editor's fields through code?

    5.
    status value'hp'-combined statusvalue
    in that formula, add current'str' status value node
    so, initial 'hp' 10, 'str' 4 result in 14

    after applying status effect that increase str 5 (time 10) , ORK.Game.ActiveGroup.Leader.Status[5].GetPreviewValue (false); results in 19, (consider effect bonus)
    but
    after run my above code (GetPreview function)
    ORK.Game.ActiveGroup.Leader.Status[5].GetPreviewValue (false);
    return 14 (not considering effect status)

    Why is the effect's bonus applied on the first call, not after my code?




    6,7 thanks it solved
    Post edited by KESHYAS on
  • 1) Well, depending on what you want to prioritize (reducing or increasing MP), you can also solve this by using the Priority setting of the effects.

    3) That largely depends on the situation this is used in and what the goal is.
    E.g. if you want to spawn new combatants and add them to an ongoing battle, your current code would be correct.

    4) Either that, or find out which of the settings in the ActiveAbility class of the level isn't initialized correctly. It's most likely a not initialized chance, e.g. the critical chance if you set it up to use critical damage.

    5) Probably because that's just what the values are ... the GetPreviewValue function returns either the previewed value (if a preview is available) or the current value (i.e. no preview available). In the first call, due to the applied effect the status value's value is already changed, i.e. that change is also integrated in whatever is previewed.
    In the 2nd call, without the effect applied that change would have to be in the preview for it to be included.

    It's hard to really tell what's going on without knowing all the details. Ultimately, the preview shows what's in the StatusPreview instance you create, so it might be better to create that with the current stats and change it's status value (min/max values) with the things you want to preview.
    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!
Sign In or Register to comment.