- Joined
- Mar 1, 2013
- Messages
- 555
Hey people
I made a missile system for my map but I've found that the missile doesn't die when it kills the target
Please see if you can help me find the problem
Sorry I know it's a lot of triggers for a simple spell but once it works then I can make missile spells with minimum effort.
Thanks for your help.
I made a missile system for my map but I've found that the missile doesn't die when it kills the target
-
GravitonCast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Graviton
-
-
Actions
-
Trigger - Run Missile Indexer <gen> (ignoring conditions)
-
Set MissileTarget[MissileIndex] = (Target unit of ability being cast)
-
Set Temp_Point2 = (Position of MissileTarget[MissileIndex])
-
Unit - Create 1 Graviton for (Owner of MissileCaster[MissileIndex]) at Temp_Point facing Temp_Point2
-
Custom script: call RemoveLocation(udg_Temp_Point)
-
Custom script: call RemoveLocation(udg_Temp_Point2)
-
Set Missile[MissileIndex] = (Last created unit)
-
Set MissileSpeed[MissileIndex] = 5.00
-
Set MissileDamage[MissileIndex] = 200.00
-
Set MissileValue[MissileIndex] = 0.00
-
Set MissileKill[MissileIndex] = True
-
-
-
Missile Indexer
-
Events
-
Conditions
-
Actions
-
If (MissileIndex Equal to 0) then do (Trigger - Turn on Missile loop <gen>) else do (-------- 0 --------)
-
Set MissileIndex = (MissileIndex + 1)
-
Set MissileCaster[MissileIndex] = (Triggering unit)
-
Set Temp_Point = (Position of MissileCaster[MissileIndex])
-
-
-
Missile loop
-
Events
-
Time - Every 0.01 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer Temp_Int) from 1 to MissileIndex, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Missile[Temp_Int] is paused) Equal to False
-
-
Then - Actions
-
Set Temp_Point = (Position of Missile[Temp_Int])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MissileTarget[Temp_Int] Equal to No unit
-
-
Then - Actions
-
Set Temp_Enemies = (Units within 70.00 of Temp_Point matching (((Owner of (Matching unit)) is an ally of (Owner of Missile[Temp_Int])) Equal to False))
-
If ((Temp_Enemies is empty) Equal to False) then do (Set MissileTarget[Temp_Int] = (Random unit from Temp_Enemies)) else do (-------- 0 --------)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Temp_Enemies is empty) Equal to False
-
-
Then - Actions
-
Set MissileTarget[Temp_Int] = (Random unit from Temp_Enemies)
-
Trigger - Run Missile Event <gen> (ignoring conditions)
-
-
Else - Actions
-
Set Temp_Point2 = (Temp_Point offset by MissileSpeed[Temp_Int] towards (Facing of Missile[Temp_Int]) degrees)
-
Unit - Move Missile[Temp_Int] instantly to Temp_Point2
-
Custom script: call RemoveLocation(udg_Temp_Point2)
-
-
-
Custom script: call DestroyGroup(udg_Temp_Enemies)
-
-
Else - Actions
-
Set Temp_Point2 = (Position of MissileTarget[Temp_Int])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between Temp_Point and Temp_Point2) Greater than (10.00 + MissileSpeed[Temp_Int])
-
-
Then - Actions
-
Set Temp_Real = (Angle from Temp_Point to Temp_Point2)
-
Set Temp_Point3 = (Temp_Point offset by MissileSpeed[Temp_Int] towards Temp_Real degrees)
-
Unit - Move Missile[Temp_Int] instantly to Temp_Point3, facing Temp_Real degrees
-
Custom script: call RemoveLocation(udg_Temp_Point3)
-
-
Else - Actions
-
Trigger - Run Missile Event <gen> (ignoring conditions)
-
-
-
Custom script: call RemoveLocation(udg_Temp_Point2)
-
-
-
Custom script: call RemoveLocation(udg_Temp_Point)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Missile[Temp_Int] is dead) Equal to True
-
-
Then - Actions
-
Set MissileCaster[Temp_Int] = MissileCaster[MissileIndex]
-
Set MissileCaster[MissileIndex] = No unit
-
Set MissileTarget[Temp_Int] = MissileTarget[MissileIndex]
-
Set MissileTarget[MissileIndex] = No unit
-
Set Missile[Temp_Int] = Missile[MissileIndex]
-
Set Missile[MissileIndex] = No unit
-
Set MissileSpeed[Temp_Int] = MissileSpeed[MissileIndex]
-
Set MissileSpeed[MissileIndex] = 0.00
-
Set MissileDamage[Temp_Int] = MissileDamage[MissileIndex]
-
Set MissileDamage[MissileIndex] = 0.00
-
Set MissileValue[Temp_Int] = MissileValue[MissileIndex]
-
Set MissileValue[MissileIndex] = 0.00
-
Set MissileKill[Temp_Int] = MissileKill[MissileIndex]
-
Set MissileKill[MissileIndex] = False
-
Set MissileIndex = (MissileIndex - 1)
-
Set Temp_Int = (Temp_Int - 1)
-
If (MissileIndex Equal to 0) then do (Trigger - Turn off (This trigger)) else do (-------- 0 --------)
-
-
Else - Actions
-
-
-
-
-
-
Missile Event
-
Events
-
Conditions
-
Actions
-
Set QMissileCaster = MissileCaster[Temp_Int]
-
Set QMissileTarget = MissileTarget[Temp_Int]
-
Set QMissileDamage = MissileDamage[Temp_Int]
-
Set QMissile = Missile[Temp_Int]
-
Set QMissileValue = MissileValue[Temp_Int]
-
Set MissileImpact = 1.00
-
Set MissileImpact = 0.00
-
If (MissileKill[Temp_Int] Equal to True) then do (Unit - Kill Missile[Temp_Int]) else do (-------- 0 --------)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MissileKill[Temp_Int] Equal to True
-
-
Then - Actions
-
Game - Display to (All players) the text: true
-
-
Else - Actions
-
Game - Display to (All players) the text: false
-
-
-
-
-
GravitonEnd
-
Events
-
Game - MissileImpact becomes Equal to 1.00
-
-
Conditions
-
(Unit-type of QMissile) Equal to Graviton
-
-
Actions
-
Set Temp_Point = (Position of QMissileTarget)
-
Unit - Cause QMissileCaster to damage QMissileTarget, dealing QMissileDamage damage of attack type Hero and damage type Sonic
-
Special Effect - Create a special effect at Temp_Point using war3mapImported\Arcane Nova.mdx
-
Special Effect - Destroy (Last created special effect)
-
Custom script: call RemoveLocation(udg_Temp_Point)
-
-
Sorry I know it's a lot of triggers for a simple spell but once it works then I can make missile spells with minimum effort.
Thanks for your help.