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

Problem with leaks

Status
Not open for further replies.
Level 15
Joined
Jan 27, 2007
Messages
948
Well, the problem is basically I don't understand how to detect leaks, and could someone please tell me where are the leaks here? As I'm pretty sure it leaks, since it laggs out the game, but, dunno where :S Or it doesn't leak?

  • Spawn Wild Animals
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Panther for Neutral Hostile at (Random point in (Playable map area)) facing (Random angle) degrees
  • Not At Water
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at (Position of (Triggering unit))) Equal to (==) Sunken Ruins - Sand
        • Then - Actions
          • Unit - Move (Triggering unit) instantly to (Random point in (Playable map area))
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions
 
Level 5
Joined
Jan 4, 2007
Messages
103
Hm...the first trigger should only leak because of the random point. You could do this: Set RandomPoint(variable)=RandomPointPlayableArea then Create 1 Panther at RandomPoint and then Custom Script: call RemoveLocation(udg_RandomPoint). Similar could be used for the second one. Hope it helps:)
 
Level 15
Joined
Jan 27, 2007
Messages
948
Well, many thanks, it now looks like:

  • Spawn Wild Animals
    • Events
      • Time - Every 100.00 seconds of game time
    • Conditions
    • Actions
      • Set RandomPoint = (Random point in (Playable map area))
      • Unit - Create 1 Panther for Neutral Hostile at (Random point in (Playable map area)) facing (Random angle) degrees
      • Custom script: call RemoveLocation(udg_RandomPoint)
  • Not At Water
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to (==) Panther
          • (Terrain type at (Position of (Triggering unit))) Equal to (==) Sunken Ruins - Sand
        • Then - Actions
          • Set RandomPoint = (Random point in (Playable map area))
          • Unit - Move (Triggering unit) instantly to (Random point in (Playable map area))
          • Custom script: call RemoveLocation(udg_RandomPoint)
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions
This one shouldn't leak, right?

Thanks once again.
 
Level 5
Joined
Jan 4, 2007
Messages
103
This one shouldn't leak, right?

Thanks once again.

Yes, it shouldn't if you fixed what Watermelon said:). np for the help:) Anyway, if you have anyother trigger that has random points, use the same for them to remove the leaks. Just one more thing, the first trigger in your older post says every 10sec, in your newer it says every 100sec, might be just a miss type but still check it.:) Hope it helps:)
 
Status
Not open for further replies.
Top