You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Need some ways to check if variable was exported before fetching/storing (and possibly crashing the script). This should allow for global scripts to communicate without hard requirements.
Concrete motivation for this: my damage mod script needs to read/write some data for other global script to use. But if these external vars doesn't exist, it can work normally as a stand-alone damage mod, because it doesn't depend on them.
The text was updated successfully, but these errors were encountered:
Add new opcode/metarule to check if given exported var exists:
import variable super_var;
//...
value := super_var
if external_var_exists(@super_var) // can use stringify operator here to not confuse ssl optimizer
else 0;
Change vanilla op_fetch_external to just print error and return 0 but continue script. op_store_external similarly can just print error and continue. Not sure how "correct" this is but it will solve the main issue. You can check against 0 to see if some variable was set or not.
Need some ways to check if variable was exported before fetching/storing (and possibly crashing the script). This should allow for global scripts to communicate without hard requirements.
Concrete motivation for this: my damage mod script needs to read/write some data for other global script to use. But if these external vars doesn't exist, it can work normally as a stand-alone damage mod, because it doesn't depend on them.
The text was updated successfully, but these errors were encountered: