• 🏆 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] SPELL: Will this cause leaking issues?

Status
Not open for further replies.
Level 3
Joined
Jul 4, 2013
Messages
35
I'm creating a spell right now, and I'd like to know if you guys suspect it will cause leaking issues. There's only one hero on the map at any time that's able to cast this spell.

  • AllConsumingFlames
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to All-Consuming Flames
    • Actions
      • Set ACFCaster = (Casting unit)
      • Set ACFTargetPoint = (Target point of ability being cast)
      • Set ACFCasterPoint = (Position of (Casting unit))
      • Unit - Create 1 Dummy (AllConsumingFlames) for (Owner of ACFCaster) at ACFCasterPoint facing Default building facing degrees
      • Set ACFDummy = (Last created unit)
      • Set ACFBreathPoint = ACFTargetPoint
      • Unit - Add a 4.50 second Generic expiration timer to ACFDummy
      • Trigger - Turn on AllConsumingFlamesAttack <gen>
      • Wait 4.50 seconds
      • Trigger - Turn off AllConsumingFlamesAttack <gen>
      • Custom script: call RemoveLocation(udg_ACFTargetPoint)
      • Custom script: call RemoveLocation(udg_ACFCasterPoint)
      • Set ACFCaster = No unit
      • Set ACFDummy = No unit
      • Custom script: call RemoveLocation(udg_ACFBreathPoint)
This is the trigger that runs for the duration of this effect.


  • AllConsumingFlamesAttack
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit - Order ACFDummy to Neutral - Breath Of Frost ACFBreathPoint
I believe there is room for improvement in this spell. I'd like to know if you guys have any pointers. The idea is that the hero uses Stampede as a dummy ability and channels. A dummy is created that uses Breath of Fire every 0.25 seconds for the duration of the channel.
 
Level 3
Joined
Jul 4, 2013
Messages
35
when multuple units cast it at the same time, it will leak the 2 locations. The Wait completely ruins your trigger. Try to use indexing instead such that each spell cast has its own counter and dummy caster rather than using Wait.
I highly suggest reading
http://www.hiveworkshop.com/forums/...orials-279/visualize-dynamic-indexing-241896/

Seems to be the kind of tutorial I could use. I'll take a look at it and update this post shortly.

I've updated the spell according to the tutorial. I created a duplicate of the hero that uses the ability and it DOES work when more than one unit casts - BUT there's a new issue: when I click on a unit when I cast the Stampede dummy ability. Doing that seems to make no fire appear, and causes no damage to be dealt. The hero just stands there channeling nothing for the duration. The issue seems to happen if i cast the Stampede ability too close or too far (range of 300) from the hero.

Here's what I have right now.


  • AllConsumingFlames
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to All-Consuming Flames
    • Actions
      • Set ACFIndex = (ACFIndex + 1)
      • Set ACFCaster[ACFIndex] = (Casting unit)
      • Set ACFTargetPoint[ACFIndex] = (Target point of ability being cast)
      • Set ACFCasterPoint[ACFIndex] = (Position of (Casting unit))
      • Set ACFCounter[ACFIndex] = 0.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ACFIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on AllConsumingFlamesAttack <gen>
        • Else - Actions
  • AllConsumingFlamesAttack
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ACFLoopInteger) from 1 to ACFIndex, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy (AllConsumingFlames) for (Owner of ACFCaster[ACFLoopInteger]) at ACFCasterPoint[ACFLoopInteger] facing Default building facing degrees
          • Set ACFDummy[ACFLoopInteger] = (Last created unit)
          • Unit - Add a 0.10 second Generic expiration timer to ACFDummy[ACFLoopInteger]
          • Unit - Order ACFDummy[ACFLoopInteger] to Neutral - Breath Of Frost ACFTargetPoint[ACFLoopInteger]
          • Set ACFCounter[ACFLoopInteger] = (ACFCounter[ACFLoopInteger] + 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ACFCounter[ACFLoopInteger] Greater than or equal to 18.00
            • Then - Actions
              • Set ACFCaster[ACFLoopInteger] = ACFCaster[0]
              • Set ACFTargetPoint[ACFLoopInteger] = ACFTargetPoint[ACFIndex]
              • Set ACFCounter[ACFLoopInteger] = ACFCounter[ACFIndex]
              • Set ACFIndex = (ACFIndex - 1)
              • Set ACFLoopInteger = (ACFLoopInteger - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ACFIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
I've failed to mention earlier that I have a killswitch for the trigger too, which activates when the ability is interrupted for whatever reason.


  • AllConsumingFlamesStop
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to All-Consuming Flames
    • Actions
      • Set ACFCaster[ACFLoopInteger] = ACFCaster[0]
      • Set ACFTargetPoint[ACFLoopInteger] = ACFTargetPoint[ACFIndex]
      • Set ACFCounter[ACFLoopInteger] = ACFCounter[ACFIndex]
      • Set ACFIndex = (ACFIndex - 1)
      • Set ACFLoopInteger = (ACFLoopInteger - 1)
      • Trigger - Turn off AllConsumingFlamesAttack <gen>

I'd like to know if there's a way that I could remove these errors. I suspect it might have something to do with the dummy unit or abilities.


I also suspect that the spell may be leaking.
 
Last edited by a moderator:
Level 22
Joined
Feb 6, 2014
Messages
2,466
Things I changed:
- Dummy doesn't need to be an array
  • Set ACFDummy = (Last created unit)
- Fix location leaks
  • Custom script: call RemoveLocation(udg_ACFCasterPoint[ACFLoopInteger])
  • Custom script: call RemoveLocation(udg_ACFTargetPoint[ACFLoopInteger])
- Fix De-indexing error
  • Set ACFCaster[ACFLoopInteger] = ACFCaster[ACFIndex]
  • AllConsumingFlamesAttack
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ACFLoopInteger) from 1 to ACFIndex, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy (AllConsumingFlames) for (Owner of ACFCaster[ACFLoopInteger]) at ACFCasterPoint[ACFLoopInteger] facing Default building facing degrees
          • Set ACFDummy = (Last created unit)
          • Unit - Add a 0.10 second Generic expiration timer to ACFDummy
          • Unit - Order ACFDummy to Neutral - Breath Of Frost ACFTargetPoint[ACFLoopInteger]
          • Set ACFCounter[ACFLoopInteger] = (ACFCounter[ACFLoopInteger] + 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ACFCounter[ACFLoopInteger] Greater than or equal to 18.00
            • Then - Actions
              • Custom script: call RemoveLocation(udg_ACFCasterPoint[ACFLoopInteger])
              • Custom script: call RemoveLocation(udg_ACFTargetPoint[ACFLoopInteger])
              • Set ACFCaster[ACFLoopInteger] = ACFCaster[ACFIndex]
              • Set ACFTargetPoint[ACFLoopInteger] = ACFTargetPoint[ACFIndex]
              • Set ACFCounter[ACFLoopInteger] = ACFCounter[ACFIndex]
              • Set ACFIndex = (ACFIndex - 1)
              • Set ACFLoopInteger = (ACFLoopInteger - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ACFIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions

  • AllConsumingFlamesStop
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to All-Consuming Flames
    • Actions
      • Set TempUnit = (Triggering Unit)
      • For each (Integer ACFLoopInteger) from 1 to ACFIndex, do (Actions)
        • Loop - Actions
          • If - Conditions
            • ACFCaster[ACFLoopInteger] = TempUnit
            • Then - Actions
              • Custom script: call RemoveLocation(udg_ACFCasterPoint[ACFLoopInteger])
              • Custom script: call RemoveLocation(udg_ACFTargetPoint[ACFLoopInteger])
              • Set ACFCaster[ACFLoopInteger] = ACFCaster[ACFIndex]
              • Set ACFTargetPoint[ACFLoopInteger] = ACFTargetPoint[ACFIndex]
              • Set ACFCounter[ACFLoopInteger] = ACFCounter[ACFIndex]
              • Set ACFIndex = (ACFIndex - 1)
              • Set ACFLoopInteger = (ACFLoopInteger - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ACFIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off AllConsumingFlamesAttack <gen>
                • Else - Actions
            • Else - Actions
 
Last edited:
Level 3
Joined
Jul 4, 2013
Messages
35
I seem to get an error with these custom scripts: Expected a Name -

Custom script: call RemoveLocation(udg_ACFCasterPoint[ACFLoopInteger])
Custom script: call RemoveLocation(udg_ACFTargetPoint[ACFLoopInteger])

EDIT: Temporarily disabling custom scripts to see how it works.

EDIT 2: The spell still doesn't seem to fire under certain conditions. As I said, I suspect this is an issue with the spell itself, instead of the trigger.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
I seem to get an error with these custom scripts: Expected a Name -

Custom script: call RemoveLocation(udg_ACFCasterPoint[ACFLoopInteger])
Custom script: call RemoveLocation(udg_ACFTargetPoint[ACFLoopInteger])

EDIT: Temporarily disabling custom scripts to see how it works.

EDIT 2: The spell still doesn't seem to fire under certain conditions. As I said, I suspect this is an issue with the spell itself, instead of the trigger.

Oops, sorry I made some mistake.
Trigger 3 will not work for now. Currently fixing it.

EDIT: Done

If it still doesn't work, I think the issue is not in the trigger anymore
Check your Breath of Frost ability Casting Range.
 
Level 3
Joined
Jul 4, 2013
Messages
35
The custom scripts still give me an error.

And yes, the issue is indeed with the spell itself. I'll need to think of another way to go about this. Thanks for the help, regardless.
 
Level 3
Joined
Jul 4, 2013
Messages
35
"Error: Expected a name."
The trigger line in the error message is:

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
call RemoveLocation(udg_ACFTargetPoint[ACFLoopInteger])
endfunction
 
Status
Not open for further replies.
Top