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
808
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
808
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,463
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,463
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 The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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