• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Problems in Region Damage Trigger

Status
Not open for further replies.
Level 14
Joined
Mar 27, 2008
Messages
1,003
Well... I have two problems with these triggers that I made.

Purpose of said triggers: To damage units owned by players in a certain group every five seconds and ping the location.

What works: The players and units are added to their respective groups when they enter the region, also they are removed from their respective groups once they leave the region. Also the text displays just fine.

What doesn't work: The units in the region aren't getting damaged and the ping doesn't ping the location of the unit, it only pings the first location that it was at.

The Triggers:

Add units and players to groups:

  • Player Enters Fog
    • Events
      • Unit - A unit enters Damage Players Outside Fort <gen>
    • Conditions
      • (Owner of (Entering unit)) Not equal to Player 11 (Dark Green)
      • (Owner of (Entering unit)) Not equal to Player 12 (Brown)
    • Actions
      • Player Group - Add (Owner of (Entering unit)) to PLYRGRP_DamageHumans
      • Unit Group - Add (Entering unit) to SYS_OutsideFort
Remove units and players from groups:

  • Player Leaves Fog
    • Events
      • Unit - A unit leaves Damage Players Outside Fort <gen>
    • Conditions
      • (Owner of (Leaving unit)) Not equal to Player 11 (Dark Green)
      • (Owner of (Leaving unit)) Not equal to Player 12 (Brown)
    • Actions
      • Player Group - Remove (Owner of (Leaving unit)) from PLYRGRP_DamageHumans
      • Unit Group - Remove (Leaving unit) from SYS_OutsideFort
Damaging the unit / pinging position / spawning text:

  • Damage Players in Fog
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SYS_OutsideFort and do (Actions)
        • Loop - Actions
          • Unit - Cause UNIT_EnvironmentDamageTotem to damage (Picked unit), dealing 75.00 damage of attack type Chaos and damage type Disease
      • Player Group - Pick every player in PLYRGRP_DamageHumans and do (Actions)
        • Loop - Actions
          • Game - Display to PLYRGRP_DamageHumans the text: |cffff0000You are o...
          • Cinematic - Ping minimap for PLYRGRP_DamageHumans at (Position of (Picked unit)) for 5.00 seconds
Can anyone help please?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
in the enter and leave region triggers change everything over to triggering unit. it is faster and safer to do it that way. in the 3rd trigger make sure UNIT_EnvironmentDamageTotem can attack. also you ping minimap cinematic leaks a location.

if none of that solves it check if there are units in the group.

Alternatively post ur map or send it in pm
 
Level 7
Joined
Jan 22, 2013
Messages
293
Can anyone help please?

Hello! I have notice you have leaks in the player groups, I will fix your trigger in a moment (if your here alreadly to see this while im typing up your fix)

  • Damage Players in Fog
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set TempPlayerGroup = (PLYGRP_DamageHumans)
      • Set TempUnitGroup = (SYS_OutsideFort)
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause UNIT_EnvironmentDamageTotem to damage (Picked unit), dealing 75.00 damage of attack type Chaos and damage type Disease
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Player Group - Pick every player in TempPlayerGroup and do (Actions)
        • Loop - Actions
          • Game - Display to TempPlayerGroup the text: |cffff0000You are o...
          • Set AntiLeakLocation = (Position of (Picked unit))
          • Cinematic - Ping minimap for TempPlayerGroup at AntiLeakLocation for 5.00 seconds
          • Custom script: call RemoveLocation(udg_AntiLeakLocation)
      • Custom script: call DestroyForce(udg_TempPlayerGroup)
you had 3 Leaks. I don't believe that solves your trigger unless the ping was your issue.
Overall you should post your map for farther or please give more information.

I don't use Destroy Force often so Perhaps someone with more experience with Destroy Force can help you.
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
  • Formula:
    • Set TempPlayerGroup = (Player group((Owner of (Triggering unit))))
    • Player Group - Pick every player in PLYRGRP_DamageHumans and do (Actions)
    • Custom script: call DestroyForce(udg_TempPlayerGroup)

that would ruin the triggers if u look at the first 2 triggers he adds and removes the players from that group there. so if u were to destroy it the players would only get pinged once. then they would be removed.
also it would bug up the next time he went to use it. as the players would be removed and the units would still be in the unit group
 
Level 7
Joined
Jan 22, 2013
Messages
293
that would ruin the triggers if u look at the first 2 triggers he adds and removes the players from that group there. so if u were to destroy it the players would only get pinged once. then they would be removed.
also it would bug up the next time he went to use it. as the players would be removed and the units would still be in the unit group


Are you trolling me, that's not even in my post Death.

Perhaps you copied that when I was modifying my post. Durpa Durpa.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
the way you have now causes more overhead. you are creating and destroying a group and a player group every 5 seconds. it is better the way he has it even if it is 3 triggers. if he really wants it can be changed to 1 trigger. but i wouldnt do it the way u are because of the overhead. 2 triggers would probable be the best here because he can easily check if the unit is in the region if it isnt then remove it from group if it is add it to group. You don't leak global player groups or unit groups so the extra overhead isnt worth it if the group and player group are there the whole game.
 
Level 7
Joined
Jan 22, 2013
Messages
293
the way you have now causes more overhead. you are creating and destroying a group and a player group every 5 seconds. it is better the way he has it even if it is 3 triggers. if he really wants it can be changed to 1 trigger. but i wouldnt do it the way u are because of the overhead. 2 triggers would probable be the best here because he can easily check if the unit is in the region if it isnt then remove it from group if it is add it to group. You don't leak global player groups or unit groups so the extra overhead isnt worth it if the group and player group are there the whole game.

Are we helping him or arguing?

Post the wrong and fix it give it to him and I can see what you are saying.

Its ok to prove me wrong, just don't argue about it, just post it and be done with it lol.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
How about enumerating the units inside the regions? Like Unit in regions.

thats pretty much what Orthane did. i was thinking that the overhead wasnt worth it if you change what blackenvyX has into 2 triggers. then it would be less overhead. No creating and destroying groups and player groups every 5 seconds. im not sure about the speed for groups or player groups being created and destroyed in GUI. it shouldnt be a big deal for speed at all either way. its just wat blackenvyX prefers at this rate lol
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
When he has something triggering literally every 5 seconds it needs to me air tight from any possible leak lol even if its just an assumption that it will leak lol.

Yeah it needs to be leakless, but an assumption of a leak is no basis to do an action. If you have an assumption, you try to confirm or refute it. And then make the action.

In this case, creating and destroying groups all the time is not needed.

Im not reading the comments above.

Dude...
 
Level 7
Joined
Jan 22, 2013
Messages
293
Yeah it needs to be leakless, but an assumption of a leak is no basis to do an action. If you have an assumption, you try to confirm or refute it. And then make the action.

In this case, creating and destroying groups all the time is not needed.



Dude...

How will I know what leaks or not, if I know the action leaks, how will I know the situations where it wont then Maker, you got a link for this stuff?

FYI: I almost never use that DestroyForce action. Infact that's the first time I've ever used it in a trigger lol.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Those only show pictures which I followed in this event by putting codes on those. IT does not explain crap towards the situations its worth putting it on.

Only explination is If it is not ALL PLAYERS, pretty sure in this case it was not all players.
Things can only leak if they get created. If a player group does not get re-created all the time, it cannot leak.
Adding/removing players from an already existing player group is a great way to avoid re-creating them so that it does not leak.

Maker said:
Many frown upon people who do not read the thread before posting. That is bad forum conduct.
I couldn't agree more.
 
Level 7
Joined
Jan 22, 2013
Messages
293
Things can only leak if they get created. If a player group does not get re-created all the time, it cannot leak.
Adding/removing players from an already existing player group is a great way to avoid re-creating them so that it does not leak.

Now that is good advice.
 
Status
Not open for further replies.
Top