- Joined
- May 13, 2010
- Messages
- 167
Does anyboy here have any clue of why this lags?
I submitted this spell a while ago. Maker moderated it and said it was ok, but for some reason it causes heavy fps drop after casting it a few times.
At first i though it was the dummy unit not clearing propperly, or some sort of missed memory leak, so i didn't worry. After a couple of days, i just couldn't crack it, the spells does drop de fps with every cast. Does anyboy here have any clue of why this is happen and maybe some way to fix it?
Maker said that his library wasn't the problem.
I tried to test the spell wiothout pressing ESC to reset cooldown and yet, lag appeared. Here is some utility info:
I submitted this spell a while ago. Maker moderated it and said it was ok, but for some reason it causes heavy fps drop after casting it a few times.
At first i though it was the dummy unit not clearing propperly, or some sort of missed memory leak, so i didn't worry. After a couple of days, i just couldn't crack it, the spells does drop de fps with every cast. Does anyboy here have any clue of why this is happen and maybe some way to fix it?
Maker said that his library wasn't the problem.
I tried to test the spell wiothout pressing ESC to reset cooldown and yet, lag appeared. Here is some utility info:
Deploys the awesome laser feature of the goblin invention. Once the laser is launch, it will seek for enemies in a straight line, damaging every enemy target it hits. Since the ability is very hard to properly aim, the goblin engineer designed the device to deal bonus damage every 0.1 seconds, meaning that the targets that are far away from the start point will take bonus damage. Cannot affect structures.
Level 1 - Deals 95 base damage to every target it hits. Lasts 0.6 seconds and gets 5 bonus damage every 0.1 seconds.
Level 2 - Deals 170 base damage to every target it hits. Lasts 1.2 seconds and gets 7 bonus damage every 0.1 seconds.
Level 3 - Deals 245 base damage to every target it hits. Lasts 1.8 seconds and gets 9 bonus damage every 0.1 seconds.
Level 1 - Deals 95 base damage to every target it hits. Lasts 0.6 seconds and gets 5 bonus damage every 0.1 seconds.
Level 2 - Deals 170 base damage to every target it hits. Lasts 1.2 seconds and gets 7 bonus damage every 0.1 seconds.
Level 3 - Deals 245 base damage to every target it hits. Lasts 1.8 seconds and gets 9 bonus damage every 0.1 seconds.
-
Sharp Laser Start
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Sharp Laser
-
Actions
- -------- ---------------------------------------------------------------- --------
- -------- Don't touch this settings --------
- -------- ---------------------------------------------------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SL_Skip Equal to 0
-
Then - Actions
- Trigger - Turn on Sharp Laser Loop <gen>
- Else - Actions
-
If - Conditions
- Set SL_Skip = (SL_Skip + 1)
- Set SL_Times = (SL_Times + 1)
- Set SL_Off[SL_Times] = True
- Set SL_Timer[SL_Times] = 0.00
- Set SL_Caster[SL_Times] = (Triggering unit)
- Set SL_Player[SL_Times] = (Owner of SL_Caster[SL_Times])
- Set SL_Location1[SL_Times] = (Target point of ability being cast)
- Set SL_Location2[SL_Times] = (Position of SL_Caster[SL_Times])
- Set SL_AbilityLevel[SL_Times] = (Level of Sharp Laser for SL_Caster[SL_Times])
- Set SL_Offset[SL_Times] = 40.00
- -------- ---------------------------------------------------------------- --------
- -------- Set the base damage here --------
- -------- ---------------------------------------------------------------- --------
- Set SL_Damage[SL_Times] = (((Real(SL_AbilityLevel[SL_Times])) x 75.00) + 20.00)
- -------- ---------------------------------------------------------------- --------
- -------- For each damage interval, there is a bonus damage added to the total, configure the ammount below --------
- -------- ---------------------------------------------------------------- --------
- Set SL_DamageIncrease[SL_Times] = (((Real(SL_AbilityLevel[SL_Times])) x 2.00) + 3.00)
- -------- ---------------------------------------------------------------- --------
- -------- This is the area of effect in wich enemy units are hit by the laser --------
- -------- ---------------------------------------------------------------- --------
- Set SL_AoE[SL_Times] = 100.00
- -------- ---------------------------------------------------------------- --------
- -------- How much time (seconds) should the hero be executing the spell? --------
- -------- ---------------------------------------------------------------- --------
- Set SL_Duration[SL_Times] = ((Real(SL_AbilityLevel[SL_Times])) x 0.60)
- -------- ---------------------------------------------------------------- --------
- -------- Every X interval of spell time, the target units gets damaged. Configure X below --------
- -------- ---------------------------------------------------------------- --------
- Set SL_DamageInterval[SL_Times] = 0.10
- -------- ---------------------------------------------------------------- --------
- -------- Special effect shown when laser hits --------
- -------- ---------------------------------------------------------------- --------
- Set SL_SFX = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
- -------- ---------------------------------------------------------------- --------
- -------- Below this line are the Min and Max lifetime of each lightning effect (A lightning gets created at every damage interval). I heavily recommend leaving this at it is --------
- -------- ---------------------------------------------------------------- --------
- Set DurMin = 0.30
- Set DurMax = 0.50
- -------- ---------------------------------------------------------------- --------
- -------- Don't touch this settings --------
- -------- ---------------------------------------------------------------- --------
- Set SL_3[SL_Times] = (Random real number between 0.00 and 100.00)
- Set SL_4[SL_Times] = (Random real number between 0.00 and 100.00)
- Set SL_Angle[SL_Times] = ((Angle from SL_Location1[SL_Times] to SL_Location2[SL_Times]) + 300.00)
- Unit - Pause SL_Caster[SL_Times]
- Unit - Create 1 Dummy for SL_Player[SL_Times] at SL_Location1[SL_Times] facing Default building facing degrees
- Set SL_Dummy[SL_Times] = (Last created unit)
- Unit - Add a SL_Duration[SL_Times] second Generic expiration timer to SL_Dummy[SL_Times]
- Custom script: call RemoveLocation(udg_SL_Location1[udg_SL_Times])
- Custom script: call RemoveLocation(udg_SL_Location2[udg_SL_Times])
-
Events
-
Sharp Laser Loop
-
Events
- Time - Every 0.02 seconds of game time
- Conditions
-
Actions
- -------- ---------------------------------------------------------------- --------
- -------- Don't touch this settings --------
- -------- ---------------------------------------------------------------- --------
-
For each (Integer SL) from 1 to SL_Times, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SL_Off[SL] Equal to True
-
Then - Actions
- Set SL_Timer[SL] = (SL_Timer[SL] + 0.02)
- Set SL_Duration[SL] = (SL_Duration[SL] - 0.02)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SL_Duration[SL] Less than or equal to 0.00
-
Then - Actions
- Unit - Unpause SL_Caster[SL]
- Set SL_Skip = (SL_Skip - 1)
- Set SL_Off[SL] = False
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SL_Skip Equal to 0
-
Then - Actions
- Set SL_Times = 0
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SL_Timer[SL] Greater than or equal to SL_DamageInterval[SL]
-
Then - Actions
- Set SL_Timer[SL] = 0.00
- Set SL_DamageIncrease[SL] = (SL_DamageIncrease[SL] x 2.00)
- Set SL_Location1[SL] = (Position of SL_Dummy[SL])
- Set SL_Location2[SL] = (SL_Location1[SL] offset by SL_Offset[SL] towards SL_Angle[SL] degrees)
- Set SL_1[SL] = (X of SL_Location1[SL])
- Set SL_2[SL] = (Y of SL_Location1[SL])
- Unit - Move SL_Dummy[SL] instantly to SL_Location2[SL]
- Animation - Play SL_Caster[SL]'s spell animation
- Unit - Make SL_Caster[SL] face SL_Location1[SL] over 0.00 seconds
- Custom script: set bj_lastCreatedLightning = AddLightningEx("AFOD", true, GetUnitX(udg_SL_Caster[udg_SL]), GetUnitY(udg_SL_Caster[udg_SL]), udg_SL_3[udg_SL], udg_SL_1[udg_SL], udg_SL_2[udg_SL], udg_SL_4[udg_SL])
- Custom script: call TimedL.U2P(bj_lastCreatedLightning, udg_SL_Caster[udg_SL], GetRandomReal(udg_DurMin,udg_DurMax), GetUnitX(udg_SL_Caster[udg_SL]), GetUnitY(udg_SL_Caster[udg_SL]), udg_SL_1[udg_SL], udg_SL_2[udg_SL], udg_SL_3[udg_SL], udg_SL_4[udg_SL], 1, 0)
- Special Effect - Create a special effect at SL_Location2[SL] using SL_SFX
- Special Effect - Destroy (Last created special effect)
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within SL_AoE[SL] of SL_Location2[SL] matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) belongs to an enemy of SL_Player[SL]) Equal to True))) and do (Actions)
-
Loop - Actions
- Unit - Cause SL_Caster[SL] to damage (Picked unit), dealing (SL_Damage[SL] + SL_DamageIncrease[SL]) damage of attack type Spells and damage type Normal
-
Loop - Actions
- Custom script: call RemoveLocation(udg_SL_Location1[udg_SL])
- Custom script: call RemoveLocation(udg_SL_Location2[udg_SL])
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Events
Last edited: