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

dmg unit if unit enter region

Status
Not open for further replies.
Level 3
Joined
Jun 9, 2008
Messages
36
hiho

i try do to dmg a unit if a enemy reaches a region
it works but the unit has 50 HP and it get demg like 45 - 44 -21 -32
the unit should get 1 dmg if a unit enters "50 - 49 -48 - 47 ....."

i tryed manny things dmg area effect dmg target effect set life ... and so on
but it is not in a row :cry:

need help
 
Level 3
Joined
Jun 9, 2008
Messages
36
w00t??
how to make - 1%????????
Unit - Set life of Team Live Generator 0007 <gen> to (Percentage life of Team Live Generator 0007 <gen>)%
 
Level 13
Joined
Jun 5, 2008
Messages
504
event: unit enters region

actions:
set life of triggering unit = life of triggering unit - 1

if you want 1% it should be like:

set life of triggering unit = life of triggering unit - (life of triggering unit/100)
 
Level 7
Joined
Jun 16, 2008
Messages
327
You will have to make two triggers, the first one will be:

  • Events
    • A unit enters (YourRegion)
  • Conditions
  • Actions
    • Set (DamagedUnit) = Entering Unit
    • Trigger - Turn on (Trigger02)
Your second trigger will look like this:

  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Then actions) else do (Else actions
    • If - Conditions
    • (YourRegion) contains (DamagedUnit) equal to true
    • Then - Actions
    • Unit Group - Pick every Unit in (Units in(YourRegion)) and do (Unit - Set life of (Picked Unit) to ((Life of Picked Unit) - 1.00)
    • Else - Actions
    • Trigger - Turn off (this trigger)
Remember that "DamagedUnit" is a unit variable and "YourRegion" means the name of the region which will damage the unit. "Trigger02" means the second trigger that you would make.
 
Level 3
Joined
Jun 9, 2008
Messages
36
(YourRegion) contains (DamagedUnit) equal to true
found:(Entering unit) equal DamageUnit


Unit Group - Pick every Unit in (Units in(YourRegion)) and do (Unit - Set life of (Picked Unit) to ((Life of Picked Unit) - 1.00)

sorry i cannot find them
only :Einheitengruppe - Pick every unit in (Units in Unit enter <gen>) and do (Einheit - Set life of (Picked unit) to (Leben of (Picked unit)))
 
Level 3
Joined
Jun 9, 2008
Messages
36
doesn't work because

Unit Group - Pick every Unit in (Units in(YourRegion)) and do (Unit - Set life of (Picked Unit) to ((Life of Picked Unit) - 1.00) is need and i have:
Einheitengruppe - Pick every unit in (Units in Unit enter <gen>) and do (Einheit - Set life of (Picked unit) to (Leben of (Picked unit))) -1.00 i smissing :( but i cant choose this option
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
choose arithmetic, then click the first field and select "life of triggering Unit", then click the second field and choose "-" then click the third field and select "1"

as you are german obviously i can show you a screenshot
 

Attachments

  • life of unit.jpg
    life of unit.jpg
    53.1 KB · Views: 69
Level 3
Joined
Jun 9, 2008
Messages
36
thank you got that part ^^

next problem ...
(YourRegion) contains (DamagedUnit) equal to true

only got
(Entering unit) equal DamageUnit
 
Level 3
Joined
Jun 9, 2008
Messages
36
because its an TD and whenever a evil unit enters the city the unit ( my "life generator" should loose 1 life"
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
  • Events
    • Unit - a Unit enters <town region>
  • Conditions
  • Actions
    • Unit - set life of "life generator" to life of life generator - 1.00
add conditions where you need them

is that what you want? if yes, it would help if you tell your complete problems next time ;)
 
Level 3
Joined
Jun 9, 2008
Messages
36
it woooorks UreDe4D thank you
and thank you other guys for your help :)
i promise to explain the hole situation next time before i ask ^^

*happy*
 
Status
Not open for further replies.
Top