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;
}
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)
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;
}
It looks like you're new here. If you want to get involved, click one of these buttons!
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.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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
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.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!