• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Spelleffects won't be destroyed if another unit with the same spell casts it at the same time.

Status
Not open for further replies.
Level 15
Joined
Jul 19, 2007
Messages
855
Well I got some spells in my map which uses triggers to make some spelleffects before the spell is cast but the problem is if there is more than one of that unit which casts the same spell at the same time, the spelleffect isn't gone... It's a bit hard to explain but I hope you get it.
Here is the triggers...
  • Star Spells
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Star Serious Laser
          • (Ability being cast) Equal to Star Sensitive Inferno
          • (Ability being cast) Equal to Star Gentle Uterus
    • Actions
      • Set VariableSet StarIndex = (StarIndex + 1)
      • Set VariableSet StarCount[StarIndex] = 0
      • Special Effect - Create a special effect attached to the left hand of (Triggering unit) using war3mapImported\WaterAurora.mdx
      • Set VariableSet StarEffect[StarIndex] = (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StarIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Star Spells periodic <gen>
        • Else - Actions
  • Star Spells periodic
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • For each (Integer LoopInteger) from 1 to StarIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • StarCount[LoopInteger] Greater than or equal to 3
            • Then - Actions
              • Special Effect - Destroy StarEffect[LoopInteger]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • StarIndex Not equal to LoopInteger
                • Then - Actions
                  • Set VariableSet StarCount[LoopInteger] = StarCount[StarIndex]
                  • Set VariableSet StarEffect[LoopInteger] = StarEffect[StarIndex]
                  • Set VariableSet LoopInteger = (LoopInteger - 1)
                • Else - Actions
              • Set VariableSet StarIndex = (StarIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • StarIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • Set VariableSet StarCount[LoopInteger] = (StarCount[LoopInteger] + 1)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
It looks like you want a Special Effect to appear while the unit is channeling and then disappear when it stops.

If so, the trigger is very simple, using a Unit Indexer do this:
  • Star Spells
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Star Serious Laser
          • (Ability being cast) Equal to Star Sensitive Inferno
          • (Ability being cast) Equal to Star Gentle Uterus
    • Actions
      • Special Effect - Create a special effect attached to the left hand of (Triggering unit) using war3mapImported\WaterAurora.mdx
      • Set VariableSet StarEffect[Custom value of (Triggering unit)] = (Last created special effect)
  • Star Spells
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Star Serious Laser
          • (Ability being cast) Equal to Star Sensitive Inferno
          • (Ability being cast) Equal to Star Gentle Uterus
    • Actions
      • Special Effect - Destroy StarEffect[Custom value of (Triggering unit)]
So this links the Special Effect to the Unit by using it's custom value as the [index] in your Special Effect array. And the Unit Indexer guarantees that each Unit will have it's own unique custom value so the [indexes] will never conflict with one another.
 
Last edited:
Level 15
Joined
Jul 19, 2007
Messages
855
It looks like you want a Special Effect to appear while the unit is channeling and then disappear when it stops.

If so, the trigger is very simple, using a Unit Indexer do this:
  • Star Spells
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Star Serious Laser
          • (Ability being cast) Equal to Star Sensitive Inferno
          • (Ability being cast) Equal to Star Gentle Uterus
    • Actions
      • Special Effect - Create a special effect attached to the left hand of (Triggering unit) using war3mapImported\WaterAurora.mdx
      • Set VariableSet StarEffect[Custom value of (Triggering unit)] = (Last created special effect)
  • Star Spells
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Star Serious Laser
          • (Ability being cast) Equal to Star Sensitive Inferno
          • (Ability being cast) Equal to Star Gentle Uterus
    • Actions
      • Special Effect - Destroy StarEffect[Custom value of (Triggering unit)]
So this links the Special Effect to the Unit by using it's custom value as the [index] in your Special Effect array. And the Unit Indexer guarantees that each Unit will have it's own unique custom value so the [indexes] will never conflict with one another.
I want it to appear and disappear every 0.50 seconds of the casting time because it has a casting time of 1.75 sec and it seems to work fine as long as not another unit with one of these three spells is casting it at the same time, then the effect wont be gone...
 
Status
Not open for further replies.
Top