• 🏆 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!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

Trigger causing lag and crashes in some cases

Status
Not open for further replies.
Level 2
Joined
Feb 5, 2017
Messages
4
Hi everyone,

I've tried to fix the trigger below over and over again but can't figure out why it is causing so much lag/crashes. Thank you in advance!
Screenshot (7).png
 

Uncle

Warcraft Moderator
Level 62
Joined
Aug 10, 2018
Messages
6,285
A lot is wrong here. Wait for Condition is just bad, don't use it. You should change (Casting unit) to (Triggering unit). Change (Triggering player) to (Owner of (Triggering unit)). Change the Event BEGINS casting an ability to STARTS the effect of an ability. And there's a much better way to handle this trigger using a Loop trigger that compares the distance between the cast point and the target periodically. Also, if you want to keep it MUI with the Loop trigger, you may have to remove the previous instance of the ability associated with the casting unit when casting it again. Or better yet, use dynamic indexing to keep it completely MUI without any issues. You could even use a Damage engine to detect when the Acid bomb impacts the enemy and deal the bonus damage then.
 
Last edited:
Level 2
Joined
Feb 5, 2017
Messages
4
Changed over to 'triggering unit'. It lags out/crashes when the damage action fires. its interacting with a damage engine, but I still get the same issue when I turn it off. Sorry for the noob question, but how do I remove any previous instances of the ability associated with the casting unit when casting it again? Do I literally remove it, and then add it back and level it up?
 

Uncle

Warcraft Moderator
Level 62
Joined
Aug 10, 2018
Messages
6,285
Changed over to 'triggering unit'. It lags out/crashes when the damage action fires. its interacting with a damage engine, but I still get the same issue when I turn it off. Sorry for the noob question, but how do I remove any previous instances of the ability associated with the casting unit when casting it again? Do I literally remove it, and then add it back and level it up?
It sounds like your Damage engine trigger is the cause of the crash.

Regarding removing previous instances of the ability, it's all about making the Actions of your trigger(s) work properly regardless of the ability cooldown/number of casters. So if a unit were to cast the ability again while a previous instance was already active, and by that I mean previous instance of TRIGGERS that are associated with the ability/unit, then you'd need to handle those triggers properly to make sure that nothing goes wrong. But that only applies if your triggers are setup in a certain way.

Anyway, after looking at your trigger again I think I fully understand what you're trying to do now which changes some things.
So you basically want Acid Bomb to deal bonus damage on impact based on the level of Flame Burst.
I have some questions before I can help you further:

Why do you need the initial 0.30 second Wait?
What happens in your Damage trigger? Can you post that trigger please.
What do you want this custom ability to do exactly? The more details the better.
 
Last edited:
Level 2
Joined
Feb 5, 2017
Messages
4
It sounds like your Damage engine trigger is the cause of the crash.

Regarding removing previous instances of the ability, it's all about making the Actions of your trigger(s) work properly regardless of the ability cooldown/number of casters. So if a unit were to cast the ability again while a previous instance was already active, and by that I mean previous instance of TRIGGERS that are associated with the ability/unit, then you'd need to handle those triggers properly to make sure that nothing goes wrong. But that only applies if your triggers are setup in a certain way.

Anyway, after looking at your trigger again I think I fully understand what you're trying to do now which changes some things.
So you basically want Acid Bomb to deal bonus damage on impact based on the level of Flame Burst.
I have some questions before I can help you further:

Why do you need the initial 0.30 second Wait?
What happens in your Damage trigger? Can you post that trigger please.
What do you want this custom ability to do exactly? The more details the better.
Thank you so much for the reply.

The gist of it is I have an AoS-style map where there can be mirrored hero selections. I indexed by player number so that in mirror matches the trigger can work for both players using the same hero type simultaneously.

The .3 second wait ensures that the dummy casts the Acid Bomb ability in a scenario where the caster kills a unit from close range with Flame Burst. I'm using Acid Bomb for the missile art since it doesn't show with Flame burst (based on Channel).

I think the issue is the damage engine too... to be frank I downloaded it and do not fully understand how it works.
Screenshot (9).png
 

Uncle

Warcraft Moderator
Level 62
Joined
Aug 10, 2018
Messages
6,285
A Damage Engine provides you with the ability to create triggers that can interact with Damage being dealt. When I asked you to post your Damage trigger, I meant any triggers you created that detect damage. If it's Bribe's Damage Engine it'd look something like this:
  • Events
  • Game - DamageModifierEvent becomes Equal to 1.00
  • Conditions
  • Actions

And it sounds like your Dummy unit isn't setup properly. A Dummy unit should be able to cast a spell instantly on any number of targets without any delays. Make sure your Dummy unit has these settings:
Movement Type: None
Speed Base: 0
Art - Cast Point / Backswing: 0.00
Attacks Enabled: None
Death Type: Can't Raise, Does Not Decay

Also, I edited my first post and added some other things that you should change so look over that again if you'd like.

That being said, I still don't fully understand how you want the spell to work. Why not use Acid Bomb as the main spell instead of Channel? What does the spell do exactly? Can you give me it's tooltip description.

As far as I understand you want to fire a missile at an enemy unit which deals Damage based on the caster's Intelligence upon impact. If that's the case, I would ditch the Wait stuff and detect when Acid Bomb hits it's target using a Damage Engine trigger. Then you can deal the bonus damage in this new trigger.
Something like this, assuming you're using Bribe's Damage Engine:
  • Events
  • Game - DamageModifierEvent becomes Equal to 1.00
  • Conditions
  • Unit-type of DamageEventSource Equal to FlameBurstDummy
  • Actions
  • Set Variable PN = Player number of (Owner of (DamageEventSource))
  • Unit - Cause PlayerHero[PN] to deal X damage to DamageEventTarget...

If you're on an older version of DamageEngine you may have to take extra steps. I believe older versions had to temporarily turn off the Damage Engine before dealing damage inside of a Damage Event trigger. There's plenty of information out there about how the systems works if you need help.
 
Last edited:
Level 2
Joined
Feb 5, 2017
Messages
4
A Damage Engine provides you with the ability to create triggers that can interact with Damage being dealt. When I asked you to post your Damage trigger, I meant any triggers you created that detect damage. If it's Bribe's Damage Engine it'd look something like this:
  • Events
  • Game - DamageModifierEvent becomes Equal to 1.00
  • Conditions
  • Actions

And it sounds like your Dummy unit isn't setup properly. A Dummy unit should be able to cast a spell instantly on any number of targets without any delays. Make sure your Dummy unit has these settings:
Movement Type: None
Speed Base: 0
Art - Cast Point / Backswing: 0.00
Attacks Enabled: None
Death Type: Can't Raise, Does Not Decay

Also, I edited my first post and added some other things that you should change so look over that again if you'd like.

That being said, I still don't fully understand how you want the spell to work. Why not use Acid Bomb as the main spell instead of Channel? What does the spell do exactly? Can you give me it's tooltip description.

As far as I understand you want to fire a missile at an enemy unit which deals Damage based on the caster's Intelligence upon impact. If that's the case, I would ditch the Wait stuff and detect when Acid Bomb hits it's target using a Damage Engine trigger. Then you can deal the bonus damage in this new trigger.
Something like this, assuming you're using Bribe's Damage Engine:
  • Events
  • Game - DamageModifierEvent becomes Equal to 1.00
  • Conditions
  • Unit-type of DamageEventSource Equal to FlameBurstDummy
  • Actions
  • Set Variable PN = Player number of (Owner of (DamageEventSource))
  • Unit - Cause PlayerHero[PN] to deal X damage to DamageEventTarget...

If you're on an older version of DamageEngine you may have to take extra steps. I believe older versions had to temporarily turn off the Damage Engine before dealing damage inside of a Damage Event trigger. There's plenty of information out there about how the systems works if you need help.
Thank you so much for the reply! I will try to apply some of this next time I have a free moment. You've been super helpful!
 
Status
Not open for further replies.
Top