Adds occasional ember particles and crackling snaps to the thermal burner anomalies (because I'm crap, and they ALWAYS get me!)
I made this because these damn anomalies really do... always... get me. Especially in the rain and during the night! That one outside the ecologist bunker in Jupiter has made me nearly ragequit on several occasions.
The script checks for all thermal anomalies in the current level, then plays ember particles and fire crackling noises randomly on them.
This most certainly isn't the best code, but it seems to work for what I need... just that little extra help to maybe not insta-die to these blasted things!
Fixed all OGG comments.
Moved some variables to top of script in effort to stop particles cutting off mid-animation (which I don't think works, sad face)
Totally forgot to check for levels like Agroprom Underground which are not in the dyn_anomalies array!
Thanks to =Krieger= for pointing this out in the comments!
Dynamic anomalies fix. The script now checks the dyn_anomalies array created in the bind_anomaly_field.script, making sure each thermal anomalies are dynamically enabled. Previously there were ember particles and crackling sounds on thermal anomalies that were disabled, which was wrong.
Thanks to moddbplsffs for pointing this out! (10 points for username)
Changed the method for the delay between each spark/crackle. Using 15 seconds as a base (15000ms), this is divided by how many burners are in the current level, e.g.:
Garbage has 38 burners (not including dynamic anomalies), so 15000ms ÷ 38 = 395ms (rounded up)
Dark Valley has 9 burners (not including dynamic anomalies), so 15000ms ÷ 9 = 1667ms (rounded up)
This helps to stop levels with few burners in them constantly chuck out spark particles.
I was finding the object's name instead of finding the section name, so it was including the steam jets in Zaton and some other objects that had "thermal" in their name.
It now correctly checks for objects with "zone_mine_thermal" in the section name.
Also, I noticed there are only a few burners in Agroprom, so I have added a couple of "if burner count is greater than 15/30" so the sparks and crackles aren't so spammy when levels have few burners in them. (Zaton has 86 burners in it!)