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

[Trigger] Multi-target Bloodlust

Status
Not open for further replies.
Level 2
Joined
Mar 17, 2008
Messages
9
Hi,
I'm trying to make an ability that gives everyone on the team bloodlust.
I think there must be a memory leak or something in here because the game always ends up crashing after awhile with this trigger enabled.
I am wondering if someone can help me figure out what I did wrong.
YdQP4Ar.gif

OVe0kcq.gif
 
You have a lot of unnecessary steps in here that I would clean up. That could make it perform better.

This step of converting the player to a player group seems completely pointless to me. Why don't you set triggeringUnitOwner = Owner of (Triggering unit), and then (Matching unit) belongs to an ally of triggeringUnitOwner ?

Remove all units of Vampiric_Bloodlust from Vampiric_Bloodlust -> Unit Group - Clear.

"For each (Integer A) from 1 to (Number of units in Vampiric_Bloodlust), do (Actions)"

Here, you're setting a variable to the same unit multiple times.
 
Last edited:
The trigger runs when bloodlust is casted.
Inside the trigger a unit casts bloodlust, which could fire itself again and result in an infinite loop.
Try to turn the trigger off before you order the bloodlust cast, and then turn it on again.

One global dummy could be used, instead of creating one dummy per cast. Single Target Spell for Multiple Units

This explains how to easily post triggers on this forum. How To Post Your Trigger

Edit

Even bloodlust has probably low casting/animation time, it's better use "Starts effect of ability" over "Begins casting an ability". E.g. the mana is not consumed, yet, and spell effect might be interrupted. Casting Events Guide
 
Last edited:
Level 2
Joined
Mar 17, 2008
Messages
9
The trigger runs when bloodlust is casted.
Inside the trigger a unit casts bloodlust, which could fire itself again and result in an infinite loop.
Try to turn the trigger off before you order the bloodlust cast, and then turn it on again.

One global dummy could be used, instead of creating one dummy per cast. Single Target Spell for Multiple Units

This explains how to easily post triggers on this forum. How To Post Your Trigger

Edit

Even bloodlust has probably low casting/animation time, it's better use "Starts effect of ability" over "Begins casting an ability". E.g. the mana is not consumed, yet, and spell effect might be interrupted. Casting Events Guide

As for the bloodlust starting an infinite loop, that shouldn't be the case. I should have specified in the OP but the Bloodlust Trigger is a custom spell based on thunderclap, so as far as im aware, that should make them unrelated.

I'll give the 1 dummy a try and see if that fixes it.

Thanks for the tip on how to post triggers! I was wondering how people made them show up so nice.
 
Level 2
Joined
Mar 17, 2008
Messages
9
You have a lot of unnecessary steps in here that I would clean up. That could make it perform better.

This step of converting the player to a player group seems completely pointless to me. Why don't you set triggeringUnitOwner = Owner of (Triggering unit), and then (Matching unit) belongs to an ally of triggeringUnitOwner ?

Remove all units of Vampiric_Bloodlust from Vampiric_Bloodlust -> Unit Group - Clear.

"For each (Integer A) from 1 to (Number of units in Vampiric_Bloodlust), do (Actions)"

Here, you're setting a variable to the same unit multiple times.


Good point, changed the triggeringUnitOwner top be just a player.

Changed it to Unit group -clear.

I didn't actually mean to have that loop in there, it was from an old attempt to get it working and forgot to remove it from that instance.
 
Level 2
Joined
Mar 17, 2008
Messages
9
  • Vampire Bloodlust2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bloodlust
    • Actions
      • -------- Caster --------
      • Set Caster_Bloodlust = (Triggering unit)
      • -------- Owner Of Caster --------
      • Set triggeringUnitOwner = (Owner of (Triggering unit))
      • -------- Caster's Position --------
      • Set tempPoint = (Position of (Triggering unit))
      • -------- Create Dummy --------
      • Unit - Create 1 Bloodlust Dummy (level1) for triggeringUnitOwner at tempPoint facing Default building facing degrees
      • Set Vampire_Bloodluster = (Last created unit)
      • Unit - Add a 6.00 second Generic expiration timer to Vampire_Bloodluster
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Set Vampiric_Bloodlust = (Units in Left Team <gen> matching (((Matching unit) belongs to an ally of triggeringUnitOwner) Equal to True))
        • Else - Actions
          • Set Vampiric_Bloodlust = (Units in Right Team <gen> matching (((Matching unit) belongs to an ally of triggeringUnitOwner) Equal to True))
      • Unit Group - Pick every unit in Vampiric_Bloodlust and do (Actions)
        • Loop - Actions
          • Set tempUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tempUnit is alive) Equal to True
            • Then - Actions
              • Unit - Order Vampire_Bloodluster to Orc Shaman - Bloodlust tempUnit
            • Else - Actions
      • Custom script: call DestroyGroup(udg_Vampiric_Bloodlust)
      • Custom script: call RemoveLocation(udg_tempPoint)
So, i tried the 1 dummy version, but it only costs bloodlust on one unit. Did I fuck it up somehow?
 
Level 7
Joined
Apr 17, 2017
Messages
316
  • Vampire Bloodlust2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bloodlust
    • Actions
      • -------- Caster --------
      • Set Caster_Bloodlust = (Triggering unit)
      • -------- Owner Of Caster --------
      • Set triggeringUnitOwner = (Owner of (Triggering unit))
      • -------- Caster's Position --------
      • Set tempPoint = (Position of (Triggering unit))
      • -------- Create Dummy --------
      • Unit - Create 1 Bloodlust Dummy (level1) for triggeringUnitOwner at tempPoint facing Default building facing degrees
      • Set Vampire_Bloodluster = (Last created unit)
      • Unit - Add a 6.00 second Generic expiration timer to Vampire_Bloodluster
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Set Vampiric_Bloodlust = (Units in Left Team <gen> matching (((Matching unit) belongs to an ally of triggeringUnitOwner) Equal to True))
        • Else - Actions
          • Set Vampiric_Bloodlust = (Units in Right Team <gen> matching (((Matching unit) belongs to an ally of triggeringUnitOwner) Equal to True))
      • Unit Group - Pick every unit in Vampiric_Bloodlust and do (Actions)
        • Loop - Actions
          • Set tempUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tempUnit is alive) Equal to True
            • Then - Actions
              • Unit - Order Vampire_Bloodluster to Orc Shaman - Bloodlust tempUnit
            • Else - Actions
      • Custom script: call DestroyGroup(udg_Vampiric_Bloodlust)
      • Custom script: call RemoveLocation(udg_tempPoint)
So, i tried the 1 dummy version, but it only costs bloodlust on one unit. Did I fuck it up somehow?

Does your dummy unit have 0 Cast Point, Cast backswing ? Also, does your dummy ability have enough range, no cooldown and no manacost ?
 
Level 2
Joined
Mar 17, 2008
Messages
9
Ok, so I figured that part out, i had forgot to set movement speed to 0.

Unfortunately, the game still crashes after awhile.
 
Level 2
Joined
Mar 17, 2008
Messages
9
Ok, so after letting the game run for about 20 minutes, it crashed with that trigger disabled. So I suppose it is something else then.
Is there a maximum number of units on the map allowed before it crashes, because the rest of my triggers are pretty simple so far.

EDIT:

I think i figured it out after some reading i saw that the patch notes mentioning that AI is kinda broken, I still had the melee AI enabled on map initialization. Disabled it and appears to not crash anymore.
 
Last edited:
Status
Not open for further replies.
Top