• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Paused unit invisibility

Status
Not open for further replies.
Level 28
Joined
Dec 3, 2020
Messages
973
If you mean you want them to be unseen, you can just Hide them with a trigger action.

But if you mean that the unit for example has Permanent Invisibility (Akama's invisibility basically) and you pause it, I am certain that it will NOT be invisible but I've never tested this specific case since when I pause a unit, I always Hide it.

You can still use spells on paused units from what I can remember, you could always create a dummy unit and make it cast the Sorceress' invisibility on the paused unit.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
I would almost never use Pause, it's pretty much guaranteed to cause problems and I doubt you actually want to pause the unit's buff/expiration timers.

Here's a nice function for disabling a unit instantly (requires patch 1.31+):
  • Set Variable Unit = Your unit...
  • Custom script: call BlzPauseUnitEx( udg_Unit, true )
Despite it's name, it acts like a Stun that bypasses the need for a buff/ability and is applied immediately. Set it to false to "unpause" the unit.
  • Custom script: call BlzPauseUnitEx( udg_Unit, false )
Note that this function uses a counter system to keep track of the state of the unit. Setting it to true adds 1 and false subtracts 1. As long as the counter is > 0 then the unit will be stunned. This means you can actually make a unit "stun immune" by making this counter so low into the negatives that it'd be impossible to get past 0 again.

Alternatively, a Dummy unit that casts a near instant Storm Bolt could work. You just need to account for things like Spell Shield blocking it and triggers that Remove buffs. Also, I believe a 0 damage Storm Bolt would still fire a damage event, which may need to be accounted for. It all depends on how you've designed your map.
 
Last edited:
Level 28
Joined
Dec 3, 2020
Messages
973
I would almost never use Pause, it's pretty much guaranteed to cause problems and I doubt you actually want to pause the unit's buff/expiration timers.

Here's a nice function for disabling a unit instantly (requires patch 1.31+):
  • Set Variable Unit = Your unit...
  • Custom script: call BlzPauseUnitEx( udg_Unit, true )
Despite it's name, it acts like a Stun that bypasses the need for a buff/ability and is applied immediately. Set it to false to "unpause" the unit.
  • Custom script: call BlzPauseUnitEx( udg_Unit, false )
Note that this function uses a counter system to keep track of the state of the unit. Setting it to true adds 1 and false subtracts 1. As long as the counter is > 0 then the unit will be stunned. This means you can actually make a unit "stun immune" by making this counter so low into the negatives that it'd be impossible to get past 0 again.

Alternatively, a Dummy unit that casts a near instant Storm Bolt could work. You just need to account for things like Spell Shield blocking it and triggers that Remove buffs. Also, I believe a 0 damage Storm Bolt would still fire a damage event, which may need to be accounted for. It all depends on how you've designed your map.
I would argue. Maybe not for this case specifically but sometimes you also want to pause the buff/expiration timers. Imagine you're playing a custom game in which you have a "battle phase" where the units of team 1 and team 2 fight each other and a "play phase" where each player plays his cards (for example) that summon more units. During that play phase you'd want to pause the units so they do not do anything and make them invulnerable so they don't take any damage etc... and that current buffs/debuffs or expiration timers they have do not progress.

Now when I think about it, do paused units automatically/passively regen their hp and mana and cooldowns?
 
Level 10
Joined
May 24, 2016
Messages
339
If you mean you want them to be unseen, you can just Hide them with a trigger action.

But if you mean that the unit for example has Permanent Invisibility (Akama's invisibility basically) and you pause it, I am certain that it will NOT be invisible but I've never tested this specific case since when I pause a unit, I always Hide it.

You can still use spells on paused units from what I can remember, you could always create a dummy unit and make it cast the Sorceress' invisibility on the paused unit.
Really? I could have cast inivsiibility from sorcereror ability on paused unit? Man, I have already made a much harder solution... Thx anyway.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
I would argue. Maybe not for this case specifically but sometimes you also want to pause the buff/expiration timers. Imagine you're playing a custom game in which you have a "battle phase" where the units of team 1 and team 2 fight each other and a "play phase" where each player plays his cards (for example) that summon more units. During that play phase you'd want to pause the units so they do not do anything and make them invulnerable so they don't take any damage etc... and that current buffs/debuffs or expiration timers they have do not progress.

Now when I think about it, do paused units automatically/passively regen their hp and mana and cooldowns?
Yeah, it has it's use case for sure. But I am doubtful that OP actually needs this functionality. I could be wrong though.

Pause is just a buggy mess unless you're careful, which I know people aren't and Warcraft 3 doesn't do them any favors. I've helped many mapmakers and pretty much everyone's map is filled with bugs because they don't account for things like this. For example, a lot of triggered spells aren't designed to work properly when the caster/target is Paused. It's just not something people really think about.
 
Level 10
Joined
May 24, 2016
Messages
339
Yeah, it has it's use case for sure. But I am doubtful that OP actually needs this functionality. I could be wrong though.

Pause is just a buggy mess unless you're careful, which I know people aren't and Warcraft 3 doesn't do them any favors. I've helped many mapmakers and pretty much everyone's map is filled with bugs because they don't account for things like this. For example, a lot of triggered spells aren't designed to work properly when the caster/target is Paused. It's just not something people really think about.
You are right. But since Im not into some arena skill shots with knockback scripts, I believe pause system should work pretty okay and never cause any troubles.
 
Level 10
Joined
May 24, 2016
Messages
339
Yeah, it has it's use case for sure. But I am doubtful that OP actually needs this functionality. I could be wrong though.

Pause is just a buggy mess unless you're careful, which I know people aren't and Warcraft 3 doesn't do them any favors. I've helped many mapmakers and pretty much everyone's map is filled with bugs because they don't account for things like this. For example, a lot of triggered spells aren't designed to work properly when the caster/target is Paused. It's just not something people really think about.
1 simple question Uncle. How to modify unitdamagetarget so it cause MAGIC damage through magic immune type target?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
1 simple question Uncle. How to modify unitdamagetarget so it cause MAGIC damage through magic immune type target?
What exactly is a magic immune type target? There's abilities like Anti-Magic Shell and Spell Immunity which modify/prevent Magic damage, and you can also modify the Damage Tables in the Gameplay Constants to reduce Magic damage dealt.

But regardless I think you'll have to deal a different type of damage. You can always do the calculations yourself.
 
Level 10
Joined
May 24, 2016
Messages
339
What exactly is a magic immune type target? There's abilities like Anti-Magic Shell and Spell Immunity which modify/prevent Magic damage, and you can also modify the Damage Tables in the Gameplay Constants to reduce Magic damage dealt.

But regardless I think you'll have to deal a different type of damage. You can always do the calculations yourself.
You see, gargolye has a magic immune ability, but I wanted 1 skill to actually deal through magic immune

If I simply change from magic to chaos (for example), damage system will ignore any gargolye's magic ressitance that could have be given over buffs.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
You see, gargolye has a magic immune ability, but I wanted 1 skill to actually deal through magic immune

If I simply change from magic to chaos (for example), damage system will ignore any gargolye's magic ressitance that could have be given over buffs.
Right, so you account for the gargoyle's magic resistance and reduce the chaos damage yourself.
  • Set Variable DamageAmount = (DamageAmount * 0.50)
 
Level 10
Joined
May 24, 2016
Messages
339
Yeah, it has it's use case for sure. But I am doubtful that OP actually needs this functionality. I could be wrong though.

Pause is just a buggy mess unless you're careful, which I know people aren't and Warcraft 3 doesn't do them any favors. I've helped many mapmakers and pretty much everyone's map is filled with bugs because they don't account for things like this. For example, a lot of triggered spells aren't designed to work properly when the caster/target is Paused. It's just not something people really think about.
The one thing that I found out about PauseUnit and that everyone should know, in 1.26 has a serious bug


If you make a berserk based abil (to make abil used instantly) that pause unit upon spell effect event, then get this unit stunned and use it's berserk while stunned - unit got paused forever, you can't unpause him. That might also work without stuns (as I believe), for that you just need to force unit use berserk with script.
The only way to fix that is to add a 0.01 delay, f.e making a timer that will lead into actuall pausing unit and needed spell effect actions.


By the way Uncle, could you tell me, you can load Hash data from a dead unit handle. Or no?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
The one thing that I found out about PauseUnit and that everyone should know, in 1.26 has a serious bug


If you make a berserk based abil (to make abil used instantly) that pause unit upon spell effect event, then get this unit stunned and use it's berserk while stunned - unit got paused forever, you can't unpause him. That might also work without stuns (as I believe), for that you just need to force unit use berserk with script.
The only way to fix that is to add a 0.01 delay, f.e making a timer that will lead into actuall pausing unit and needed spell effect actions.


By the way Uncle, could you tell me, you can load Hash data from a dead unit handle. Or no?
You should be able to load data until the unit finishes decaying and is removed from the game. I don't think it's handle id would change upon death but I'm not sure. The handle id will definitely be null if you try to reference it once removed.
 
Status
Not open for further replies.
Top