• 🏆 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!

[Solved] How to remove leak from this one?

Status
Not open for further replies.
Level 4
Joined
Sep 11, 2018
Messages
74
  • ChooseHero1
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (choosehero[(Integer A)] contains Own Character 1 0035 <gen>) Equal to True
            • Then - Actions
              • Unit - Create 1 herotype[(Integer A)] for Player 1 (Red) at (Center of ownstartpoint1 <gen>) facing Default building facing degrees
              • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Camera - Pan camera for Player 1 (Red) to (Position of (Last created unit)) over 0.00 seconds
              • Set protagonist[1] = (Last created unit)
              • Unit - Pause Own Character 1 0035 <gen>
              • Trigger - Turn off (This trigger)
            • Else - Actions
 
Level 4
Joined
Sep 11, 2018
Messages
74
Well this one give me errors:
  • ChooseHero1
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (choosehero[(Integer A)] contains Own Character 1 0035 <gen>) Equal to True
            • Then - Actions
              • Set temploc = ownstartpoint1 <gen>
              • Unit - Create 1 herotype[(Integer A)] for Player 1 (Red) at (Center of temploc) facing Default building facing degrees
              • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Camera - Pan camera for Player 1 (Red) to (Position of (Last created unit)) over 0.00 seconds
              • Set protagonist[1] = (Last created unit)
              • Set leader[1] = protagonist[1]
              • Unit - Pause Own Character 1 0035 <gen>
              • Custom script: call RemoveLocation(udg_temploc)
              • Trigger - Turn off (This trigger)
            • Else - Actions
 
Level 7
Joined
Apr 17, 2017
Messages
316
That is a region not a location try call RemoveRect(udg_temploc)
What you should be doing is creating a point variable and setting it after the create action, set point= position of last created unit
When you are done with the variable, use call RemoveLocation(udg_point)
So there are 2 point leaks in this one, center of region and position of unit.
 
Last edited:
Status
Not open for further replies.
Top