• 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.

Upgrade "Decrement"

Status
Not open for further replies.
Level 9
Joined
May 21, 2014
Messages
580
Hello, Hive! I have searched the Internet for my issues and I have not gotten anything so far.

Upgrades in Warcraft 3 have "Increment" fields, where it adds the increment value to the base for each upgrade done.

I have thought doing the reverse of this: Setting the increment value to a negative number so it "decrements."

I have tested it: It doesn't decrement from the base value. It rather uses the value to subtract from the current upgrade.

Let us say I have a HP Bonus Base of 100, and HP Bonus increment at 10.
For every upgrade, the HP will increase as follows (for every upgrade): (Current HP)+100, (Current HP)+110, (Current HP)+120... [with Current HP using the previous upgrade].

Now, I have a HP Bonus Base of 100, and HP Bonus Increment at -10.
WHat it does is that the First Upgrade will give 100 HP Bonus, which is fine. The next upgrade will subtract 10 from the Current HP of the unit he already has, in which it is supposed to give a 90 HP bonus.

Is there a way to decrement a value using these fields only? (No triggers)
 
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
WHat it does is that the First Upgrade will give 100 HP Bonus, which is fine. The next upgrade will subtract 10 from the Current HP of the unit, in which I expected it will give a 90 HP bonus.

Is there a way to decrement a value using these fields only? (No triggers)

it's not supposed to be 90 bonus hp at level 2? I don't think it says what's wrong.

I have tested it: It doesn't decrement from the base value. It rather uses the value to subtract from the current upgrade.

Edit: well in that case -110 (or -90) should work for level 2 at least, test it and see how it does with the next levels
 
Last edited:
Level 9
Joined
May 21, 2014
Messages
580
it's not supposed to be 90 bonus hp at level 2? I don't think it says what's wrong.



Edit: well in that case -110 (or -90) should work for level 2 at least, test it and see how it does with the next levels

What I mean here is that it should be at 90 Bonus HP.
What it really does is it Subtracts 10 from the current HP of the unit, instead of having an additional 90.

With this setup:

HP Bonus Base: 100
HP Bonus Increment: -10

Expected output: [2nd upgrade] HP Bonus will give a 90. [500 + 100 + 90 is the formula, given that 500 is the hp of the unit.]
WHat it does: [2nd upgrade] It decreases 10 from the HP of the unit. [500 + 100 -10]
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
If I understand you correctly, you want the following values:

Level 1: 100 hp (0 + 100)
Level 2: 190 hp (100 + 90)
Level 3: 270 hp (190 + 80)
etc

The only way I can think of doing this without using triggers (which would be very easy and recommended) would be to use multiple upgrades instead.

"HP Tier 1", Level 1: 100 hp
"HP Tier 2", Level 1: 90 hp
"HP Tier 3", Level 1: 80 hp
etc

Each one would require the one before it in tech requirements.

EDIT: The most basic triggered way I can think of:
Create an item ability that provides HP bonus. Set the HP bonus for each level as desired. The first time the upgrade is researched, give this ability to all the units that use the upgrade.
On subsequent researches, simply increase the level of this ability for units.
You will need a different trigger to set the level of the ability for newly trained units.
 
Level 12
Joined
Nov 3, 2013
Messages
989
if it's like what rulerofiron thinks and you're going to have a lot of levels then I think that adding hp through trigger w/ either tomes or adding and then removing hp ability would be more appropriate
 
Status
Not open for further replies.
Top