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

[Solved] Experience Bonus for Specified Hero

Status
Not open for further replies.

KPC

KPC

Level 7
Joined
Jun 15, 2018
Messages
195
Hi, I want to create a "Book of Learning" whereby the Hero who holds this item will get 50% more experience. Let's start with the fact that it is not easy. You can't just use it:
  • Hero - Make Player 1 (Red) Heroes gain 100.00% experience from future kills
Because this increases the experience gain for each hero of a specific player.

So you will have to manually increase the amount of experience for the hero with this item. Knowing the mechanics of the game experience is essential. I will describe it below:

Let's start with the fact that always experience is shared between Heroes that belongs to owner of killing unit or his allies.

This mechanic works if there is no Hero within 1200 range of dying unit:

1. The experience is awarded globally without loss due to the distance you are away.
2. Experience is shared between all heroes currently on the map

The exception to such mechanics is the situation in which there is a hero within 1200 range:

1. The experience is shared only to Heroes which are in 1200 range from dying unit.

There is experience bonus for killing due to Tech (Tier of Hall):

If Player have only one Hero (including dead heroes and heroes being trained), he'll receive extra experience points if he's either on tier 2 or tier 3.
Tier 1 - 100%
Tier 2 - 115%
Tier 3 - 130%
If Player starts training another Hero or he has more than one already (including dead heroes) he will get normal experience bonus ratio.

High level = less experience from creeping:

It is known that if your hero is level 5, he no longer gains experience for killing creeps.
But you also get less experience every time your hero gains a level:
1543583598_xp-corrected-creep.PNG


Summoned units gives 50% experience.

Now you should know how much experience you get for killing a particular unit or hero:
1543445025_exp3.PNG

1543445016_exp2.PNG


When it comes to the mechanics of gaining experience, that's all. If it is not legible read the article I used to make this note: Hero Experience In Warcraft 3: How It Works

Now let's focus on stages of triggers:

First we need to collect data needed to calculate the value of the experience granted:

Here is pattern: (Pure Experience)/(Amount of Heroes)x(Tech Tier Bonus)x(Book of Learing Value)x(Creeps Reduction (if need))

Pure Experience:
We need two arrays of integers UnitsExperience and HeroesExperience. Then we need to set them due to level:

UnitsExperience[1] = 25
UnitsExperience[2] = 40
...
UnitsExperience[10] = 340

HeroesExperience[1] = 100
HeroesExperience[2] = 120
...
HeroesExperience[10] = 800

Amount of Heroes:
I have a little problem with this one. In this variable I need to store ammount of Heroes owned by player who killed unit or his allies. We have two cases:
1. No Heroes in 1200 range from dying unit
2. There is/are Hero/Heroes in this range

Due to this we set Ammount of Heroes to:
1. Units in Playable Map Area of type Hero, owned by Player (Owner of Killing Unit) or Ally of him.
2. Units within 1200 range of Position of Dying Unit of type Hero, owned by Player (Owner of Killing Unit) or Ally of him.

Tech Tier Bonus:
I found a way to count this one. I will put triggers later.

Book of Learining Value:
On the start we can set it to 1 to simplify tests or calculations.

Creeps Reduction:
Also easy to make.

  • Setup Experience
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Setup TechBonusMultipler --------
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set VariableSet TechBonusMultipler[(Integer A)] = 1.00
      • -------- Setup CreepsMultipler --------
      • Set VariableSet CreepsMultipler[1] = 0.80
      • Set VariableSet CreepsMultipler[2] = 0.70
      • Set VariableSet CreepsMultipler[3] = 0.60
      • Set VariableSet CreepsMultipler[4] = 0.50
      • For each (Integer A) from 5 to 20, do (Actions)
        • Loop - Actions
          • Set VariableSet CreepsMultipler[(Integer A)] = 0.00
      • -------- Setup UnitsExperience --------
      • Set VariableSet TempScalar = 5
      • Set VariableSet Scalar = 15
      • For each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • Set VariableSet TempScalar = (TempScalar + 5)
          • Set VariableSet Scalar = (Scalar + TempScalar)
          • Set VariableSet UnitsExperience[(Integer A)] = Scalar
      • -------- Setup HeroExperience --------
      • Set VariableSet TempScalar = -20
      • Set VariableSet Scalar = 100
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set VariableSet TempScalar = (TempScalar + 20)
          • Set VariableSet Scalar = (Scalar + TempScalar)
          • Set VariableSet HeroesExperience[(Integer A)] = Scalar
      • Set VariableSet Scalar = 200
      • For each (Integer A) from 5 to 20, do (Actions)
        • Loop - Actions
          • Set VariableSet HeroesExperience[(Integer A)] = (Scalar + 100)
  • Train Hero
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(Paladin))
          • (Issued order) Equal to (Order(Archmage))
          • (Issued order) Equal to (Order(Mountain King))
          • (Issued order) Equal to (Order(Blood Mage))
          • (Issued order) Equal to (Order(Blademaster))
          • (Issued order) Equal to (Order(Far Seer))
          • (Issued order) Equal to (Order(Tauren Chieftain))
          • (Issued order) Equal to (Order(Shadow Hunter))
          • (Issued order) Equal to (Order(Death Knight))
          • (Issued order) Equal to (Order(Lich))
          • (Issued order) Equal to (Order(Dreadlord))
          • (Issued order) Equal to (Order(Crypt Lord))
          • (Issued order) Equal to (Order(Keeper of the Grove))
          • (Issued order) Equal to (Order(Priestess of the Moon))
          • (Issued order) Equal to (Order(Demon Hunter))
          • (Issued order) Equal to (Order(Warden))
          • (Issued order) Equal to (Order(Alchemist))
          • (Issued order) Equal to (Order(Sea Witch))
          • (Issued order) Equal to (Order(Tinker))
          • (Issued order) Equal to (Order(Beastmaster))
          • (Issued order) Equal to (Order(Brewmaster))
          • (Issued order) Equal to (Order(Dark Ranger))
          • (Issued order) Equal to (Order(Firelord))
          • (Issued order) Equal to (Order(Pit Lord))
    • Actions
      • -------- When Player Begins Training a Hero --------
      • -------- Increases Heroes Amount for him (0, 1, 2, 3) --------
      • Set VariableSet HeroesAmount[(Player number of (Owner of (Triggering unit)))] = (HeroesAmount[(Player number of (Owner of (Triggering unit)))] + 1)
      • -------- When Player has more than 1 Hero --------
      • -------- TechBonusMultipler = 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroesAmount[(Player number of (Owner of (Triggering unit)))] Greater than 1
        • Then - Actions
          • Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.00
        • Else - Actions
  • Cancel Hero
    • Events
      • Unit - A unit Cancels training a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Altar of Kings
          • (Unit-type of (Triggering unit)) Equal to Altar of Storms
          • (Unit-type of (Triggering unit)) Equal to Altar of Darkness
          • (Unit-type of (Triggering unit)) Equal to Altar of Elders
    • Actions
      • -------- When Player Cancels Training a Hero --------
      • -------- Decreases Heroes Amount for him (0, 1, 2, 3) --------
      • Set VariableSet HeroesAmount[(Player number of (Owner of (Triggering unit)))] = (HeroesAmount[(Player number of (Owner of (Triggering unit)))] - 1)
      • -------- For each checks if Player has at most 1 Hero --------
      • -------- TechBonusMultipler = 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroesAmount[(Player number of (Owner of (Triggering unit)))] Less than or equal to 1
        • Then - Actions
          • Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.00
        • Else - Actions
      • -------- TechBonusMultipler = 1.15 when Player has T2 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroesAmount[(Player number of (Owner of (Triggering unit)))] Less than or equal to 1
          • Or - Any (Conditions) are true
            • Conditions
              • (Number of living Keep units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Stronghold units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Halls of the Dead units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Tree of Ages units owned by (Owner of (Triggering unit))) Greater than or equal to 1
        • Then - Actions
          • Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.15
        • Else - Actions
      • -------- TechBonusMultipler = 1.3 when Player has T3 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroesAmount[(Player number of (Owner of (Triggering unit)))] Less than or equal to 1
          • Or - Any (Conditions) are true
            • Conditions
              • (Number of living Castle units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Fortress units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Black Citadel units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Tree of Eternity units owned by (Owner of (Triggering unit))) Greater than or equal to 1
        • Then - Actions
          • Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.30
        • Else - Actions
  • Tech Bonus
    • Events
      • Unit - A unit Finishes construction
      • Unit - A unit Finishes an upgrade
      • Unit - A unit Dies
    • Conditions
      • HeroesAmount[(Player number of (Owner of (Triggering unit)))] Less than or equal to 1
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Keep
          • (Unit-type of (Triggering unit)) Equal to Castle
          • (Unit-type of (Triggering unit)) Equal to Stronghold
          • (Unit-type of (Triggering unit)) Equal to Fortress
          • (Unit-type of (Triggering unit)) Equal to Halls of the Dead
          • (Unit-type of (Triggering unit)) Equal to Black Citadel
          • (Unit-type of (Triggering unit)) Equal to Tree of Ages
          • (Unit-type of (Triggering unit)) Equal to Tree of Eternity
    • Actions
      • -------- When Player Finishes tech or lose it --------
      • -------- Changes TechBonusMultipler dependently --------
      • Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.00
      • -------- TechBonusMultipler = 1.15 when Player has T2 and 1 Hero --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Number of living Keep units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Stronghold units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Halls of the Dead units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Tree of Ages units owned by (Owner of (Triggering unit))) Greater than or equal to 1
        • Then - Actions
          • Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.15
        • Else - Actions
      • -------- TechBonusMultipler = 1.3 when Player has T3 and 1 Hero --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Number of living Castle units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Fortress units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Black Citadel units owned by (Owner of (Triggering unit))) Greater than or equal to 1
              • (Number of living Tree of Eternity units owned by (Owner of (Triggering unit))) Greater than or equal to 1
        • Then - Actions
          • Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.30
        • Else - Actions
  • Book of Learning
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • -------- Picks Heroes that belongs to owner of killing unit or his allies in 1200 area --------
      • -------- --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 1200.00 of (Position of (Dying unit)).) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Killing unit)) is an ally of (Owner of (Picked unit)).) Equal to True
              • ((Owner of (Dying unit)) is an enemy of (Owner of (Picked unit)).) Equal to True
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • -------- --------
              • -------- FullHeroes = Count units is this group --------
              • -------- We will use this value to verify if there are 0 Heroes in 1200 range --------
              • -------- In this case we need to: FullHeroes = Cout each Hero in entire map that belongs to owner of killing unit or his allies --------
              • -------- This value will be used to count sharing experience --------
              • Unit Group - Add (Picked unit) to TempUnitGroup
              • Set VariableSet FullHeroes = (Number of units in TempUnitGroup)
              • -------- --------
              • -------- Here we have each Hero in 1200 range or in whloe Map --------
              • -------- Now we want to save only those with the item - Book of Learining --------
              • -------- For later giving the Experience --------
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has an item of type |cffffcc00Book of Learning|r) Equal to True
                • Then - Actions
                  • -------- Now we check if dying unit is Hero/Creep/Summon/Unit --------
                  • -------- Killing Hero: --------
                  • -------- Uses HeroesExperience values to count ExperienceGained --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Dying unit) is A Hero) Equal to True
                      • (Owner of (Dying unit)) Not equal to Neutral Hostile
                    • Then - Actions
                      • Set VariableSet ExperienceGained = (Integer((((Real(HeroesExperience[(Hero level of (Dying unit))])) / (Real(FullHeroes))) x (1.00 x TechBonusMultipler[(Player number of (Owner of (Picked unit)))]))))
                    • Else - Actions
                  • -------- --------
                  • -------- Summon: --------
                  • -------- Uses UnitsExperience values and 50% multipler to count ExperienceGained --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Dying unit) is Summoned) Equal to True
                      • (Owner of (Dying unit)) Not equal to Neutral Hostile
                    • Then - Actions
                      • Set VariableSet ExperienceGained = (Integer((((Real((UnitsExperience[(Level of (Dying unit))] / 2))) / (Real(FullHeroes))) x (1.00 x TechBonusMultipler[(Player number of (Owner of (Picked unit)))]))))
                    • Else - Actions
                  • -------- --------
                  • -------- Unit: --------
                  • -------- Uses UnitsExperience values to count ExperienceGained --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Dying unit) is Summoned) Equal to False
                      • (Owner of (Dying unit)) Not equal to Neutral Hostile
                    • Then - Actions
                      • Set VariableSet ExperienceGained = (Integer((((Real(UnitsExperience[(Level of (Dying unit))])) / (Real(FullHeroes))) x (1.00 x TechBonusMultipler[(Player number of (Owner of (Picked unit)))]))))
                    • Else - Actions
                  • -------- --------
                  • -------- Creep: --------
                  • -------- Uses UnitsExperience values to count ExperienceGained --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Dying unit)) Equal to Neutral Hostile
                    • Then - Actions
                      • Set VariableSet ExperienceGained = (Integer((((Real(UnitsExperience[(Level of (Dying unit))])) / (Real(FullHeroes))) x ((CreepsMultipler[(Level of (Picked unit))] x 1.00) x TechBonusMultipler[(Player number of (Owner of (Picked unit)))]))))
                    • Else - Actions
                  • -------- --------
                  • -------- Creep Summon: --------
                  • -------- Uses UnitsExperience values to count ExperienceGained --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Dying unit)) Equal to Neutral Hostile
                      • ((Dying unit) is Summoned) Equal to True
                    • Then - Actions
                      • Set VariableSet ExperienceGained = (Integer((((Real(UnitsExperience[(Level of (Dying unit))])) / (Real(FullHeroes))) x ((CreepsMultipler[(Level of (Picked unit))] x (1.00 x 0.50)) x TechBonusMultipler[(Player number of (Owner of (Picked unit)))]))))
                    • Else - Actions
                  • -------- --------
                  • Hero - Add ExperienceGained experience to (Picked unit), Hide level-up graphics
                  • Unit Group - Remove all units from TempUnitGroup.
                • Else - Actions
            • Else - Actions
So far I made it for Heroes in 1200 Range. But I have problem with picking all Heroes in map in the same trigger using picked units. :/
 

Attachments

  • Book of Learining.w3m
    25.4 KB · Views: 20
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
You would compare your Heroes old experience with it's current experience (which could be a larger value now) and if there's a change then you calculate the difference and amplify it.

A unit dies
If OldExperience Less Than CurrentExperience -> Set Difference = CurrentExperience - OldExperience
Set Difference = Difference * ExpMultiplier
Add Difference to your Hero (add the extra experience)
Set OldExperience = CurrentExperience

OldExperience would be an Integer Array that you could track using Unit Indexing. CurrentExperience is just the Current Experience of the Hero, which you get through a function. ExpMultiplier is a Real that would increase/decrease the total exp gained, so this is what your Books of Learning would modify. You could track it using an Array/Unit Indexer or calculate it at the time of Exp Gain (former seems more efficient). Difference is a Real that's used to figure out how much Exp was gained.

  • Exp
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set VariableSet ExpMultiplier = 2.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • OldExperience Less than (Hero experience of Paladin 0001 <gen>)
        • Then - Actions
          • Set VariableSet Difference = ((Real((Hero experience of Paladin 0001 <gen>))) - (Real(OldExperience)))
          • Game - Display to (All players) for 30.00 seconds the text: (Exp Gained: + (String(Difference)))
          • Set VariableSet Difference = (Difference x ExpMultiplier)
          • Game - Display to (All players) for 30.00 seconds the text: (Exp Gained After Multiplier: + (String(Difference)))
          • Hero - Add (Integer(Difference)) experience to Paladin 0001 <gen>, Show level-up graphics
        • Else - Actions
      • Set VariableSet OldExperience = (Hero experience of Paladin 0001 <gen>)
Now this example doesn't make use of Unit Indexing or Arrays, but the concept is there. I tested it and it works great.

This of course assumes that our Paladin Hero is ALWAYS within range of the Dying unit, and that it's always an Enemy that died.

This also doesn't account for other Events that might add Experience (acquiring a Tome of Experience for example). Also, adding Experience through triggers would need to be adjusted to take into consideration ExpMultiplier.
 

Attachments

  • Exp Demo.w3m
    17.6 KB · Views: 20
Last edited:
  • Like
Reactions: KPC

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
With Arrays and Unit Indexing. Like I said, OldExperience and ExpMultiplier need to be an Array. You put in the custom value of your Hero as the Index.

But you can make ExpMultiplier a non-array if you want to calculate it on the spot instead of at the time of acquiring the Books of Learning. This seems very inefficient so I only mention it because it IS possible, but not recommended.
 
Last edited:
  • Like
Reactions: KPC

KPC

KPC

Level 7
Joined
Jun 15, 2018
Messages
195
  • Exp
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set VariableSet CV = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • OldExperience[CV] Less than (Hero experience of (Picked unit))
            • Then - Actions
              • Set VariableSet Difference = ((Real((Hero experience of (Picked unit)))) - (Real(OldExperience[CV])))
              • Set VariableSet Difference = (Difference x ExpMultiplier)
              • Hero - Add (Integer(Difference)) experience to (Picked unit), Show level-up graphics
            • Else - Actions
          • Set VariableSet OldExperience[CV] = (Hero experience of (Picked unit))
I thought it will work but it is not working for many Heroes... I think I'm doing somthing wrong with unit indexing.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Where are you setting ExpMultiplier? Looks like it's still set to 0, and since you're multiplying Difference by 0 the result will always be 0.

ExpMultiplier is a Real value that will be tracked for each individual Hero. It's default value should be 1.0, since it gets increased/decreased depending on the number of Books of Learning the Hero has equipped.

So when you Acquire a Book of Learning, you would do:
  • Set Variable CV = Custom value of Hero manipulating item
  • Set Variable ExpMultiplier[CV] = ExpMultiplier[CV] + 0.25
Then subtract 0.25 when you Lose it.

This results in a 25% Exp increase per Book.
 
Last edited:

KPC

KPC

Level 7
Joined
Jun 15, 2018
Messages
195
  • Exp Copy
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set VariableSet ExpMultiplier = 1.00
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set VariableSet CV = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
              • OldExperience[CV] Less than (Hero experience of (Picked unit))
            • Then - Actions
              • Set VariableSet Difference = ((Real((Hero experience of (Picked unit)))) - (Real(OldExperience[CV])))
              • Game - Display to (All players) for 30.00 seconds the text: (Exp Gained: + (String(Difference)))
              • Set VariableSet Difference = (Difference x ExpMultiplier)
              • Game - Display to (All players) for 30.00 seconds the text: (Exp Gained After Multiplier: + (String(Difference)))
              • Hero - Add (Integer(Difference)) experience to (Picked unit), Show level-up graphics
            • Else - Actions
          • Set VariableSet OldExperience[CV] = (Hero experience of (Picked unit))
There must be something wrong with that. I mean I had Exp Multiplier set to 1 (for testing I wanted it to be a constant variable for simplify).
I'm not sure how Pick Units works with its Picked Units. Is it loop for each picked unit working one by one through all units? Because it seems not.
Is it ok that I'm using CV value like this? One I use Picked Unit and once CV for its index. I don't know if it is not mixed.
Error appear like this: when I have more than one Hero whole trigger is working only for one and calculations are broken (Difference increasing too fast)
 

Attachments

  • Exp Demo (2).w3m
    18 KB · Views: 20

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
There is no Unit Indexer in that demo map. All of the unit's have a default Custom Value of 0, the Unit Indexer is what assigns them a unique value.

Edit: Hold on, maybe it's not working. Messing around with it.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Okay, I figured it out. Hopefully you didn't download the map I uploaded a moment ago. The default value for Exp Multiplier should be 0, and you should multiply the Difference by this value. So if you gained 10 base exp, it would multiply 10 * ExpMultiplier (0 by default), and Add that much bonus Exp to the Hero. So if your ExpMultiplier was still 0 (no Books of Learning equipped), you'd get 0 BONUS Exp, however, if your ExpMultiplier was > 0, you'd get Exp*ExpMultiplier as bonus Exp.

I attached a working example.
 

Attachments

  • Exp Demo Fixed.w3m
    23.6 KB · Views: 20
Last edited:

KPC

KPC

Level 7
Joined
Jun 15, 2018
Messages
195
I used to test features on my map where I have unit indexer and damage engine. So I totally forgot to include it to the demo map. Forgive me this oversight ^^
Anyways as always thanks for help @Uncle!
 
Status
Not open for further replies.
Top