[Trigger] Need help with 2 laggy abilities

Status
Not open for further replies.
Level 9
Joined
Jun 25, 2009
Messages
427
Hey guys, i'm back from my village for few days, so yeah, i have one spell which i downloaded somewhere and it lags, it's very unadvanced and piece of s**t cause it uses waits, and etc. I need help how to get it to work the same as it does (around the caster flames go down and knockbacks all units they touch) the triggers:
  • DD Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fire Blast
    • Actions
      • Set DD_Caster = (Triggering unit)
      • Set DD_Location = (Position of DD_Caster)
      • Set DD_Number = 0.00
      • Wait 0.10 seconds
      • For each (Integer A) from 1 to 18, do (Actions)
        • Loop - Actions
          • Unit - Create 1 D'sD_Dummy for (Owner of DD_Caster) at DD_Location facing DD_Number degrees
          • Set DD_Number = (DD_Number + 20.00)
          • Set DD_Dummies[(Integer A)] = (Last created unit)
          • Unit - Add a 1.20 second Generic expiration timer to (Last created unit)
          • Animation - Change (Last created unit) flying height to 10.00 at 750.00
      • Wait 0.10 seconds
      • Set DD_Number = 0.00
      • For each (Integer A) from 1 to 18, do (Actions)
        • Loop - Actions
          • Set DD_Location_Off = (DD_Location offset by 500.00 towards DD_Number degrees)
          • Unit - Order DD_Dummies[(Integer A)] to Move To DD_Location_Off
          • Set DD_Number = (DD_Number + 20.00)
          • Custom script: call RemoveLocation(udg_DD_Location_Off)
      • Wait 0.20 seconds
      • Set DD_Number = 250.00
      • Custom script: call RemoveLocation(udg_DD_Location)
      • Trigger - Turn on DD Effect <gen>
      • Wait 1.00 seconds
      • Trigger - Turn off DD Effect <gen>
The loop trigga
  • DD Effect
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set DD_Location = (Position of DD_Caster)
      • Set DD_Group = (Units within DD_Number of DD_Location 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 (Owner of DD_Caster)) Equal to True) and (((Matching unit) is Magi
      • Unit Group - Pick every unit in DD_Group and do (Actions)
        • Loop - Actions
          • Set DD_Location_Off = (Position of (Picked unit))
          • Set DD_Location_Off_2 = (DD_Location_Off offset by 6.00 towards (Angle from DD_Location to DD_Location_Off) degrees)
          • Unit - Move (Picked unit) instantly to DD_Location_Off_2
          • Unit - Cause DD_Caster to damage (Picked unit), dealing (1.50 x (Real((Level of Fire Blast for DD_Caster)))) damage of attack type Spells and damage type Magic
          • Special Effect - Create a special effect at DD_Location_Off using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
          • Set DD_Effect = (Last created special effect)
          • Special Effect - Destroy DD_Effect
          • Custom script: call RemoveLocation(udg_DD_Location_Off)
          • Custom script: call RemoveLocation(udg_DD_Location_Off_2)
      • Custom script: call RemoveLocation(udg_DD_Location)
      • Custom script: call DestroyGroup(udg_DD_Group)
      • Set DD_Number = (DD_Number + 12.50)
Okay, the next spell is: I fly ~2k range picking nearby units, dealing damage, but after some casts it begins to lag. Need some help!!! :)
The trigger
  • Shifting Battlephase Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shifting Battlephase
    • Actions
      • Set Shifting_Battlephase_Unit = (Triggering unit)
      • Unit - Turn collision for Shifting_Battlephase_Unit Off
      • Trigger - Turn on Shifting Battlephase Loop <gen>
  • Shifting Battlephase Loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set Shifting_Battlephase_Point = (Position of Shifting_Battlephase_Unit)
      • Set Shifting_Battlephase_Point_Off = (Shifting_Battlephase_Point offset by 100.00 towards (Facing of Shifting_Battlephase_Unit) degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Terrain pathing at Shifting_Battlephase_Point_Off of type Flyability is off) Equal to True
              • Shifting_Battlephase_Distance Equal to 0.00
        • Then - Actions
          • Custom script: call RemoveLocation(udg_Shifting_Battlephase_Point_Off)
          • Custom script: call RemoveLocation(udg_Shifting_Battlephase_Point)
          • Unit - Turn collision for Shifting_Battlephase_Unit On
          • Set Shifting_Battlephase_Distance = 800.00
          • Trigger - Turn off (This trigger)
          • Skip remaining actions
        • Else - Actions
          • Set Shifting_Battlephase_Off_2 = (Shifting_Battlephase_Point offset by 160.00 towards (Facing of Shifting_Battlephase_Unit) degrees)
          • Unit - Move Shifting_Battlephase_Unit instantly to Shifting_Battlephase_Point_Off
          • Set Shifting_Battlephase_Group = (Units within 300.00 of Shifting_Battlephase_Point_Off matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) Not equal to Shifting_Battlephase_Unit) and ((((Matching unit) belongs to
          • Unit Group - Pick every unit in Shifting_Battlephase_Group and do (Actions)
            • Loop - Actions
              • Unit - Cause Shifting_Battlephase_Unit to damage (Picked unit), dealing (4.00 x (Real((Level of Bash for Shifting_Battlephase_Unit)))) damage of attack type Spells and damage type Magic
              • Unit - Move (Picked unit) instantly to Shifting_Battlephase_Off_2
          • Set Shifting_Battlephase_Distance = (Shifting_Battlephase_Distance - 40.00)
          • Custom script: call RemoveLocation(udg_Shifting_Battlephase_Point_Off)
          • Custom script: call RemoveLocation(udg_Shifting_Battlephase_Off_2)
          • Custom script: call RemoveLocation(udg_Shifting_Battlephase_Point)
          • Custom script: call DestroyGroup(udg_Shifting_Battlephase_Group)
People who will help me fix this crap will get +rep (or even 2 :))

Tiche3:sad:
 
Level 9
Joined
Jun 25, 2009
Messages
427
I remade Shifting Battlephase, by removing unecessary stuff and made it MUI.
View attachment 86970

Thank you for your hard work, although i can't open it, i get SaveHashBj and other function errors, so i can't open the map, any solutions? :)

EDIT: i tested it through wc, actually that's not what i meant, i just move the unit in the targeted position picking units, you don't have to make him actually jump (the model of the hero itself is flying (hover or somethin)) so yeah :)
 
Thank you for your hard work, although i can't open it, i get SaveHashBj and other function errors, so i can't open the map, any solutions? :)

if you are using JNGP you will have to update jasshelper or something (Dr Super Good has a tutorial about that in his signature or someone else just use the search)
else you probably didn't patch your wc3 to newest version yet

to the video: "Dieses Video enthält Content von Sony Music Entertainment. Es ist in deinem Land nicht mehr verfügbar."
or on english: "This video contains content from Sony Music Entertainment. It is not available in your country any longer."
sure, I could use some slow proxy server but that just isn't it...
 
if you are using JNGP you will have to update jasshelper or something (Dr Super Good has a tutorial about that in his signature or someone else just use the search)
else you probably didn't patch your wc3 to newest version yet

to the video: "Dieses Video enthält Content von Sony Music Entertainment. Es ist in deinem Land nicht mehr verfügbar."
or on english: "This video contains content from Sony Music Entertainment. It is not available in your country any longer."
sure, I could use some slow proxy server but that just isn't it...

You know which song it was playing? "I kissed a girl" - Katy Perry, lol!
Tiche3, there are millions of spells in the Spells' section that do what you look for.
 
Level 9
Joined
Jun 25, 2009
Messages
427
in this case I am very happy about the stupid laws we have here in germany :ugly:

Actually, i am not asking for new spells, i'm just asking for fixes of Laggy things :( I did the shifting battlephase by myself and i hoped that i removed leaks, but it is one of the first loopie spells, so it might have leaks, that cause it to BAM, lag. And for the DD spell, i'm not asking for a whole new spell, it's for leaks too :(

I'll be waiting.:grin:
 
Level 7
Joined
Jun 6, 2010
Messages
224
pff... ok fine -.-

this trigger needs to have a bigger timer resolution,
try Every 0.03 instead and increase your dd_number increment.

The loop trigga
  • DD Effect
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set DD_Location = (Position of DD_Caster)
      • Set DD_Group = (Units within DD_Number of DD_Location 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 (Owner of DD_Caster)) Equal to True) and (((Matching unit) is Magi
      • Unit Group - Pick every unit in DD_Group and do (Actions)
        • Loop - Actions
          • Set DD_Location_Off = (Position of (Picked unit))
          • Set DD_Location_Off_2 = (DD_Location_Off offset by 6.00 towards (Angle from DD_Location to DD_Location_Off) degrees)
          • Unit - Move (Picked unit) instantly to DD_Location_Off_2
          • Unit - Cause DD_Caster to damage (Picked unit), dealing (1.50 x (Real((Level of Fire Blast for DD_Caster)))) damage of attack type Spells and damage type Magic
          • Special Effect - Create a special effect at DD_Location_Off using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
          • Set DD_Effect = (Last created special effect)
          • Special Effect - Destroy DD_Effect
          • Custom script: call RemoveLocation(udg_DD_Location_Off)
          • Custom script: call RemoveLocation(udg_DD_Location_Off_2)
      • Custom script: call RemoveLocation(udg_DD_Location)
      • Custom script: call DestroyGroup(udg_DD_Group)
      • Set DD_Number = (DD_Number + 12.50)

also this needs a bit optimisation.


  • Shifting Battlephase Loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set Shifting_Battlephase_Point = (Position of Shifting_Battlephase_Unit)
      • Set Shifting_Battlephase_Point_Off = (Shifting_Battlephase_Point offset by 100.00 towards (Facing of Shifting_Battlephase_Unit) degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Terrain pathing at Shifting_Battlephase_Point_Off of type Flyability is off) Equal to True
              • Shifting_Battlephase_Distance Equal to 0.00
        • Then - Actions
          • Custom script: call RemoveLocation(udg_Shifting_Battlephase_Point_Off)
          • Custom script: call RemoveLocation(udg_Shifting_Battlephase_Point)
          • Unit - Turn collision for Shifting_Battlephase_Unit On
          • Set Shifting_Battlephase_Distance = 800.00
          • Trigger - Turn off (This trigger)
          • Skip remaining actions
        • Else - Actions
          • Set Shifting_Battlephase_Off_2 = (Shifting_Battlephase_Point offset by 160.00 towards (Facing of Shifting_Battlephase_Unit) degrees)
          • Unit - Move Shifting_Battlephase_Unit instantly to Shifting_Battlephase_Point_Off
          • Set Shifting_Battlephase_Group = (Units within 300.00 of Shifting_Battlephase_Point_Off matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) Not equal to Shifting_Battlephase_Unit) and ((((Matching unit) belongs to
          • Unit Group - Pick every unit in Shifting_Battlephase_Group and do (Actions)
            • Loop - Actions
              • Unit - Cause Shifting_Battlephase_Unit to damage (Picked unit), dealing (4.00 x (Real((Level of Bash for Shifting_Battlephase_Unit)))) damage of attack type Spells and damage type Magic
              • Unit - Move (Picked unit) instantly to Shifting_Battlephase_Off_2
          • Set Shifting_Battlephase_Distance = (Shifting_Battlephase_Distance - 40.00)
          • Custom script: call RemoveLocation(udg_Shifting_Battlephase_Point_Off)
          • Custom script: call RemoveLocation(udg_Shifting_Battlephase_Off_2)
          • Custom script: call RemoveLocation(udg_Shifting_Battlephase_Point)
          • Custom script: call DestroyGroup(udg_Shifting_Battlephase_Group)
  • Unit - Cause Shifting_Battlephase_Unit to damage (Picked unit), dealing (4.00 x (Real((Level of Bash for Shifting_Battlephase_Unit)))) damage of attack type Spells and damage type Magic
instead of calculating the damage you deal every 0.04 seconds, i suggest you preload it to a variable when you cast the spell.
got it?
WHERES MY COOKIE? WHO ATE IT?:hohum:
 
Status
Not open for further replies.
Top