• 🏆 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 error after import

Status
Not open for further replies.
Level 7
Joined
Sep 19, 2012
Messages
204
Hi there,

I imported the Spell http://www.hiveworkshop.com/forums/spells-569/tether-v1-03-a-268563/?prev=c%3D114%26r%3D20%26d%3Dlist%26page%3D2 and tested it. Everything works fine except for one thing, and i cant find the mistake. When the Tether is active the Tether ability should be replaced by the Break Tether ability. For some reason it shows up as an 2nd ability for me. Any Ideas? maybe it isnt the code? i have no Idea.

  • Tether Configurables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Define the abilities involved --------
      • Set Te_AbCode = Tether
      • Set TeBr_AbCode = Break Tether
      • Set TeS_AbCode = Tether Slow (Tornado)
      • Set TeS_BuffCode = Tether Slow (Slow Aura)
      • Set TeSpd_AbCode = Tether MS Gain (Tornado)
      • Set TeSpd_BuffCode = Tether Bonus
      • Set Te_AbConvert = Tether Convert
      • Set Te_AttackType = Spells
      • Set Te_DamageType = Magic
      • -------- Define how much distance enemy units are from the line to be caught --------
      • Set Te_LineDist = 50.00
      • -------- Define Visual Effects --------
      • Set Te_LightningType = Chain Lightning - Primary
      • Set Te_LightningTypeBreaking = Finger of Death
      • -------- The Special Effect attached to the Tethered Unit --------
      • Set Te_AttachTargetSFX = Abilities\Spells\Orc\LightningShield\LightningShieldTarget.mdl
      • -------- The Special Effect attached to the Tethered Unit --------
      • Set Te_AttachCasterSFX = Abilities\Spells\Undead\UnholyFrenzy\UnholyFrenzyTarget.mdl
      • -------- Define how much distance the latching unit moves every 0.03 second --------
      • Set Te_LatchSpeed = 30.00
      • -------- Define how long the duration last each level --------
      • Set Te_Duration[1] = 20.00
      • Set Te_Duration[2] = 30.00
      • Set Te_Duration[3] = 40.00
      • -------- Define the damage taken by units caught by the line --------
      • Set Te_Damage[1] = 150.00
      • Set Te_Damage[2] = 200.00
      • Set Te_Damage[3] = 250.00
      • -------- Define the Slow duration on enemy units caught within the link --------
      • Set Te_Slow_Duration[1] = 1.00
      • Set Te_Slow_Duration[2] = 2.00
      • Set Te_Slow_Duration[3] = 3.00
      • -------- When Caster restores health or mana, tethered units gain TargetGain x the amount --------
      • Set Te_TargetGain[1] = 1.00
      • Set Te_TargetGain[2] = 2.00
      • Set Te_TargetGain[3] = 3.00
      • -------- Tether will break if the distance between Caster and Target is greater than Te_BreakDist --------
      • Set Te_BreakDist[1] = 800.00
      • Set Te_BreakDist[2] = 1000.00
      • Set Te_BreakDist[3] = 1200.00
      • -------- The Distance when the Link will change visual effect to tell the player that Tether is about to Break because of too much distance --------
      • Set Te_AboutToBreakDist[1] = 600.00
      • Set Te_AboutToBreakDist[2] = 800.00
      • Set Te_AboutToBreakDist[3] = 1000.00
      • -------- If the Target is more than Te_LatchDistance units away, Caster will Latch into the unit --------
      • Set Te_LatchDistance[1] = 700.00
      • Set Te_LatchDistance[2] = 600.00
      • Set Te_LatchDistance[3] = 500.00
      • -------- When the Caster Latches, how close will it latch to the target --------
      • Set Te_LatchStopDist = 300.00
      • -------- End Configurables --------
      • Custom script: call DestroyGroup(udg_Te_AffectedUnits[0])
      • Custom script: call DestroyGroup(udg_Te_AffectedUnits[1])
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Disable Te_AbConvert for (Picked player)
  • Tether Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Te_AbCode
    • Actions
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- ----------------------------------- Indexing ------------------------------------- --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • Set Te_MaxIndex = (Te_MaxIndex + 1)
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- ---------------------------------- Spell Data ------------------------------------ --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • Set Te_Caster[Te_MaxIndex] = (Triggering unit)
      • Set Te_Target[Te_MaxIndex] = (Target unit of ability being cast)
      • Set Te_CasterHP[Te_MaxIndex] = (Life of Te_Caster[Te_MaxIndex])
      • Set Te_CasterMana[Te_MaxIndex] = (Mana of Te_Caster[Te_MaxIndex])
      • Set Te_Owner[Te_MaxIndex] = (Triggering player)
      • -------- Stores affected enemy units into this group --------
      • Custom script: set udg_Te_AffectedUnits[udg_Te_MaxIndex] = CreateGroup()
      • Set Te_IndexedLevel[Te_MaxIndex] = (Level of Te_AbCode for Te_Caster[Te_MaxIndex])
      • -------- A non-array integer Te_Level is used for easier readability --------
      • Set Te_Level = Te_IndexedLevel[Te_MaxIndex]
      • -------- Replace Tether Ability with Brek Tether ability --------
      • Unit - Add Te_AbConvert to Te_Caster[Te_MaxIndex]
      • Unit - Add TeBr_AbCode to Te_Caster[Te_MaxIndex]
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- --------------------------------- Bonus Speed -------------------------------- --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • Unit - Add TeSpd_AbCode to Te_Caster[Te_MaxIndex]
      • Unit - Set level of TeSpd_AbCode for Te_Caster[Te_MaxIndex] to Te_Level
      • Unit - Add TeSpd_AbCode to Te_Target[Te_MaxIndex]
      • Unit - Set level of TeSpd_AbCode for Te_Target[Te_MaxIndex] to Te_Level
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- ---------------------------------- Spell Timing --------------------------------- --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • Set Te_TimeLeft[Te_MaxIndex] = Te_Duration[Te_Level]
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- ---------------------------- Spell Visual Effects --------------------------- --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • Set Te_TempLoc1 = (Position of Te_Caster[Te_MaxIndex])
      • Set Te_TempLoc2 = (Position of Te_Target[Te_MaxIndex])
      • Set Te_TempReal = (Distance between Te_TempLoc1 and Te_TempLoc2)
      • Special Effect - Create a special effect attached to the origin of Te_Target[Te_MaxIndex] using Te_AttachTargetSFX
      • Set Te_SFXTarget[Te_MaxIndex] = (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of Te_Caster[Te_MaxIndex] using Te_AttachCasterSFX
      • Set Te_SFXCaster[Te_MaxIndex] = (Last created special effect)
      • Lightning - Create a Te_LightningType lightning effect from source Te_TempLoc1 to target Te_TempLoc2
      • Set Te_LinkEffect[Te_MaxIndex] = (Last created lightning effect)
      • Set Te_AboutToBreak[Te_MaxIndex] = False
      • Custom script: call RemoveLocation(udg_Te_TempLoc1)
      • Custom script: call RemoveLocation(udg_Te_TempLoc2)
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- ----------------------- To latch or not to latch --------------------------- --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Te_TempReal Greater than or equal to Te_LatchDistance[Te_Level]
        • Then - Actions
          • Set Te_Latching[Te_MaxIndex] = True
        • Else - Actions
          • Set Te_Latching[Te_MaxIndex] = False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Te_MaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Tether Periodic <gen>
        • Else - Actions
  • Tether Break
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to TeBr_AbCode
    • Actions
      • Custom script: local integer i = 1
      • Custom script: local integer counter = 0
      • Custom script: local unit tempUnit
      • Set Te_TempUnit = (Triggering unit)
      • -------- I know it is O(n) but to my defense, it is in GUI --------
      • For each (Integer Te_LoopInt) from 1 to Te_MaxIndex, do (Actions)
        • Loop - Actions
          • -------- Find the Tether Breaker --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Te_Caster[Te_LoopInt] Equal to Te_TempUnit
            • Then - Actions
              • -------- Destroy Handles --------
              • Lightning - Destroy Te_LinkEffect[Te_LoopInt]
              • Custom script: call DestroyGroup(udg_Te_AffectedUnits[udg_Te_LoopInt])
              • Special Effect - Destroy Te_SFXTarget[Te_LoopInt]
              • Special Effect - Destroy Te_SFXCaster[Te_LoopInt]
              • -------- Remove Bonus Speed --------
              • -------- Count how many times Te_Target is Tethered --------
              • Custom script: set tempUnit = udg_Te_Target[udg_Te_LoopInt]
              • Custom script: loop
              • Custom script: exitwhen i > udg_Te_MaxIndex
              • Custom script: if tempUnit == udg_Te_Target[i] then
              • Custom script: set counter = counter + 1
              • Custom script: endif
              • Custom script: set i = i + 1
              • Custom script: endloop
              • Custom script: set tempUnit = null
              • Custom script: if counter == 1 then
              • Unit - Remove TeSpd_AbCode from Te_Target[Te_LoopInt]
              • Unit - Remove TeSpd_BuffCode buff from Te_Target[Te_LoopInt]
              • Custom script: endif
              • Unit - Remove TeSpd_AbCode from Te_Caster[Te_LoopInt]
              • Unit - Remove TeSpd_BuffCode buff from Te_Caster[Te_LoopInt]
              • Unit - Remove Te_AbConvert from Te_Caster[Te_LoopInt]
              • Unit - Remove TeBr_AbCode from Te_Caster[Te_LoopInt]
              • -------- Transfer Data --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Te_LoopInt Not equal to Te_MaxIndex
                • Then - Actions
                  • Set Te_Caster[Te_LoopInt] = Te_Caster[Te_MaxIndex]
                  • Set Te_Target[Te_LoopInt] = Te_Target[Te_MaxIndex]
                  • Set Te_CasterHP[Te_LoopInt] = Te_CasterHP[Te_MaxIndex]
                  • Set Te_Latching[Te_LoopInt] = Te_Latching[Te_MaxIndex]
                  • Set Te_CasterMana[Te_LoopInt] = Te_CasterMana[Te_MaxIndex]
                  • Set Te_AffectedUnits[Te_LoopInt] = Te_AffectedUnits[Te_MaxIndex]
                  • Set Te_LinkEffect[Te_LoopInt] = Te_LinkEffect[Te_MaxIndex]
                  • Set Te_TimeLeft[Te_LoopInt] = Te_TimeLeft[Te_MaxIndex]
                  • Set Te_SFXTarget[Te_LoopInt] = Te_SFXTarget[Te_MaxIndex]
                  • Set Te_SFXCaster[Te_LoopInt] = Te_SFXCaster[Te_MaxIndex]
                  • Set Te_IndexedLevel[Te_LoopInt] = Te_IndexedLevel[Te_MaxIndex]
                  • Set Te_AboutToBreak[Te_LoopInt] = Te_AboutToBreak[Te_MaxIndex]
                  • Set Te_Owner[Te_LoopInt] = Te_Owner[Te_MaxIndex]
                • Else - Actions
              • -------- De-indexing --------
              • Set Te_MaxIndex = (Te_MaxIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Te_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off Tether Periodic <gen>
                • Else - Actions
              • Custom script: exitwhen true
            • Else - Actions
Ill not post the other 2 triggers since they are only for looping the ability and stuff ^^
 
Status
Not open for further replies.
Top