#Stuck with Custom Variables

1 messages · Page 1 of 1 (latest)

grim lodge
#

Essentially, I am attempting to write a WA to track my gold per session. I know there are mods to do it, but the less mods the better! I just wanted to make text with alpha 0 when 0 and then alpha 100 when not 0. I attempted to use a custom variable called goldNew, but whenever I assign data to the variable, it does not retain the information. I know I'm doing it wrong. I'm really new at this. Any ideas?

distant gale
#

I know there are mods to do it, but the less mods the better!
You're making a mod. If you make one that's worse than the mods out there then it's certainly not better.

So that's not a good reason to make it but learning to make custom Auras is so I'm not trying to discourage you.

Regarding the question, changing alpha is a shitty workaround. You want to only show something when there's something to show, do that.

#

Regarding your issue, you're not interacting with TSU properly

#

!TSU

boreal arrowBOT
jovial kraken
#

!aura_env no globals

boreal arrowBOT
grim lodge
#

Ah, thanks for that last tidbit. I know a workaround that will work nicely. I'll ready up on TSU, thank you so much!

grim lodge
jovial kraken
#

goldNew and goldOld are both global variable. Don't use globals. declare them as aura_env.goldNew, aura_env.goldOld

grim lodge
#

oh I see. Just for curiosity, what does that affect if they are declared globally?

jovial kraken
#

any other code that happens to use the same variable name will mess everything up

grim lodge
#

Oh no, that would be awful! Thank you so much. I didn't realize global variables could be accessed outside of the aura it was in.

jovial kraken
#

tracking down a problem when using global variables is nearly impossible