Trigger region dmg

djb4cc1o94

TH.net Regular
Reaction score
5
Hello i am making a trigger wich when a hero enters region he takes dmg over time...i did this but didnt work,is there any other way for do this?Maybe with some ability added from spellbook?

Entering Trigger :

Fire Legion
Events
Unit - A unit enters Fire Legion <gen>
Conditions
(Owner of (Entering unit)) Not equal to Player 12 (Brown)
Actions
Trigger - Turn on Takes Dmg <gen>

Turn On Trigger :

Takes Dmg
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Unit - Cause (Entering unit) to damage (Entering unit), dealing 1.00 damage of attack type Chaos and damage type Unknown

Dunno if Entering Unit is right...

Found this
Well, I tried to do something here and I hope it helps you.
There will be 4 triggers:

Trigger:
  • AcidRainWarn
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: Acid rain will fall in 360 seconds

Trigger:
  • AcidRainRun
    • Events
      • Time - Elapsed game time is 360.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) for 10.00 seconds the text: Acid rain will fall NOW!
      • Unit - Create 1 dummy01 for Neutral Hostile at (Center of (Playable map area)) facing Default building facing degrees
      • Set TempUnit1 = (Last created unit)
      • Trigger - Turn on AcidRainCheckUnits &lt;gen&gt;


Trigger:
  • AcidRainCheckUnits
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Triggering unit) is A structure) Equal to False) and (((Region 000 &lt;gen&gt; contains (Matching unit)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((Race of (Owner of (Matching unit))) Equal to Hum and do (Actions)
        • Loop - Actions
          • Set TempUnit2 = (Picked unit)


Trigger:
  • AcidRainDamage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (AcidRainCheckUnits &lt;gen&gt; is on) Equal to True
    • Actions
      • Unit - Cause TempUnit1 to damage TempUnit2, dealing 10.00 damage of attack type Hero and damage type Normal


I'm not so expert, but I really hope it helps you... It was hard to do =)

Will it work?Because it seems pretty confused :| Also it needs some modify for my case.
 

Varine

And as the moon rises, we shall prepare for war
Reaction score
803
Would it not make more sense to have the entire sequence in one event?

Like:

Event: Unit enters region

Condition: Owning Player != Brown; Unit is == Hero Type

Action: Cause entering unit x damage every x second


And yours may not work because from the looks of it, you're having the entering unit attack itself.
 

djb4cc1o94

TH.net Regular
Reaction score
5
And yours may not work because from the looks of it, you're having the entering unit attack itself.

It doesnt matter,most of healself abilityes are used to attack themself with negative value...


Action: Cause entering unit x damage every x second

Are you sure that action exists?

Also found this :

Trigger:
  • Damage Region
    • Events
    • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Integer((Life of (Picked unit)))) Greater than or equal to 2
    • Then - Actions
    • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 1.00)
    • Else - Actions


Will it work?
 

Varine

And as the moon rises, we shall prepare for war
Reaction score
803
I don't know if that's the exact phrasing as I haven't looked at the World Editor for some time, but I'm probably not going to now.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
place an insivisble dummy unit with immolation in that region? make it owned by player 12 (brown) to make it only hit its enemies?

Other then that go with something like this:
Code:
Events
 Every X seconds of game time
Conditions
Actions
 set Temp_Group = Units in MY_RECT
 unit group - pick all units in Temp_Group
   loop - actions
    if owner of picked unit != player 12 Brown
      unit - make picked unit damage picked unit dealing Y damage of type spell and kind normal
    else
    end
  call DestroyGroup (udg_Temp_Group)
(Its handwritten pseudocode of course)
 

Smitty

Member
Reaction score
20
The problem with the original trigger is that the second trigger uses 'entering unit' when there is no entering unit.
 

inevit4ble

Well-Known Member
Reaction score
38
You dont really want a periodic trigger to be On all the time.

I would use "Unit Enters region" to turn On periodic damage trigger and this trigger off

Then in periodic trigger, set group == units in region, if no units in group then turn trigger off again and other trigger back on.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
You dont really want a periodic trigger to be On all the time.

I would use "Unit Enters region" to turn On periodic damage trigger and this trigger off

Then in periodic trigger, set group == units in region, if no units in group then turn trigger off again and other trigger back on.
the problem with activating / deactivating the triggers is that you to have to consider many different situations.
Like if the units inside the region die (and thus never leave it again) or if they get removed.
checking if a unit group is empty periodically isnt all that good either.
but you are right, whenever possible you should avoid periodic triggers and try to catch the proper event.
 

inevit4ble

Well-Known Member
Reaction score
38
Trigger:
  • UnitEnters
    • Events
      • Unit - A unit enters Beginning &lt;gen&gt;
    • Conditions
    • Actions
      • Trigger - Turn on PeriodicDamage &lt;gen&gt;
      • Trigger - Turn off (This trigger)

Trigger:
  • PeriodicDamage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set MyUnitGroup = (Units in Beginning &lt;gen&gt; matching (((Matching unit) is alive) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in MyUnitGroup) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in MyUnitGroup and do (Actions)
            • Loop - Actions
              • Unit - Cause (Picked unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
        • Else - Actions
          • Trigger - Turn on UnitEnters &lt;gen&gt;
          • Trigger - Turn off (This trigger)
      • Custom script: call DestroyGroup(udg_MyUnitGroup)
 

inevit4ble

Well-Known Member
Reaction score
38
They just pull alot of CPU power. to have 20 periodics running the whole game is just going to make lag
 

djb4cc1o94

TH.net Regular
Reaction score
5
Hey,btw i used 2 of this trigger for 2 different regions,the first one works but the second one doesnt, also i need a condition and i dont know where to place it.

Trigger:
  • (Owner of (Triggering unit)) Not Equal to (==) Player 12 (Brown)
for 1st region
Trigger:
  • (Owner of (Triggering unit)) Equal to (==) Player 12 (Brown)
for 2nd region

I dont know if triggering unit is right but its weird it still works for one trigger only.Damn i tried everywhere the condition must be wrong :|
 
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