• 🏆 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!

[Solved] Is there a Faster way to do this without losing FPS?

Status
Not open for further replies.
Level 9
Joined
Feb 17, 2009
Messages
291
Disclaimer: I don't know JASS

It is rather long, but it's just repetition. I wanted to emulate Diablo 2's stark tinting contrasts depending on the type of status a creature has (e.g. Blue for Cold, Green for Poison, etc.) and then make a priority list since some debuffs are more severe/multifaceted than others.

As you might imagine, doing this 10x a second murdered about 30 percent of my frames. Thankfully, every 1 second is BARELY noticable if at all, but the display is nowhere near as good of course. Is there a faster and less taxing way to do this?

EDIT: fixed the custom script at the bottom. I was very tired when I wrote that

  • Status Colors 1st
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set AA_LEAK_UnitGroups = (Units in (Playable map area))
      • Unit Group - Pick every unit in AA_LEAK_UnitGroups 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
              • (Unit-type of (Picked unit)) Not equal to Random Hero (good guy colored)
              • (Unit-type of (Picked unit)) Not equal to Random Hero (BG)
            • Then - Actions
              • -------- -------------------- --------
              • -------- PRIORITY 1 --------
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) has buff Petrify ) Equal to True
                      • ((Picked unit) has buff Petrify (2)) Equal to True
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (10.00%, 10.00%, 10.00%) with 0.00% transparency
                  • Skip remaining actions
                • Else - Actions
              • -------- -------------------- --------
              • -------- PRIORITY 2 --------
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) has buff Stunned) Equal to True
                      • ((Picked unit) has buff Stunned (Pause)) Equal to True
                      • ((Picked unit) has buff Thunder Clap) Equal to True
                      • ((Picked unit) has buff Entangling Roots ) Equal to True
                      • ((Picked unit) has buff Magic Entangle) Equal to True
                      • ((Picked unit) has buff Holy Fire ) Equal to True
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (72.00%, 25.00%, 72.00%) with 0.00% transparency
                  • Skip remaining actions
                • Else - Actions
              • -------- -------------------- --------
              • -------- PRIORITY 3 --------
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) has buff Slow Poison (Non-stacking)) Equal to True
                      • ((Picked unit) has buff Slow Poison (Stacking)) Equal to True
                      • ((Picked unit) has buff Poison (Non-stacking)) Equal to True
                      • ((Picked unit) has buff Poison (Stacking)) Equal to True
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (15.00%, 100.00%, 15.00%) with 0.00% transparency
                  • Skip remaining actions
                • Else - Actions
              • -------- -------------------- --------
              • -------- PRIORITY 4 --------
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) has buff Slowed) Equal to True
                      • ((Picked unit) has buff Slowed (Info) CUSTOM ) Equal to True
                      • ((Picked unit) has buff Slowed (Non-stacking) CUSTOM) Equal to True
                      • ((Picked unit) has buff Slowed (Stacking) CUSTOM) Equal to True
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (20.00%, 45.00%, 100.00%) with 0.00% transparency
                  • Skip remaining actions
                • Else - Actions
              • -------- -------------------- --------
              • -------- PRIORITY 5 --------
              • -------- -------------------- --------
              • 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 |cff8b00ffGaze of Romulus|r) Equal to True
                      • ((Picked unit) has an item of type |cff8b00ffGaze of Romulus|r |cff00ff00II|r) Equal to True
                      • ((Picked unit) has an item of type |cff8b00ffGaze of Romulus|r |cff00ff00III|r) Equal to True
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (25.00%, 100.00%, 25.00%) with 75.00% transparency
                  • Skip remaining actions
                • Else - Actions
              • -------- -------------------- --------
              • -------- PRIORITY 6 --------
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Equal to Ghost_Dragon
                • Then - Actions
                  • Animation - Change Ghost_Dragon's vertex coloring to (100.00%, 100.00%, 100.00%) with 55.00% transparency
                  • Skip remaining actions
                • Else - Actions
              • -------- -------------------- --------
              • -------- PRIORITY 7 --------
              • -------- -------------------- --------
              • -------- -fixes for tinted units- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Equal to Voldemort 0282 <gen>
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (40.00%, 40.00%, 40.00%) with 0.00% transparency
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Equal to Huge Mamma Jamma
                    • Then - Actions
                      • Animation - Change (Picked unit)'s vertex coloring to (0.00%, 0.00%, 0.00%) with 0.00% transparency
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Big Mamma Jamma
                        • Then - Actions
                          • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Picked unit)) Equal to Brood Mother
                            • Then - Actions
                              • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 31.40%, 100.00%) with 0.00% transparency
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Unit-type of (Picked unit)) Equal to Unbroken Darkweaver
                                • Then - Actions
                                  • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 39.22%, 39.22%) with 0.00% transparency
                                • Else - Actions
                                  • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
            • Else - Actions
      • Custom script: call DestroyGroup(udg_AA_LEAK_UnitGroups)
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
Rather than creating a group that has to pick the entire map every second. Add the units to a certain group and set what color the units in that group should be every second or however frequently. You likely could do .1 or .03 etc if its only enumerating through like 10 groups.

Also if you have unit types and particular units there is no need to continuously set their color over and over to the same value.

Also an option since a lot of these are buff based is using a damage detection system and then changing the color, then check for when the buff is gone and reset color.
 
Level 9
Joined
Feb 17, 2009
Messages
291
Rather than creating a group that has to pick the entire map every second. Add the units to a certain group and set what color the units in that group should be every second or however frequently. You likely could do .1 or .03 etc if its only enumerating through like 10 groups.

Sounds like a good idea, I've never done that though. The only unit group action I've used over the years, is picking and doing loops :p I'm a very visual learner. Does that mean the lag isn't coming from picking units in playable map area, but rather the loop resulting from that? If that's true then are you saying I could pick the whole map and then have a part down below that handles group 1, 2, 3, etc. specifically?

Also if you have unit types and particular units there is no need to continuously set their color over and over to the same value.

Yeah you're right, I don't know a better way though.

Also an option since a lot of these are buff based is using a damage detection system and then changing the color, then check for when the buff is gone and reset color.

I have Weep's GDD, but I am very much a novice with this too. I use it to display SCT that's about it. It's probably way more powerful than that. I wanted to use it to fix all of the places I did "unit is attacked" but then I realized I didn't know how to distinguish between attacks and spells so item dummies started firing off of spells and shit :D
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
Creating and destroying groups especially ones that need to pick a lot of units very frequently is expensive.
A way to this reduce group creation is catching which units will have this debuff, saving them either in a group or unit array, then you can check if their debuff or a duration that you've defined has ended then resetting their color.

For specific units or unit types you can simply set their vertex color in the OE. Like Unbroken Darkweaver you just need to calculate what those percentages look like in a 255 - 255 -255 format and put them and you'll have your color.

Also for the unit's like the Ghost Dragon who have normal color but need a transparency fix, you need to simply detect when this unit enters the map and then set it's transparency. If there are any Ghost Dragons pre-placed you'll need to just pick them on map init and set them.

Again the use of DDS could be a potential way to check and change colors although personally I don't think I would go that route, it probably is an acceptable one though. I don't know much about Weeb's so it may or may not have the ability to distinguish between damage sources, regardless it would imagine it still would be able to see if a unit had a certain buff.

Hopefully this gives a little more info, if not I can try to show a small demo of what I mean tomorrow, or maybe someone else might explain a better way that you like.

Edit: Also be advised that Skip Remaining Actions means that you never reach the end of the trigger in most cases so you neglect to destroy your point (although I don't see where you set it) and I don't see a DestroyGroup call so that means you're leaking a group as well.
 
Level 9
Joined
Feb 17, 2009
Messages
291
Creating and destroying groups especially ones that need to pick a lot of units very frequently is expensive.
A way to this reduce group creation is catching which units will have this debuff, saving them either in a group or unit array, then you can check if their debuff or a duration that you've defined has ended then resetting their color.

Was my idea in previous post what you meant? Otherwise I probably need to see an example cause my brain's always had a hard time grasping how to do this.

Also for the unit's like the Ghost Dragon who have normal color but need a transparency fix, you need to simply detect when this unit enters the map and then set it's transparency. If there are any Ghost Dragons pre-placed you'll need to just pick them on map init and set them.

I have Bribe's unit indexer but I don't use it much, so not sure how to do that.

Edit: Also be advised that Skip Remaining Actions means that you never reach the end of the trigger in most cases so you neglect to destroy your point (although I don't see where you set it) and I don't see a DestroyGroup call so that means you're leaking a group as well.

Well I'm glad you caught that. That was meant to kill the group. It's late over here too :p

I used skips because I thought it would help me prioritize which color is shown. I didn't need to check beyond whatever color was applied - i.e. poisoned deals damage, and both poison/chilled slow your speed, so poison is more dangerous and thus I deemed it higher priority to show than chilled. It seems to work so I assumed that was good enough of a method (the rationalists on this website are groaning at my usage of 'good enough' right now)
 
Or you could make it like this. Create a custom "Sphere" ability, name it "Poison Type Unit" set all fields to empty and add ability to your poison status units.

Then make a new trigger with event - every time a unit enters the map.

Check if the unit has ability "Poison Type Unit".

Set tinting color to green if the unit has "poison type unit" ability. This way it won't waste frame-rate and save a whole lot performance. Basically every time a unit with that ability enters or spawns in the map, it will have it's color changed without looping every # seconds.

For pre-placed units just enumerate just like you did in your triggers.

I created a test map for you.
 

Attachments

  • Poison Type.w3x
    17.6 KB · Views: 47
Last edited:
Level 9
Joined
Feb 17, 2009
Messages
291
Or you could make it like this. Create a custom "Sphere" ability, name it "Poison Type Unit" set all fields to empty and add ability to your poison status units.

Then make a new trigger with event - every time a unit enters the map.

Check if the unit has ability "Poison Type Unit".

Set tinting color to green if the unit has "poison type unit" ability. This way it won't waste frame-rate and save a whole lot performance. Basically every time a unit with that ability enters or spawns in the map, it will have it's color changed without looping every # seconds.

For pre-placed units just enumerate just like you did in your triggers.

I created a test map for you.

I appreciate it but I think my goal here has been a bit unclear.

I'm not trying to make units change color as they enter the map. I'm trying to change their color as they are hit by certain item, unit or hero abilities like stun, chilled and poison for the duration. That's why I created the master buff list for each type. It's an AoS, I want stunned/rooted units to change to purple, poisoned to green, etc. while the debuff lasts, with a set of priority rules for more/less severe debuffs. Does that make sense now?

My trigger already accomplished this perfectly but it is too intense of a process to do like I am doing

EDIT: "debuff", not debug
 
Last edited:
Level 37
Joined
Jul 22, 2015
Messages
3,485
  • You have a unit group leak every 1 second
  • It seems you are removing a null location every 1 second. That can have some nasty consequences. Where is AA_Leak_Points being defined?
  • Store (Picked unit) into a variable instead of having to call it everytime
  • Instead of enumerating through the entire map and checking if they have a buff to change the color, add them to specific unit groups when the spell is casted on them
 
Level 9
Joined
Feb 17, 2009
Messages
291
  • You have a unit group leak every 1 second
  • It seems you are removing a null location every 1 second. That can have some nasty consequences. Where is AA_Leak_Points being defined?
  • Store (Picked unit) into a variable instead of having to call it everytime
  • Instead of enumerating through the entire map and checking if they have a buff to change the color, add them to specific unit groups when the spell is casted on them

Please read my other posts all of this was already discussed and I replied to it
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
Instead of running it periodically, hook it to changes in conditions that would cause a tint change. This removes periodic polling and hence saves lots of resources.

For restoring default tint you can use a hashtable to store the data as that has O(1) lookup speed as opposed to your O(n) lookup you currently have.

If acquiring an item causes the tint change then when that specific item is acquired you recompute tint for that specific unit. If a certain buff obtained on creation affects tint then on creation you recompute tint for that created unit.
 
Level 9
Joined
Feb 17, 2009
Messages
291
Instead of running it periodically, hook it to changes in conditions that would cause a tint change. This removes periodic polling and hence saves lots of resources.

For restoring default tint you can use a hashtable to store the data as that has O(1) lookup speed as opposed to your O(n) lookup you currently have.

If acquiring an item causes the tint change then when that specific item is acquired you recompute tint for that specific unit. If a certain buff obtained on creation affects tint then on creation you recompute tint for that created unit.

Well I thought about trying to make it based on damage or spells cast, but I don't know how I'd take it away. Lots of guys here are way past figuring out how to make a giant array and add units to groups. I've never had to do that.

Some people were confused earlier, I'll clarify again just in case...

Say my hero has both an orb of venom and orb of frost and I attack you (I use dummies for orb effects so yes they can stack in my map). Poison lasts for 2 sec, frost lasts for 4 let's say. Poison is higher on my list so your hero changes tint to green for 2 sec.

After 2 sec, you change to blue for 2 seconds more, since the frost lasts longer and is lower priority than poison (why it does not show for the first 2 sec).

2 Sec later when the cold is gone, you tint back to normal since pois/frost debuffs are gone.

I have a lot of items/abilities with different durations, so that's why I used this periodic / unit group idea. I couldn't think of a better way to track that all over the map. I probably need something visual at this point cause I'm not following very well.

I don't know how to use hashtables so i'm SOL on that :\
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
So I had a few minutes. So I hope it works without any problems. I'll post the triggers if anyone else wants to glace over them.

To use this you just need to set the MaxNumberOfPriorties to whatever the max number is, so if there is one for stun, one for slow that would be 2. etc.

You'll also need to set everything that is in the "How to Use" trigger. That includes, the unit whose color is changing, the duration of the color change, and then TempReal-TempReal3 are the unit's initial colors. So if it is cast on a unit who has no red it would be something like 0, 100, 100. TempReal4 is the unit's initial transparency. Again this is all so we know what to set it back too after. Lastly you set the Priority, this lets us know what color to change to if there are multiple effects happening simultaneously.

So for example in the event that someone gets entangling rooted you could just catch the spell being cast and then set all the values as shown below and it would change to whatever color and end when the spell ended by making the duration the same as duration of the spell.

For a spell like storm bolt, you would need to trigger the projectile (this is very easy). That way you could know precisely when it hits and change the color accordingly.

For an orb effect on attack its the same deal except you use the DDS. EX: When a footman is damaged by a Blademaster if the blademaster has the orb of venom we set all the values again and the footman turns our color.

Edit: Just so the name of the map doesn't confuse you. I'm not actually tying the color to a buff, we're just simulating that effect by applying it when the buff comes and removing it when the buff will end by putting in the same duration.

Here is a test map so you can tinker around a little, but it ought to be pretty easy to implement.


  • Debuff SetUp
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set TempPriority = 1
      • Set MaxNumberOfPriorties = 2
      • For each (Integer TempInteger) from 1 to MaxNumberOfPriorties, do (Actions)
        • Loop - Actions
          • Custom script: set udg_Debuff_Groups[udg_TempInteger] = CreateGroup()
  • Debuff init
    • Events
    • Conditions
    • Actions
      • Set Debuff_MaxIndex = (Debuff_MaxIndex + 1)
      • Set Debuff_Unit[Debuff_MaxIndex] = TempUnit
      • Set Debuff_Duration[Debuff_MaxIndex] = TempDuration
      • Set Debuff_Color[Debuff_MaxIndex] = TempReal
      • Set Debuff_Color2[Debuff_MaxIndex] = TempReal2
      • Set Debuff_Color3[Debuff_MaxIndex] = TempReal3
      • Set Debuff_Transparency[Debuff_MaxIndex] = TempReal4
      • Set Debuff_Priority[Debuff_MaxIndex] = TempPriority
      • Unit Group - Add Debuff_Unit[Debuff_MaxIndex] to Debuff_Groups[TempPriority]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Debuff_MaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Debuff loop <gen>
        • Else - Actions
  • Debuff loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TempInteger) from 1 to Debuff_MaxIndex, do (Actions)
        • Loop - Actions
          • Set Debuff_Duration[TempInteger] = (Debuff_Duration[TempInteger] - 0.04)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Debuff_Duration[TempInteger] Less than or equal to 0.00
            • Then - Actions
              • Unit Group - Remove Debuff_Unit[TempInteger] from Debuff_Groups[Debuff_Priority[TempInteger]]
              • Set TempBoolean = False
              • For each (Integer TempInteger2) from 1 to MaxNumberOfPriorties, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Debuff_Unit[TempInteger] is in Debuff_Groups[TempInteger2]) Equal to True
                    • Then - Actions
                      • Set TempBoolean = True
                    • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TempBoolean Equal to True
                • Then - Actions
                • Else - Actions
                  • Animation - Change Debuff_Unit[TempInteger]'s vertex coloring to (Debuff_Color[TempInteger]%, Debuff_Color2[TempInteger]%, Debuff_Color3[TempInteger]%) with Debuff_Transparency[TempInteger]% transparency
              • Set Debuff_Unit[TempInteger] = Debuff_Unit[Debuff_MaxIndex]
              • Set Debuff_Duration[TempInteger] = Debuff_Duration[Debuff_MaxIndex]
              • Set Debuff_Color[TempInteger] = Debuff_Color[Debuff_MaxIndex]
              • Set Debuff_Color2[TempInteger] = Debuff_Color2[Debuff_MaxIndex]
              • Set Debuff_Color3[TempInteger] = Debuff_Color3[Debuff_MaxIndex]
              • Set Debuff_Transparency[TempInteger] = Debuff_Transparency[Debuff_MaxIndex]
              • Set Debuff_Priority[TempInteger] = Debuff_Priority[Debuff_MaxIndex]
              • Set TempInteger = (TempInteger - 1)
              • Set Debuff_MaxIndex = (Debuff_MaxIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Debuff_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Debuff_Unit[TempInteger] is in Debuff_Groups[Debuff_Priority[TempInteger]]) Equal to True
                • Then - Actions
                • Else - Actions
                  • Unit Group - Add Debuff_Unit[TempInteger] to Debuff_Groups[Debuff_Priority[TempInteger]]
              • Unit Group - Pick every unit in Debuff_Groups[1] and do (Actions)
                • Loop - Actions
                  • Set TempUnit = (Picked unit)
                  • Animation - Change TempUnit's vertex coloring to (0.00%, 0.00%, 100.00%) with 0.00% transparency
              • Unit Group - Pick every unit in Debuff_Groups[2] and do (Actions)
                • Loop - Actions
                  • Set TempUnit = (Picked unit)
                  • Animation - Change TempUnit's vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
  • How to Use
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempDuration = 10.00
      • Set TempReal = 100.00
      • Set TempReal2 = 100.00
      • Set TempReal3 = 100.00
      • Set TempReal4 = 0.00
      • Set TempPriority = 1
      • -------- This is for demo purposes --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempPriority Equal to 1
        • Then - Actions
          • Set TempPriority = 2
        • Else - Actions
          • Set TempPriority = 1
      • -------- This is for demo purposes --------
      • Trigger - Run Debuff init <gen> (ignoring conditions)
 

Attachments

  • Color by Buff.w3x
    19.2 KB · Views: 46
Last edited:
Level 9
Joined
Feb 17, 2009
Messages
291
So I had a few minutes. So I hope it works without any problems. I'll post the triggers if anyone else wants to glace over them.

To use this you just need to set the MaxNumberOfPriorties to whatever the max number is, so if there is one for stun, one for slow that would be 2. etc.

You'll also need to set everything that is in the "How to Use" trigger. That includes, the unit whose color is changing, the duration of the color change, and then TempReal-TempReal3 are the unit's initial colors. So if it is cast on a unit who has no red it would be something like 0, 100, 100. TempReal4 is the unit's initial transparency. Again this is all so we know what to set it back too after. Lastly you set the Priority, this lets us know what color to change to if there are multiple effects happening simultaneously.

So for example in the event that someone gets entangling rooted you could just catch the spell being cast and then set all the values as shown below and it would change to whatever color and end when the spell ended by making the duration the same as duration of the spell.

For a spell like storm bolt, you would need to trigger the projectile (this is very easy). That way you could know precisely when it hits and change the color accordingly.

For an orb effect on attack its the same deal except you use the DDS. EX: When a footman is damaged by a Blademaster if the blademaster has the orb of venom we set all the values again and the footman turns our color.

Edit: Just so the name of the map doesn't confuse you. I'm not actually tying the color to a buff, we're just simulating that effect by applying it when the buff comes and removing it when the buff will end by putting in the same duration.

Here is a test map so you can tinker around a little, but it ought to be pretty easy to implement.

First of all I really appreciate you taking time to help me out. <3 This is what I was talking about!

Now I have a few things here - I haven't done triggered projectiles before (not the 'proper' way at least) and I have like 900 custom abilities lmfao so I really don't know how much I even care tbh. No biggie tho. How would you do a skill like frost nova that causes chilled in an aoe?

Another thing is when I tried using my DDS (I only started using one recently) to do exactly what you described, *ALL* sources of damage from that hero would, for example, spawn orb dummies because they carried a frost item/whatever. I guess it would be cool if orbs proc'ed on literally everything but there would be huge balance concerns I can't even begin to imagine.

I actually had a whole list of 'Unit is Attacked' triggered spells I was going to go back and fix with my new DDS (I had no clue how abusable the stop button was) and now I can't even start cause I guess my method is wrong XD

Long story short how can I get only the unit's attacks for instance, and exclude spell damage and triggered damage the hero may cause?
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
For frost nova example:

  • Frost Nova
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Frost Nova
    • Actions
      • Set TempUnit2 = (Target unit of ability being cast)
      • Set TempPoint = (Position of TempUnit2)
      • Set TempGroup = (Units within 500.00 of TempPoint)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempUnit3 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit3 belongs to an enemy of (Owner of TempUnit2)) Equal to True
            • Then - Actions
              • Set TempUnit = TempUnit3
              • Set TempDuration = 5.00
              • Set TempReal = 100.00
              • Set TempReal2 = 100.00
              • Set TempReal3 = 100.00
              • Set TempReal4 = 0.00
              • Set TempPriority = 1
              • Trigger - Run Debuff init <gen> (ignoring conditions)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_TempGroup)

As for how you get only the unit's attacks. It's likely the DDS you're using doesn't support distinguishing between spell, physical, and triggered damage. I believe Bribe's can, and looking_for_help's can. (This ought to be easy to find out though).

Keep in mind I kind of did it backwards from what you had (sorry), you could change it around but I went from 1 being lowest priority to whatever your highest will be. Rather than e.g. 10 being the lowest.

Also, rather minor thing as it gets corrected when effects expire, but the loop should be initially off.
 
Last edited:
Level 9
Joined
Feb 17, 2009
Messages
291
I'll be working on implementing LFH's system. This is gonna take a while *phew*

Anyway, no biggie on that priority thing I just wrote in some notes. Unfortunately the frost nova trigger did not work for me I'm still trying to figure out what's wrong.

Edit: so what seems to be happening is WC3 is overriding all of my color changes with their frost color change. I don't see a quick way around that so I may just decide to let it be.
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
Probably Frost Nova is a "bad" ability to try and showcase haha. (I didn't notice it would fail as I tested casting it on my own friendly units and I guess the buff wasn't happening, but I see what you mean.)

You probably would just need to trigger the frost nova, ie. use channel as the base spell with unit targeting. Then damage with the trigger and use something like the sorceress slow cast from a dummy unit on the effected units as that spell doesn't not impart a color change. (I'm fairly certain anyway.) If it does we could go the "hidden passive" with movement speed "aura" in disabled spellbook.
 
Last edited:
Level 9
Joined
Feb 17, 2009
Messages
291
Probably Frost Nova is a "bad" ability to try and showcase haha. (I didn't notice it would fail as I tested casting it on my own friendly units and I guess the buff wasn't happening, but I see what you mean.)

You probably would just need to trigger the frost nova, ie. use channel as the base spell with unit targeting. Then damage with the trigger and use something like the sorceress slow cast from a dummy unit on the effected units as that spell doesn't not impart a color change. (I'm fairly certain anyway.) If it does we could go the "hidden passive" with movement speed "aura" in disabled spellbook.

I decided to lame out on that :p I DID get it to work for my frost-slowing items though, and that was the most important thing. I am also very grateful you mentioned LFH's dds because this one is way better for my needs. Thanks for all your help!! It means a lot. Everything's working awesome-ly now.
 
Status
Not open for further replies.
Top