• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Probluem : About SetunitX/Y

Status
Not open for further replies.
Level 2
Joined
Jul 18, 2010
Messages
12
I WEAK TO ENGLISH
  • Events
  • Conditions
    • Multiple ConditionsAnd - All (Conditions) are true
      • Conditions
        • (Triggering unit) Equal to (==) BMT_ATKED_UNIT
        • (Damage source) Equal to (==) BMT_ATKING_UNIT
  • Actions
    • Trigger - Turn off (This trigger)
    • Set BMT_Target_Location = (Position of (Triggering unit))
    • Set BMT_Blink_Location = (BMT_Target_Location offset by 100.00 towards (Random angle) degrees)
    • Custom script: call SetUnitX ( GetEventDamageSource(), GetLocationX(udg_BMT_Blink_Location))
    • Custom script: call SetUnitY ( GetEventDamageSource(), GetLocationY(udg_BMT_Blink_Location))
    • Special Effect - Destroy (Create a special effect using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl at BMT_Blink_Location)
    • Custom script: call RemoveLocation (udg_BMT_Target_Location)
    • Custom script: call RemoveLocation (udg_BMT_Blink_Location)
    • Unit - Order (Damage source) to Right-Click (Triggering unit)
    • Wait BMT_CD[(Level of Blademaster [Blademaster Ultimath] for (Damage source))] seconds
    • Trigger - Turn on (This trigger)
That is my Trigger
setunitx/y with variable
-----------------------------------------------------------------------


My Question

  • Set BMT_Target_Location = (Position of (Triggering unit))
    • Set BMT_Blink_Location = (BMT_Target_Location offset by 100.00 towards (Random angle) degrees)
    • Custom script: call SetUnitX ( GetEventDamageSource(), GetLocationX(udg_BMT_Blink_Location))
    • Custom script: call SetUnitY ( GetEventDamageSource(), GetLocationY(udg_BMT_Blink_Location))
I have know that is a leak point for a few day
(Set Variables then SetunitX with last setted variables)

How to SetUnitX likes that Trigger without set variable

I would like to fix this , but i can't do it TT:goblin_cry:
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
No leaks since you remove both Locations. However you can turn this to more efficient jass (since you're already using SetUnitX/Y

Also, find a workaround to that "wait", these are never good.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
I would use a unit indexer and a global game-time timer.
Then you can store the moment that your unit would be able to use the ability again as game-time and you can check if the current game-time is higher than that value.

1, It will make this MUI.
2, It will be 100% accurate.
3, It will be fun to do so.

I also recommend you to use a DDS.
 
Status
Not open for further replies.
Top