• 🏆 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] Is a variable point a leaky point?

Status
Not open for further replies.
Level 8
Joined
Feb 20, 2007
Messages
338
On my map I have three points where a lot of units will be spawned.

I have:

  • Grey Growth Purple
    • Events
      • Player - Player 9 (Gray)'s Current lumber becomes Greater than or equal to 10.00
    • Conditions
      • (Number of units in (Units owned by Player 3 (Teal))) Greater than 13
    • Actions
      • Unit - Create 1 Timber Wolf for Player 4 (Purple) at Grey_Spawn facing (Random point in (Playable map area))
      • Unit - Order (Last created unit) to Right-Click Arnada
      • Player - Set Player 9 (Gray) Current lumber to 0
And
  • Brown Hero Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to HERO_Brown
    • Actions
      • Wait 9.00 seconds
      • Hero - Instantly revive (Dying unit) at (Player 12 (Brown) start location), Show revival graphics
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit - Order (Picked unit) to Right-Click HERO_Brown
And
  • Hunter Growth
    • Events
      • Player - Player 2 (Blue)'s Current lumber becomes Greater than or equal to 12.00
    • Conditions
      • (Number of units in (Units owned by Player 2 (Blue))) Less than or equal to 30
    • Actions
      • Unit - Create 1 Hunter for Player 2 (Blue) at Hunter_Spawn facing (Random point in (Playable map area))
      • Set TempPoint5 = (Random point in (Playable map area))
      • Unit - Order (Last created unit) to Patrol To TempPoint5
      • Custom script: call RemoveLocation( udg_TempPoint5 )
      • Player - Set Player 2 (Blue) Current lumber to 0
I have variations of a theme on this 3 teams, Brown wolves, Player wolves and Hunters - hunters hunt both, brown wolves are a computer team and the gray wolves are the player's team.

Hunter_Spawn, Grey_Spawn and Brown_Spawn are three permanent points. Ultimately something like 100 hunters may be spawned/created at the Hunter_Spawn point, 75 to 80 Wolves spawned at Both Grey and Brown points (assuming death of units through the game).

Once I set those points they are just three points and not being recreated each time I spawn a unit - right?

Also does the command Right-click X unit leak?

I'm using that a lot, having units right click the two player heroes and the computer hero not only upon creation, but also when the hero enters a region (12 triggering regions) where I am using variations on:

  • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 3 (Teal)) and do (Actions)
    • Loop - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit - Order (Picked unit) to Right-Click Sirius
I do not know if the point of the unit moves with the unit or if a new point is made each time a unit is commanded to move to/attack/right click X unit.

Is the Hunter command to patrol to TempPoint5 is the correct usage of cleaning up a leak point?

I know I have leaks - each time I test the map by the end sequence the game starts to lag.

Thanks
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I don't see any leaks (unless random points leak ? I don't think so) besides the unit group destroy script which should be put BEFORE the group is made, like this:

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 3 (Teal)) and do (Actions)
    • Loop - Actions
      • Unit - Order (Picked unit) to Right-Click Sirius

And instead of using points you can just use regions for most of those things, and regions don't leak :)
 
Level 17
Joined
Jun 17, 2007
Messages
1,433
I don't see any leaks (unless random points leak ? I don't think so) besides the unit group destroy script which should be put BEFORE the group is made, like this:

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 3 (Teal)) and do (Actions)
    • Loop - Actions
      • Unit - Order (Picked unit) to Right-Click Sirius

And instead of using points you can just use regions for most of those things, and regions don't leak :)

Random Points do leak :wink:
Also, What do you mean by regions don't leak?
 
Level 8
Joined
Feb 20, 2007
Messages
338
I don't see any leaks (unless random points leak ? I don't think so) besides the unit group destroy script which should be put BEFORE the group is made, like this:

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 3 (Teal)) and do (Actions)
    • Loop - Actions
      • Unit - Order (Picked unit) to Right-Click Sirius

And instead of using points you can just use regions for most of those things, and regions don't leak :)

Well then if my placement of destroy group is in the wrong place that is most likely why my game is lagging out at the end.

This is the first map where I have used groups to such an extent -

This also means that I will have to go back to all of my other maps and move that custom script item...

Thanks.
 
Status
Not open for further replies.
Top