- Joined
- Mar 15, 2012
- Messages
- 2,878
It fatal's.. it appears at 2 casts or higher, can anyone explain why to me if they can spot the issue?
[trigger=]
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Beam
Actions
Set Kbeamindex = (Kbeamindex + 1)
Set KbeamCaster[Kbeamindex] = (Triggering unit)
Set Kbeampoint = (Position of KbeamCaster[Kbeamindex])
Set Kbeamu[Kbeamindex] = (Last created unit)
Set Kbeamtarget[Kbeamindex] = (Target point of ability being cast)
Lightning - Create a Healing Wave - Secondary lightning effect from source Kbeampoint to target (Kbeampoint offset by (50.00, 50.00))
Set Kbeambeam[Kbeamindex] = (Last created lightning effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Kbeamindex Equal to 1
Then - Actions
Trigger - Turn on Untitled Trigger 002 <gen>
Else - Actions
Custom script: call RemoveLocation(udg_Kbeampoint)
[/trigger]
[trigger=]
Events
Time - Every 0.04 seconds of game time
ConditionsActions
For each (Integer Kbeamloop) from 1 to Kbeamindex, do (Actions)
Loop - Actions
Set Kbeamoffset[Kbeamloop] = (Kbeamoffset[Kbeamloop] + 30.00)
Set Kbeampoint = (Position of KbeamCaster[Kbeamindex])
Set Kbeampoint2 = (Kbeampoint offset by Kbeamoffset[Kbeamloop] towards (Angle from Kbeampoint to Kbeamtarget[Kbeamloop]) degrees)
Lightning - Move Kbeambeam[Kbeamloop] to source Kbeampoint and target Kbeampoint2
Special Effect - Create a special effect at Kbeampoint2 using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit Group - Pick every unit in (Units within 90.00 of Kbeampoint2 matching ((((Matching unit) belongs to an enemy of (Owner of KbeamCaster[Kbeamloop])) Equal to True) and ((((Matching unit) is dead) Not equal to True) and (((Matching unit) is hidden) Not equal to True)))) and do (Actions)
Loop - Actions
Unit - Cause KbeamCaster[Kbeamloop] to damage (Picked unit), dealing 30.00 damage of attack type Spells and damage type Magic
Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\HumanBloodFootman.mdl
Special Effect - Destroy (Last created special effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(KbeamCaster[Kbeamloop] is dead) Equal to True
(Distance between Kbeampoint2 and Kbeamtarget[Kbeamloop]) Less than or equal to 40.00
(Distance between Kbeampoint and Kbeamtarget[Kbeamloop]) Less than or equal to 40.00
Then - Actions
Set KbeamCaster[Kbeamloop] = KbeamCaster[Kbeamindex]
Set KbeamCaster[Kbeamindex] = No unit
Set Kbeamu[Kbeamloop] = Kbeamu[Kbeamindex]
Set Kbeamu[Kbeamindex] = No unit
Set Kbeamoffset[Kbeamloop] = Kbeamoffset[Kbeamindex]
Set Kbeamoffset[Kbeamindex] = 0.00
Set Kbeambeam[Kbeamloop] = Kbeambeam[Kbeamindex]
Lightning - Destroy Kbeambeam[Kbeamindex]
Set Kbeamtarget[Kbeamloop] = Kbeamtarget[Kbeamindex]
Custom script: call RemoveLocation(udg_Kbeamtarget[udg_Kbeamindex])
Set Kbeamindex = (Kbeamindex - 1)
Set Kbeamloop = (Kbeamloop - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Kbeamindex Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
Custom script: call RemoveLocation(udg_Kbeampoint)
Custom script: call RemoveLocation(udg_Kbeampoint2)
[/trigger]
Edit: I found out why it fatals, it seems to be because the lightning action however another bug hidden somewhere in my code is the reason for it.... The bug makes a index ignore itself or something and then when the lightning follows it fatals somehow. Like when one instance stops the other instance follows it exactly.
Edit2: Is it because of the point array?
Edit3: Read Post #3 ( The lightning fatal issue )
[trigger=]
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Beam
Actions
Set Kbeamindex = (Kbeamindex + 1)
Set KbeamCaster[Kbeamindex] = (Triggering unit)
Set Kbeampoint = (Position of KbeamCaster[Kbeamindex])
Set Kbeamu[Kbeamindex] = (Last created unit)
Set Kbeamtarget[Kbeamindex] = (Target point of ability being cast)
Lightning - Create a Healing Wave - Secondary lightning effect from source Kbeampoint to target (Kbeampoint offset by (50.00, 50.00))
Set Kbeambeam[Kbeamindex] = (Last created lightning effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Kbeamindex Equal to 1
Then - Actions
Trigger - Turn on Untitled Trigger 002 <gen>
Else - Actions
Custom script: call RemoveLocation(udg_Kbeampoint)
[/trigger]
[trigger=]
Events
Time - Every 0.04 seconds of game time
ConditionsActions
For each (Integer Kbeamloop) from 1 to Kbeamindex, do (Actions)
Loop - Actions
Set Kbeamoffset[Kbeamloop] = (Kbeamoffset[Kbeamloop] + 30.00)
Set Kbeampoint = (Position of KbeamCaster[Kbeamindex])
Set Kbeampoint2 = (Kbeampoint offset by Kbeamoffset[Kbeamloop] towards (Angle from Kbeampoint to Kbeamtarget[Kbeamloop]) degrees)
Lightning - Move Kbeambeam[Kbeamloop] to source Kbeampoint and target Kbeampoint2
Special Effect - Create a special effect at Kbeampoint2 using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit Group - Pick every unit in (Units within 90.00 of Kbeampoint2 matching ((((Matching unit) belongs to an enemy of (Owner of KbeamCaster[Kbeamloop])) Equal to True) and ((((Matching unit) is dead) Not equal to True) and (((Matching unit) is hidden) Not equal to True)))) and do (Actions)
Loop - Actions
Unit - Cause KbeamCaster[Kbeamloop] to damage (Picked unit), dealing 30.00 damage of attack type Spells and damage type Magic
Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\HumanBloodFootman.mdl
Special Effect - Destroy (Last created special effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(KbeamCaster[Kbeamloop] is dead) Equal to True
(Distance between Kbeampoint2 and Kbeamtarget[Kbeamloop]) Less than or equal to 40.00
(Distance between Kbeampoint and Kbeamtarget[Kbeamloop]) Less than or equal to 40.00
Then - Actions
Set KbeamCaster[Kbeamloop] = KbeamCaster[Kbeamindex]
Set KbeamCaster[Kbeamindex] = No unit
Set Kbeamu[Kbeamloop] = Kbeamu[Kbeamindex]
Set Kbeamu[Kbeamindex] = No unit
Set Kbeamoffset[Kbeamloop] = Kbeamoffset[Kbeamindex]
Set Kbeamoffset[Kbeamindex] = 0.00
Set Kbeambeam[Kbeamloop] = Kbeambeam[Kbeamindex]
Lightning - Destroy Kbeambeam[Kbeamindex]
Set Kbeamtarget[Kbeamloop] = Kbeamtarget[Kbeamindex]
Custom script: call RemoveLocation(udg_Kbeamtarget[udg_Kbeamindex])
Set Kbeamindex = (Kbeamindex - 1)
Set Kbeamloop = (Kbeamloop - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Kbeamindex Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
Custom script: call RemoveLocation(udg_Kbeampoint)
Custom script: call RemoveLocation(udg_Kbeampoint2)
[/trigger]
Edit: I found out why it fatals, it seems to be because the lightning action however another bug hidden somewhere in my code is the reason for it.... The bug makes a index ignore itself or something and then when the lightning follows it fatals somehow. Like when one instance stops the other instance follows it exactly.
Edit2: Is it because of the point array?
Edit3: Read Post #3 ( The lightning fatal issue )
Last edited: