• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Solved] Help wiht Chain Storm Bolt

Status
Not open for further replies.
Level 6
Joined
Aug 5, 2017
Messages
251
I did insert the spell successfully with triggers and variables. If I test the spell from the map, it works fine, but if I try it in my Andorhal map, the storm bolt hammer stands still. I did change some variable numbers, but the same thing happens.
The information below came from the test map:
Note:
- When a new ability is added, make sure you put the right unit order in place (order (Last created unit) to [your ability's base order ID] Target)
How do I change a unit's ID?
 
Level 6
Joined
Aug 5, 2017
Messages
251
I'll re-post in your fashion.(it's much better)
First code:
  • Chain Storm Bolt Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Storm Bolt
    • Actions
      • -------- Setup Variables --------
      • -------- ----------------------------------------------------------------------------------------------------EDIT UNDER [Missile Speed, Bounce Range, Number of Bounces and how many times the same unit may be hit during one chain.] --------
      • Set SpellBounceRange = 400.00
      • Set SpellBounceSpeed = 600.00
      • Set SpellNumberBounces = (2 + (2 x 1))
      • Set SpellMaximumNumberHits = 1
      • -------- ----------------------------------------------------------------------------------------------------EDIT ABOVE [Missile Speed, Bounce Range, Number of Bounces and how many times the same unit may be hit during one chain.] --------
      • -------- Spell Effect Create Dummy Unit With Model --------
      • Set TemporaryPoint[1] = (Position of (Casting unit))
      • Set TemporaryPoint[2] = (Position of (Target unit of ability being cast))
      • -------- ----------------------------------------------------------------------------------------------------EDIT UNDER [The Missile Type, which is a unit.] --------
      • Unit - Create 1 Storm Bolt Missile for (Owner of (Casting unit)) at TemporaryPoint[1] facing TemporaryPoint[2]
      • -------- ----------------------------------------------------------------------------------------------------EDIT ABOVE [The Missile Type, which is a unit.] --------
      • -------- ----------------------------------------------------------------------------------------------------EDIT UNDER [Select the right Loop Trigger.] --------
      • If ((PowerChainGroup is empty) Equal to True) then do (Trigger - Turn on Chain Storm Bolt Loop <gen>) else do (Do nothing)
      • -------- ----------------------------------------------------------------------------------------------------EDIT ABOVE [Select the right Loop Trigger.] --------
      • Unit Group - Add (Last created unit) to PowerChainGroup
      • -------- Save Variables --------
      • Hashtable - Save SpellBounceRange as 0 of (Key (Last created unit)) in PowerChainHash
      • Hashtable - Save SpellBounceSpeed as 1 of (Key (Last created unit)) in PowerChainHash
      • Hashtable - Save SpellNumberBounces as 2 of (Key (Last created unit)) in PowerChainHash
      • Hashtable - Save Handle Of(Target unit of ability being cast) as 3 of (Key (Last created unit)) in PowerChainHash
      • Hashtable - Save (Level of Chain Storm Bolt for (Casting unit)) as 4 of (Key (Last created unit)) in PowerChainHash
      • Hashtable - Save SpellMaximumNumberHits as 5 of (Key (Last created unit)) in PowerChainHash
      • Hashtable - Save (Key (Last created unit)) as 6 of (Key (Last created unit)) in PowerChainHash
      • -------- Clean up --------
      • Custom script: call RemoveLocation (udg_TemporaryPoint[2])
      • Custom script: call RemoveLocation (udg_TemporaryPoint[1])
Second code(long):
  • Chain Storm Bolt Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in PowerChainGroup) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in PowerChainGroup and do (Actions)
            • Loop - Actions
              • -------- Load Variables --------
              • Set SpellBounceSpeed = (Load 1 of (Key (Picked unit)) from PowerChainHash)
              • Set SpellNumberBounces = (Load 2 of (Key (Picked unit)) from PowerChainHash)
              • Set TemporaryTarget = (Load 3 of (Key (Picked unit)) in PowerChainHash)
              • Set TemporaryKeyTarget = (Load 3 of (Key (Picked unit)) in PowerChainHash)
              • Set TemporaryKeySpell = (Load 6 of (Key (Picked unit)) from PowerChainHash)
              • -------- Spell Effect Move Bouncing Missile --------
              • Set TemporaryPoint[1] = (Position of (Picked unit))
              • Set TemporaryPoint[2] = (Position of TemporaryTarget)
              • Set TemporaryPoint[3] = (TemporaryPoint[1] offset by (0.02 x SpellBounceSpeed) towards (Angle from TemporaryPoint[1] to TemporaryPoint[2]) degrees)
              • Unit - Move (Picked unit) instantly to TemporaryPoint[3], facing TemporaryPoint[2]
              • Custom script: call RemoveLocation (udg_TemporaryPoint[3])
              • Custom script: call RemoveLocation (udg_TemporaryPoint[1])
              • Set TemporaryPoint[1] = (Position of (Picked unit))
              • -------- Collision Of Unit And Bouncing Missile --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between TemporaryPoint[1] and TemporaryPoint[2]) Less than or equal to (SpellBounceSpeed / 70.00)
                • Then - Actions
                  • Custom script: call RemoveLocation (udg_TemporaryPoint[1])
                  • Custom script: call RemoveLocation (udg_TemporaryPoint[2])
                  • -------- Spell Hit --------
                  • Set TemporaryPoint[1] = (Position of TemporaryTarget)
                  • Unit - Create 1 Caster for (Owner of (Picked unit)) at TemporaryPoint[1] facing TemporaryPoint[1]
                  • Unit - Add Storm Bolt (Dummy Spell) to (Last created unit)
                  • -------- ----------------------------------------------------------------------------------------------------EDIT UNDER [Ability casted against every unit in the chain, and the right cast order.] --------
                  • Unit - Set level of Storm Bolt (Dummy Spell) for (Last created unit) to (Load 4 of (Key (Picked unit)) from PowerChainHash)
                  • Unit - Order (Last created unit) to Neutral - Firebolt TemporaryTarget
                  • -------- ----------------------------------------------------------------------------------------------------EDIT ABOVE [Ability casted against every unit in the chain, and the right cast order.] --------
                  • Unit - Add a 0.10 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation (udg_TemporaryPoint[1])
                  • -------- Save Variables On Target Unit --------
                  • Hashtable - Save ((Load TemporaryKeySpell of (Key TemporaryKeyTarget) from PowerChainHash) + 1) as TemporaryKeySpell of (Key TemporaryKeyTarget) in PowerChainHash
                  • -------- Decrease Bounces --------
                  • Set SpellNumberBounces = (SpellNumberBounces - 1)
                  • -------- Bounce On When More Units Can Be Hit --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SpellNumberBounces Greater than 0
                    • Then - Actions
                      • -------- Load Variables --------
                      • Set SpellMaximumNumberHits = (Load 5 of (Key (Picked unit)) from PowerChainHash)
                      • Set SpellBounceRange = (Load 0 of (Key (Picked unit)) from PowerChainHash)
                      • -------- Spell Effect --------
                      • -------- ----------------------------------------------------------------------------------------------------EDIT UNDER [The conditions that a unit must meet to be aquired as the next target] --------
                      • Set TemporaryGroup[1] = (Units within SpellBounceRange of (Position of (Picked unit)) matching (((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (SpellMaximumNumberHits Greater than (Load TemporaryKeySpell of (Key (Matching unit)
                      • -------- ----------------------------------------------------------------------------------------------------EDIT ABOVE [The conditions that a unit must meet to be aquired as the next target] --------
                      • Set TemporaryGroup[2] = (Random 1 units from TemporaryGroup[1])
                      • -------- New Unit To Bounce To Found --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in TemporaryGroup[2]) Greater than 0
                        • Then - Actions
                          • -------- Make This Unit The New Target --------
                          • Unit Group - Pick every unit in TemporaryGroup[2] and do (Actions)
                            • Loop - Actions
                              • Set TemporaryTarget = (Picked unit)
                          • Custom script: call DestroyGroup (udg_TemporaryGroup[2])
                          • Custom script: call DestroyGroup (udg_TemporaryGroup[1])
                          • Set TemporaryPoint[1] = (Position of (Picked unit))
                          • Set TemporaryPoint[2] = (Position of TemporaryTarget)
                          • -------- New Dummy Unit --------
                          • -------- ----------------------------------------------------------------------------------------------------EDIT UNDER [The Missile Type, which is a unit.] --------
                          • Unit - Create 1 Storm Bolt Missile for (Owner of (Picked unit)) at TemporaryPoint[1] facing TemporaryPoint[2]
                          • -------- ----------------------------------------------------------------------------------------------------EDIT ABOVE [The Missile Type, which is a unit.] --------
                          • Unit Group - Add (Last created unit) to PowerChainGroup
                          • -------- Save Variables --------
                          • Hashtable - Save SpellBounceRange as 0 of (Key (Last created unit)) in PowerChainHash
                          • Hashtable - Save SpellBounceSpeed as 1 of (Key (Last created unit)) in PowerChainHash
                          • Hashtable - Save SpellNumberBounces as 2 of (Key (Last created unit)) in PowerChainHash
                          • Hashtable - Save Handle OfTemporaryTarget as 3 of (Key (Last created unit)) in PowerChainHash
                          • Hashtable - Save (Load 4 of (Key (Picked unit)) from PowerChainHash) as 4 of (Key (Last created unit)) in PowerChainHash
                          • Hashtable - Save SpellMaximumNumberHits as 5 of (Key (Last created unit)) in PowerChainHash
                          • Hashtable - Save (Load 6 of (Key (Picked unit)) from PowerChainHash) as 6 of (Key (Last created unit)) in PowerChainHash
                          • -------- Clean up --------
                          • Custom script: call RemoveLocation (udg_TemporaryPoint[2])
                          • Custom script: call RemoveLocation (udg_TemporaryPoint[1])
                        • Else - Actions
                          • Custom script: call DestroyGroup (udg_TemporaryGroup[2])
                          • Custom script: call DestroyGroup (udg_TemporaryGroup[1])
                          • -------- Clean Up Units That Were Hit --------
                          • Set TemporaryGroup[1] = (Units in (Playable map area) matching ((Load TemporaryKeySpell of (Key (Matching unit)) from PowerChainHash) Not equal to 0))
                          • Unit Group - Pick every unit in TemporaryGroup[1] and do (Actions)
                            • Loop - Actions
                              • Hashtable - Save 0 as TemporaryKeySpell of (Key (Picked unit)) in PowerChainHash
                          • Custom script: call DestroyGroup (udg_TemporaryGroup[1])
                    • Else - Actions
                      • -------- Clean Up Units That Were Hit --------
                      • Set TemporaryGroup[1] = (Units in (Playable map area) matching ((Load TemporaryKeySpell of (Key (Matching unit)) from PowerChainHash) Not equal to 0))
                      • Unit Group - Pick every unit in TemporaryGroup[1] and do (Actions)
                        • Loop - Actions
                          • Hashtable - Save 0 as TemporaryKeySpell of (Key (Picked unit)) in PowerChainHash
                      • Custom script: call DestroyGroup (udg_TemporaryGroup[1])
                  • -------- Remove Old Dummy Unit --------
                  • Unit - Kill (Picked unit)
                  • Unit Group - Remove (Picked unit) from PowerChainGroup
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in PowerChainHash
                • Else - Actions
                  • Custom script: call RemoveLocation (udg_TemporaryPoint[1])
                  • Custom script: call RemoveLocation (udg_TemporaryPoint[2])
        • Else - Actions
          • Trigger - Turn off (This trigger)
 
Last edited:
Status
Not open for further replies.
Top