(Started from this thread and evolved into this, thanks to everyone from first thread who helped get me to this point.)
Hi. I have a map using Bribe's Unit Indexer and Damage System. I am using the Indexer to create mock attributes for non-heroes.
The idea was, for every level of the non-hero unit, they get to randomly distribute a point to Str, Agi, Int, Bonus Health, or Bonus Mana.
I was using Health Bonus level X 10 added to max health.
I changed my mind
@Tasyen provided me with a helpful summation equation
--
-edit1
@KILLCIDE gave me this helpful little table in the original thread, forgot to mention.
The equation from @Tasyen is the same thing I think? And this is when I was doing +20 health instead of +10.
--
What I'm trying to do:
I only want ODD levels to distribute a random point to either Str, Agi, or Int.
I only want EVEN levels to distribute a random point to either Health Bonus or Mana Bonus,
I am just so bad at thinking of the math I need. I am trying to use modulo to determine each even and odd occurrence from level 1 to the units level, so it will distribute a point to the available ability accordingly.
Does that make sense? The trigger I'm using was working, I thought, but then wouldn't add a bonus at all after level 3.
In my demo map, the wolves are level 3, so should distribute 2 points to either Str, Agi, or Int. They should distribute one to Health Bonus or Mana Bonus. You can move the wolf to the circle to show the scores, but I can't seem to get my "for" loop to the right spot for even/odd unit level.
Thanks for any assistance, really appreciate it, especially people from original thread.
Hi. I have a map using Bribe's Unit Indexer and Damage System. I am using the Indexer to create mock attributes for non-heroes.
-
Scaling HELP HERE please
-
Events
-
Game - UnitIndexEvent becomes Equal to 1.00
-
-
Conditions
-
(UDexUnits[UDex] is A Hero) Equal to False
-
-
Actions
-
-------- ------------------------------------------------------------------- --------
-
-------- \\ Wolf Level 3 --------
-
-------- ------------------------------------------------------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(UDexUnits[UDex] is A Hero) Equal to False
-
(Unit-type of UDexUnits[UDex]) Equal to Wolf
-
-
Then - Actions
-
-------- --------
-
-------- Set Strength Level --------
-
Unit - Remove Non-Hero Stats (Str) from UDexUnits[UDex]
-
-------- Set Agility Level --------
-
Unit - Set level of Non-Hero Stats (Agi) for UDexUnits[UDex] to 1
-
-------- Set Intelligence Level --------
-
Unit - Remove Non-Hero Stats (Int) from UDexUnits[UDex]
-
-------- Set Health Bonus Level --------
-
Unit - Remove Non-Hero Stats (Health Bonus)) from UDexUnits[UDex]
-
-------- Set Mana Bonus Level --------
-
Unit - Remove Non-Hero Stats (Mana Bonus)) from UDexUnits[UDex]
-
-------- --------
-
-------- Non Hero Distributes Stats --------
-
For each (Integer Integer1) from 1 to ((Level of UDexUnits[UDex]) mod 2), do (Actions)
-
Loop - Actions
-
Set NonHeroStatsRollToDistribute = (Random integer number between 1 and 3)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
NonHeroStatsRollToDistribute Equal to 1
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Non-Hero Stats (Str) for UDexUnits[UDex]) Equal to 0
-
-
Then - Actions
-
Unit - Add Non-Hero Stats (Str) to UDexUnits[UDex]
-
-
Else - Actions
-
Unit - Set level of Non-Hero Stats (Str) for UDexUnits[UDex] to ((Level of Non-Hero Stats (Str) for UDexUnits[UDex]) + 1)
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
NonHeroStatsRollToDistribute Equal to 2
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Non-Hero Stats (Agi) for UDexUnits[UDex]) Equal to 0
-
-
Then - Actions
-
Unit - Add Non-Hero Stats (Agi) to UDexUnits[UDex]
-
-
Else - Actions
-
Unit - Set level of Non-Hero Stats (Agi) for UDexUnits[UDex] to ((Level of Non-Hero Stats (Agi) for UDexUnits[UDex]) + 1)
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
NonHeroStatsRollToDistribute Equal to 3
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Non-Hero Stats (Int) for UDexUnits[UDex]) Equal to 0
-
-
Then - Actions
-
Unit - Add Non-Hero Stats (Int) to UDexUnits[UDex]
-
-
Else - Actions
-
Unit - Set level of Non-Hero Stats (Int) for UDexUnits[UDex] to ((Level of Non-Hero Stats (Int) for UDexUnits[UDex]) + 1)
-
-
-
-
Else - Actions
-
-
-
-
-
-
-
-
For each (Integer Integer2) from 1 to ((Level of UDexUnits[UDex]) mod 2), do (Actions)
-
Loop - Actions
-
Set NonHeroStatsRollToDistribute = (Random integer number between 4 and 5)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
NonHeroStatsRollToDistribute Equal to 4
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Non-Hero Stats (Health Bonus)) for UDexUnits[UDex]) Equal to 0
-
-
Then - Actions
-
Unit - Add Non-Hero Stats (Health Bonus)) to UDexUnits[UDex]
-
-
Else - Actions
-
Unit - Set level of Non-Hero Stats (Health Bonus)) for UDexUnits[UDex] to ((Level of Non-Hero Stats (Health Bonus)) for UDexUnits[UDex]) + 1)
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
NonHeroStatsRollToDistribute Equal to 5
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Non-Hero Stats (Mana Bonus)) for UDexUnits[UDex]) Equal to 0
-
-
Then - Actions
-
Unit - Add Non-Hero Stats (Mana Bonus)) to UDexUnits[UDex]
-
-
Else - Actions
-
Unit - Set level of Non-Hero Stats (Mana Bonus)) for UDexUnits[UDex] to ((Level of Non-Hero Stats (Mana Bonus)) for UDexUnits[UDex]) + 1)
-
-
-
-
Else - Actions
-
-
-
-
-
-
-------- --------
-
-------- Set Strength Variable --------
-
Set NonHeroStr[UDex] = (Level of Non-Hero Stats (Str) for UDexUnits[UDex])
-
-------- Bonus Damage from Strength --------
-
For each (Integer Integer1) from 1 to NonHeroStr[UDex], do (Hero - Create Tome of Damage and give it to UDexUnits[UDex])
-
-------- Set Agility Variable --------
-
Set NonHeroAgi[UDex] = (Level of Non-Hero Stats (Agi) for UDexUnits[UDex])
-
-------- Bonus Attack Speed from Agility (%) --------
-
Set NonHeroAttackSpeedBonus[UDex] = ((Level of Non-Hero Stats (Agi) for UDexUnits[UDex]) x (Integer(0.01)))
-
Custom script: call CSS_AddBonus(udg_UDexUnits[udg_UDex], udg_NonHeroAttackSpeedBonus[udg_UDex], 1)
-
-------- Bonus Move Speed from Agility --------
-
Set NonHeroMoveBonus[UDex] = ((Real((Level of Non-Hero Stats (Agi) for UDexUnits[UDex]))) x 0.01)
-
Custom script: call UnitAddMoveSpeedBonus(udg_UDexUnits[udg_UDex], udg_NonHeroMoveBonus[udg_UDex], 0.00, 0.00)
-
-------- Set Intelligence Variable --------
-
Set NonHeroInt[UDex] = (Level of Non-Hero Stats (Int) for UDexUnits[UDex])
-
-------- Set Mana Bonus Variable --------
-
Set NonHeroManaBonus[UDex] = ((Level of Non-Hero Stats (Mana Bonus)) for UDexUnits[UDex]) x 10)
-
Custom script: call CSS_AddBonus(udg_UDexUnits[udg_UDex], udg_NonHeroManaBonus[udg_UDex], 9)
-
Unit - Set mana of UDexUnits[UDex] to (Max mana of UDexUnits[UDex])
-
-------- --------
-
-------- Set Health Bonus Variable --------
-
Set NonHeroHealthBonus[UDex] = (5 x (((Level of Non-Hero Stats (Health Bonus)) for UDexUnits[UDex]) x ((Level of Non-Hero Stats (Health Bonus)) for UDexUnits[UDex]) + 1)) / 2))
-
Set NonHeroHealthBonus[UDex] = (10 x (Level of Non-Hero Stats (Health Bonus)) for UDexUnits[UDex]))
-
Custom script: call CSS_AddBonus(udg_UDexUnits[udg_UDex], udg_NonHeroHealthBonus[udg_UDex], 8)
-
-
Else - Actions
-
-
-
The idea was, for every level of the non-hero unit, they get to randomly distribute a point to Str, Agi, Int, Bonus Health, or Bonus Mana.
I was using Health Bonus level X 10 added to max health.
I changed my mind
@Tasyen provided me with a helpful summation equation
- ( (level * (level + 1) ) / 2 ) x multi
-
-
Set NonHeroHealthBonus[UDex] = (10 x (((Level of Non-Hero Stats (Health Bonus)) for UDexUnits[UDex]) x ((Level of Non-Hero Stats (Health Bonus)) for UDexUnits[UDex]) + 1)) / 2))
-
--
-edit1
@KILLCIDE gave me this helpful little table in the original thread, forgot to mention.
The equation from @Tasyen is the same thing I think? And this is when I was doing +20 health instead of +10.
If the ability level is 1, then a1 = 5((1)^2 + 1) = 5(1 + 1) = 5(2) = 10
If the ability level is 2, then a2 = 5((2)^2 + 2) = 5(4 + 2) = 5(6) = 30
a3 = 5((3)^2 + 3) = 5(9 + 3) = 5(12) = 60
a4 = 5((4)^2 + 4) = 5(16 + 4) = 5(20) = 100
a5 = 5((5)^2 + 5) = 5(25 + 5) = 5(30) = 150
and sooo on and so forth...
--
What I'm trying to do:
I only want ODD levels to distribute a random point to either Str, Agi, or Int.
I only want EVEN levels to distribute a random point to either Health Bonus or Mana Bonus,
-
For each (Integer Integer1) from 1 to ((Level of UDexUnits[UDex]) mod 2), do (Actions)
-
Loop - Actions
-
Set NonHeroStatsRollToDistribute = (Random integer number between 1 and 3)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
NonHeroStatsRollToDistribute Equal to 1
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Non-Hero Stats (Str) for UDexUnits[UDex]) Equal to 0
-
-
Then - Actions
-
Unit - Add Non-Hero Stats (Str) to UDexUnits[UDex]
-
-
Else - Actions
-
Unit - Set level of Non-Hero Stats (Str) for UDexUnits[UDex] to ((Level of Non-Hero Stats (Str) for UDexUnits[UDex]) + 1)
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
NonHeroStatsRollToDistribute Equal to 2
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Non-Hero Stats (Agi) for UDexUnits[UDex]) Equal to 0
-
-
Then - Actions
-
Unit - Add Non-Hero Stats (Agi) to UDexUnits[UDex]
-
-
Else - Actions
-
Unit - Set level of Non-Hero Stats (Agi) for UDexUnits[UDex] to ((Level of Non-Hero Stats (Agi) for UDexUnits[UDex]) + 1)
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
NonHeroStatsRollToDistribute Equal to 3
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Non-Hero Stats (Int) for UDexUnits[UDex]) Equal to 0
-
-
Then - Actions
-
Unit - Add Non-Hero Stats (Int) to UDexUnits[UDex]
-
-
Else - Actions
-
Unit - Set level of Non-Hero Stats (Int) for UDexUnits[UDex] to ((Level of Non-Hero Stats (Int) for UDexUnits[UDex]) + 1)
-
-
-
-
Else - Actions
-
-
-
-
-
-
-
I am just so bad at thinking of the math I need. I am trying to use modulo to determine each even and odd occurrence from level 1 to the units level, so it will distribute a point to the available ability accordingly.
Does that make sense? The trigger I'm using was working, I thought, but then wouldn't add a bonus at all after level 3.
In my demo map, the wolves are level 3, so should distribute 2 points to either Str, Agi, or Int. They should distribute one to Health Bonus or Mana Bonus. You can move the wolf to the circle to show the scores, but I can't seem to get my "for" loop to the right spot for even/odd unit level.
Thanks for any assistance, really appreciate it, especially people from original thread.
Attachments
Last edited: