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

[Spell] How to make this spell MUI?

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2011
Messages
527
i tried to make a configurable MUI spell, but i'm new to making one.
basically, this ability fires 5 carrion swarms at a cone thrice over 0.9 seconds. i pause the unit so the player can't control the unit, change its facing, and make the ability look weird. problem is, when multiple units cast it at once, the first unit that casts it does not get unpaused.
  • Rain Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Sets the dummy type --------
      • Set R_dummytype = Dummy
      • -------- Sets the ability used by the hero --------
      • Set R_ability = Rain
      • -------- Sets the dummy ability cast by the dummy unit --------
      • Set R_dummyability = Rain (Dummy)
      • -------- Sets interval between shots --------
      • Set R_interval = 0.30
      • -------- Sets spell duration --------
      • Set R_spellduration = 0.90
  • Rain Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to R_ability
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • R_index[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on Rain Loop <gen>
        • Else - Actions
      • Set R_index[1] = (R_index[1] + 1)
      • Set R_time[R_index[1]] = 0.00
      • Set R_duration[R_index[1]] = R_spellduration
      • Set R_caster[R_index[1]] = (Casting unit)
      • Unit - Pause R_caster[R_index[1]]
      • Set R_location = (Position of R_caster[R_index[1]])
      • Set R_facing = (Facing of R_caster[R_index[1]])
      • Unit - Create 1 R_dummytype for (Owner of (Casting unit)) at R_location facing Default building facing degrees
      • Set R_dummy[R_index[1]] = (Last created unit)
      • Unit - Add R_dummyability to R_dummy[R_index[1]]
      • Unit - Set level of R_dummyability for R_dummy[R_index[1]] to (Level of R_ability for R_caster[R_index[1]])
  • Rain Loop
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Set R_location = (Position of R_caster[R_index[1]])
      • Set R_direction = (R_location offset by 25.00 towards (R_facing + 30.00) degrees)
      • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction
      • Custom script: call RemoveLocation(udg_R_direction)
      • Custom script: call RemoveLocation(udg_R_location)
      • Set R_location = (Position of R_caster[R_index[1]])
      • Set R_direction = (R_location offset by 25.00 towards (R_facing + 15.00) degrees)
      • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction
      • Custom script: call RemoveLocation(udg_R_direction)
      • Custom script: call RemoveLocation(udg_R_location)
      • Set R_location = (Position of R_caster[R_index[1]])
      • Set R_direction = (R_location offset by 25.00 towards R_facing degrees)
      • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction
      • Custom script: call RemoveLocation(udg_R_direction)
      • Custom script: call RemoveLocation(udg_R_location)
      • Set R_location = (Position of R_caster[R_index[1]])
      • Set R_direction = (R_location offset by 25.00 towards (R_facing - 15.00) degrees)
      • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction
      • Custom script: call RemoveLocation(udg_R_direction)
      • Custom script: call RemoveLocation(udg_R_location)
      • Set R_location = (Position of R_caster[R_index[1]])
      • Set R_direction = (R_location offset by 25.00 towards (R_facing - 30.00) degrees)
      • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction
      • Custom script: call RemoveLocation(udg_R_direction)
      • Custom script: call RemoveLocation(udg_R_location)
      • For each (Integer R_index[0]) from 1 to R_index[1], do (Actions)
        • Loop - Actions
          • Set R_time[R_index[0]] = (R_time[R_index[0]] + R_interval)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • R_time[R_index[0]] Equal to R_duration[R_index[0]]
            • Then - Actions
              • Unit - Unpause R_caster[R_index[1]]
              • Unit - Remove R_dummy[R_index[1]] from the game
              • Set R_caster[R_index[0]] = R_caster[R_index[1]]
              • Set R_dummy[R_index[0]] = R_dummy[R_index[1]]
              • Unit - Unpause R_caster[R_index[1]]
              • Unit - Remove R_dummy[R_index[1]] from the game
              • Set R_index[1] = (R_index[1] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • R_index[1] Equal to 0
                • Then - Actions
                  • Set R_index[0] = 0
                  • Set R_index[1] = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
can anyone with MUI spell knowledge help me on this? i'd appreciate it if you do.
 

Attachments

  • Rain.w3x
    21.8 KB · Views: 71
Level 9
Joined
Apr 23, 2011
Messages
527
it works! +rep
but i just noticed another problem.
for example, unit a fires his ability, then after 1 volley, unit b fires his ability. the remaining 2 volleys transfer to unit b, and they fire at the same time, doubling the damage (this also happens even if only 1 unit is casting). here's the current trigger:
  • Rain Loop
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • For each (Integer R_index[0]) from 1 to R_index[1], do (Actions)
        • Loop - Actions
          • Set R_location = (Position of R_caster[R_index[1]])
          • Set R_direction = (R_location offset by 25.00 towards (R_facing + 30.00) degrees)
          • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction
          • Custom script: call RemoveLocation(udg_R_direction)
          • Custom script: call RemoveLocation(udg_R_location)
          • Set R_location = (Position of R_caster[R_index[1]])
          • Set R_direction = (R_location offset by 25.00 towards (R_facing + 15.00) degrees)
          • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction
          • Custom script: call RemoveLocation(udg_R_direction)
          • Custom script: call RemoveLocation(udg_R_location)
          • Set R_location = (Position of R_caster[R_index[1]])
          • Set R_direction = (R_location offset by 25.00 towards R_facing degrees)
          • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction
          • Custom script: call RemoveLocation(udg_R_direction)
          • Custom script: call RemoveLocation(udg_R_location)
          • Set R_location = (Position of R_caster[R_index[1]])
          • Set R_direction = (R_location offset by 25.00 towards (R_facing - 15.00) degrees)
          • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction
          • Custom script: call RemoveLocation(udg_R_direction)
          • Custom script: call RemoveLocation(udg_R_location)
          • Set R_location = (Position of R_caster[R_index[1]])
          • Set R_direction = (R_location offset by 25.00 towards (R_facing - 30.00) degrees)
          • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction
          • Custom script: call RemoveLocation(udg_R_direction)
          • Custom script: call RemoveLocation(udg_R_location)
          • Set R_time[R_index[0]] = (R_time[R_index[0]] + R_interval)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • R_time[R_index[0]] Equal to R_duration[R_index[0]]
            • Then - Actions
              • Unit - Unpause R_caster[R_index[1]]
              • Unit - Remove R_dummy[R_index[1]] from the game
              • Set R_caster[R_index[1]] = R_caster[R_index[0]]
              • Set R_dummy[R_index[1]] = R_dummy[R_index[0]]
              • Unit - Unpause R_caster[R_index[0]]
              • Unit - Remove R_dummy[R_index[0]] from the game
              • Set R_index[1] = (R_index[1] - 1)
              • Set R_index[0] = (R_index[0] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • R_index[1] Equal to 0
                • Then - Actions
                  • Set R_index[0] = 0
                  • Set R_index[1] = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Level 18
Joined
Oct 17, 2012
Messages
849
The following should be the other way around:
  • Set R_caster[R_index[1]] = R_caster[R_index[0]]
  • Set R_dummy[R_index[1]] = R_dummy[R_index[0]]
The next following should have R_index[0] as their index:
  • Unit - Unpause R_caster[R_index[1]]
  • Unit - Remove R_dummy[R_index[1]]
All these should be in place, since the loop integer is R_index[0], not R_index[1]. If you set R_index[1] to R_index[0], then you have shorten the number of units that can cast the spell properly.
 
Level 9
Joined
Apr 23, 2011
Messages
527
hmm, when i tried that, the first caster gets paused again.
anyway, my main problem is the casting of the spell, so do you mind if you look into it?
  • Rain Loop
    • Events
      • Time - Every 0.15 seconds of game time
    • Conditions
    • Actions
      • For each (Integer R_index[0]) from 1 to R_index[1], do (Actions)
        • Loop - Actions
          • Animation - Change R_caster[R_index[0]]'s animation speed to 250.00% of its original speed
          • Animation - Change R_caster[R_index[1]]'s animation speed to 250.00% of its original speed
          • Animation - Play R_caster[R_index[0]]'s attack animation
          • Animation - Play R_caster[R_index[1]]'s attack animation
          • Set R_facing[R_index[1]] = (Facing of R_caster[R_index[1]])
          • Set R_location[R_index[1]] = (Position of R_caster[R_index[1]])
          • Set R_direction[R_index[1]] = (R_location[R_index[1]] offset by 25.00 towards (R_facing[R_index[1]] + 30.00) degrees)
          • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction[R_index[1]]
          • Custom script: call RemoveLocation(udg_R_direction[udg_R_index[1]])
          • Custom script: call RemoveLocation(udg_R_location[udg_R_index[1]])
          • Set R_facing[R_index[1]] = (Facing of R_caster[R_index[1]])
          • Set R_location[R_index[1]] = (Position of R_caster[R_index[1]])
          • Set R_direction[R_index[1]] = (R_location[R_index[1]] offset by 25.00 towards (R_facing[R_index[1]] + 15.00) degrees)
          • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction[R_index[1]]
          • Custom script: call RemoveLocation(udg_R_direction[udg_R_index[1]])
          • Custom script: call RemoveLocation(udg_R_location[udg_R_index[1]])
          • Set R_facing[R_index[1]] = (Facing of R_caster[R_index[1]])
          • Set R_location[R_index[1]] = (Position of R_caster[R_index[1]])
          • Set R_direction[R_index[1]] = (R_location[R_index[1]] offset by 25.00 towards R_facing[R_index[1]] degrees)
          • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction[R_index[1]]
          • Custom script: call RemoveLocation(udg_R_direction[udg_R_index[1]])
          • Custom script: call RemoveLocation(udg_R_location[udg_R_index[1]])
          • Set R_facing[R_index[1]] = (Facing of R_caster[R_index[1]])
          • Set R_location[R_index[1]] = (Position of R_caster[R_index[1]])
          • Set R_direction[R_index[1]] = (R_location[R_index[1]] offset by 25.00 towards (R_facing[R_index[1]] - 15.00) degrees)
          • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction[R_index[1]]
          • Custom script: call RemoveLocation(udg_R_direction[udg_R_index[1]])
          • Custom script: call RemoveLocation(udg_R_location[udg_R_index[1]])
          • Set R_facing[R_index[1]] = (Facing of R_caster[R_index[1]])
          • Set R_location[R_index[1]] = (Position of R_caster[R_index[1]])
          • Set R_direction[R_index[1]] = (R_location[R_index[1]] offset by 25.00 towards (R_facing[R_index[1]] - 30.00) degrees)
          • Unit - Order R_dummy[R_index[1]] to Undead Dreadlord - Carrion Swarm R_direction[R_index[1]]
          • Custom script: call RemoveLocation(udg_R_direction[udg_R_index[1]])
          • Custom script: call RemoveLocation(udg_R_location[udg_R_index[1]])
          • Set R_time[R_index[0]] = (R_time[R_index[0]] + R_interval)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • R_time[R_index[0]] Equal to R_duration[R_index[0]]
            • Then - Actions
              • Animation - Change R_caster[R_index[0]]'s animation speed to 100.00% of its original speed
              • Unit - Unpause R_caster[R_index[0]]
              • Unit - Remove R_dummy[R_index[0]] from the game
              • Animation - Change R_caster[R_index[1]]'s animation speed to 100.00% of its original speed
              • Unit - Unpause R_caster[R_index[1]]
              • Unit - Remove R_dummy[R_index[1]] from the game
              • Set R_index[1] = (R_index[1] - 1)
              • Set R_index[0] = (R_index[0] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • R_index[1] Equal to 0
                • Then - Actions
                  • Set R_index[0] = 0
                  • Set R_index[1] = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Status
Not open for further replies.
Top