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

Set stats of creeps

Status
Not open for further replies.
Level 2
Joined
Feb 23, 2016
Messages
7
Hey there,

I'm working on a Tower Defense map, where the stats of the creeps are randomized. So the wave gets at the beginning an amount of points and this amount has to split randomly to Lifepoints, Armor, Evasion, Regeneration and Speed. I've created some formulas to generate those in dependence to the actual lvl of the wave.

My first Idea was to set the Stats through abilities but the maximum level of an ability is 100 and because the points aren't raising linear but quadratic these are far to less (for 42 waves i need about 8400 Points) and it would be pain in the *** to adjust the value of each level...

For changing the Stats in the trigger editor i didn't found any solution.
I have no experience with Jass but didn't found a solution in the internet there neither.

Does anyone has an idea.
Thanks in advance,
Unicorn
 
Level 14
Joined
Nov 30, 2013
Messages
926
I don't think you can change their stats through "Heroes-stuffs" actions if there aren't a hero unit unless you create ability like a bonus HP but as you said, it will be painful as ever.
How far the Waves can go? If is alot, setting the level of an ability of HP, Armor, or whatever will be painful for you.
 
Level 2
Joined
Feb 23, 2016
Messages
7
Thanks for help,
I don't have experience with Jass but with other languages, so aslong as i don't have to code myself I'll probably understand the code^^

I'll try that and give feedback if it worked.
 
Level 2
Joined
Feb 23, 2016
Messages
7
Sorry for no response. I'm a little busy at the time but I'm doing my best.

So thanks for all the responses.

I downloaded the Jass NewGen Pack and implemented the Libraries.
I think slowly I'm getting how to use it >.<

I'll post all updates and the solution code as I have it :)


@ Dr Super Good:
Ye I considered about that but what i don't like about Starcraft II is, that there is no LAN-Mode and with the internet here we can't play that game on LAN-Partys :/

Ok got a perfect idea without Jass :grin:

The BonusMod helped me for the idea.

I'll just create abilities in 2^n steps and then add them to the unit to the value I want to. The modulo function in the trigger editor will help me for this.
This is simple to change while balancing (what probably will be often) because I don't have to change each value but just the fomula I have.
I'll try this and post the trigger if it works.
 
Last edited by a moderator:
Level 2
Joined
Feb 23, 2016
Messages
7
Ok for those who have the same problem here is my code. I'm sorry for the german parts in it but I'm unable to change the language. I think you'll understand it anyway.
Feel free to use it if you need to:

In the first trigger I generate "Points" on dependence to the wave. Then I add those Points to either armor, lifepoints, evasion, speed or regeneration. Then I transform the points of each Stat to an actual value:

  • NextWaveCountdown
    • Ereignisse
      • Zeit - tNextWave expires
    • Bedingungen
    • Aktionen
      • Countdown-Timer - Start tNextWave as a Einmalig timer that will expire in 60.00 seconds
      • Set iWave = (iWave + 1)
      • Spiel - Display to (All players) the text: (Wave + ((String(iWave)) + (: + sCreepName[iWave])))
      • -------- Set All Points randomly --------
      • Set rCreepPoints = ((125.00 / 21.00) x ((Power((Real(iWave)), 2.00)) x ((Real(iCreepInterval[iWave])) / 7.00)))
      • Set rCreepArmor = 0.00
      • Set rCreepEvasion = 0.00
      • Set rCreepLife = 0.00
      • Set rCreepRegen = 0.00
      • Set rCreepSpeed = 0.00
      • For each (Integer A) from 1 to (Integer(rCreepPoints)), do (Actions)
        • Schleifen - Aktionen
          • Set iCreepChooseAdd = (Random integer number between 1 and 5)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • iCreepChooseAdd Gleich 1
            • 'THEN'-Aktionen
              • Set rCreepArmor = (rCreepArmor + 1.00)
            • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • iCreepChooseAdd Gleich 2
            • 'THEN'-Aktionen
              • Set rCreepEvasion = (rCreepEvasion + 1.00)
            • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • iCreepChooseAdd Gleich 3
            • 'THEN'-Aktionen
              • Set rCreepLife = (rCreepLife + 1.00)
            • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • iCreepChooseAdd Gleich 4
            • 'THEN'-Aktionen
              • Set rCreepRegen = (rCreepRegen + 1.00)
            • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • iCreepChooseAdd Gleich 5
            • 'THEN'-Aktionen
              • Set rCreepSpeed = (rCreepSpeed + 1.00)
            • 'ELSE'-Aktionen
      • Set rCreepArmorValue = ((5.00 / 84.00) x rCreepArmor)
      • Set rCreepEvasionValue = ((1.00 / 84.00) x rCreepEvasion)
      • Set rCreepLifeValue = ((125.00 / 21.00) x rCreepLife)
      • Set rCreepRegenValue = ((5.00 / 42.00) x rCreepRegen)
      • Set rCreepSpeedValue = ((1.00 / 21.00) x rCreepSpeed)
The second Trigger is a little longer but very easy by it's concept. The trigger runs Every time a unit is created and this unit is equal to the creeps owner (in my case player 9, 10 and 11).
So before the Trigger will work you need to create abilities.
For example if you want to change the units hp up to 1023 you'll need 10 abilitys. The first one adds 1 hp, the second 2, the third 4 and so on up to 512. In the game constant you have to activate, that abilities can stack!
The bad thing now is, that there is no while-loop or at least I didn't found it, so I had to do it without. Probably theres a shorter way but this will also work.
So first I had to set any integer (I used my trash integer: iTemp) to the value the unit should get (this is needed because I don't want to change the value itself).
Now I need to create as much If-Conditions as I have abilities for the specified Stat. The condition asks if iTemp mod 2 is equal to 1 or 0. If it's 0 nothing happens. If it's 1 that means to add a ability to the unit (Some will now see that I do nothing different then transforming a decimal number to a binary number and add the value of each digit to the unit). The first condition adds 1 and the tenth adds 512. After each Condition the iTemp must be set to iTemp/2.

Don't be afraid of the long trigger it's very simple :)
  • AddToCounter
    • Ereignisse
      • Einheit - A unit enters (Entire map)
    • Bedingungen
      • Or - Any (Conditions) are true
        • Bedingungen
          • (Owner of (Triggering unit)) Gleich Spieler 9 (Grau)
          • (Owner of (Triggering unit)) Gleich Spieler 10 (Hellblau)
          • (Owner of (Triggering unit)) Gleich Spieler 11 (Dunkelgrün)
    • Aktionen
      • Set iCounter = (iCounter + 1)
      • -------- Set the Value of Armor for Triggering Unit --------
      • Set iTemp = (Integer(rCreepArmorValue))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CArmor1 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CArmor2 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CArmor4 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CArmor8 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CArmor16 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CArmor32 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CArmor64 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CArmor128 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CArmor256 to (Triggering unit)
        • 'ELSE'-Aktionen
      • -------- Set the Value of Evasion for Triggering Unit --------
      • Set iTemp = (Integer(rCreepEvasionValue))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CEvasion1 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CEvasion2 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CEvasion4 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CEvasion8 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CArmor16 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CEvasion32 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CEvasion64 to (Triggering unit)
        • 'ELSE'-Aktionen
      • -------- Set the Value of Live for Triggering Unit --------
      • Set iTemp = (Integer(rCreepLifeValue))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife1 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife2 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife4 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife8 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife16 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife32 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife64 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife128 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife256 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife512 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife1024 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife2048 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife4096 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife8192 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife16384 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CLife32768 to (Triggering unit)
        • 'ELSE'-Aktionen
      • -------- Set the Value of Regen for Triggering Unit --------
      • Set iTemp = (Integer(rCreepRegenValue))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CRegen1 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CRegen2 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CRegen4 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CRegen8 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CRegen16 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CRegen32 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CRegen64 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CRegen128 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CRegen256 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CRegen512 to (Triggering unit)
        • 'ELSE'-Aktionen
      • -------- Set the Value of Speed for Triggering Unit --------
      • Set iTemp = (Integer(rCreepSpeedValue))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CSpeed1 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CSpeed2 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CSpeed4 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CSpeed8 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CSpeed16 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CSpeed32 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CSpeed64 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CSpeed128 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (iTemp mod 2) Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Add CSpeed256 to (Triggering unit)
        • 'ELSE'-Aktionen
      • Set iTemp = (iTemp / 2)
That's it. Now I have units with trigger based stats, which are easily to change.
Maybe this will help some other poor souls with the same problem.

Peace out and thanks for all the help I've got :thumbs_up:
 
Level 2
Joined
Feb 23, 2016
Messages
7
No it isn't necessary ^^
Ye thought of this after I did the post, too.
I'll write a new shorter one.

Edit:
So now the code is "a little" shorter than before. This is the second trigger:

  • AddToCounter
    • Ereignisse
      • Einheit - A unit enters (Entire map)
    • Bedingungen
      • Or - Any (Conditions) are true
        • Bedingungen
          • (Owner of (Triggering unit)) Gleich Spieler 9 (Grau)
          • (Owner of (Triggering unit)) Gleich Spieler 10 (Hellblau)
          • (Owner of (Triggering unit)) Gleich Spieler 11 (Dunkelgrün)
    • Aktionen
      • Set iCounter = (iCounter + 1)
      • -------- Set the Value of Armor for Triggering Unit --------
      • Set iTemp = (Integer(rCreepArmorValue))
      • For each (Integer A) from 1 to 9, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (iTemp mod 2) Gleich 1
            • 'THEN'-Aktionen
              • Einheit - Add AbilityArmor[(Integer A)] to (Triggering unit)
            • 'ELSE'-Aktionen
          • Set iTemp = (iTemp / 2)
      • -------- Set the Value of Evasion for Triggering Unit --------
      • Set iTemp = (Integer(rCreepEvasionValue))
      • For each (Integer A) from 1 to 7, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (iTemp mod 2) Gleich 1
            • 'THEN'-Aktionen
              • Einheit - Add AbilityEvasion[(Integer A)] to (Triggering unit)
            • 'ELSE'-Aktionen
          • Set iTemp = (iTemp / 2)
      • -------- Set the Value of Live for Triggering Unit --------
      • Set iTemp = (Integer(rCreepLifeValue))
      • For each (Integer A) from 1 to 16, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (iTemp mod 2) Gleich 1
            • 'THEN'-Aktionen
              • Einheit - Add AbilityLife[(Integer A)] to (Triggering unit)
            • 'ELSE'-Aktionen
          • Set iTemp = (iTemp / 2)
      • -------- Set the Value of Regen for Triggering Unit --------
      • Set iTemp = (Integer(rCreepRegenValue))
      • For each (Integer A) from 1 to 10, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (iTemp mod 2) Gleich 1
            • 'THEN'-Aktionen
              • Einheit - Add AbilityRegen[(Integer A)] to (Triggering unit)
            • 'ELSE'-Aktionen
          • Set iTemp = (iTemp / 2)
      • -------- Set the Value of Speed for Triggering Unit --------
      • Set iTemp = (Integer(rCreepSpeedValue))
      • For each (Integer A) from 1 to 9, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (iTemp mod 2) Gleich 1
            • 'THEN'-Aktionen
              • Einheit - Add AbilitySpeed[(Integer A)] to (Triggering unit)
            • 'ELSE'-Aktionen
          • Set iTemp = (iTemp / 2)
edit edit:
Offcourse you have to set the Ability-Arrays in the Initialization
 
Last edited:
Status
Not open for further replies.
Top