• 🏆 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] Deleaking problem

Status
Not open for further replies.
Level 10
Joined
Apr 13, 2005
Messages
630
i got this trigger that idk how to remove the point

  • 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

  • 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:
Level 5
Joined
Oct 17, 2006
Messages
151
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])
 
Level 5
Joined
Oct 17, 2006
Messages
151
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.)
 
Level 5
Joined
Feb 5, 2008
Messages
109
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).
 
Status
Not open for further replies.
Top