[Spell Help] Negative Magic Resist Aura

Jinxx

New Member
Reaction score
4
I need to make an aura that reduces the magic resistance of nearby enemies by 10/20/30/40/50 percent. The easy part is giving enemies who come within range of the "caster" (aura owner, whatever you want to call him) the unit ability based on that runed bracers item thing, with negative values, and leveling it to the level of the aura - that's easy.

Now the part I'm having trouble with is taking that invisible unit ability away once they leave range of the aura, because there isn't a "unit leaves range" event. The suggestions in the old threads about this say to add units coming within range into a group, then check every 0.01 seconds, and if the enemy is not in the aura's AoE anymore (they've moved away from the aura owner) then take away the negative magic resist.

Now I was wondering, is there a more elegant way to handle this? I really hate using brute force periodic triggers, especially with such small time values. On the other hand, setting the timer higher can result in the enemy eating a boatload of extra damage (that they shouldn't have suffered) from an untimely nuke since the trigger was a few fractions of a second too late taking away the negative magic resist.

Ideas?

P.S. Any way to possibly manipulate this with buff checking?
 

Jinxx

New Member
Reaction score
4
No what? Godamn you're fast.

but even 0.10 - 20 seconds faster enough.
Did you read the post? Setting it higher can cause unwanted effects. If the trigger makes the checks "slower", then an enemy can possibly get killed by a nuke that deals more damage than it should.

EDIT: There's no way you could have read the post so fast - please don't reply if you won't take the time to at least read it and understand the problem.
 

Jedi

New Member
Reaction score
63
They are faster than you think, even endurance aura, unholy aura, etc aura have 2-3 seconds delay.
 

Jinxx

New Member
Reaction score
4
They are faster than you think, even endurance aura, unholy aura, etc aura have 2-3 seconds delay.
I know, but I don't want a delay. Also, I know this works, but the key words here are other solutions. Periodic triggers aren't a problem by themselves, but they add up quickly in a map and I want to avoid them if possible.
 

Music Man

Cool Member
Reaction score
3
You try this yet?

Trigger:
  • Unit Leaves Range of Unit
    • Events
      • Unit - A unit leaves (Region centered at (Position of Wolf 0007 <gen>) with size (500.00, 500.00))
    • Conditions
    • Actions


? And then do whatever actions you want to the unit leaving the range?
 

Happy

Well-Known Member
Reaction score
71
@ Music Man : with your solution the region has to be set periodic so its hardly the same....

@ Jinxx : you could make a dummy spell that only adds a buff that lasts 1 second....then if a unit comes in range create a dummy casting this spell...this way round the owner of the units coming near could see that it has reduced magic immunity and you reduce lagg because of the 0.01 periodic timer thing because you have to check only every second...
 

Jinxx

New Member
Reaction score
4
@ Jinxx : you could make a dummy spell that only adds a buff that lasts 1 second....then if a unit comes in range create a dummy casting this spell...this way round the owner of the units coming near could see that it has reduced magic immunity and you reduce lagg because of the 0.01 periodic timer thing because you have to check only every second...
Theoretically, this isn't a bad idea, but it's the same as if using a dummy aura with dummy buffs. The principle is identical, but there are 2 problems:

1) It still relies on periodic events, which I want to avoid if possible (although you're right, performance-wise 1.0-sec timers are better than 0.01-sec timers)

2) An enemy usually won't enter the aura's range at exactly 1.0-second intervals, meaning that the periodic trigger tasked with removing the negative magic resistance will be "early" or "late" in most cases... I could easily tweak one of the vanilla auras to have a 5-second "fade time", and then run the periodic removal trigger every 5.0 seconds, but the larger the time interval, the bigger the time lapse.

EDIT #1: It would be ideal if there was some way to track the life duration of buffs. Is there?

EDIT #2: Thinking about it a bit more, the best way to do this would be something along the lines of...

Event -> unit looses dummy aura buff
Condition -> unit not dead
Action -> take away the negative magic resistance

EDIT #3: Or maybe starting a timer that expires in N seconds when the unit enters the aura, is refreshed if unit re-enters the aura, and, once it expires, take away the negative magic resistance (since it expired, it would mean that unit didn't re-enter aura range since the timer would then have been reset to N seconds)... However, I don't know if this method is full-proof... possible bugs?
 

Dirac

22710180
Reaction score
147
How about adding a buff to the aura, and checkin every .1 seconds if any unit that has the buff dosnt have the ability and adding it to the unit
 

Jinxx

New Member
Reaction score
4
Dirac... checkin every .1 seconds
Jinxx... Now I was wondering, is there a more elegant way to handle this? I really hate using brute force periodic triggers, especially with such small time values.
:)

Why not get a Aura system... There are LOADDDS of them...
I'm trying to limit the amount of imported systems. I swore I'd make a fun and playable AoS with only the WE, vanilla JASS, and Weep's GDD (which I didn't plan on implementing in the first place, but his system is just too useful and flexible to pass up).

Also HeX, getting an aura system is the easy way of solving the problem - come on, don't you enjoy a challenge? :cool:
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
On the other hand, setting the timer higher can result in the enemy eating a boatload of extra damage (that they shouldn't have suffered) from an untimely nuke since the trigger was a few fractions of a second too late taking away the negative magic resist.
If you weren't aware, Unit Enters Range is not instant: it only checks about every 0.1 seconds, anyway.

Triggered auras require periodic methods, as far as I know. :(
 

tommerbob

Minecraft. :D
Reaction score
110
:)


I'm trying to limit the amount of imported systems. I swore I'd make a fun and playable AoS with only the WE, vanilla JASS, and Weep's GDD (which I didn't plan on implementing in the first place, but his system is just too useful and flexible to pass up).

Also HeX, getting an aura system is the easy way of solving the problem - come on, don't you enjoy a challenge? :cool:

This type of mindset is completely confusing to me. Why would you want to limit yourself on the possibilities you can do with a map, simply for the sake of making your life harder?

It's like someone who knows GUI and vJass perfectly, but decides to use GUI to do something that would be 20 times easier in vJass, for the simple fact that doing it in GUI is more difficult and time consuming.

People make systems for the exact reason that you need them.

Sorry for the tangent, it is just mind-boggling to me that someone wouldn't want to use a system that makes their life easier.

Back on topic, as far as you using a periodic event every .01 seconds will cause some lag. And as Weep said, the game checks for things like "unit enters region" etc. only so often anyway, so it would be pointless to make your periodic event faster than that.
 

Jinxx

New Member
Reaction score
4
This type of mindset is completely confusing to me. Why would you want to limit yourself on the possibilities you can do with a map, simply for the sake of making your life harder?

It's like someone who knows GUI and vJass perfectly, but decides to use GUI to do something that would be 20 times easier in vJass, for the simple fact that doing it in GUI is more difficult and time consuming.

People make systems for the exact reason that you need them.

Sorry for the tangent, it is just mind-boggling to me that someone wouldn't want to use a system that makes their life easier.
I'm not discarding user-made systems to make my life harder, I'm not a masochist. The reason I don't like to include too many is because it bloats the map, and I'm not speaking about size. Is it really efficient to import a whole system for just one single spell/ability? If I had a team of 10 people, each extremely good in one aspect of W3 mapping, and we were on a quest to create the best map ever, then hell yes, I'd vJASS everything and put in as many custom systems as needed, but for a one-man, small AoS map? Not necessary IMHO.

Back on topic, as far as you using a periodic event every .01 seconds will cause some lag. And as Weep said, the game checks for things like "unit enters region" etc. only so often anyway, so it would be pointless to make your periodic event faster than that.
Oh God, I swear, if I had some kind of portal thingy, I'd teleport right next to you and slap you! Did I mention wanting to make checks faster than 0.01 seconds? Is that even possible? Who in their right mind would need such precision? The whole point of the story here is bypassing the annoying periodic-based aspect of the aura! I seriously wish people would actually read the posts before commenting... :mad:

EDIT:

Triggered auras require periodic methods, as far as I know.
Any way to rig this thing and make it work with an expiring timer? Such as, enemy enters range, gets the dummy aura's dummy debuff, gets the negative magic resist, timer goes up and expires in, say, 5.0 seconds (for the sake of argument, this would be the aura's "fade time"). If same unit re-enters aura range, the said timer is reset to 5.0 seconds. If timer expires, the negative magic resist is removed. I think this would be preferable to running 0.01 periodic checks, but I don't know if it's fullproof... Come on Weep, you're the trigger-daddy here, work your magic! :D

Also, is there any way to check when a debuff runs out?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
[...]

Any way to rig this thing and make it work with an expiring timer? Such as, enemy enters range, gets the dummy aura's dummy debuff, gets the negative magic resist, timer goes up and expires in, say, 5.0 seconds (for the sake of argument, this would be the aura's "fade time"). If same unit re-enters aura range, the said timer is reset to 5.0 seconds. If timer expires, the negative magic resist is removed. I think this would be preferable to running 0.01 periodic checks, but I don't know if it's fullproof... Come on Weep, you're the trigger-daddy here, work your magic! :D

i strongly believe this would be worse then a single periodic event.
seriously, why dont you just do it with the periodic event, i would do so and i believe everybody else would do as well.
every other method i can imagine would be worse then the periodic check.

Also, is there any way to check when a debuff runs out?
only with a custom status system, no native way.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Any way to rig this thing and make it work with an expiring timer? Such as, enemy enters range, gets the dummy aura's dummy debuff, gets the negative magic resist, timer goes up and expires in, say, 5.0 seconds (for the sake of argument, this would be the aura's "fade time"). If same unit re-enters aura range, the said timer is reset to 5.0 seconds. If timer expires, the negative magic resist is removed.
Sure, although, it ought to check if it's still in range at the timer expiration, since if the unit simply stays in range, it won't trigger another "enters range" event. Also, this shifts the inaccuracy to the exit event away from the enters event, which I guess is OK for your map? And still, the enters event may be off by up to 0.1 seconds because of the way WC3 handles the "enters range" event, like I mentioned.

Come on Weep, you're the trigger-daddy here, work your magic! :D
:p

Enters Region and Exits Region are instant, but you can't make truly circular regions, and you have to move the region to center on your hero periodically anyway. There's Enters Range of Unit, which is itself only about as accurate as a periodic 0.1s check, and no Exist Range check. If you look at the existing aura systems, they all use a periodic method, as far as I'm aware.

Also, is there any way to check when a debuff runs out?
Only by checking periodically to see if the unit still has it, or by starting a timer when it gains the buff, if you know the buff's duration and know that it won't be dispelled. :thdown:
 

tommerbob

Minecraft. :D
Reaction score
110
Oh God, I swear, if I had some kind of portal thingy, I'd teleport right next to you and slap you! Did I mention wanting to make checks faster than 0.01 seconds? Is that even possible? Who in their right mind would need such precision? The whole point of the story here is bypassing the annoying periodic-based aspect of the aura! I seriously wish people would actually read the posts before commenting... :mad:

Take a chill pill bro. Sorry for the miscommunication. What I meant is that your periodic event of .01 seconds is too fast. Like Weep said, the game checks certain conditions only so fast, and it definitely isn't that fast, so it would be pointless to check it faster than about 0.1 seconds. That was my point. So much for reading the posts before commenting, eh? :rolleyes:
 

Jinxx

New Member
Reaction score
4
i strongly believe this would be worse then a single periodic event.
seriously, why dont you just do it with the periodic event, i would do so and i believe everybody else would do as well.
every other method i can imagine would be worse then the periodic check.
Yeah, the way things stand I'll probably go with the periodic - fuck it, I've spent enough time messing with this anyway...

But for the sake of argument, why would a single expiring timer be less efficient than a periodic event that blindly fires thousands of times during the course of a game? :confused:

Only by checking periodically to see if the unit still has it, or by starting a timer when it gains the buff, if you know the buff's duration and know that it won't be dispelled. :thdown:
:(

What I meant is that your periodic event of .01 seconds is too fast. Like Weep said, the game checks certain conditions only so fast, and it definitely isn't that fast, so it would be pointless to check it faster than about 0.1 seconds. That was my point.
Well, 0.1 seconds is still too fast... I hate the fact that it keeps on blindly firing in the background; it's complete overkill, like trying to destroy a run-down building by nuking the whole country to pieces!

Want To Buy: buff expiration event!
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
whats your problem with the periodic event? in the event of no units hit by the aura checking whether an integer aint 0 every 0.1 seconds aint feeding that much performance.
(use an integer variable to track whether the unit group is empty or not, the native function is crap)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top