Particles recreating themselves

So I have some particles attached to items to show rarity, like the yellow one here

However, when I tab out and tab back in (or make panorama changes), the particles get created again. And again. And again.

(different area because my item cleanup system deleted those)

Is there a fix for this?

MAKE CUSTOM GAMES GREAT AGAIN

Finished-
kv checker - https://arhowk.github.io
panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

My pet project This Cursed World/Crestfallen (name pending)
https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

Comments

  • This happens when the particle indexes haven't been released, and the resources are reloaded at runtime.

    Resources automatically reload when you change them (as you can see in the console log). Unfortunately, if the particle is still there when it's changed, it'll break it. Not sure of the reason as to why; perhaps it's trying to reference elements that no longer exist, since the reloaded particle is a new instance.

    I haven't found a way to avoid this other than make sure the particles are definitely gone/garbage-collected before you make changes.

  • Posts: 858

    So, what you're saying is, this shouldn't cause problems at runtime? (when deployed to volvo servers) since theres no particle changing.

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • edited December 2015 Posts: 45

    I've never experienced this bug outside of a testing environment, so you should be safe. It's only when the resources are reloaded in real time after changes, which doesn't happen in a static build of your mod.

  • Posts: 213

    I ran into this messing around with clientside particles. The only 'real' solution I came up with was to have the particles decay after a really small period (1\60s or so) and redraw them, however I was having problems with stuttering if I was moving the particle around a lot.