• 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] Can you find me the leaks

Status
Not open for further replies.
Level 6
Joined
Nov 15, 2010
Messages
112
Guys, i make this spell 2-3 days ago. but it is rejected. The moderator said that this spell has many leaks. can you tell me where is the leaks??The spell name is Flash Sword w/ Knockback. this is the trigger:

[trigger=Flash Sword Ability]
Flash Sword Ability
Events
Unit - A unit Is attacked
Conditions
(Level of Flash Sword for (Attacking unit)) Greater than 0
Actions
Set Caster = (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 4) Equal to 1
Then - Actions
Set Target = (Attacked unit)
Set Angle = (Facing of Caster)
Animation - Play Caster's Attack Slam animation
Unit - Cause Caster to damage Target, dealing 900.00 damage of attack type Hero and damage type Lightning
Special Effect - Create a special effect at (Position of Target) using Abilities\Weapons\Bolt\BoltImpact.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Turn collision for Target Off
Trigger - Turn off (This trigger)
Trigger - Turn on Flash Sword Knockback <gen>
If ((Level of Flash Sword for Caster) Greater than 0) then do (Wait 0.95 seconds) else do (Do nothing)
Trigger - Turn off Flash Sword Knockback <gen>
Unit - Turn collision for Target On
Trigger - Turn on (This trigger)
Else - Actions[/trigger]

[trigger=Flash Sword Knockback]
Flash Sword Knockback
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
(Terrain pathing at ((Position of Target) offset by 10.00 towards Angle degrees) of type Walkability is off) Equal to False
Then - Actions
Set Targt_Pos = (Position of Target)
Unit - Cause Caster to damage Target, dealing 10.00 damage of attack type Spells and damage type Lightning
Unit - Move Target instantly to (Targt_Pos offset by 5.00 towards Angle degrees)
Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Special Effect - Destroy (Last created special effect)
Destructible - Pick every destructible within 105.00 of Targt_Pos and do (Destructible - Kill (Picked destructible))
Else - Actions
Custom script: call RemoveLocation(udg_Targt_Pos)[/trigger]
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
[trigger=Flash Sword Ability]
Flash Sword Ability
Events
Unit - A unit Is attacked
Conditions
(Level of Flash Sword for (Attacking unit)) Greater than 0
Actions
Set Caster = (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 4) Equal to 1
Then - Actions
Set Target = (Attacked unit)
Set Angle = (Facing of Caster)
Animation - Play Caster's Attack Slam animation
Unit - Cause Caster to damage Target, dealing 900.00 damage of attack type Hero and damage type Lightning
Special Effect - Create a special effect at (Position of Target) using Abilities\Weapons\Bolt\BoltImpact.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Turn collision for Target Off
Trigger - Turn off (This trigger) // Don't do this
Trigger - Turn on Flash Sword Knockback <gen>
If ((Level of Flash Sword for Caster) Greater than 0) then do (Wait 0.95 seconds) else do (Do nothing) // Remove this
Trigger - Turn off Flash Sword Knockback <gen> // Don't do this here
Unit - Turn collision for Target On
Trigger - Turn on (This trigger) // Remove this
Else - Actions[/trigger]

[trigger=Flash Sword Knockback]
Flash Sword Knockback
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
(Terrain pathing at ((Position of Target) offset by 10.00 towards Angle degrees) of type Walkability is off) Equal to False // Leaks two points
Then - Actions
Set Targt_Pos = (Position of Target)
Unit - Cause Caster to damage Target, dealing 10.00 damage of attack type Spells and damage type Lightning
Unit - Move Target instantly to (Targt_Pos offset by 5.00 towards Angle degrees)
Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Special Effect - Destroy (Last created special effect)
Destructible - Pick every destructible within 105.00 of Targt_Pos and do (Destructible - Kill (Picked destructible))
Custom script: call RemoveLocation(udg_Targt_Pos)
Else - Actions
[/trigger]

Don't ever turn on/off the first trigger.
Turn off the looping trigger in the looping trigger.
I moved the call RemoveLocation in to the correct place.
 
Level 6
Joined
Nov 15, 2010
Messages
112
like this???

[TRIGGER=Flash Sword Ability]
Flash Sword Ability
Events
Unit - A unit Is attacked
Conditions
(Level of Flash Sword for (Attacking unit)) Greater than 0
Actions
Set Caster = (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 4) Equal to 1
Then - Actions
Set Target = (Attacked unit)
Set Angle = (Facing of Caster)
Animation - Play Caster's Attack Slam animation
Unit - Cause Caster to damage Target, dealing 900.00 damage of attack type Hero and damage type Lightning
Special Effect - Create a special effect at (Position of Target) using Abilities\Weapons\Bolt\BoltImpact.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at (Position of Target) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Turn collision for Target Off
Trigger - Turn on Flash Sword Knockback <gen>
If ((Level of Flash Sword for Caster) Greater than 0) then do (Wait 0.95 seconds) else do (Do nothing)
Trigger - Turn off Flash Sword Knockback <gen>
Unit - Turn collision for Target On
Else - Actions[/TRIGGER]

[TRIGGER=Flash Sword Knockback]
Flash Sword Knockback
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
(Terrain pathing at ((Position of Target) offset by 10.00 towards Angle degrees) of type Walkability is off) Equal to False
Then - Actions
Set Targt_Pos = (Position of Target)
Unit - Cause Caster to damage Target, dealing 10.00 damage of attack type Spells and damage type Lightning
Unit - Move Target instantly to (Targt_Pos offset by 5.00 towards Angle degrees)
Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Special Effect - Destroy (Last created special effect)
Destructible - Pick every destructible within 105.00 of Targt_Pos and do (Destructible - Kill (Picked destructible))
Custom script: call RemoveLocation(udg_Targt_Pos)
Else - Actions[/TRIGGER]
 
Level 6
Joined
Nov 15, 2010
Messages
112
you still leak the projection point on the loop... and (Position of Target) at the first trigger...

i've fix it like this:

[trigger=]
Flash Sword Ability
Events
Unit - A unit Is attacked
Conditions
(Level of Flash Sword for (Attacking unit)) Greater than 0
Actions
Set Caster = (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 4) Equal to 1
Then - Actions
Set Target = (Attacked unit)
Set Angle = (Facing of Caster)
Animation - Play Caster's Attack Slam animation
Unit - Cause Caster to damage Target, dealing 900.00 damage of attack type Hero and damage type Lightning
Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Turn collision for Target Off
Trigger - Turn on Flash Sword Knockback <gen>
If ((Level of Flash Sword for Caster) Greater than 0) then do (Wait 0.95 seconds) else do (Do nothing)
Trigger - Turn off Flash Sword Knockback <gen>
Unit - Turn collision for Target On
Else - Actions
[/trigger]

[trigger=]
Flash Sword Knockback
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Set Targt_Pos = (Position of Target)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at (Targt_Pos offset by 10.00 towards Angle degrees) of type Walkability is off) Equal to False
Then - Actions
Unit - Cause Caster to damage Target, dealing 10.00 damage of attack type Spells and damage type Lightning
Unit - Move Target instantly to (Targt_Pos offset by 5.00 towards Angle degrees)
Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Special Effect - Destroy (Last created special effect)
Destructible - Pick every destructible within 105.00 of Targt_Pos and do (Destructible - Kill (Picked destructible))
Custom script: call RemoveLocation(udg_Targt_Pos)
Else - Actions
[/trigger]
 
Level 6
Joined
Nov 15, 2010
Messages
112
this will be good...

[trigger=]
Flash Sword Knockback
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Set Targt_Pos = (Position of Target)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at (Targt_Pos offset by 10.00 towards Angle degrees) of type Walkability is off) Equal to False
Then - Actions
Set Pos_Tar_Offsts = (Targt_Pos offset by 5.00 towards Angle degrees)
Unit - Cause Caster to damage Target, dealing 10.00 damage of attack type Spells and damage type Lightning
Unit - Move Target instantly to Pos_Tar_Offsts
Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Special Effect - Destroy (Last created special effect)
Destructible - Pick every destructible within 105.00 of Targt_Pos and do (Destructible - Kill (Picked destructible))
Custom script: call RemoveLocation(udg_Targt_Pos)
Else - Actions
[/trigger]
 
The locations are removed improperly.

  • Flash Sword Knockback
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set Targt_Pos = (Position of Target)
      • Set Pos_Tar_Offsts = (Targt_Pos offset by 5.00 towards Angle degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at Pos_Tar_Offsts of type Walkability is off) Equal to False
        • Then - Actions
          • Unit - Cause Caster to damage Target, dealing 10.00 damage of attack type Spells and damage type Lightning
          • Unit - Move Target instantly to Pos_Tar_Offsts
          • Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Destructible - Pick every destructible within 105.00 of Targt_Pos and do (Destructible - Kill (Picked destructible))
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Targt_Pos)
      • Custom script: call RemoveLocation(udg_Targt_Pos_Offsts)
Edit: fixed yet another leak in this edit.
 
Level 6
Joined
Nov 15, 2010
Messages
112
thanks...

the trigger is like this.....

[trigger=]
Flash Sword Knockback
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Set Targt_Pos = (Position of Target)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at (Targt_Pos offset by 10.00 towards Angle degrees) of type Walkability is off) Equal to False
Then - Actions
Set Pos_Tar_Offsts = (Targt_Pos offset by 5.00 towards Angle degrees)
Unit - Cause Caster to damage Target, dealing 10.00 damage of attack type Spells and damage type Lightning
Unit - Move Target instantly to Pos_Tar_Offsts
Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Special Effect - Destroy (Last created special effect)
Destructible - Pick every destructible within 105.00 of Targt_Pos and do (Destructible - Kill (Picked destructible))
Custom script: call RemoveLocation(udg_Targt_Pos)
Else - Actions
Custom script: call RemoveLocation(udg_Pos_Tar_Offsts)
[/trigger]
 
Level 6
Joined
Nov 15, 2010
Messages
112
this is good thing...

[trigger=]
Flash Sword Knockback
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Set Targt_Pos = (Position of Target)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at (Targt_Pos offset by 10.00 towards Angle degrees) of type Walkability is off) Equal to False
Then - Actions
Set Pos_Tar_Offsts = (Targt_Pos offset by 5.00 towards Angle degrees)
Unit - Cause Caster to damage Target, dealing 10.00 damage of attack type Spells and damage type Lightning
Unit - Move Target instantly to Pos_Tar_Offsts
Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Special Effect - Destroy (Last created special effect)
Destructible - Pick every destructible within 105.00 of Targt_Pos and do (Destructible - Kill (Picked destructible))
Else - Actions
Custom script: call RemoveLocation(udg_Targt_Pos)
Custom script: call RemoveLocation(udg_Pos_Tar_Offsts)
[/trigger]
 
Haha, after all the hardwork making it "leakless", it's time for MUI
Ahahahahaa

You have to change the subject now and then. "No project is ever finished", so he will need some leak fixing, some MUI tutorials, something else, more leak fixing, etc., eventually he will get the hang of it if this is something he really wants to do.
 
Level 6
Joined
Nov 15, 2010
Messages
112
hey, i have finished my spell with index....like this:

[trigger=]
Flash Sword Ability
Events
Unit - A unit Is attacked
Conditions
(Level of Flash Sword for (Attacking unit)) Greater than 0
Actions
Set Caster_n_Target[1] = (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 4) Equal to 1
Then - Actions
Set Angle = (Facing of Caster_n_Target[1])
Set Caster_n_Target[2] = (Attacked unit)
Animation - Play Caster_n_Target[1]'s attack walk stand spin animation
Unit - Cause Caster_n_Target[1] to damage Caster_n_Target[2], dealing 900.00 damage of attack type Hero and damage type Lightning
Special Effect - Create a special effect attached to the origin of Caster_n_Target[2] using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Turn collision for Caster_n_Target[2] Off
Trigger - Turn on Flash Sword Knockback <gen>
Special Effect - Create a special effect attached to the weapon of Caster_n_Target[1] using Abilities\Weapons\Bolt\BoltImpact.mdl
If ((Level of Flash Sword for Caster_n_Target[1]) Equal to 1) then do (Wait 0.95 seconds) else do (Do nothing)
Trigger - Turn off Flash Sword Knockback <gen>
Unit - Turn collision for Caster_n_Target[2] On
Special Effect - Destroy (Last created special effect)
Else - Actions
[/trigger]

[trigger=]
Flash Sword Knockback
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Set Point[1] = (Position of Caster_n_Target[2])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at (Point[1] offset by 500.00 towards Angle degrees) of type Walkability is off) Equal to False
Then - Actions
Set Point[2] = (Point[1] offset by 5.00 towards Angle degrees)
Unit - Cause Caster_n_Target[1] to damage Caster_n_Target[2], dealing 10.00 damage of attack type Spells and damage type Lightning
Unit - Move Caster_n_Target[2] instantly to Point[2]
Special Effect - Create a special effect attached to the origin of Caster_n_Target[2] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Special Effect - Destroy (Last created special effect)
Destructible - Pick every destructible within 105.00 of Point[1] and do (Destructible - Kill (Picked destructible))
Else - Actions
Custom script: call RemoveLocation(udg_Point[2])
Custom script: call RemoveLocation(udg_Point[1])
[/trigger]
 
it depends... MUI means that the spell can be used by more than one unit at almost the same time without colliding with each other (in simpler terms, without bugging)...

for example, in your current set-up, if two units activate the effect, the first one will end faster since the variables get overridden by the new caster...
 
Status
Not open for further replies.
Top