#toggle gold skill

1 messages · Page 1 of 1 (latest)

rotund hull
#

i dont understand why he cant destroy this modifiers while i have <= 100 gold

#

no error in console

chilly sorrel
#

you have the wrong class names below modifier_evrei_insurance_gold = class({})

rotund hull
#

he still dont destroy while i have <= 100 gold

chilly sorrel
#

its not clear what you are trying to do in the ability.

#

you are spawning a modifier thinker in OnToggle, is that whats not being destroyed?

rotund hull
chilly sorrel
#

i dont see code that would destroy the thinker

#

it looks like you are just spawning a new one every time OnToggle is called

rotund hull
#

but here i destroy thinker, isnt it?

chilly sorrel
#

thats not a thinker

#

i mean the CreateModifierThinker line

rotund hull
chilly sorrel
#

why are you using a modifier thinker at all, i dont see the reason

#

all the effects of the modifier are based on the caster, so it being on a separate entity doesnt do anything

rotund hull
chilly sorrel
#

modifier thinkers and OnIntervalThink are unrelated

#

a modifier thinker is a dummy unit that gets your modifier applied to it

#

they are generally used when you want to use a modifier without a unit

#

StartIntervalThink and OnIntervalThink can be used in any modifier

rotund hull
#

big thanks

chilly sorrel
#

so if im understanding you right, you want this modifier to automatically be removed when your gold goes below 100?

#

you should do that logic inside the modifier's OnIntervalThink and make it remove itself