• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Powerups and PauseUnit

Status
Not open for further replies.
Level 26
Joined
Aug 18, 2009
Messages
4,097
Want to share knowledge about a quirk I just found:

If a unit is paused (not stunned but via PauseUnit), it does not accept powerup items. Although UnitAddItem returns true, no pickup events are fired and the item is dropped again to its previous location. So this might meddle with some systems like setting a unit's white attack damage.
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Scrap :|. This will mess up my triggers :D. Thks for such an useful share.
Btw, if we cannot use PauseUnit, is there any other way to disable that unit (not hidden, no stun, hex plz :D).
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Btw, if we cannot use PauseUnit, is there any other way to disable that unit (not hidden, no stun, hex plz :D).

Order it to use an ability based on Channel, set Follow through time to some long time, disable other abilities to true and Options - visible to false (unticked). If I remember correctly, this does not have the downsides of PauseUnit. However stunning the unit might break the channel.
 
Level 16
Joined
Aug 7, 2009
Messages
1,403
Wouldn't unpausing the unit, adding them the item and pausing them again work?

I know that I had a similar issue with hexed units (they didn't receive buffs from auras, and all my non-stacking buffs are based on the slow aura) and a custom rutin that removes the hex buff from them, adds the buff ability (the aura) and hexes them again if they had been previously hexed, solves the problem. So it might help here too.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
Wouldn't unpausing the unit, adding them the item and pausing them again work?

I know that I had a similar issue with hexed units (they didn't receive buffs from auras, and all my non-stacking buffs are based on the slow aura) and a custom rutin that removes the hex buff from them, adds the buff ability (the aura) and hexes them again if they had been previously hexed, solves the problem. So it might help here too.

I'm not sure pause and/or unpause an unit is something instant, i vaguely remember an issue about that.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
It's not that I desperately need PauseUnit. Just used it in a place where it was okay, later on occured the problem.

PauseUnit also stores all the instant orders given meanwhile, then executes them when unpaused.

About hex: There is a flag in gameplay constants that morphed units can grant auras. It does not seem to work however.
 
Level 16
Joined
Aug 7, 2009
Messages
1,403
Just don't use pause unit, you can pause a unit by stacking "stop" order but it's not good too ^^

The only time I've used it was to abuse glitches, but that's about it. I've never made a Kamehameha spell either, so it hasn't been necessary for me at all (for Kamehameha it is though, because it's not a real Kamehameha spell if it's MUI, not uses PauseUnit or isn't done in GUI). SetUnitPosition works just fine for me. The reason why I suggested the unpause/repause solution because it might be necessary for some people for certain things, like WaterKnight said above.

I'm not sure pause and/or unpause an unit is something instant, i vaguely remember an issue about that.

Well, IDK, I can live without it, as I said. I've seen it used to give a unit the stop order, for example, so as I said, IDK. It's definitely worth a try, though.

About hex: There is a flag in gameplay constants that morphed units can grant auras. It does not seem to work however.

Hmm, I didn't know about that flag. I haven't been in the gameplay constants menu since I started working on IID, which was roughly 2 years ago, and the first (and for now, the only) spell that uses it was made like a year later. But the hex/unhex solution works perfectly fine, and because adding a buff is now done via a wrapper (that's used by the buffstruct too), if I need to change anything buff related, or a similar problem pops up again, I can just change that rutin without having to go through everything.
 
Status
Not open for further replies.
Top