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

How to remove many effects from the game?

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,141
Hello everyone. I am trying to create skills based on League of Legends character Veigar's Event Horizon.

We are creating area and detects enemy heroes who try to enter gets --- action part ---

But i have a serious problem with the effects.


  • Veigar E Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Veigar E //
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Veigar E // for (Casting unit)) Greater than or equal to 1
        • Then - Actions
          • Set Veigar_E = 0.00
          • Set Veigar_E_Area = (Target point of ability being cast)
          • For each (Integer A) from 1 to 12, do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect at ((Target point of ability being cast) offset by 250.00 towards Veigar_E degrees) using Units\Human\HeroBloodElf\BloodElfBall.mdl
              • Set Veigar_E = (Veigar_E + 30.00)
          • Wait 4.00 seconds
          • Special Effect - Destroy (Last created special effect)
When i try to delete Last created special effect, it removes only one effect (last created one)
How can i remove these effects?

By the way alternatively it is possible if i will replace effects with units but i prefer this one if possible.
 
Last edited:
Level 20
Joined
Aug 29, 2012
Messages
837
You need to keep track of them in some way, here is an option to give you an idea:

  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Special Effect - Create a special effect at (Center of (Playable map area)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
        • Set Int = (Int + 1)
        • Set SFX[Int] = (Last created special effect)
    • Wait 4.00 seconds
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Special Effect - Destroy SFX[(Integer A)]
    • Set Int = 0


Int is an integer variable, SFX a special effect variable with an array. What it should do is store all your created special effects into a variable, going from 1 to 12, and then destroys special effects 1 - 12, assuming the ability has not been reused by someone else in the meantime :)
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
@Chaosium You are amazing. Thank you so much.
Here is the current situation. Is it all good or do i need to do any leak things?

  • Veigar E Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Prison //
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Dark Prison // for (Casting unit)) Greater than or equal to 1
        • Then - Actions
          • Set DarkPrison = 0.00
          • Set PrisonArea = (Target point of ability being cast)
          • For each (Integer A) from 1 to 12, do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect at ((Target point of ability being cast) offset by 250.00 towards DarkPrison degrees) using Units\Human\HeroBloodElf\BloodElfBall.mdl
              • Set VeigarEffect = (VeigarEffect + 1)
              • Set VeigarEffect2[VeigarEffect] = (Last created special effect)
              • Set DarkPrison = (DarkPrison + 30.00)
          • Wait 4.00 seconds
          • For each (Integer A) from 1 to 12, do (Actions)
            • Loop - Actions
              • Special Effect - Destroy VeigarEffect2[(Integer A)]
          • Set VeigarEffect = 0
        • Else - Actions
 
Level 20
Joined
Aug 29, 2012
Messages
837
Only thing that I can think of is clearing the PrisonArea point with call RemoveLocation(udg_Prison_Area) after you're done using it

Edit: also it seems you're creating the special effect at the target point of the ability and your point variable is not used at all, so make sure you're using PrisonArea so that you can clear this point afterward :)
 
Level 20
Joined
Feb 27, 2019
Messages
593
Using offset creates a new point. Both points need to be removed to prevent leaks.
  • Special Effect - Create a special effect at ((Target point of ability being cast) offset by 250.00 towards DarkPrison degrees) using Units\Human\HeroBloodElf\BloodElfBall.mdl
  • Set Point1 = (Target point of ability being cast)
  • Set Point2 = Point1 offset by 250.00 towards...
  • call RemoveLocation(udg_Point1)
  • call RemoveLocation(udg_Point2)
It should end up looking something like this.
  • Special Effect - Create a special effect at Point2 using Units\Human\HeroBloodElf\BloodElfBall.mdl
 
Status
Not open for further replies.
Top