• 🏆 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!

Disabling health/mana regeneration temporarily

Status
Not open for further replies.
Level 3
Joined
Apr 3, 2019
Messages
48
Hello Hive,

I'm trying to make a survival type game where, if you go too long without eating food, you get a hunger debuff and 20% of your hero's health knocked off. Problem is... it just regenerates before the next timer finishes, which doesn't really go with the theme... Is there some way to disable health/mana regeneration while the debuff is active so that the unit loses 20% health each cycle? I am wondering if maybe there is a spell with an ability like that pre-programmed in, but cannot think of one. Thanks very much!
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
But that disables regeneration permanently. I just want to turn it off when the debuff is active.
Use your imagination for a moment, either you disable it this way, and when you want regeneration comes back, give the unit a regeneration ability with the about you want, OR do the opposite - have the unit with its regeneration and to "disable" regeneration give it the ability with negative regeneration.
Or in 1.31.1 you can simply
  • Unit - Set Unit: Footman 0001 <gen>'s Real Field: Hit Points Regeneration Rate ('uhpr') to Value: 50.00
 
Level 3
Joined
Apr 3, 2019
Messages
48
Well, I tried the negative regeneration rate idea initially, but the unit is a hero, so its health regeneration rate is going to change as you level up/get items/etc. There doesn't seem to be any way to set something = to unit's current health regeneration.

If 1.31.1 has a regeneration feature then I'd love to upgrade, but I've heard only bad, glitchy things about it.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
This doesn't seem to work yet (along with many other things) but it would probably be the easiest solution once it does:
  • Unit - Set Unit: YourUnit Integer Field: Hit Points Regeneration Type ('uhrt') to Value: SomeInteger
I tried setting the Value to -10 all the way to 10, but none of them worked.
You'd think it would be like 0 = None, 1 = Always, 2 = Only On Blight, 3 = Only During Day, 4 = Only During Night.
 
Level 3
Joined
Apr 3, 2019
Messages
48
This doesn't seem to work yet (along with many other things) but it would probably be the easiest solution once it does:
  • Unit - Set Unit: YourUnit Integer Field: Hit Points Regeneration Type ('uhrt') to Value: SomeInteger
I tried setting the Value to -10 all the way to 10, but none of them worked.
You'd think it would be like 0 = None, 1 = Always, 2 = Only On Blight, 3 = Only During Day, 4 = Only During Night.

Yeah, I see the problem here.
Your using an integer field when it should be a real field. At least I believe that's the problem.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
This is Hit Points Regeneration TYPE, not the actual amount regenerated. The category for this option is found under Integer, meaning you won't find it under Real or Boolean or String. Like I said, it's not working yet as far as i'm aware but hopefully with the next few patches it will be fixed.
 
Level 3
Joined
Apr 3, 2019
Messages
48
I get it.

But where is there an integer value for regeneration type though? I'm guessing you'll have to set type equal to an integer to make it work (if that's possible), or just use another mildly more complex trigger that uses real variable for units standing in blight or whatever.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
I get it.

But where is there an integer value for regeneration type though? I'm guessing you'll have to set type equal to an integer to make it work (if that's possible), or just use another mildly more complex trigger that uses real variable for units standing in blight or whatever.

Once it works (if it's even going to work) you'll most likely just set the Integer to some number between 0-4 or 1-5. There's 5 options and logically it'd make sense that Blizzard just numbered them this way. Ideally, they would make it so that you could just select Always, None, etc... without having to just guess how Blizzard ordered it.
 
Level 3
Joined
Apr 3, 2019
Messages
48
Well I'd personally prefer a simple drop down bar with all options on it then an integer. But hey, at least its doable either way... which is better luck than I usually get.
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
Well I'd personally prefer a simple drop down bar with all options on it then an integer. But hey, at least its doable either way... which is better luck than I usually get.
The reason it's done this way is that the functions that change the values are generic functions rather than being specific to the field you are trying to modify. They are just xxSetRealValue() and to be standardized/consistent they take the same input parameters for all fields they can modify.
 
Status
Not open for further replies.
Top