Experience System No Split of Experience between Heroes

colinjames12

Member
Reaction score
0
Hello i would like the heroes to not split the experience between each other when they kill a creep so I disabled the experience and make my own using triggers.
My problem is that I'm not sure what equation to use that would be similar to the one in gameplay constants.
Here's what I did with the hero exp gained.
Hero Exp Gained - normal, constant factor = 5
Hero Exp Gained - normal, level factor = 5
Hero Exp Gained - normal, previous value factor = 1
Hero Exp Gained - normal, table = 10
Hero Exp Gained - creep reduction table = 100, 95 ,90 ,85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25

The equation of the experience gained during gameplay is
(previous value) * (previous value factor) + (level) * (level factor) + (constant factor)

level 1 unit killed - exp gained = 10 * creep reduction table 100 % = 10
level 2 = 25 * 95% = 23.75
level 3 = 45 * 90% = 40.5

From what I saw in another post, in order for the experience gain to not split between heroes, I have to trigger the equation, but I'm not sure what the equation will be?

So it's like solving the formula of a sequence, is anybody good in math here?
I mean I'm good in math but it's summer if you know what I mean.
 

ultimate11

Active Member
Reaction score
25
Well you can do it easy way or hard way.
Trigger:
  • Event
    • A unit dies
    • Conditions
      • Owner of (triggering unit) not equal to owner of (killing unit)
    • Actions
      • Set - Integer[1] = Level of (triggering unit)
      • Set - Integer[2] = Level of (killing unit)
      • Set - Integer[3] = Your_XP_factor
      • Set - Integer[4] = Your_XP_factor_reduction
      • Set - Integer[5] = (Integer[3]/(Integer[2]xInteger[4]))xInteger[1])
      • Hero - Add experience (Integer[5]) to (killing unit)
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Isn't it in Gameplay Constants? Hero Maximum XP Gain Range and Hero XP - Global Distribution.
 

colinjames12

Member
Reaction score
0
I saw in another post that to not split the experience between heroes, I need to trigger the data from the gameplay constants and make my own experience gain. So what I need is the equation similar to the gameplay constants.
 

colinjames12

Member
Reaction score
0
I've made a new one now. Can someone tell me if this will work?
Trigger:
  • exp system
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Neutral Hostile
      • ((Killing unit) is A Hero) Equal to True
    • Actions
      • Set experiencegain_Copy = (All allies of (Owner of (Killing unit)))
      • Floating Text - Create floating text that reads (EXP+ + (String(((Hero experience of (Killing unit)) - heroexp[(Player number of (Owner of (Killing unit)))])))) above (Dying unit) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 25.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
      • Player Group - Pick every player in experiencegain_Copy and do (Actions)
        • Loop - Actions
          • Set experiencepoint = (Position of (Killing unit))
          • Set experiencegain = (Units within 1000000.00 of experiencepoint matching ((((Matching unit) is A Hero) Equal to True) and ((Owner of (Matching unit)) Equal to (Picked player))))
          • Unit Group - Pick every unit in experiencegain and do (Actions)
            • Loop - Actions
              • Hero - Add ((Hero experience of (Killing unit)) - heroexp[(Player number of (Owner of (Killing unit)))]) experience to (Picked unit), Show level-up graphics
          • Custom script: call DestroyGroup(udg_experiencegain)
          • Custom script: call RemoveLocation(udg_experiencepoint)
      • Set heroexp[(Player number of (Owner of (Killing unit)))] = (Hero experience of (Killing unit))
      • Custom script: call DestroyForce(udg_experiencegain_Copy)
 

OMGOMGOMG

UMBWGMG (Unidentified Human Being.)
Reaction score
28
If you want to see if this works then add a
Trigger:
  • Game - Display to all players the text TEST
and then just create a neutral hostile with 2 heroes near it (Both from different players) and force the heroes to kill the hostile unit. if the experience isn't shared then theres something wrong with it.
 

colinjames12

Member
Reaction score
0
it works but it doesn't work fine. when i tested it, i've encountered a bug. I can't really explain in words how the bug occurs but what happens is that when the trigger is executed by different heroes, the variable heroexp is altered. For example, when a lvl 10 hero kills a lvl 2 goblin, the hero gains an enormous amount of exp which makes him lvl up to lvl 16.

I can't really explain it well but I hope some expert on this problem will have a good answer. Need response quickly.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
It might be because a player has more than one hero, since the variable for Player 1 is changed to the experience of the last Player 1 hero that killed a unit.
 

colinjames12

Member
Reaction score
0
no, every player has only one hero so that can't happen but I think it's how i set the variable "heroexp". I think it should be placed inside the unit group instead. I'm gonna try to test it and see what happens.
 

OMGOMGOMG

UMBWGMG (Unidentified Human Being.)
Reaction score
28
IT could be because theres more than 1 person in experience gain or it could be cause of the
Set experiencegain = (Units within 1000000.00 of experiencepoint matching ((((Matching unit) is A Hero) Equal to True) and ((Owner of (Matching unit)) Equal to (Picked player)))).Try changing the underlined part to 1000.00
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top