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

Triggers leak :(

Status
Not open for further replies.
Level 6
Joined
Jan 29, 2010
Messages
213
[SOLVED]
[There's no problems anymore and I don't like "custom scripts" sry...]

Hi all!
I have some problem with Last created unit, and variable.
When I use skill it works perfectly, but when I kill quest unit, than skill leaks, spining unit stops spining...

There's a skill - Light Guardian (light guardian just reveals invisible units and increase your visibility range...)
Light Guardian [triggers]


  • Light Guardian cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to light guardian
    • Actions
      • Set light_guardian_caster[(Player number of (Owner of (Triggering unit)))] = (Casting unit)
      • Unit - Create 1 Light Guardian for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
      • Set Light_Guardian[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
      • Unit - Change color of Light_Guardian[(Player number of (Owner of (Triggering unit)))] to Yellow
      • Set light_guardian_position[(Player number of (Owner of (Triggering unit)))] = 0
      • Set Light_Guardian_Time[(Player number of (Owner of (Triggering unit)))] = 875

  • Light Guardian spin
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer B) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Light_Guardian[(Integer B)] Not equal to No unit
            • Then - Actions
              • Set light_guardian_position[(Integer B)] = (light_guardian_position[(Integer B)] + 2)
              • Unit - Move Light_Guardian[(Integer B)] instantly to ((Position of light_guardian_caster[(Integer B)]) offset by 500.00 towards (Real(light_guardian_position[(Integer B)])) degrees)
              • Set Light_Guardian_Time[(Integer B)] = (Light_Guardian_Time[(Integer B)] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Light_Guardian_Time[(Integer B)] Equal to 0
                • Then - Actions
                  • Unit - Remove Light_Guardian[(Integer B)] from the game
                  • Set Light_Guardian[(Integer B)] = No unit
                • Else - Actions
            • Else - Actions
And there's quest - Kobold quest
Kobold quest [triggers]


  • quest kobold start
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacked unit) Equal to Kobold Taskmaster 0000 <gen>
    • Actions
      • Set kobold_quest[(Player number of (Owner of (Attacking unit)))] = (Attacking unit)
      • Unit - Order (Attacking unit) to Stop
      • Game - Display to (All players matching ((Matching player) Equal to (Owner of kobold_quest[(Player number of (Owner of (Attacking unit)))]))) the text: Kobold Tuskmaster: ...

  • quest kobold OK
    • Events
      • Player - Player 1 (Red) types a chat message containing -ok as An exact match
      • Player - Player 2 (Blue) types a chat message containing -ok as An exact match
      • Player - Player 3 (Teal) types a chat message containing -ok as An exact match
      • Player - Player 4 (Purple) types a chat message containing -ok as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -ok as An exact match
      • Player - Player 6 (Orange) types a chat message containing -ok as An exact match
      • Player - Player 7 (Green) types a chat message containing -ok as An exact match
      • Player - Player 8 (Pink) types a chat message containing -ok as An exact match
      • Player - Player 9 (Gray) types a chat message containing -ok as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -ok as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -ok as An exact match
      • Player - Player 12 (Brown) types a chat message containing -ok as An exact match
    • Conditions
      • kobold_quest[(Player number of (Triggering player))] Not equal to No unit
    • Actions
      • Game - Display to (All players matching ((Matching player) Equal to (Triggering player))) the text: You: I'll be please...
      • Game - Display to (All players matching ((Matching player) Equal to (Triggering player))) the text: Kobold Tuskmaster: ...


  • quest kobold NO
    • Events
      • Player - Player 1 (Red) types a chat message containing -no as An exact match
      • Player - Player 2 (Blue) types a chat message containing -no as An exact match
      • Player - Player 3 (Teal) types a chat message containing -no as An exact match
      • Player - Player 4 (Purple) types a chat message containing -no as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -no as An exact match
      • Player - Player 6 (Orange) types a chat message containing -no as An exact match
      • Player - Player 7 (Green) types a chat message containing -no as An exact match
      • Player - Player 8 (Pink) types a chat message containing -no as An exact match
      • Player - Player 9 (Gray) types a chat message containing -no as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -no as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -no as An exact match
      • Player - Player 12 (Brown) types a chat message containing -no as An exact match
    • Conditions
      • kobold_quest[(Player number of (Triggering player))] Not equal to No unit
    • Actions
      • Game - Display to (All players matching ((Matching player) Equal to (Triggering player))) the text: You: Sry, Im to bus...
      • Game - Display to (All players matching ((Matching player) Equal to (Triggering player))) the text: Kobold Tuskmaster: ...
      • Set kobold_quest[(Player number of (Triggering player))] = No unit
  • quest kobold KILL
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Crab lobster
    • Actions
      • Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at (Random point in (Playable map area)) facing Default building facing degrees
      • Cinematic - Ping minimap for (All players matching ((Matching player) Equal to (Owner of (Killing unit)))) at (Position of (Last created unit)) for 1.00 seconds
 
Last edited:
Instead of just asking other people to fix your leaks, you should definitely just learn yourself. There are plenty of tutorials around this site for that.

Catch a man a fish, and he'll eat for a day. Teach a man to fish, and he'll eat for a lifetime.

Btw im really really confused as to what light guardian is supposed to do. It doesn't deal damage anywhere in the trigger. It leaks 2(number of leaks)x12(number of loops)x33(times trigger runs every second) points a second, because you aren't turning it off and you aren't clearing the leaks. Maybe by the time you finish the kobold quest your map is so fucked with leaks it just doesn't work.
 
Status
Not open for further replies.
Top