Spells That Lag?

jhnam95

Active Member
Reaction score
12
I've been searching through for a while, but I couldn't find the solution or the reason.
The spells that I'm having trouble with are the extremely simple types where after the effect goes off, a dummy unit is created and is ordered to cast another spell at the same target. What's really weird is that this is causing significant lag on some abilities, but not all. I've played around with some of the possible solutions such as pre-loading the abilities on a dummy unit at map initialization and removing it. I've also made 25 dummy units for each player to recycle through during map init.

So for example, here's a spell that does NOT lag. Basically what it does is it has a dummy unit use Thunderclap on top of the target unit.

Code:
Paladin 1 Hammer Slam
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Paladin 1 Hammer Slam 
    Actions
        Set Point_Temp = (Position of (Target unit of ability being cast))
        Set Unit_Temp = (Random unit from UnitGroup_Dummies[(Player number of (Owner of (Triggering unit)))])
        Unit - Move Unit_Temp instantly to Point_Temp
        Unit - Set level of Paladin 1 Hammer Slam  for Unit_Temp to (Level of Paladin 1 Hammer Slam  for (Triggering unit))
        Special Effect - Create a special effect at Point_Temp using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
        Environment - Create a 1.00 second wave deformation from Point_Temp to Point_Temp with radius 250.00, depth 96.00, and a 0.00 second trailing delay
        Unit - Order Unit_Temp to Human Mountain King - Thunder Clap
        Unit Group - Remove Unit_Temp from UnitGroup_Dummies[(Player number of (Owner of (Triggering unit)))]
        Unit Group - Add Unit_Temp to UnitGroup_UsedDummies
        Set Real_Temp = 2.00
        Custom script:   call SaveReal(udg_AA_GlobalHashtable, StringHash("DummyReal"), GetHandleId(udg_Unit_Temp), udg_Real_Temp)
        Custom script:   call RemoveLocation (udg_Point_Temp)

And then here's one that lags SOMETIMES. It's just the Volcano ability, except that it uses a Dummy unit so that it doesn't channel. This one has a very brief lag (less than 1 second) and the lag varies a lot. Sometimes the lag is about a second and sometimes the lag doesn't occur at all.

Code:
Firelord 2 Volcano
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Firelord 2 Volcano 
    Actions
        Set Point_Temp = (Target point of ability being cast)
        Set Unit_Temp = (Random unit from UnitGroup_Dummies[(Player number of (Owner of (Triggering unit)))])
        Unit - Move Unit_Temp instantly to Point_Temp
        Unit - Set level of Firelord 2 Volcano  for Unit_Temp to (Level of Firelord 2 Volcano  for (Triggering unit))
        Unit - Order Unit_Temp to Neutral Fire Lord - Volcano (Target point of ability being cast)
        Unit Group - Remove Unit_Temp from UnitGroup_Dummies[(Player number of (Owner of (Triggering unit)))]
        Unit Group - Add Unit_Temp to UnitGroup_UsedDummies
        Set Real_Temp = 15.00
        Custom script:   call SaveReal(udg_AA_GlobalHashtable, StringHash("DummyReal"), GetHandleId(udg_Unit_Temp), udg_Real_Temp)
        Custom script:   call RemoveLocation (udg_Point_Temp)

And lastly, here's one that lags the game the entire duration of this spell. I'm not sure what exactly is the problem on this. It might not even be the triggers. The lag lasts until the unit has lost the buff altogether. This is a spell based off of Frost Arrow (I think), and uses triggers to deal a critical strike and Cripple the target for a short period. This spell lags differently based on the unit type of the target for some reason. A custom unit based off of Knight will lag the game for the entire duration of the buff, but on a Paladin it'll lag only for about 2 seconds.

Code:
Tuskarr Hunter 4 Wounding Spear
    Events
        Game - GDD_Event becomes Equal to 0.00
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (GDD_DamagedUnit has buff Tuskarr Hunter 4 Wounding Spear (Non-stacking)) Equal to True
                (GDD_DamagedUnit has buff Tuskarr Hunter 4 Wounding Spear (Stacking)) Equal to True
    Actions
        Trigger - Turn off (This trigger)
        Set Point_Temp = (Position of GDD_DamagedUnit)
        Set Unit_Temp = (Random unit from UnitGroup_Dummies[(Player number of (Owner of GDD_DamageSource))])
        Unit - Move Unit_Temp instantly to Point_Temp
        Unit - Set level of Tuskarr 4 Wounding Spear Wound  for Unit_Temp to 1
        Unit - Order Unit_Temp to Neutral Alchemist - Acid Bomb GDD_DamagedUnit
        Unit - Remove Tuskarr Hunter 4 Wounding Spear (Non-stacking) buff from GDD_DamagedUnit
        Unit - Remove Tuskarr Hunter 4 Wounding Spear (Stacking) buff from GDD_DamagedUnit
        Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing (GDD_Damage x (0.00 + (Real((Level of Tuskarr Hunter 4 Wounding Spear  for GDD_DamageSource))))) damage of attack type Hero and damage type Universal
        Floating Text - Create floating text that reads (String((((Real((Level of Tuskarr Hunter 4 Wounding Spear  for GDD_DamageSource))) + 0.00) x GDD_Damage))) at (((Position of GDD_DamagedUnit) offset by 0.00 towards 45.00 degrees) offset by 100.00 towards 45.00 degrees) with Z offset 0.00, using font size 9.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
        Floating Text - Change the fading age of (Last created floating text) to 0.25 seconds
        Floating Text - Change the lifespan of (Last created floating text) to 1.51 seconds
        Unit Group - Remove Unit_Temp from UnitGroup_Dummies[(Player number of (Owner of GDD_DamageSource))]
        Unit Group - Add Unit_Temp to UnitGroup_UsedDummies
        Set Real_Temp = 2.00
        Custom script:   call SaveReal(udg_AA_GlobalHashtable, StringHash("DummyReal"), GetHandleId(udg_Unit_Temp), udg_Real_Temp)
        Custom script:   call RemoveLocation (udg_Point_Temp)
        Trigger - Turn on (This trigger)

Should I change these spells to JASS? I know how to use some basic and rudimentary JASS, but I probably could if I needed to. But even if I did change to JASS, I'm not sure if it'll fix it since I have no idea what the cause is. Can the lag be simply because I used GUI?
 

Grags_1977

Ultra Cool Member
Reaction score
32
I had this problem with one of my spells not that long. I couldn't for the life of me figure out what the problem was. So I changed the spell it was based of to something else and that fixed it.

If you've based it of channel just double check you've not got the same OrderID on another spell.
 

jhnam95

Active Member
Reaction score
12
You mean the caster's spell, right? I suppose that might work for Volcano, but I'm not sure how that'll work for the Wounding Spear. It's an orb effect.
 

Dirac

22710180
Reaction score
147
Thats not it.
You're leaking many things, fix that.

Floating Text - Create floating text that reads (String((((Real((Level of Tuskarr Hunter 4 Wounding Spear for GDD_DamageSource))) + 0.00) x GDD_Damage))) at (((Position of GDD_DamagedUnit) offset by 0.00 towards 45.00 degrees) offset by 100.00 towards 45.00 degrees) with Z offset 0.00, using font size 9.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency

And thats not the only leak.
And no, there's no difference between JASS and GUI, changing it to JASS would only make it confusing because the code you get from the conversion from GUI to JASS is all messed up.

Maybe the reason of why the third spell lags so much is because when you deal damage to a unit it fires other triggers that use damage detection and might cause an infinite loop. GUI damage detection is terrible, slow and can't be trusted.
 

jhnam95

Active Member
Reaction score
12
I changed the Volcano into JASS and turned almost everything into natives. That doesn't lag anymore. Should I try to convert the third too?
 

Dirac

22710180
Reaction score
147
I changed the Volcano into JASS and turned almost everything into natives. That doesn't lag anymore. Should I try to convert the third too?
This makes no sense.
Converting GUI to JASS does nothing.
You changed something or you're having issues with your computer.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top