- Joined
- Feb 26, 2022
- Messages
- 13
Title. The basic use-case is to make a type of unit that always recieves unique effects that aren't damage from getting dispelled, even if he doesn't have regular buffs to dispel. Here's the list of things I've tried or at least considered:
I hope what I have done already consitutes sufficient due dilligence before posting. This might just be an engine limitation I'll just have to deal with or switch to Retera's Java rewrite (if anybody has successfully gotten that to work)...
Anyway, I love you guys. If anybody has a fix I haven't thought of, I would be super grateful. I've tried everything I can think of here.
Thanks in advance <3
- A common sense, just-works trigger event that fires when a buff is dispelled with built-in functions to get dispeller, dispelee, ability that was used to dispel, and buff that got dispelled?
- Doesn't exist. I already checked the blizzard.j and common.j files. The string "dispel" appears exactly 7 times accross both of them and no instance of it is related to event registration.
- Since the effect I want to check is more or less permanent, and the idea is that it will come back 30 seconds after getting dispelled, I thought of this:
- A "tracker ability" that is hidden and does basically nothing, an "effect active" buff that gets applied via dummy units, and an "effect lockout" effect that also gets applied with dummy units.
- All units that have this are permenently classified as "summoned" in the OE so they take damage from dispels.
- An EVENT_PLAYER_UNIT_DAMAGED that has a condition that checks if he does have the tracker ability, and doesn't have the other two.
- If the condition passes, it means he just got dispelled and therefore the damage source must be from the dispel so we set the damage to zero with event responses, apply the lockout so further damage won't get set to zero, and then do the rest of the script.
- The problem? It appears from testing that the damage that dispel effects cause to summoned units gets applied before removing the buffs, so it fails because during the check, it still has the "active effect" buff. It will proc on the next instance of damage he takes, but that isn't what I want.
- This is also kind of awful since we're now doing more checks every single time a unit gets damaged, and even if they fail and it doesn't proceed, it's extra CPU overhead.
- Check every single unit on the map whenever any spell is cast, filtering out dummy spells and other undesirables by checking the caster unit type (all dummy spells for my project get cast by the same unit).
- The problem is that this is even more overhead.
- Imagine a 12 player game with a bunch of curses and slows and inner fires getting cast in a big fight and for each one, every single unit in the map needs to get cast in case it was a dispel.
- Run the check whenevery any spell is cast as described above, but only the spell's target if it's single target, or people in its radius if it's an AOE.
- The problem: we can't get a spell's radius.
- The ability real field ABILITY_RLF_AREA_OF_EFFECT is defined in common.j, however, in the GUI, we are unable to get or set any ability real value except for "Missile Arc ('amac')"
- And I know from personal experience that if it doesn't let you modify a field in the GUI, it won't work with Lua (or probably JASS), either.
- Run the check only if the spell being cast is a known because in the base game, there is a limited number of different spells that do dispels and if I add any more, I can add those two.
- This is problematic because I intend to architect my map in such a way that it is designed to be mergable with other maps/assets. I have a Python script that merges object editor and trigger data.
- If the conditions say "only proceed if the spell cast was Abolish Magic, Mass Dispel, Purge, (Whatever the Obsidian Destroyer's anti-magic spell is), Dispel Magic (Neutral)(, or one of my custom dispels)", then this becomes an issue the second there are more dispels that I didn't and realistically couldn't account for.
- Such a solution also kind of just makes me cringe because I consider proper abstraction to be a best practice
- Periodic global check whether or not each unit has the buff?
- While probably not as bad as every single attack or spell, it's still a lot of overhead.
- If I did it only once every ten seconds (or even every one second) then it would probably be fine, but then I run into the issue of now it's not very responsive.
- If there's a range of 0 and 1 seconds between dispelling and the resultant effects triggering, dependent upon how far it was in between global checks, then this is inconsistent and therefore awful.
- Periodic check using a timer created for each unit where this will come up?
- Less overhead than periodic global check, which means we can check more often (such as every 0.1 seconds) because we will be doing it on less units.
- Better, but basically the same problem, just to a lesser degree and now we have to do cleanup every time a unit dies (extra overhead).
- Checking out this post: https://www.hiveworkshop.com/threads/how-to-check-if-a-buff-is-dispelled.262487/ where he links to this post: Please! Help with a trigger! where he give us his system.
- The problem is that it only works for his Effect over time system.
- "// - EOT_Event_An_EOT_Is_Dispelled - real (event simulator)
// This event is ran when an eot is dispelled." - That means for it to work I have make an event within his ecosystem.
- Obviously, anything that is user-defined is going to be much more cooperative; if I was sure that the only things doing the dispelling were things I defined in my own scripts, well I wouldn't be posting this.
- He's got the lines: "//This is the loop for every 0.03 seconds of gametime.
function EOT_Interval takes nothing returns boolean" in his EOT System script. I've not analyzed the whole thing, but this really makes me think he's just spamming checks periodically, which is what I described above and has the same problem. - (Not to disparage Wietlol; his system does seem like I was put together well, I just don't know if it does anything I haven't already thought of for this use-case.)
- (Also, he wrote it in JASS and I use Lua (or at least I am for this map), so even if it was perfect, it'd still be a lot of refactoring to implement it 1:1 or I'd just have to in-line everything, meaning if there was a simpler way, I'd take that)
- Looking for native buffs that do something that I might be able to get to call trigger events when dispelled.
- I can't find any.
- It really doesn't seem like any spells in vanilla WC3 do something specifically when they expire, certainly not when they're dispelled...
I hope what I have done already consitutes sufficient due dilligence before posting. This might just be an engine limitation I'll just have to deal with or switch to Retera's Java rewrite (if anybody has successfully gotten that to work)...
Anyway, I love you guys. If anybody has a fix I haven't thought of, I would be super grateful. I've tried everything I can think of here.
Thanks in advance <3
Last edited:

