• 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.

[Trigger] Custom Spell Problem

Status
Not open for further replies.
Level 5
Joined
May 12, 2014
Messages
133
I'm trying to make this spell that shoots chunks of ice from the sky down onto nearby enemy units. The spells works except for this one problem I have: The chunks of ice don't actually move anywhere. I can't figure out why the ice isn't moving. I don't need this spell to be MUI or MPI since a single boss will be casting this spell only every 60 seconds.
  • Crystal Haven
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Crystal Rain
    • Actions
      • Set Crystal_Haven_C = (Triggering unit)
      • Set Crystal_Haven_Count = 0
      • Set Crystal_Haven_Count2 = 0
      • Set Crystal_Haven_P[0] = (Position of (Triggering unit))
      • Unit - Create 1 Crystal Rain First Effect for (Owner of (Triggering unit)) at Crystal_Haven_P[0] facing Default building facing degrees
      • Set Crystal_Haven_Shards[0] = (Last created unit)
      • Animation - Change Crystal_Haven_Shards[0]'s size to (200.00%, 200.00%, 200.00%) of its original size
      • Custom script: call RemoveLocation (udg_Crystal_Haven_P[0])
      • Set Crystal_Haven_Phases[0] = True
      • Trigger - Turn on Crystal Haven DPS <gen>
  • Crystal Haven DPS
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Crystal_Haven_Phases[0] Equal to True
        • Then - Actions
          • -------- MAKES THE FIRST PROJECTILE FLY UPWARDS --------
          • Set Crystal_Haven_P[0] = (Position of Crystal_Haven_Shards[0])
          • Unit - Move Crystal_Haven_Shards[0] instantly to Crystal_Haven_P[0]
          • Animation - Change Crystal_Haven_Shards[0] flying height to ((Current flying height of Crystal_Haven_Shards[0]) + 80.00) at 0.00
          • Custom script: call RemoveLocation (udg_Crystal_Haven_P[0])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current flying height of Crystal_Haven_Shards[0]) Greater than or equal to 1000.00
            • Then - Actions
              • Set Crystal_Haven_Phases[0] = False
              • Set Crystal_Haven_Phases[1] = True
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Crystal_Haven_Phases[1] Equal to True
            • Then - Actions
              • -------- CREATES THE OTHER PROJECTILES AND MOVES THEM --------
              • Set Crystal_Haven_Count2 = (Crystal_Haven_Count2 + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Crystal_Haven_Count2 Greater than or equal to 10
                • Then - Actions
                  • Set Crystal_Haven_Count2 = 0
                  • Set Crystal_Haven_Count = (Crystal_Haven_Count + 1)
                  • Set Crystal_Haven_Shard_Active[Crystal_Haven_Count] = True
                  • Set Crystal_Haven_P[0] = (Position of Crystal_Haven_Shards[0])
                  • Set Crystal_Haven_T = (Units within 1800.00 of Crystal_Haven_P[0] matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching unit) is dead) Not equal to True) and (((Matching unit) belongs to an enemy
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in Crystal_Haven_T) Equal to 0
                    • Then - Actions
                      • Set Crystal_Haven_P[Crystal_Haven_Count] = (Crystal_Haven_P[0] offset by (Random real number between 0.00 and 1800.00) towards (Random angle) degrees)
                    • Else - Actions
                      • Set Crystal_Haven_P[Crystal_Haven_Count] = (Position of (Random unit from Crystal_Haven_T))
                  • Unit - Create 1 Crystal Rain Missile for (Owner of Crystal_Haven_C) at Crystal_Haven_P[0] facing Crystal_Haven_P[Crystal_Haven_Count]
                  • Set Crystal_Haven_Shards[Crystal_Haven_Count] = (Last created unit)
                  • Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation (udg_Crystal_Haven_P[0])
                  • Custom script: call DestroyGroup (udg_Crystal_Haven_T)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Crystal_Haven_Count Greater than or equal to 20
                    • Then - Actions
                      • Set Crystal_Haven_Phases[1] = False
                    • Else - Actions
                • Else - Actions
            • Else - Actions
          • -------- MOVES ALL PROJECTILES --------
          • For each (Integer A) from 1 to Crystal_Haven_Count, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Crystal_Haven_Shard_Active[(Integer A)] Equal to True
                • Then - Actions
                  • Set Crystal_Haven_P[0] = (Position of Crystal_Haven_Shards[0])
                  • Set Crystal_Haven_P2[0] = (Position of Crystal_Haven_Shards[(Integer A)])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between Crystal_Haven_P2[0] and Crystal_Haven_P[(Integer A)]) Less than or equal to ((Distance between Crystal_Haven_P[0] and Crystal_Haven_P[(Integer A)]) / 24.00)
                    • Then - Actions
                      • -------- DAMAGE PART --------
                      • Set Crystal_Haven_Shard_Active[(Integer A)] = False
                      • Unit - Remove Crystal_Haven_Shards[(Integer A)] from the game
                      • Special Effect - Create a special effect at Crystal_Haven_P[(Integer A)] using war3mapImported\IceSlam.mdx
                      • Special Effect - Destroy (Last created special effect)
                      • Set Crystal_Haven_T = (Units within 300.00 of Crystal_Haven_P2[0] matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching unit) is dead) Not equal to True) and (((Matching unit) belongs to an enemy
                      • Unit Group - Pick every unit in Crystal_Haven_T and do (Actions)
                        • Loop - Actions
                          • Unit - Cause Crystal_Haven_C to damage (Picked unit), dealing ((Real((Intelligence of Crystal_Haven_C (Include bonuses)))) x 1.00) damage of attack type Spells and damage type Normal
                      • Environment - Create a 0.20 second Temporary crater deformation at Crystal_Haven_P2[0] with radius 300.00 and depth 72.00
                      • Custom script: call DestroyGroup (udg_Crystal_Haven_T)
                      • Custom script: call RemoveLocation (udg_Crystal_Haven_P[GetForLoopIndexA()])
                    • Else - Actions
                      • Set Crystal_Haven_P2[1] = (Crystal_Haven_P2[0] offset by ((Distance between Crystal_Haven_P[0] and Crystal_Haven_P[(Integer A)]) / 30.00) towards (Angle from Crystal_Haven_P[0] to Crystal_Haven_P[(Integer A)]) degrees)
                      • Set Crystal_Haven_XY[0] = (X of Crystal_Haven_P2[1])
                      • Set Crystal_Haven_XY[1] = (Y of Crystal_Haven_P2[1])
                      • Custom script: call SetUnitX(udg_Crystal_Haven_Shards[GetForLoopIndexA()],udg_Crystal_Haven_XY[0])
                      • Custom script: call SetUnitY(udg_Crystal_Haven_Shards[GetForLoopIndexA()],udg_Crystal_Haven_XY[1])
                      • Animation - Change Crystal_Haven_Shards[(Integer A)] flying height to ((Current flying height of Crystal_Haven_Shards[(Integer A)]) - 30.00) at 30.00
                      • Custom script: call RemoveLocation (udg_Crystal_Haven_P2[1])
                  • Custom script: call RemoveLocation (udg_Crystal_Haven_P[0])
                  • Custom script: call RemoveLocation (udg_Crystal_Haven_P2[0])
                • Else - Actions
          • For each (Integer A) from 1 to Crystal_Haven_Count, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Crystal_Haven_Shard_Active[(Integer A)] Equal to False
                • Then - Actions
                  • Unit - Set the custom value of Crystal_Haven_Shards[0] to ((Custom value of Crystal_Haven_Shards[0]) + 1)
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of Crystal_Haven_Shards[0]) Greater than or equal to Crystal_Haven_Count
              • Crystal_Haven_Phases[1] Equal to False
            • Then - Actions
              • Trigger - Turn off (This trigger)
              • Unit - Remove Crystal_Haven_Shards[0] from the game
            • Else - Actions
              • Unit - Set the custom value of Crystal_Haven_Shards[0] to 0
I think the problem is around where I labeled "DAMAGE PART" in the periodic trigger since this is where I try to move the ice chunks, but I'm not sure. Can someone point out where I'm failing?
 

Attachments

  • Crystal Rain Spell.w3x
    33.5 KB · Views: 37
Idk, this is the only line where I see you moving anything:
  • Unit - Move Crystal_Haven_Shards[0] instantly to Crystal_Haven_P[0]
And that is below "MAKES THE FIRST PROJECTILE FLY UPWARDS". But in that trigger, you're just moving it to the same location--the position of the projectile. You should set Crystal_Haven_P[0] to some other location, such as through "Polar Projection" (position of Crystal_Haven_P[0] offset by X towards <some angle>).
 
Level 5
Joined
May 12, 2014
Messages
133
Idk, this is the only line where I see you moving anything:
  • Unit - Move Crystal_Haven_Shards[0] instantly to Crystal_Haven_P[0]
And that is below "MAKES THE FIRST PROJECTILE FLY UPWARDS". But in that trigger, you're just moving it to the same location--the position of the projectile. You should set Crystal_Haven_P[0] to some other location, such as through "Polar Projection" (position of Crystal_Haven_P[0] offset by X towards <some angle>).

Actually, that part is when the spell is first cast, it sends an ice shard upwards directly above the caster. After that part ends, It's suppose to be hovering mid-air for about 10 seconds, shooting down chunks of ice at random nearby units.
 
Status
Not open for further replies.
Top