[Trigger] How to make a charge spell MUI

Status
Not open for further replies.
Level 5
Joined
Oct 30, 2007
Messages
91
Well i am trying to make a charge spell mui but i don't know how, here's my script. The spell is broken up into 2 triggers, i know that is bad but 1 is when the spell is casted the other is the charge moving loop. The loop trigger is originally off. PLZ HELP =(

  • BEGIN CAST
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to [Z] Berserker Slash
    • Actions
      • -------- Sets the Casting unit, perpares the casting unit for charge! >:) --------
      • Set Temp_Caster = (Casting unit)
      • Set Temp_Point = (Target point of ability being cast)
      • -------- - --------
      • -------- - --------
      • -------- Turn's off the BM collision so he wont get stuck --------
      • Unit - Turn collision for Temp_Caster Off
      • -------- - --------
      • -------- - --------
      • -------- FX to make it look COOL --------
      • Special Effect - Create a special effect attached to the origin of (Casting unit) using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the chest of Temp_Caster using Abilities\Weapons\SludgeMissile\SludgeMissile.mdl
      • Set Temp_FX = (Last created special effect)
      • Sound - Play HeroBladeMasterYesAttack3 <gen> at 100.00% volume, attached to Temp_Caster
      • -------- - --------
      • -------- - --------
      • -------- Makes the BM stick out his sword --------
      • Animation - Play (Casting unit)'s attack,second animation
      • -------- - --------
      • -------- - --------
      • -------- Turns on the moving charge part. --------
      • Trigger - Turn on BERSERK MOVE <gen>
      • -------- - --------
      • -------- - --------
AND

  • BERSERK MOVE
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • -------- Sets the base of movement. --------
      • Set Temp_Charge_Point_1 = (Position of Temp_Caster)
      • -------- - --------
      • -------- - --------
      • -------- Sets new place, point based on postition of hero. --------
      • Set Temp_Charge_Point_2 = (Temp_Charge_Point_1 offset by 75.00 towards (Angle from Temp_Charge_Point_1 to Temp_Point) degrees)
      • -------- - --------
      • -------- - --------
      • -------- Sets new place for impaled units. --------
      • Set Temp_Charge_Point_3 = (Temp_Charge_Point_2 offset by 80.00 towards (Angle from Temp_Charge_Point_1 to Temp_Point) degrees)
      • -------- - --------
      • -------- - --------
      • -------- Moves hero to new position. --------
      • Unit - Move Temp_Caster instantly to Temp_Charge_Point_2
      • -------- - --------
      • -------- - --------
      • -------- Moves damaged units to get impaled. --------
      • Unit Group - Pick every unit in Temp_Group_2 and do (Actions)
        • Loop - Actions
          • Unit - Turn collision for (Picked unit) Off
          • Unit - Move (Picked unit) instantly to Temp_Charge_Point_3
          • -------- Moves impaled unit with you. --------
      • -------- - --------
      • -------- - --------
      • -------- Measures the distance between points, used later --------
      • Set Charge_Distance = (Distance between Temp_Charge_Point_1 and Temp_Point)
      • -------- - --------
      • -------- - --------
      • -------- Creates the after image. --------
      • Unit - Create 1 DUMMY BM for (Owner of Temp_Caster) at Temp_Charge_Point_2 facing (Facing of Temp_Caster) degrees
      • Animation - Change (Last created unit)'s animation speed to 0.00% of its original speed
      • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 60.00% transparency
      • -------- - --------
      • -------- - --------
      • -------- Creates the image. --------
      • Special Effect - Create a special effect at Temp_Charge_Point_2 using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at Temp_Charge_Point_3 using Abilities\Spells\Undead\Impale\ImpaleMissTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at Temp_Charge_Point_3 using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- - --------
      • -------- - --------
      • -------- Adds the unit to the temp group, going to be destroyed later. --------
      • Set Temp_Group = (Units owned by (Owner of Temp_Caster) of type DUMMY BM)
      • -------- - --------
      • -------- - --------
      • -------- Level one of the slash --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of [Z] Berserker Slash for Temp_Caster) Equal to 1
        • Then - Actions
          • Set Temp_Group_2 = (Units within 75.00 of (Position of Temp_Caster) matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Temp_Caster)) Equal to True)))
          • Unit Group - Pick every unit in Temp_Group_2 and do (Actions)
            • Loop - Actions
              • Unit - Cause Temp_Caster to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
              • -------- HERO DAMAGES THEM! --------
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Some FX --------
              • Unit Group - Add (Picked unit) to Temp_Group_2
              • -------- Adds unit to impaled group. --------
        • Else - Actions
      • -------- - --------
      • -------- - --------
      • -------- Level two of the slash --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of [Z] Berserker Slash for Temp_Caster) Equal to 2
        • Then - Actions
          • Set Temp_Group_2 = (Units within 75.00 of (Position of Temp_Caster) matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Temp_Caster)) Equal to True)))
          • Unit Group - Pick every unit in Temp_Group_2 and do (Actions)
            • Loop - Actions
              • Unit - Cause Temp_Caster to damage (Picked unit), dealing 200.00 damage of attack type Spells and damage type Normal
              • -------- HERO DAMAGES THEM! --------
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Some FX --------
              • Unit Group - Add (Picked unit) to Temp_Group_2
              • -------- Adds unit to impaled group. --------
        • Else - Actions
      • -------- - --------
      • -------- - --------
      • -------- Level three of the slash --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of [Z] Berserker Slash for Temp_Caster) Equal to 3
        • Then - Actions
          • Set Temp_Group_2 = (Units within 75.00 of (Position of Temp_Caster) matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Temp_Caster)) Equal to True)))
          • Unit Group - Pick every unit in Temp_Group_2 and do (Actions)
            • Loop - Actions
              • Unit - Cause Temp_Caster to damage (Picked unit), dealing 300.00 damage of attack type Spells and damage type Normal
              • -------- HERO DAMAGES THEM! --------
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Some FX --------
              • Unit Group - Add (Picked unit) to Temp_Group_2
              • -------- Adds unit to impaled group. --------
        • Else - Actions
      • -------- - --------
      • -------- - --------
      • -------- How the movement stops, uses the distance from the variable that gets it and finds out when to stop. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Charge_Distance Less than or equal to 100.00
        • Then - Actions
          • -------- Turns hero's collision on. --------
          • Unit - Turn collision for Temp_Caster On
          • Trigger - Turn off (This trigger)
          • -------- Destroys afterimages. --------
          • Unit Group - Pick every unit in Temp_Group and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • -------- Turns impaled unit's collision and removes them from being impaled. --------
          • Unit Group - Pick every unit in Temp_Group_2 and do (Actions)
            • Loop - Actions
              • Unit - Turn collision for (Picked unit) On
              • Unit Group - Remove (Picked unit) from Temp_Group_2
          • -------- Destroys one of the fx --------
          • Special Effect - Destroy Temp_FX
          • Custom script: call RemoveLocation (udg_Temp_Point)
          • Custom script: call DestroyGroup (udg_Temp_Group_2)
        • Else - Actions
          • Custom script: call DestroyGroup (udg_Temp_Group)
          • Custom script: call RemoveLocation (udg_Temp_Charge_Point_1)
          • Custom script: call RemoveLocation (udg_Temp_Charge_Point_2)
          • Custom script: call RemoveLocation (udg_Temp_Charge_Point_3)
THX :wink:
 
Level 5
Joined
Oct 30, 2007
Messages
91
K i red the tuts and made the spell use loops and arrays but it still wont become mui what did i do wrong? i added 3 additional triggers but those probably can be compressed later after i get it to work >.<
NEW TRIGGERS:
  • ACTIVATE
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • Set BerserkID[(Integer A)] = (Integer A)
          • Set Temp_Caster[(Integer A)] = No unit
  • BERSERK NEW INDEX
    • Events
    • Conditions
    • Actions
      • Set BERSERKINDEX = (BERSERKINDEX + 1)
      • Set B_Current_Index = BerserkID[BERSERKINDEX]
  • BERSERK NEW INDEX
    • Events
    • Conditions
    • Actions
      • Set BERSERKINDEX = (BERSERKINDEX + 1)
      • Set B_Current_Index = BerserkID[BERSERKINDEX]
  • BEGIN CAST
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to [Z] Berserker Slash
    • Actions
      • Trigger - Run BERSERK NEW INDEX <gen> (ignoring conditions)
      • -------- Sets the Casting unit, perpares the casting unit for charge! >:) --------
      • Set Temp_Caster[B_Current_Index] = (Casting unit)
      • Set Temp_Point[B_Current_Index] = (Target point of ability being cast)
      • -------- - --------
      • -------- - --------
      • -------- Turn's off the BM collision so he wont get stuck --------
      • Unit - Turn collision for Temp_Caster[B_Current_Index] Off
      • -------- - --------
      • -------- - --------
      • -------- FX to make it look COOL --------
      • Special Effect - Create a special effect attached to the origin of (Casting unit) using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the chest of Temp_Caster[B_Current_Index] using Abilities\Weapons\SludgeMissile\SludgeMissile.mdl
      • Set Temp_FX[B_Current_Index] = (Last created special effect)
      • Sound - Play HeroBladeMasterYesAttack3 <gen> at 100.00% volume, attached to Temp_Caster[B_Current_Index]
      • -------- - --------
      • -------- - --------
      • -------- Makes the BM stick out his sword --------
      • Animation - Play (Casting unit)'s attack,second animation
      • -------- - --------
      • -------- - --------
      • -------- Turns on the moving charge part. --------
      • Trigger - Turn on BERSERK MOVE <gen>
      • -------- - --------
      • -------- - --------
  • BERSERK MOVE
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Caster[(Integer A)] Not equal to No unit
            • Then - Actions
              • -------- Sets the base of movement. --------
              • Set Temp_Charge_Point_1[(Integer A)] = (Position of Temp_Caster[(Integer A)])
              • -------- - --------
              • -------- Sets new place, point based on postition of hero. --------
              • Set Temp_Charge_Point_2[(Integer A)] = (Temp_Charge_Point_1[(Integer A)] offset by 10.00 towards (Angle from Temp_Charge_Point_1[(Integer A)] to Temp_Point[(Integer A)]) degrees)
              • -------- - --------
              • -------- Sets new place for impaled units. --------
              • Set Temp_Charge_Point_3[(Integer A)] = (Temp_Charge_Point_2[(Integer A)] offset by 100.00 towards (Angle from Temp_Charge_Point_2[(Integer A)] to Temp_Point[(Integer A)]) degrees)
              • -------- - --------
              • -------- Moves hero to new position. --------
              • Unit - Move Temp_Caster[(Integer A)] instantly to Temp_Charge_Point_2[(Integer A)]
              • -------- - --------
              • -------- Moves damaged units to get impaled. --------
              • Unit Group - Pick every unit in Temp_Group_2[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Unit - Turn collision for (Picked unit) Off
                  • Unit - Move (Picked unit) instantly to Temp_Charge_Point_3[(Integer A)]
                  • -------- Moves impaled unit with you. --------
              • -------- - --------
              • -------- Measures the distance between points, used later --------
              • Set Temp_Real[(Integer A)] = (Distance between Temp_Charge_Point_2[(Integer A)] and Temp_Point[(Integer A)])
              • -------- - --------
              • -------- Creates the after image. --------
              • Unit - Create 1 DUMMY BM for (Owner of Temp_Caster[(Integer A)]) at Temp_Charge_Point_2[(Integer A)] facing (Facing of Temp_Caster[(Integer A)]) degrees
              • Animation - Change (Last created unit)'s animation speed to 0.00% of its original speed
              • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 60.00% transparency
              • -------- - --------
              • -------- Creates the image. --------
              • Special Effect - Create a special effect at Temp_Charge_Point_2[(Integer A)] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect at Temp_Charge_Point_2[(Integer A)] using Abilities\Spells\Undead\Impale\ImpaleMissTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect at Temp_Charge_Point_3[(Integer A)] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- - --------
              • -------- Adds the unit to the temp group, going to be destroyed later. --------
              • Set Temp_Group[(Integer A)] = (Units of type DUMMY BM)
              • -------- - --------
              • -------- Level one of the slash --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of [Z] Berserker Slash for Temp_Caster[(Integer A)]) Equal to 1
                • Then - Actions
                  • Set Temp_Group_2[(Integer A)] = (Units within 75.00 of Temp_Charge_Point_2[(Integer A)] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of Temp_Caster[(Integer A)])) Equal to True) and (((Matching unit) is alive) Equal to True
                  • Unit Group - Pick every unit in Temp_Group_2[(Integer A)] and do (Actions)
                    • Loop - Actions
                      • Unit - Cause Temp_Caster[(Integer A)] to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
                      • -------- HERO DAMAGES THEM! --------
                      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • -------- Some FX --------
                • Else - Actions
              • -------- - --------
              • -------- Level two of the slash --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of [Z] Berserker Slash for Temp_Caster[(Integer A)]) Equal to 2
                • Then - Actions
                  • Set Temp_Group_2[(Integer A)] = (Units within 75.00 of Temp_Charge_Point_2[(Integer A)] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of Temp_Caster[(Integer A)])) Equal to True) and (((Matching unit) is alive) Equal to True
                  • Unit Group - Pick every unit in Temp_Group_2[(Integer A)] and do (Actions)
                    • Loop - Actions
                      • Unit - Cause Temp_Caster[(Integer A)] to damage (Picked unit), dealing 200.00 damage of attack type Spells and damage type Normal
                      • -------- HERO DAMAGES THEM! --------
                      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • -------- Some FX --------
                • Else - Actions
              • -------- - --------
              • -------- Level three of the slash --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of [Z] Berserker Slash for Temp_Caster[(Integer A)]) Equal to 3
                • Then - Actions
                  • Set Temp_Group_2[(Integer A)] = (Units within 75.00 of Temp_Charge_Point_2[(Integer A)] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of Temp_Caster[(Integer A)])) Equal to True) and (((Matching unit) is alive) Equal to True
                  • Unit Group - Pick every unit in Temp_Group_2[(Integer A)] and do (Actions)
                    • Loop - Actions
                      • Unit - Cause Temp_Caster[(Integer A)] to damage (Picked unit), dealing 300.00 damage of attack type Spells and damage type Normal
                      • -------- HERO DAMAGES THEM! --------
                      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • -------- Some FX --------
                • Else - Actions
              • -------- - --------
              • -------- How the movement stops, uses the distance from the variable that gets it and finds out when to stop. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Temp_Real[(Integer A)] Less than or equal to 100.00
                • Then - Actions
                  • -------- Turns hero's collision on. --------
                  • Unit - Turn collision for Temp_Caster[(Integer A)] On
                  • Trigger - Turn off (This trigger)
                  • -------- Destroys afterimages. --------
                  • Unit Group - Pick every unit in Temp_Group[(Integer A)] and do (Actions)
                    • Loop - Actions
                      • Unit - Remove (Picked unit) from the game
                  • Unit Group - Pick every unit in Temp_Group_2[(Integer A)] and do (Actions)
                    • Loop - Actions
                      • Unit - Turn collision for (Picked unit) On
                  • -------- Turns impaled unit's collision and removes them from being impaled. --------
                  • -------- Destroys one of the fx --------
                  • Special Effect - Destroy Temp_FX[(Integer A)]
                • Else - Actions
                  • Set BERSERKINDEX = (Integer A)
                  • Trigger - Run BERSERK RETURN INDEX <gen> (ignoring conditions)
            • Else - Actions
BTW: i used the mui tut listed below gave me.
 
Level 5
Joined
Oct 30, 2007
Messages
91
K thx everyone, but now how do u remove a point that has an array?
I tryed both and got an error message and if i am not mistaken an mui spell cant have leaks >.>
Also i got unit group leaks. how do i get rid of these?
  • Custom script: call DestroyGroup (udg_Temp_Group)

  • Custom script: call DestroyGroup (udg_Temp_Group[Integer A])
 
Status
Not open for further replies.
Top