• 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] If Cast On Same Time...?

Status
Not open for further replies.
Level 1
Joined
Apr 7, 2012
Messages
4
Hello everyone here, its my first time posting. well, its an simple question. i was making an spell like 'DotA Force Staff' for my map, but if i cast both of them together at the same time, the 1st one will stop. how can i make it both move together without stopping? (Sorry i don't know how post the triggers here.):goblin_cry:
 
Level 1
Joined
Apr 7, 2012
Messages
4
Heres

Heres The Code.
Cast Ability
  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to 101Bolt
    • Actions
      • Set distrance = 0
      • Set Stop = 200
      • Set Caster = (Casting unit)
      • Set Target = (Target unit of ability being cast)
      • Set Location = (Position of Target)
      • Trigger - Turn on Untitled Trigger 002 <gen>
And Here Is The Looping Part..
  • Untitled Trigger 002
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set distrance = (distrance + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • distrance Less than Stop
        • Then - Actions
          • Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
          • Unit - Move Target instantly to (Location offset by ((Distance between Location and (Position of Target)) + 25.00) towards (Facing of Target) degrees)
          • Unit - Cause Caster to damage circular area after 0.00 seconds of radius 250.00 at (Position of Target), dealing 100.00 damage of attack type Chaos and damage type Unknown
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Set Stop = 0
          • Trigger - Turn off (This trigger)
The Variables Are Mess Up (But It Works Perfectly)
How Can I Make It Not Corrupted When Cast Twice On Same Time?
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Heres The Code.
Cast Ability
  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to 101Bolt
    • Actions
      • Set distrance = 0
      • Set Stop = 200
      • Set Caster = (Casting unit)
      • Set Target = (Target unit of ability being cast)
      • Set Location = (Position of Target)
      • Trigger - Turn on Untitled Trigger 002 <gen>
And Here Is The Looping Part..
  • Untitled Trigger 002
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set distrance = (distrance + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • distrance Less than Stop
        • Then - Actions
          • Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
          • Unit - Move Target instantly to (Location offset by ((Distance between Location and (Position of Target)) + 25.00) towards (Facing of Target) degrees)
          • Unit - Cause Caster to damage circular area after 0.00 seconds of radius 250.00 at (Position of Target), dealing 100.00 damage of attack type Chaos and damage type Unknown
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Set Stop = 0
          • Trigger - Turn off (This trigger)
The Variables Are Mess Up (But It Works Perfectly)
How Can I Make It Not Corrupted When Cast Twice On Same Time?

its not mui so u can use arrays for this and 1 integer, something like this

when u cast
  • Set integer = integer + 1
  • Set stop[integer] = 200
  • Set distance[integer] = 0
  • Set caster[integer] = (Casting unit)
  • Set target[integer] = (Target unit of ability being cast)
  • Set Location[integer] = (Position of Target)
and in periodic trigger u loop over the integers
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
something like this? coz idk the dota spells

  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • Set Index = (Index + 1)
      • Set Caster[Index] = (Triggering unit)
      • Set Target[Index] = (Target unit of ability being cast)
      • Set Stop = 200.00
      • Set Distance[Index] = 0.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Periodic trigger <gen>
        • Else - Actions
  • Periodic trigger
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Index, do (Actions)
        • Loop - Actions
          • Set Distance[A] = (Distance[A] + 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Distance[A] Less than Stop
            • Then - Actions
              • Set TargetPosition = (Position of Target[A])
              • Set NextPosition = (TargetPosition offset by 25.00 towards (Facing of Target[A]) degrees)
              • Unit - Move Target[A] instantly to NextPosition
              • Special Effect - Create a special effect at TargetPosition using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause Caster[A] to damage circular area after 0.00 seconds of radius 250.00 at TargetPosition, dealing 100.00 damage of attack type Chaos and damage type Normal
              • Custom script: call RemoveLocation(udg_TargetPosition)
              • Custom script: call RemoveLocation(udg_NextPosition)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • A Not equal to Index
                • Then - Actions
                  • Set Caster[A] = Caster[Index]
                  • Set Target[A] = Target[Index]
                  • Set Distance[A] = Distance[Index]
                • Else - Actions
              • Set A = (A - 1)
              • Set Index = (Index - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 

Attachments

  • demo.w3x
    18.5 KB · Views: 59
Last edited:
Status
Not open for further replies.
Top