• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Solved] Please help me complete this trigger !

Status
Not open for further replies.
Level 2
Joined
Nov 21, 2019
Messages
8
As the title said, i'm glad to someone check it leak and does it working properly, how to code it mui @@!
It Cloak of Flames, trigger proc same time for 8 player every 0.7s
Greetings and have a goodday ^^!

  • Clock of Flames 4 DMG
    • Events
      • Time - Every 0.70 seconds of game time
    • Conditions
    • Actions
      • Set SodGuild_TempGroup[50] = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is an illusion) Equal to False) and ((((Matching unit) is paused) Equal to False) and ((((Matching unit) belongs to an enemy of Player 10 (Light Blue)) E)
      • Unit Group - Pick every unit in SodGuild_TempGroup[50] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Picked unit) has an item of type Cloak of Flames) Equal to True
                  • ((Picked unit) has an item of type Cloak of Flames Lvl1) Equal to True
                  • ((Picked unit) has an item of type Cloak of Flames Lvl2) Equal to True
                  • ((Picked unit) has an item of type Cloak of Flames Lvl3) Equal to True
            • Then - Actions
            • Else - Actions
              • Set CloakOfFlames_Integer = (Player number of (Owner of (Picked unit)))
              • Set CloakOfFlames_Hero[CloakOfFlames_Integer] = (Picked unit)
              • Set CloakOfFlames_TempLoc[CloakOfFlames_Integer] = (Position of CloakOfFlames_Hero[CloakOfFlames_Integer])
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 322.00 of CloakOfFlames_TempLoc[CloakOfFlames_HeroNumber] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) has) and do (Actions)
                • Loop - Actions
                  • Unit - Cause CloakOfFlames_Hero[CloakOfFlames_Integer] to damage (Picked unit), dealing 450.00 damage of attack type Spells and damage type Universal
                  • Special Effect - Create a special effect attached to the head of (Picked unit) using Abilities\Spells\NightElf\Immolation\ImmolationDamage.mdl
                  • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_CloakOfFlames_TempLoc[udg_CloakOfFlames_Integer])
      • Custom script: call DestroyGroup(udg_SodGuild_TempGroup[50])
  • [trigger]
  • [/SPOILER]
 
Last edited:
Level 2
Joined
Dec 4, 2019
Messages
4
I am not a GUI expert, so take all these with a grain of salt.

Is it like an aura? And what do the levels do? If the range and damage is fixed (via triggers) there's no need to check for levels right? Did you test this, what does it do ingame (if it does anything)?

((((Matching unit) belongs to an enemy of Player 10 (Light Blue)) E)
Equal to False I suppose. Dunno what happened there.

CloakOfFlames_TempLoc[CloakOfFlames_HeroNumber]
I am not sure what CloakOfFlames_HeroNumber is in there.

Also, your "picking units and dealing damage loop" is in in else actioons, not then actions.

If it is an aura that damages units around the hero for 450 damage, I could try doing it in GUI and we could compare. I also feel I could do this so much easier in vJass :p

Anyways there are a lot more experienced mappers than me on this site, but seeing that it has been 12 hours i felt like replying :) If this is all bullcrap and I have no idea what I am talking about, please tell me, I will edit accordingly.

A question for experienced mappers if i may: Does the - Pick Units Within (Range of 322 of "unit") leak?
 
Last edited:
Level 2
Joined
Nov 21, 2019
Messages
8
I am not a GUI expert, so take all these with a grain of salt.

Is it like an aura? And what do the levels do? If the range and damage is fixed (via triggers) there's no need to check for levels right? Did you test this, what does it do ingame (if it does anything)?

Equal to False I suppose. Dunno what happened there.

I am not sure what CloakOfFlames_HeroNumber is in there.

Also, your "picking units and dealing damage loop" is in in else actioons, not then actions.

If it is an aura that damages units around the hero for 450 damage, I could try doing it in GUI and we could compare. I also feel I could do this so much easier in vJass :p

Anyways there are a lot more experienced mappers than me on this site, but seeing that it has been 12 hours i felt like replying :) If this is all bullcrap and I have no idea what I am talking about, please tell me, I will edit accordingly.

A question for experienced mappers if i may: Does the - Pick Units Within (Range of 322 of "unit") leak?

Oh, thank you anyway, i just redo it...may it simple as it work ?
  • Clock of Flames 4 DMG
    • Events
      • Time - Every 0.70 seconds of game time
    • Conditions
    • Actions
      • Set SodGuild_TempGroup[50] = (Units in (Playable map area))
      • Unit Group - Pick every unit in SodGuild_TempGroup[50] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • ((Picked unit) is an illusion) Equal to False
                  • ((Picked unit) is paused) Equal to False
                  • ((Picked unit) is dead) Equal to False
                  • ((Picked unit) has an item of type Cloak of Flames OP) Equal to True
                  • ((Picked unit) has an item of type Cloak of Flames) Equal to False
                  • ((Picked unit) has an item of type Cloak of Flames Lv1) Equal to False
                  • ((Picked unit) has an item of type Cloak of Flames Lv2) Equal to False
                  • ((Picked unit) has an item of type Cloak of Flames Lv3) Equal to False
            • Then - Actions
              • Set COF = (Picked unit)
              • Set COF_TempLoc = (Position of (Picked unit))
              • Set COF_TempGroup = (Units within 322.00 of COF_TempLoc)
              • Unit Group - Pick every unit in COF_TempGroup and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A structure) Equal to False
                      • ((Picked unit) is Mechanical) Equal to False
                      • ((Picked unit) is dead) Equal to False
                      • ((Picked unit) has buff Divine Shield) Equal to False
                      • ((Picked unit) belongs to an enemy of (Owner of COF)) Equal to True
                    • Then - Actions
                      • Unit - Cause COF to damage (Picked unit), dealing 450.00 damage of attack type Spells and damage type Universal
                      • Special Effect - Create a special effect attached to the head of (Picked unit) using Abilities\Spells\NightElf\Immolation\ImmolationDamage.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_COF_TempLoc)
              • Custom script: call DestroyGroup(udg_COF_TempGroup)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_SodGuild_TempGroup[50])
  • [trigger][/SPOILER]

bwt, my "english" skill is not good at all, also may i misunderstand something u said...lol
 

Uncle

Warcraft Moderator
Level 67
Joined
Aug 10, 2018
Messages
6,935
Here's a map with a triggered Cloak of Flames. It might not work if you aren't using the latest patch.
I figure you can compare it to your own trigger and see where you can make improvements.

Some things to note:

1) In most cases you don't want to be picking through "every unit in playable map area", especially not every 0.70 seconds. That will cause massive performance problems and only get worse as more units are created. Instead, add the units to the Unit Group when they acquire the Cloak of Flames Item. So when a unit acquires the item add them to the Cloak of Flames Unit Group and when that unit loses the item remove them from the Cloak of Flames Unit Group.

2) When there are no units in the Cloak of Flames Unit Group you should turn off the "Every 0.70 second" trigger. This is important in making your triggers perform well. Only have "Timers" on when they're actually doing something.

You did a good job with cleaning up the leaks, it's just your "Units in playable map area" Unit Group that will cause performance problems.

@TotalClusterLuck Yes, that would leak. "Pick every unit" will create it's own Unit Group if you don't set it as an existing one. So if you don't create a Unit Group yourself then the game creates a Unit Group for you and puts all of those picked units inside of it. This would be fine but unfortunately the Unit Group that it creates for you is never removed/cleaned up. And since it is never removed/cleaned up it creates a memory leak. That's why you always want to create the Unit Group yourself since you can then manually destroy it using "call DestroyGroup()". OR you can use the custom script: "set bj_wantDestroyGroup = true" before your "Pick every unit" Action like I did in my map. It marks the next Unit Group you create to be destroyed after it's done picking through every unit. You don't always want to use that though since in some cases you don't want your Unit Group to be destroyed immediately after it's looped through each unit.
About Unit Group Leak

Note that I used a Unit Indexer in my map. If you don't already know, a Unit Indexer is a system that gives each unit a unique Custom Value. Using that Custom Value in combination with Array variables allows you to store near endless amounts of information. I recommend using one if you don't already. All you have to do is copy and paste Bribe's Unit Indexer (the folder in my map) into your map and it'll work. Just make sure that you weren't already using your unit's Custom Value for something else.
 

Attachments

  • Cloak of Flames Uncle.w3x
    28.3 KB · Views: 25
Last edited:
Status
Not open for further replies.
Top