Terrain Based Damage, plz help.

BassZ

New Member
Reaction score
1
Hey I'm working on a small capture the flag map with the fel wood terrain set. I want to make it so if a unit steps on "Poison" Terrain it takes % of max hp in damage every second. How would i make this.

I did search and could not find any topics that helped me. Any help would be appreciated.
 

waaaks!

Zinctified
Reaction score
255
theres a condition in the trigger editor, where u can detect terrains, maybe thats useful
 
B

benj_war3

Guest
This might help you get the idea:

This slows down the entering unit when he enters the wet cement.
Code:
Events
    Unit - A unit enters Wet Cement <gen>
Conditions
    ((Entering unit) is A Hero) Equal to True
Actions
    Unit - Set (Entering unit) movement speed to 25.00
    Trigger - Turn on leave wet cement <gen>

When the entering unit leaves the wet cement, the entering unit's speed returns to normal:

Code:
Events
    Unit - A unit leaves Wet Cement <gen>
Conditions
    ((Leaving unit) is A Hero) Equal to True
Actions
    Unit - Set (Leaving unit) movement speed to (Default movement speed of (Leaving unit))

It works perfectly fine..
 

BassZ

New Member
Reaction score
1
Ok... here is what i have.

I currently have my trigger set up like this...

Code:
Events:
Time - Every 1.00 Seconds of game time.
Conditions:
(Terrain type at(Position of(Entering Unit))) Equal to Felwood - Poison
Actions:
unit - set life of (matching unit) to ((life of (matching unit)) - ((Max life of (matching unit)) x .20))

But it dose nothing. How would i make it so it checks every 1 second if a unit is in the poison terrain and if it is dose 20% max hp in damage.

Please help.
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
Well you have 2 things wrong with that:

1) You're not selecting any units.
2) You're using entering and matching wrong.

Code:
Periodic
Set UnitGroup1 = Units in Playable map Area
Pick all units in UnitGroup1
    Set point = position of (picked unit)
    If (terrain at point = felwood - poison)
           set life of (picked unit) = Current Life of (picked unit) - (max life x .20))
    Custom Script:  call RemoveLocation(udg_point)
Custom Script:  call DestroyGroup(udg_UnitGroup1)

No need for matching, thats just used for setting up conditions inside unit group selection.
 
S

Slate.Master

Guest
Code:
Events:
Time - Every 1.00 Seconds of game time.
Conditions:
Actions:
unit group - Pick every unit in playable map and do actions:
  Loop - Actions
    If - coditions
      (Terrain type at(Position of(Picked Unit))) Equal to Felwood - Poison
    Then - Actions
       unit - set life of (matching unit) to ((life of (matching unit)) - ((Max life of (matching unit)) x .20))
    Else - Actions
       do nothing

Edit - too late :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top