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

Needing help with my charge triggers

Status
Not open for further replies.
Level 3
Joined
Feb 22, 2020
Messages
43
Not sure whats going on with my spells here but when i use the abilities the Animate Dead special effect appears for both abilities but are set to different triggers. The charge loop doesnt even have an effect but is still playing the effect of fel rush loop. Anyone have a solution for this?
 

Attachments

  • Charge Loop.PNG
    Charge Loop.PNG
    11.2 KB · Views: 24
  • Charge.PNG
    Charge.PNG
    11.6 KB · Views: 13
  • Fel Loop.PNG
    Fel Loop.PNG
    13.4 KB · Views: 15
  • Fel Rush.PNG
    Fel Rush.PNG
    9.2 KB · Views: 19

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,455
Remove "Destroy last created special effect" from the Charge Loop trigger.

Also, you're leaking a lot of Points and you should turn off these timers when you're not using them.
 
Level 3
Joined
Feb 22, 2020
Messages
43
i have tried using diffrent abilities and same thing happens, and yes i will de leak it, any idea on how?

Also i have tried using channel spell but does some pretty wonky things but the effect still goes off regardless.
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,455
Did you remove the "destroy last created special effect' action like I suggested? Because you're destroying a special effect that doesn't exist which can cause problems.

Things That Leak <-- Teaches you how to remove Location (Point) leaks and other kinds of leaks.

Removing a Point example:
  • Custom script: call RemoveLocation (udg_Point[1])
So you would ALWAYS do this after you're done using Point[1] but before you set it again.
 
Last edited:
Level 14
Joined
Nov 17, 2010
Messages
1,265
Actually that might be it. You in essence playing the death animation of the last special effect you had created so it makes sense that it would show up. Remove that from the charge loop and see what happens
 
Level 3
Joined
Feb 22, 2020
Messages
43
Did you remove the "destroy last created special effect' action like I suggested? Because you're destroying a special effect that doesn't exist which can cause problems.

Things That Leak <-- Teaches you how to remove Location (Point) leaks and other kinds of leaks.

Removing a Point example:
  • Custom script: call RemoveLocation (udg_Point[1])
So you would ALWAYS do this after you're done using Point[1] but before you set it again.

Ok, so i removed the destroy effect on charge but did not change the result sadly... hmm..
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,455
Okay, I see the problem now.

You need to use different variables for both triggers because the Loop triggers are always running. Meaning, when you cast Charge or Fel Charge, both Fel Loop and Charge Loop are running regardless.

This is because:
1) You're running these periodic events all of the time (you shouldn't do this)
2) These Loop Triggers are using the same exact variables so both of their effects are going to run. So when you set Distance to let's say 500, both Fel Loop and Charge Loop are going to run because both check if "Distance is greater than 0.00"

Check out the map I attached to see how to properly use a Periodic Event like this. Charge Loop should be set to "Initially off" so it's not running by default and it should be turned on when you cast the Charge Ability, and turned off again when it's finished. And it's variables need to be unique otherwise other triggers like Fel Loop will interfere with it.

Note that problems will occur if more than 1 unit uses each of these abilities. This is because once again the variables will interfere with one another. If you want each of your Charge abilities to be MUI (Usable by multiple units) then take a look at tutorials such as this: Visualize: Dynamic Indexing
 

Attachments

  • Charge Example.w3m
    17.1 KB · Views: 17
Last edited:
Level 3
Joined
Feb 22, 2020
Messages
43
Okay, I see the problem now.

You need to use different variables for both triggers because the Loop triggers are ALWAYS running. Meaning, when you cast Charge, both Fel Loop and Charge Loop are running.

This is because:
1) You're running these periodic events all of the time (you shouldn't do this)
2) These Loops are using the same exact variables so both of their effects are going to run. So when you set Distance to let's say 500, both Fel Loop and Charge Loop are going to run because both check if "Distance is greater than 0.00"

Check out the map I attached to see how to properly use a Periodic Event like this. Charge Loop should be set to "Initially off" so it's not running by default and it should be turned on when you cast the Charge Ability, and turned off again when it's finished. And it's variables need to be unique to it otherwise other triggers like Fel Loop will interfere with it.


Ok just finished making new variables for each of them and it worked perfectly! Both effects are working perfect and have no interference! +rep

Also want to say thank you to all who were involved to help figure it out!
 
Last edited:
Status
Not open for further replies.
Top