1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Deleaking problem

Discussion in 'Triggers & Scripts' started by deathdoorway, Jan 31, 2009.

  1. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1
    i got this trigger that idk how to remove the point

    Problem Trigger
    • Leap
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Leap
      • Actions
        • Set Leapcaster[(Player number of (Owner of (Casting unit)))] = (Casting unit)
        • Set LeapCasterPoint[(Player number of (Owner of (Casting unit)))] = (Position of (Casting unit))
        • Set LeapTargetPoint[(Player number of (Owner of (Casting unit)))] = (Target point of ability being cast)
        • Unit - Pause Leapcaster[(Player number of (Owner of (Casting unit)))]
        • Unit - Turn collision for Leapcaster[(Player number of (Owner of (Casting unit)))] Off
        • Unit - Add Crow Form to Leapcaster[(Player number of (Owner of (Casting unit)))]
        • Animation - Change Leapcaster[(Player number of (Owner of (Casting unit)))]'s animation speed to 50.00% of its original speed
        • Animation - Play Leapcaster[(Player number of (Owner of (Casting unit)))]'s walk animation, using only Common animations
        • Trigger - Turn on LeapFlyLoop <gen>
        • Animation - Change Leapcaster[(Player number of (Owner of (Casting unit)))] flying height to 700.00 at 400.00
        • Wait 0.50 seconds
        • Animation - Change Leapcaster[(Player number of (Owner of (Casting unit)))] flying height to 0.00 at 700.00
        • Wait 0.30 seconds
        • Animation - Change Leapcaster[(Player number of (Owner of (Casting unit)))]'s animation speed to 100.00% of its original speed
        • Animation - Reset Leapcaster[(Player number of (Owner of (Casting unit)))]'s animation
        • Trigger - Turn off LeapFlyLoop <gen>
        • Wait 0.05 seconds
        • Unit - Remove Crow Form from Leapcaster[(Player number of (Owner of (Casting unit)))]
        • Unit - Unpause Leapcaster[(Player number of (Owner of (Casting unit)))]
        • Unit - Turn collision for Leapcaster[(Player number of (Owner of (Casting unit)))] On
        • Custom script: call RemoveLocation(udg_LeapTargetPoint[1])
        • Custom script: call RemoveLocation(udg_LeapCasterPoint[1])
        • Set Leapcaster[(Player number of (Owner of (Casting unit)))] = No unit

    for the leapcaster n target point do i have to use 1 thru how many players meaning i have to copy n paste the trigger like

    My solution that prob doesnt work
    • LeapFlyLoop
      • Events
        • Time - Every 0.01 seconds of game time
      • Conditions
      • Actions
        • Set LeapSecSecPoint[(Player number of (Owner of (Casting unit)))] = (Position of Leapcaster[(Player number of (Owner of (Casting unit)))])
        • Set LeapSecPoint[(Player number of (Owner of (Casting unit)))] = (LeapSecSecPoint[(Player number of (Owner of (Casting unit)))] offset by ((Distance between LeapSecSecPoint[(Player number of (Owner of (Casting unit)))] and LeapTargetPoint[(Player number of (Owner of (Casting unit)))]) / 110.00) towards (Angle from LeapCast
        • Unit - Move Leapcaster[(Player number of (Owner of (Casting unit)))] instantly to LeapSecPoint[(Player number of (Owner of (Casting unit)))], facing (Angle from LeapCasterPoint[(Player number of (Owner of (Casting unit)))] to LeapTargetPoint[(Player number of (Owner of (Casting unit)))]) degrees
        • Custom script: call RemoveLocation(udg_LeapSecSecPoint[1])
        • Custom script: call RemoveLocation(udg_LeapSecSecPoint[2])
        • Custom script: call RemoveLocation(udg_LeapSecSecPoint[3])
        • Custom script: call RemoveLocation(udg_LeapSecSecPoint[4])
        • Custom script: call RemoveLocation(udg_LeapSecSecPoint[5])
        • Custom script: call RemoveLocation(udg_LeapSecPoint[1])
        • Custom script: call RemoveLocation(udg_LeapSecPoint[2])
        • Custom script: call RemoveLocation(udg_LeapSecPoint[3])
        • Custom script: call RemoveLocation(udg_LeapSecPoint[4])
        • Custom script: call RemoveLocation(udg_LeapSecPoint[5])


    or just say [player number of (owner of (casting unit))]?
     
    Last edited: Jan 31, 2009
  2. chaoslord301

    chaoslord301

    Joined:
    Sep 18, 2007
    Messages:
    105
    Resources:
    0
    Resources:
    0
  3. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1
    dont worry aboutt he .01 its just for show anyway the programdoesntwork
     
  4. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    • Custom script: call RemoveLocation(udg_LeapSecPoint[GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit))]

    I thought it was like that (not for sure)
     
  5. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1
    lol sry i just dont know. im gonna put the trigger in hidden text so the post aint that big
     
  6. neavea

    neavea

    Joined:
    Oct 17, 2006
    Messages:
    151
    Resources:
    0
    Resources:
    0
    cant you do something like this?

    • Example Trigger
      • Events
        • Time - Every 0.03 seconds of game time
      • Conditions
      • Actions
        • For each (Integer A) from 1 to 5, do (Actions)
          • Loop - Actions
            • Custom script: call removelocation(udg_yourpoint[Integar A])
     
  7. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1
    ya i used that before but removing a trigger that aint there will it cause a problem or no?
     
  8. neavea

    neavea

    Joined:
    Oct 17, 2006
    Messages:
    151
    Resources:
    0
    Resources:
    0
    no... Its like this:

    Your mom asks you to take out the trash. The trash has already been taken out... No problem right? :grin:

    Oh and btw i just showed you the loop so you wont have to repeat it over and over again... (Im not a jass coder so thats why I asked cuz I don't know if jass uses integer A and such.)
     
  9. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1
    lol idk either thanks tho for the help +rep even tho i new this.
     
  10. Triax

    Triax

    Joined:
    Feb 5, 2008
    Messages:
    106
    Resources:
    0
    Resources:
    0
    You want to get the owner of the casting unit, but there is no unit casting anything. Your event is "every 0.01 seconds", this just has no "Casting unit".
    And also do not use "Casting unit", but "Triggering unit", because "Casting unit" is "Triggering unit" anyway, but it can refer to another casting unit if this trigger runs multiple times at the same time, and additionally "Triggering unit" is faster.

    And change your style, use an integer to store (Player number of (Owner of (Triggering unit))), so you don't have to put that in all the time.
    • LeapFlyLoop
      • Events
        • Time - Every 0.01 seconds of game time
      • Conditions
      • Actions
        • Set Integer = (Player number of (Owner of (Triggering unit)))
        • Set LeapSecSecPoint[(Integer)] = (Position of Leapcaster[(Integer)])
        • Set LeapSecPoint[(Integer)] = (LeapSecSecPoint[(Integer)] offset by ((Distance between LeapSecSecPoint[(Integer)] and LeapTargetPoint[(Integer)]) / 110.00) towards (Angle from LeapCast ...
        • Unit - Move Leapcaster[(Integer)] instantly to LeapSecPoint[(Integer)], facing (Angle from LeapCasterPoint[(Integer)] to LeapTargetPoint[(Integer)]) degrees
        • Custom script: call RemoveLocation(udg_LeapSecSecPoint[Integer])
        • Custom script: call RemoveLocation(udg_LeapSecPoint[Integer])


    But as I said, this trigger does not work because there is no casting unit. If you still want to move a unit, you have to pick it with a unit group, or make it cast an ability (via another trigger for example).