Kusanagi Kuro
Hosted Project: SC
- Joined
- Mar 11, 2012
- Messages
- 708
I create a missle spell with triggers like this:
After 2 times casting it successfully, the 3rd time I try to cast it, it causes crash. Does anyone know why?
-
Shadow Shuriken Start
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Shadow Shuriken
-
Actions
- Set tempPoint = (Position of (Triggering unit))
- Set tempPoint2 = (Target point of ability being cast)
- Unit - Create 1 Shadow Shuriken for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
- Unit Group - Add (Last created unit) to ShadowShuriken_Group
- Unit - Turn collision for (Last created unit) Off
- Set CV = (Custom value of (Last created unit))
- Set ShadowShuriken_Angle[CV] = (Angle from tempPoint to tempPoint2)
- Set ShadowShuriken_Lvls[CV] = (Level of (Ability being cast) for (Triggering unit))
- Set ShadowShuriken_Distance[CV] = 900.00
- Set ShadowShuriken_Caster[CV] = (Triggering unit)
- Custom script: set udg_ShadowShuriken_DamagedGroup[udg_CV]=CreateGroup()
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Shadow Shuriken Loop <gen> is on) Equal to True
- Then - Actions
-
Else - Actions
- Trigger - Turn on Shadow Shuriken Loop <gen>
-
If - Conditions
-
Events
-
Shadow Shuriken Loop
-
Events
- Time - Every 0.02 seconds of game time
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (ShadowShuriken_Group is empty) Equal to True
-
Then - Actions
- Trigger - Turn off (This trigger)
-
Else - Actions
-
Unit Group - Pick every unit in ShadowShuriken_Group and do (Actions)
-
Loop - Actions
- Set CV = (Custom value of (Picked unit))
- Set tempPoint = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ShadowShuriken_Distance[CV] Equal to 0.00
-
Then - Actions
- Unit - Kill (Picked unit)
- Unit Group - Remove (Picked unit) from ShadowShuriken_Group
- Set tempGroup = (Units within 200.00 of tempPoint matching ((((Matching unit) belongs to an enemy of (Owner of ShadowShuriken_Caster[CV])) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching un
-
Unit Group - Pick every unit in tempGroup and do (Actions)
-
Loop - Actions
- Set ShadowShuriken_Damage[CV] = ((30.00 + (60.00 x (Real(ShadowShuriken_Lvls[CV])))) + (30.00 x (Real((Level of Shadow Charge for (Picked unit))))))
- Set DamageType = 1
- Unit - Cause ShadowShuriken_Caster[CV] to damage (Picked unit), dealing ShadowShuriken_Damage[CV] damage of attack type Spells and damage type Magic
- Set DamageType = 0
- Unit Group - Add (Picked unit) to ShadowShuriken_DamagedGroup[CV]
- Set CV2 = (Custom value of (Picked unit))
- Set ShadowCharge_Duration[CV2] = 7.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Shadow Charge for (Picked unit)) Greater than or equal to 1
-
Then - Actions
- Unit - Set level of Shadow Charge for (Picked unit) to ((Level of Shadow Charge for (Picked unit)) + 1)
-
Else - Actions
- Unit - Add Shadow Charge to (Picked unit)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Shadow Charge Countdown <gen> is on) Equal to True
- Then - Actions
-
Else - Actions
- Trigger - Turn on Shadow Charge Countdown <gen>
-
If - Conditions
-
Loop - Actions
- Custom script: call DestroyGroup(udg_tempGroup)
- Custom script: call DestroyGroup(udg_ShadowShuriken_DamagedGroup[udg_CV])
- Custom script: call RemoveLocation(udg_tempPoint)
-
Else - Actions
- Set ShadowShuriken_Distance[CV] = (ShadowShuriken_Distance[CV] - 12.00)
- Set tempPoint2 = (tempPoint offset by 12.00 towards ShadowShuriken_Angle[CV] degrees)
- Unit - Move (Picked unit) instantly to tempPoint2
- Set tempGroup = (Units within 200.00 of tempPoint matching ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is in Sh
-
Unit Group - Pick every unit in tempGroup and do (Actions)
-
Loop - Actions
- Set ShadowShuriken_Damage[CV] = ((30.00 + (60.00 x (Real(ShadowShuriken_Lvls[CV])))) + (30.00 x (Real((Level of Shadow Charge for (Picked unit))))))
- Set DamageType = 1
- Unit - Cause ShadowShuriken_Caster[CV] to damage (Picked unit), dealing ShadowShuriken_Damage[CV] damage of attack type Spells and damage type Magic
- Set DamageType = 0
- Unit Group - Add (Picked unit) to ShadowShuriken_DamagedGroup[CV]
- Set CV2 = (Custom value of (Picked unit))
- Set ShadowCharge_Duration[CV2] = 7.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Shadow Charge for (Picked unit)) Greater than or equal to 1
-
Then - Actions
- Unit - Set level of Shadow Charge for (Picked unit) to ((Level of Shadow Charge for (Picked unit)) + 1)
-
Else - Actions
- Unit - Add Shadow Charge to (Picked unit)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Shadow Charge Countdown <gen> is on) Equal to True
- Then - Actions
-
Else - Actions
- Trigger - Turn on Shadow Charge Countdown <gen>
-
If - Conditions
-
Loop - Actions
- Custom script: call DestroyGroup(udg_tempGroup)
- Custom script: call RemoveLocation(udg_tempPoint2)
- Custom script: call RemoveLocation(udg_tempPoint)
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in ShadowShuriken_Group and do (Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events