Strangest problem ever

FannyShaver

Well-Known Member
Reaction score
31
Ok, this one doesn't lag:

Trigger:
  • Envenomed Dart
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Envenomed Dart
    • Actions
      • Set DartTarget = (Target unit of ability being cast)
      • Set DartTargetPosition = (Position of DartTarget)
      • Set WitchPosition = (Position of Witch)
      • Set VenomTime = ((Real((Level of Envenomed Dart for Witch))) x 0.75)
      • Wait ((Distance between WitchPosition and DartTargetPosition) / 1000.00) seconds
      • Unit - Set DartTarget movement speed to 105.00
      • Wait VenomTime seconds
      • Unit - Set DartTarget movement speed to (Default movement speed of DartTarget)
      • Custom script: call RemoveLocation(udg_DartTargetPosition)
      • Custom script: call RemoveLocation(udg_WitchPosition)


This one does:

Trigger:
  • Envenomed Dart 2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ultimate Envenomed Dart
    • Actions
      • Set DartTarget = (Target unit of ability being cast)
      • Set DartTargetPosition = (Position of DartTarget)
      • Set WitchPosition = (Position of Witch)
      • Set VenomTime = ((Real((Level of Ultimate Envenomed Dart for Witch))) x 9.00)
      • Wait ((Distance between WitchPosition and DartTargetPosition) / 1000.00) seconds
      • Unit - Set DartTarget movement speed to 105.00
      • Wait VenomTime seconds
      • Unit - Set DartTarget movement speed to (Default movement speed of DartTarget)
      • Custom script: call RemoveLocation(udg_DartTargetPosition)
      • Custom script: call RemoveLocation(udg_WitchPosition)
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
In what way does it lag - upon casting, upon hitting the target, during the entire duration, upon ending...? Is it a single spike of lag or a general drop in framerate? Will both of those two spells ever be active at once?

Also, as I often say - when your triggers look OK, check for something else. Are the two spells based on the same original spell? Are their settings different? (Some spells can lag or even freeze the game with certain settings.) Are there any other triggers pertaining to Ultimate Envenomed Dart?
 

FannyShaver

Well-Known Member
Reaction score
31
Those spells are EXACTLY the same. And it lags for the changed movement speed duration. And no, these are only triggers associated with these abilities. And no, those abilities are never held together, as soon as Witch turns 60 level ordinary Envenomed Dart is removed and disabled and Ultimate is added.
 

Bankde

Member
Reaction score
20
Lag usually happen when "there is a lot of memory leak", "lot of function at the same time", "periodically function". I don't see anything wrong in your function. And I have never having lag problem with "WAIT" function.

Try deleting "2nd Wait" function from your trigger and see if it is still lagging or not.
 

Jedi

New Member
Reaction score
63
Are you kidding?Maybe level * 9 seconds is much longer than level * 0.75?
 

X-maul

AKA: Demtrod
Reaction score
201
Forum Rule:
Please be very specific in your posts. Don't just write something like, "Plz Help" in your thread title, and don't type it in all caps. We want to know what your problem is. So tell us!
your title does not describe it in any way...
 

X-maul

AKA: Demtrod
Reaction score
201
Without second wait I can't set unit speed back to normal.

You should consider storing the movement speed into a variable; if you just set it back to standard, it will also destroy the movement bonus of boots of speed and such effects.
 

meOme

New Member
Reaction score
31
Well, both of your triggers leak a unit-variable (DartTarget), apart from that I don't see much difference between them.

The biggest problem is that you use global variables. If ANY other unit uses Envenomed Dart or Ultimate Envenomed Dart during one of your waits (or even the same unit), you will get serious bugs/leaks because your variables get overwritten.

You really need local variables. If you don't want to use Jass, you can do it with more Custom Script:

Trigger:
  • Envenomed Dart
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Envenomed Dart
    • Actions
      • Custom script: local unit DartTarget = GetSpellTargetUnit()
      • Custom script: local location DartTargetPosition = GetUnitLoc( DartTarget )
      • Custom script: local location WitchPosition = GetUnitLoc(GetTriggerUnit())
      • Custom script: local real VenomTime = I2R(GetUnitAbilityLevel( GetTriggerUnit(), 'A000' )) * 0.75
      • Custom script: call TriggerSleepAction( DistanceBetweenPoints( WitchPosition, DartTargetPosition ) / 1000.00 )
      • Custom script: call SetUnitMoveSpeed( DartTarget, 105.00 )
      • Custom script: call TriggerSleepAction( VenomTime )
      • Custom script: call SetUnitMoveSpeed( DartTarget, GetUnitDefaultMoveSpeed( DartTarget ) )
      • Custom script: call RemoveLocation(DartTargetPosition)
      • Custom script: call RemoveLocation(WitchPosition)

Trigger:
  • Ultimate Envenomed Dart
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ultimate Envenomed Dart
    • Actions
      • Custom script: local unit DartTarget = GetSpellTargetUnit()
      • Custom script: local location DartTargetPosition = GetUnitLoc( DartTarget )
      • Custom script: local location WitchPosition = GetUnitLoc(GetTriggerUnit())
      • Custom script: local real VenomTime = I2R(GetUnitAbilityLevel( GetTriggerUnit(), 'A001' )) * 9.0
      • Custom script: call TriggerSleepAction( DistanceBetweenPoints( WitchPosition, DartTargetPosition ) / 1000.00 )
      • Custom script: call SetUnitMoveSpeed( DartTarget, 105.00 )
      • Custom script: call TriggerSleepAction( VenomTime )
      • Custom script: call SetUnitMoveSpeed( DartTarget, GetUnitDefaultMoveSpeed( DartTarget ) )
      • Custom script: call RemoveLocation(DartTargetPosition)
      • Custom script: call RemoveLocation(WitchPosition)

Exchange 'A000' and 'A001' with the ability IDs of your abilities (you can see them by pressing "Ctrl + D" in the object editor).
 

FannyShaver

Well-Known Member
Reaction score
31
There is a limit for one hero of witch for all players. That is why I decided to use Variables. I solved the problem by having 3x3seconds waits. Sounds stupid, but it really helped :/
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top