anyone good in arithmetic?

MissKerrigan

Active Member
Reaction score
23
Hello,

I made a trigger that sets the unit property (Live + Maximum Live) of units when they are spawned, but I think the computer isn't all fair to me:

(For this example, the Hitpoint Integer is set to 12)


Unit - Set (Triggering unit) Maximum Life to Hitpoint Integer * 3 / 4


Now, for some reason my units are dying when spawned like they had 0 or less hitpoints
Am I doing something wrong here?

MissKerrigan
 

MissKerrigan

Active Member
Reaction score
23
well actually I start the integer with 1 and add it 1 each round, but something goes wrong in round 12

Round 12 is a level where creeps moving faster so I am trying to give them 75% of hitpoints

(I don't want to create a behavior which reduce 25% damage, because it will all messy then)
 

MissKerrigan

Active Member
Reaction score
23
wont work, because of the next reasons:


1. can't set integers to 0.75

2. there is no such option as 'current life' I could found

3. I even can't use current life because the unit is coming more times in the game


(all units are 1 hp in the data editor and set to an arithmetic number when they spawned)
 

X-maul

AKA: Demtrod
Reaction score
201
1.
Unit life is a real.
2.
Yes there is, it's called a unit property.
3.
Do you mean that the same unit is coming back?

Check this action:
Code:
     Unit - Set (Picked unit) Life (Percent) to 75.0
If I understood you right, you want the unit to have 75% hp, this will do the trick.
 

MissKerrigan

Active Member
Reaction score
23
1. ?

2. unit property, then click on 'function'?

3. No, it's not coming back, but the same unit type is spawned again

(1 round takes 30 levels of creeps, after this the 30 rounds coming again)



if you are wondering about which map I'm talking about, you can see 'Garden Defense'

(it's changed ALL way)
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
X-maul's action will work. Use the action called "Set Unit Property". Set the property to "Life (Percent)" and the value to 75.0.

Even if they all have different health, this action will still set their life to 75%.
 

Dave312

Censored for your safe viewing
Reaction score
269
Won't that change the units current life to 75% instead of setting the units maximum life to 75% of its original value?
 

MissKerrigan

Active Member
Reaction score
23
actually I having only problems with the wave which is 14 hitpoints, can't get 75% of 14 hitpoints...
 

Dave312

Censored for your safe viewing
Reaction score
269
It sounds like the you have a bug somewhere else in your triggers and it just happens that when your hitpoints equals 14, you see the result of the bug. Try displaying all your variables in your trigger when it happens to trace the source of the error.
 

MissKerrigan

Active Member
Reaction score
23
already changed it :)


wave 7 = 14 hitpoints

wave 8 = 16 hitpoints



I changed wave 7 into wave 8, now it works, units having 12 hitpoints
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Won't that change the units current life to 75% instead of setting the units maximum life to 75% of its original value?
Well yeah. I realized that just when I was about to post. Unfortunately, I don't think there's a way to set max life to percentage.

To fix this, I think you can first set the current life (percentage) and then set the max life to the current life.
 

MissKerrigan

Active Member
Reaction score
23
I set things the next:

integer starts with 1 and goes +1 every wave


I set hitpoints integer x4 but if a fast moving wave is coming, then the integer x3
I have also waves that moves slower which I set x5
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top