Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output Modifiers in Gameplay Effect Execution Calculations Cannot Modify Source Attributes #122

Open
GuyPaddock opened this issue Nov 11, 2023 · 1 comment

Comments

@GuyPaddock
Copy link

This is likely to be obvious to others but I just spent a long time debugging an issue in which I was trying to have an ExecCalc modify multiple attributes on a source during an attack, only to find that the attributes weren't being modified. It turned out that the attributes were, in fact, being modified but on the target. Now that I know this, it does make some sense, since there's no option to specify whether an output modifier is going to target the source or the target ASCs. Section 4.5.12 indicates that ExecCalcs, "can change more than one Attribute and essentially do anything else that the programmer wants." So, from this, I was mistakenly assuming I could modify source attributes just like I can target attributes.

Eventually, the workaround I found was to call SourceAsc->ApplyModToAttribute() directly in the exec. For my purposes, this seems safe since the attributes I'm modifying are transient during a single attack, but I am not sure if it's a good general purpose solution.

@GuyPaddock
Copy link
Author

GuyPaddock commented Nov 11, 2023

I found another workaround -- I split the one execution into two separate executions invoked by two different GEs. During the attack, one of the GEs gets applied to the source and then the other GE gets applied to the target; that allows me to still use output modifiers in the execution that makes changes to attributes of the source.

This isn't as useful a workaround if the execution is performing a calculation and the result of that calculation needs to be applied to attributes on both the source and target. What I'm doing to work around that is the calculation is done by the GE exec on the source, the result is being stashed in a transient attribute on the source, and then I am reading that transient attribute in the GE exec on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant