• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

% Hp increase

Status
Not open for further replies.
Level 2
Joined
Jul 22, 2007
Messages
8
Anyone happen to have an easy method for doing a flat % increase to spawned units based on a chosen difficulty?

I thought of creating and adding an ability to them, but I can only seem to add int's instead of straight percentages.

Thanks
 
Level 9
Joined
Nov 28, 2008
Messages
704
If you knew JASS you could create a cJass define easily
JASS:
define CreateUnit = CreateUnit_Hook
function CreateUnitHook takes yadda..
    local unit Unit = Create##Unit(yadda..)
    //Set Unit Hp
    return Unit
endfunction

I'm sure theres also an easy way in GUI, but you might have to look for it.
 
Level 6
Joined
Mar 22, 2009
Messages
276
you dont need that ability thingy.
what you need to do is like this:
EX. a unit has 100 Max HP
Variable D as integer
D will represent our difficulty.
Formula: Unit - Set life of YOURUNIT to life of (YOURUNIT x D)
HARD 100% = 100 HP
MEDIUM 75% = 75 HP
EASY 50% = 50 HP
VERY EASY 25% - 25 HP

If difficulty = hard then D = 1 Unit - Set life of YOURUNIT to life of (YOURUNIT x D) or the action can be nothing because if we multiply it by 1 we'll get the same answer 100HP.
If difficulty = medium then D = .75 the action will be: Unit - Set life of YOURUNIT to life of (YOURUNIT x D) then it will be 75HP.

and so on.

You just need to subract hp from them and not to add, its much easier.
Just set their max HP as the HARDEST difficulty.
 
Last edited:
Level 2
Joined
Jul 22, 2007
Messages
8
Ahh didn't think of doing it that way, thank you


And ya, jass : \ haven't had the time learn it yet
 
Level 12
Joined
Mar 10, 2008
Messages
869
Make Very Hard 150% hp - 150% Handicap
Make Hard 125% hp - 125% Handicap
Make Medium 100% hp - 100% Handicap
Make Easy 75% hp - 75% Handicap
Make Very Easy 50% hp - 50% Handicap

Use:
  • Player - Set Handicap
For it to apply to the units that the players have to kill, apply it to your computer player that owns the spawns.

Yes you can make it higher than 100%.
 
Level 9
Joined
Oct 22, 2006
Messages
599
Anyone happen to have an easy method for doing a flat % increase to spawned units based on a chosen difficulty?

I thought of creating and adding an ability to them, but I can only seem to add int's instead of straight percentages.

Thanks

There is a value in regeneration abilities like Unholy Aura which you can tick/untick to enable percentage, just so you know. The best solution is Handicap in my opinion.
 
Level 3
Joined
Mar 28, 2009
Messages
75
You can also create a life upgrade for the spawned units that increase their life
Then you set the level of the ability depending of the difficulty
Ex :
Event - (YOUR EVENT)
If - (Unit is from Player 12)
-Difficulty is Hard
Set level of Life Upgrade for Player 12 to level 3

Player 12 is the creep player here
That normally work fine
 
Last edited:
Status
Not open for further replies.
Top