Spire's Question Thread!(Generous with rep ^^)

K

Kerberos

Guest
Now, I don't know what bj_wantDestroyGroup does, so I'm going to remove it from my suggested change. It could be that this works better with it equal to True, though.

Just to make sure I know what this is supposed to do: every 2 seconds, it orders all units owned by Brown that are within 800 of Totem to attack Totem, right?

LeakGroup is a unit group variable. This spell is multi-unit incastable (MUI).
Code:
Totem Lure
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        Set LeakGroup = All units in (Playable map area) matching (((Matching unit) is within 800.00 of Totem) and (Owner of (Matching unit) Equal to Player 12 (Brown))
        Unit Group - Pick every unit in LeakGroup and do (Actions)
            Loop - Actions
                Order (Picked unit) to Attack Totem
    Custom script:   call DestroyGroup( udg_LeakGroup )
    Set TotemDuration = (TotemDuration + 2)
    If (TotemDuration is Greater than 45) then do (Turn off (This trigger)) else do (Do nothing)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> And the more JASS-intensive version that can be cast multiple times at once

The first version already has no problems.
Don't try to add potential features by messing with almost-locals...

Why not use "units in range matching condition"?
 
K

Kerberos

Guest
The first version already has no problems.
But Totem is a global variable. If another thing casts it while the first Totem is still in effect, the units will stop focusing on the old Totem if something new grabs their attention.

Why not use "units in range matching condition"?
Um. Right, that would be better. I'll fix that in the morning.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
But Totem is a global variable. If another thing casts it while the first Totem is still in effect, the units will stop focusing on the old Totem if something new grabs their attention.

Well, yes.
But, that's not prevented either by your almost-but-not-really JASS version.

The "JASS" version will also never stop... every 2 seconds, duration starts at 0 again... that, at least, did work before.
 
S

spiremk

Guest
It's strange... I think after placing all the leak fixes, my map is lagging even more heavily...

Are there any other factors contributing to lag?

INFO:

1. I have abt 50 units spawning every 15 seconds or so...
2. Since I'm testing, Player 1 only controls 1 Hero at a time...
3. Game still lags, maybe after some time or after I cast a certain spell that uses a periodic event...
 
K

Kerberos

Guest
The "JASS" version will also never stop... every 2 seconds, duration starts at 0 again.
Right. Okay, the JASS trigger is gone.

I think I could make a pure JASS trigger that could be cast by multiple units at once, if you want that to be possible, Spire.

As to the lag, the units spawning will be pretty bad if you don't plug the memory leaks. Instead of
Code:
Unit - Create 1 Footman for Player 1 (Red) at (Random point in (Region 001)) facing Default building facing degrees
Do this:
Code:
Set LeakPoint = Random point in (Region 001)
Unit - Create 1 Footman for Player 1 (Red) at LeakPoint facing Default building facing degrees
Custom script:   call RemoveLocation( udg_LeakPoint )


This should tell you all you need to know about fixing memory leaks.
 
S

spiremk

Guest
When do I have to place the leak fixes? Immediatedly after the leaking trigger? Or if I want to spawn multiple-types of units on the same point, can I remove the leak only after the multiple spawning triggers?
 

Exide

I am amazingly focused right now!
Reaction score
448
You should remove it as soon as you are done with it.

For example in a point-leak:

Code:
    Actions
      Set L (Center of Region_1)
      Create 1 Footman for Player 1 (Red) at L facing blabla..
      Custom Script call RemoveLocation(udg_L)

or

Code:
    Actions
      Set L (Center of Region_1)
      Create 1 Footman for Player 1 (Red) at L facing blabla..
      wait 10 seconds
      Create 1 Footman for Player 1 (Red) at L facing ...
      Custom Script call RemoveLocation(udg_L)

Just make sure you don't "overwrite" the leak, like so:

Code:
    Actions
      Set L (Center of Region_1)
      Create 1 Footman for Player 1 (Red) at L facing blabla..
      wait 10 seconds
      [B]Set L (Center of Region_2)[/B]
      Create 1 Footman for Player 1 (Red) at L facing blabla..
      Custom Script call RemoveLocation(udg_L)

You need to remove the leak before "overwriting".
If you aren't "overwriting" or anything, you can wait with removing the leaks 'til the end of the trigger. But it's easier to remove it as soon as possible, I guess.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top