• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Bug Target Spell damage in an area

Status
Not open for further replies.
Level 3
Joined
Jul 27, 2016
Messages
33
Hello, I have a problem with a spell, at first it works very well but when I do it several times on a group of units there are fewer and fewer units that take the damage of my spell until which there are none left that suffer the damage of my spell.

Someone can tell me why ? The base of this spell is the "Breath Fire", and the Picked unit is :

Unit Group - Pick every unit in (Units within 300.00 of (Target point of ability being cast) matching ((((Matching unit) belongs to an enemy of Player 1 (Red).) Equal to True) and ((((Matching unit) is A flying unit) Equal to False) and (((Matching unit) is alive) Equal to True))).

1636390472123.png



Thanks for help !
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,597
What exactly do you mean by "Proc with other spell". I understand everything besides that part.

This trigger works fine for me:
  • Example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Breath of Fire
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 50
        • Then - Actions
          • -------- Do the cooldown stuff... --------
        • Else - Actions
      • -------- --------
      • Set VariableSet TempPoint = (Target point of ability being cast)
      • Set VariableSet TempGroup = (Units within 300.00 of TempPoint.)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 50
        • Then - Actions
          • -------- CRIT: --------
          • Floating Text - Create floating text that reads CRIT! above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 600.00 damage of attack type Spells and damage type Normal
        • Else - Actions
          • -------- NON-CRIT: --------
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 300.00 damage of attack type Spells and damage type Normal
      • -------- --------
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup (udg_TempGroup)

You should change your Event to STARTS the effect of an ability. Begins casting is very abusable as it can be interrupted and still run the trigger. Also, you were creating the floating text inside of the Pick every unit function which doesn't seem correct. If you do that you'll be creating a Floating Text once for EACH picked unit. Lastly you were leaking a Point/Unit Group.
 
Level 3
Joined
Jul 27, 2016
Messages
33
Oh thank you ! My spell works perfectly!
And for what it is about "Proc with another spell", it's a combo with another spell that's why I added a boolean.

I have just on question, why you add that ? Is it to optimize?
  • page.gif
    Custom script: call RemoveLocation (udg_TempPoint)
  • page.gif
    Custom script: call DestroyGroup (udg_TempGroup)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,597

Those 2 Actions remove/destroy (different word for the same thing) the Point and Unit Group. This is to avoid memory leaks.

Long story short, if you don't deal with memory leaks then your game can potentially run worse. It really depends on how long the game lasts and how many memory leaks you create.
 
Last edited:
Status
Not open for further replies.
Top