edited May 31 in ORK Support
Hi,
I have a Status Effect let's call it WeaponPowerEffect, which is on the equipment and will be applied to combatant once equipped. I have 3 questions about this status effect:

1. The WeaponPowerEffect give bonus to a status value with the condition [HP is less than 30% of MaxHP]. While the combatant equips the equipment and has the effect applied, if his HP is greater than 30%, the status value won't be changed.
But then the combatant gets hurt, and the HP is less than 30%, I need the status effect can recheck the condition and add value to the status value.

Also, after giving the bonus to the status:
1: If the HP remains below 30%, the status value won't change again.
2: If the HP becomes greater than 30%, the status value will be reset.
3: If the HP becomes greater than 30% and the status value is reset, then if the HP drops below 30% again, the status value needs to change again.

Is there an option to enable rechecking in ORK?

2. The WeaponPowerEffect has an Attack Status Effect bonus, which will apply another status effect to target after player perform any ability, I enabled the Use Attack Effect and Use Defence Effect in both User Settings and Target Settings->Target Changes of the ability. But when the player using the ability the status effect doesn't add to the target. I tried to understand the answers here https://forum.orkframework.com/discussion/4351/weapon-attack-status-effects-question but still don't know what exactly to do.

3. The WeaponPowerEffect was added to weapon by script because I need to loot. That means one equipment settings(Iron Sword for example) can have different WeaponPowerEffect for different Iron Sword instances. I do it with the code below:
StatusEffectAsset sea = ORK.StatusEffects.GetAsset(statusEffectAffix.StatusEffectIndex);
StatusEffectChange sec = new StatusEffectChange();
sec.effectCast = EffectCast.Add;
AssetSelection<StatusEffectAsset> selection = new AssetSelection<StatusEffectAsset>();
selection.SetAsset(sea);
sec.effect = selection;

//ironSwordShortcut.GetEquipmentLevel().bonus.custom?.statusEffects?.effect?.SetValue(sec, 0);
BonusSettings bs = new BonusSettings();
StatusBonusSetting statusBonusSetting = new StatusBonusSetting();
AutoEffects autoEffects = new AutoEffects();
autoEffects.effect = new StatusEffectChange[1];
autoEffects.effect.SetValue(sec, 0);

statusBonusSetting.statusEffects = autoEffects;
bs.useCustomBonus = true;
bs.custom = statusBonusSetting;

ironSwordShortcut.GetEquipmentLevel().bonus = bs;

However, after the EquipShortcut instance was added to the inventory and the game was saved, the WeaponPowerEffect effect was not saved in the EquipShortcut instance. Instead, it seems to have been saved to the equipment editor data. This issue occurs because, while multiple EquipShortcut instances were created, the last created WeaponPowerEffect effect was returned in every created EquipShortcut instance through this code:m_EquipShortcut.GetEquipmentLevel().bonus.custom?.statusEffects?.effect[0]?.effect?.settings?.Get()?.Settings?.GetName(). I think I might be doing something wrong.
Edit: Just found my post before: https://forum.orkframework.com/discussion/7444/solved-change-statusvauebonus-in-script-at-runtime-wont-be-saved
So the equipShortcut.GetEquipmentLevel() will change the settings of the equipment, not the instance of the equipment.
Post edited by bitmore on
  • 1) Generally, the bonus would be recalculated on each status recalculation of the combatant, but Consumable type status values (e.g. health) doesn't trigger a status recalculation (Normal type status values would, though).

    An 'easy' way to fix this would be via a schematic using the Reset Combatant Status node and use that e.g. as a Change Schematic on your health status value (e.g. optionally with the condition of this kind of status effect being applied).

    2) If the ability has Use Attack Effect enabled, that should use any attack status effect that's available to the combatant, e.g. from an equipment or applied status effect on the user of the ability.
    When the user uses the ability, the target of the ability should get the attack effect. I assume that attack status effect change is set up correctly?

    3) Changing settings is not saved with save games - also, changing settings will affect all instances of the equipment.
    Settings are not instanced, they are global for all instances.
    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 1
    1) After the test, the 'easy' way doesn't work, because the effect give the bonus to the status change is Used On Apply, and the status effect was applied to the combatant when the combatant equip the weapon, so the Apply event not raised again when the condition meet.
    I'm trying another way to achieve this: I create a new status effect WeaponPowerTag and use this effect as a tag, when the combatant equip the weapon the WeaponPowerTag will be applied to the combatant and do nothing.
    Then, In WeaponPowerEffect, enable the Auto Apply Settings ->Auto Apply, add two condition: HP less than 30% and WeaponPowerTag applied; Enable Auto Remove Settings -> Auto Remove, add two condition: HP is Greater Equal 30% and WeaponPowerTag is not applied, set Needed to One, this solves the recalculate issue.
    But I need the variables on equipment instance, I used to get them by Variable Origin->Selected Data with Data Key 'action', now I can't get them, I guess it's because the WeaponPowerEffect is not applied by the weapon now. Is there any way to get the variables on equipshortcut instance?

    2) I think this is the same issue as 1): I use variable on EquipShortcut instance to calculate the effect chance, my guess is that the Attack Status Effect is triggered by ability, not by equipment, so I can't get the variables on the equipment by Variable Origin->Selected Data with Data Key 'action'. This causes the effect chance always 0.

    for 1) and 2), I need a way to get the variables on equipment, or store the variables somewhere else like status effect instance, any suggestions?
    Can we have variables for Status Effect in the future? It would be much easier if status effects have its own variables settings.

    3) For now, I store the status effect GUID to equipment instance variable, and before equip/unequip, I get the GUID and set the status effect to the settings of equipment, this work, but I think it's not a good solution.Still looking for a way to set the status effect bonus to the equipment instance.
    Post edited by bitmore on
  • 1) Yeah, apply is only used when the effect is applied. I thought you're using Status Bonuses, those would be rechecked on status recalculations.

    As for the equipment variables - this depends on where you use this. The 'action' data key is context-based, so depending on what uses it where it will have nothing or something else in it. The auto apply/remove setups of effects will have no connection to the equipment the original effect came from.
    However, formulas can just get equipment and their variables via selected data nodes, e.g. Select Equipment to get equipped stuff, after which you can access the variables on them.

    2) Same as I said above regarding the equipment variables. For an ability, the ability instance is the 'action' selected data.

    3) The only way to do that would be using conditional status bonuses and e.g. using equipment variables for them. That way you can set a variable on the equipment to add the status bonus giving the effect.
    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 2
    Thanks for your help. I think I'm getting close.

    1) and 2), I create a custom Select Equipment formula node, add extra filter that check if the equipment has the status effect GUID as variable, this works, but I don't understand why the Value node failed to get the variable on the selected equipment unless the Data Origin is Global. The custom node is used in a formula for hit chance calculation.
    attackstatuseffectglobaldataorigin

    3)[Solved], I add a status bonuses template that using variable condition which use 'action' data key to get the equipment variable 'StatusEffectGUID' and do variable check. Then add this template in equipment settings. This works as charm, the bonuses can be set to equipment instances now.

    Based on the settings above, the whole status effect system almost works as I expected, but comes a new issue.
    4) WeaponPowerEffect has an Attack Status Effect, I enable the Ability->UserSettings->User Changes->Use Attack Effects/Use Defence Effects, when the player use the ability to attack the target, the attack status effect is applied to the player, not the target, I'm sure the Switch User/Target option in ability and status effect are not enabled.
    Post edited by bitmore on
  • 1+2) Well, your image shows that your Select Equipment node stores it into global selected data - so you just need to change it to store into Local selected data there to have it as local data in the other nodes.

    4) The user changes only operate on the user of the ability, i.e. it's user and target of those status changes. Using attack/defence effects here will put it on the user 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!
  • Thanks for the quick reply.
    1+2) Yeah, that's because when the Data Origin in Select Equipment node is Local, the Value node(with Local Data Origin too) can't get the variable value, it works only after the Data Origin in Select Equipment and Value node are both changed to Global.

    4) After my test, if I need the ability to trigger the Attack Status Effect and Defence Status Effect in equipment status bonus, I need to enable Ability->UserSettings->User Changes->Use Defence Effects and Ability->Target Settings->Target Change->Use Attack Effects, is this the correct way to achieve this?
  • edited June 4
    1+2) Ah, sorry - for the Value node, you want to access variables stored in selected data, so you need to use the Selected Data variable origin and use Local data origin with the data key you stored your equipment in.

    4) No, both attack and defence effects should be used by the target changes.
    You usually want to tie this to an attack, i.e. a user attacking a target. If the user has an attack effect, the target will get that effect. If the target has a defence effect, the user will get that effect.
    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!
  • edited June 5
    1+2) That's what I did, but failed to get the value. Here is the settings of the formula and the formula is used for the Status Effects->WeaponPowerEffect->Attack Status Effect->Hit Chance.
    0001 0002 0003
    In general: If the Data Origin in Select Equipment and Value nodes BOTH are Global, the Value node can get the value; If the Data Origin in two nodes both are Local, can't get the value.

    4) Oh, now I understand the use of the Defence Effect.
    What I want to achieve is: While the user has WeaponPowerEffect applied, after user performing ANY ability or specific types of abilities, ANOTHER status effect will be applied to the user. How should I set up another status effect?
    Post edited by bitmore on
  • 1) I'll do some tests.

    4) There are different ways to do this.

    Status effects can use the Status Effect status change on Action Start or Action End, i.e. whenever the combatant with the effect applied uses an action it'd trigger that status effect change (can also be limited to e.g. only abilities or specific abilities).

    Abilities can use conditions on status changes, i.e. you can set up status changes for the user that'd only be used when e.g. a defined status effect is applied.

    You can do status changes in schematics and e.g. set up ability start/end schematic that are used by all abilities (that have enabled using them).
    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.