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!
Well, you can turn off the default XP gain in Gameplay Constants.
To turn off bounty, you can either do it in the object editor, or use this action at map init:
Player - Turn Gives bounty Off for Neutral Hostile
(Player -> Turn Player Flag On/Off).
To give the Experience and gold to the killing unit, you can set up a simple table at map init as well (right below the bounty-action) which goes a bit like this:
Actions
Set UnitCount = (UnitCount + 1)
Set UnitType[UnitCount] = Footman
Set BountyBase[UnitCount] = 10
Set ExpBase[UnitCount] = 50
-------- --------
Set UnitCount = (UnitCount + 1)
Set UnitType[UnitCount] = Rifleman
Set BountyBase[UnitCount] = 50
Set ExpBase[UnitCount] = 100
-------- --------
Set UnitCount = (UnitCount + 1)
Set UnitType[UnitCount] = Knight
Set BountyBase[UnitCount] = 180
Set ExpBase[UnitCount] = 500
Where:
UnitType[X] = the unit type of the killed unit (unit type variable with array).
BountyBase[X] = the gold received when the unit is killed (integer variable with array).
ExpBase[X] = the xp gained when the unit is killed (integer variable with array).
UnitCount = a regular integer variable to count the amount of units.
When this is done, you can create a trigger that activates every time a unit dies.
It will check the unit type of the dying unit and will give XP and gold according to that type.
Bounty XP
Events
Unit - A unit Dies
Conditions
Actions
For each (Integer LoopInt) from 1 to UnitCount, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Dying unit)) Equal to UnitType[LoopInt]
Player - Add BountyBase[LoopInt] to (Owner of (Killing unit)) Current gold
Else - Actions
(LoopInt is an integer variable)
If you want the XP/Bounty to appear as a text in the game, you need to add a lot of actions - but it can be worth it ^^
Bounty XP
Events
Unit - A unit Dies
Conditions
Actions
For each (Integer LoopInt) from 1 to UnitCount, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Dying unit)) Equal to UnitType[LoopInt]
Then - Actions
Set TempLoc = (Position of (Killing unit))
Custom script: if GetLocalPlayer() == GetOwningPlayer(GetKillingUnit()) then
Floating Text - Create floating text that reads |c007788cc+ ExpBase[LoopInt] |r at TempLoc with Z offset 10.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 52.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
Floating Text - Change the lifespan of (Last created floating text) to 3.00
Custom script: if GetLocalPlayer() == GetOwningPlayer(GetKillingUnit()) then
Floating Text - Create floating text that reads |c00ffdc00+ BountyBase[LoopInt] |r at TempLoc with Z offset 80.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 52.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
Floating Text - Change the lifespan of (Last created floating text) to 3.00
Custom script: endif
Custom script: call RemoveLocation(udg_TempLoc)
Player - Add BountyBase[LoopInt] to (Owner of (Killing unit)) Current gold
you can use apocalypse's idea but this is much simpler
event:Unit-A unit dies
conditionfor specific units)(Triggering unit) Equal to (unit)
(for unit types)(Unit-type of (Triggering unit) Equal to (Unit type)
Action:Hero-Add (number of exp) experience to (Killing unit), Show(or hide) level-up graphics
Player-Add (number of gold) to (Owner of (Killing unit)) Current gold
But this way, I need to add custom expereince and gold for every unit hero kills and I need to do this only for one unit hero kills. I need bounty and expereince to work for all others kills.
You should've made that clear that in the first place >.>
Learn how to write a proper question.
Quickly Enabling/Disabling the bounty/experience won't work.
Is there anything else we need to know that could be useful? Are there any other units near that 'boss', do you have to enter some kind of area, ...?
And just to get things straight: you can't calculate the amount of XP it gives by default and substract it from 300, right?
(so if it usually gives 120xp, you could trigger it to give +180xp for a total of 300xp - which is exactly the same result).
And the bounty can also not be done through the object editor? (Since you CAN let a single creep give +190 gold by default).
And may I also know why all of this isn't possible?
All things in your list are impossible because the unit which is killed triggers destruction of many other units and buildings. So Hero gets xp from all buildings and gold from all units.
All things in your list are impossible because the unit which is killed triggers destruction of many other units and buildings. So Hero gets xp from all buildings and gold from all units.
If you want the hero to gain experience/gold from all the buildings/units he destroys, then you should just set the values in the object editor to let the boss give +190 gold and trigger it to give +X gold (where X is 300 - the default experience it gives).
If you don't want the hero to gain experience/gold from those, then you should disable the experience/bounty with the event "Boss is attacked" (which will be activated right before it hits) and re-enable when the boss died (or a second after the impact if the boss is still alive).
The attacked event runs before damage is dealt >.< You should use a damage event instead. Also you have to disable the bounty for the owner of theattacked/damaged units and please no double posts
The attacked event runs before damage is dealt >.< You should use a damage event instead. Also you have to disable the bounty for the owner of theattacked/damaged units and please no double posts
No, that was exactly the point: the bounty should be turned off before the unit dies, otherwise he would still get the bounty.
The "Run After Attack" is useless though, why didn't you just put the other actions after the wait instead of creating a seperate trigger for them?
So the Mountain King is your hero and the footman is the unit that you don't want to give default exp/gold, right?
I'll check it out later, gotta study now.
Well, you can turn off the default XP gain in Gameplay Constants.
To turn off bounty, you can either do it in the object editor, or use this action at map init:
Player - Turn Gives bounty Off for Neutral Hostile
(Player -> Turn Player Flag On/Off).
To give the Experience and gold to the killing unit, you can set up a simple table at map init as well (right below the bounty-action) which goes a bit like this:
Actions
Set UnitCount = (UnitCount + 1)
Set UnitType[UnitCount] = Footman
Set BountyBase[UnitCount] = 10
Set ExpBase[UnitCount] = 50
-------- --------
Set UnitCount = (UnitCount + 1)
Set UnitType[UnitCount] = Rifleman
Set BountyBase[UnitCount] = 50
Set ExpBase[UnitCount] = 100
-------- --------
Set UnitCount = (UnitCount + 1)
Set UnitType[UnitCount] = Knight
Set BountyBase[UnitCount] = 180
Set ExpBase[UnitCount] = 500
Where:
UnitType[X] = the unit type of the killed unit (unit type variable with array).
BountyBase[X] = the gold received when the unit is killed (integer variable with array).
ExpBase[X] = the xp gained when the unit is killed (integer variable with array).
UnitCount = a regular integer variable to count the amount of units.
When this is done, you can create a trigger that activates every time a unit dies.
It will check the unit type of the dying unit and will give XP and gold according to that type.
Bounty XP
Events
Unit - A unit Dies
Conditions
Actions
For each (Integer LoopInt) from 1 to UnitCount, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Dying unit)) Equal to UnitType[LoopInt]
Player - Add BountyBase[LoopInt] to (Owner of (Killing unit)) Current gold
Else - Actions
(LoopInt is an integer variable)
If you want the XP/Bounty to appear as a text in the game, you need to add a lot of actions - but it can be worth it ^^
Bounty XP
Events
Unit - A unit Dies
Conditions
Actions
For each (Integer LoopInt) from 1 to UnitCount, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Dying unit)) Equal to UnitType[LoopInt]
Then - Actions
Set TempLoc = (Position of (Killing unit))
Custom script: if GetLocalPlayer() == GetOwningPlayer(GetKillingUnit()) then
Floating Text - Create floating text that reads |c007788cc+ ExpBase[LoopInt] |r at TempLoc with Z offset 10.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 52.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
Floating Text - Change the lifespan of (Last created floating text) to 3.00
Custom script: if GetLocalPlayer() == GetOwningPlayer(GetKillingUnit()) then
Floating Text - Create floating text that reads |c00ffdc00+ BountyBase[LoopInt] |r at TempLoc with Z offset 80.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 52.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
Floating Text - Change the lifespan of (Last created floating text) to 3.00
Custom script: endif
Custom script: call RemoveLocation(udg_TempLoc)
Player - Add BountyBase[LoopInt] to (Owner of (Killing unit)) Current gold
So the Mountain King is your hero and the footman is the unit that you don't want to give default exp/gold, right?
I'll check it out later, gotta study now.
Correct, I mixed it up with "Unit dies" event - sorry for the mixup
Either way, I don't see the point in creating a damage detection system (or copy one) if the "Unit is attacked" can't be abused here and should work as well
I felt this would be relevant to ask in this thread instead of making my own, but what is the default exp formula? I wanted to show a +## in my map when a unit dies. How is it calculated, like when there's heroes around and whatnot.
I felt this would be relevant to ask in this thread instead of making my own, but what is the default exp formula? I wanted to show a +## in my map when a unit dies. How is it calculated, like when there's heroes around and whatnot.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.