Spawning Lag

Venge22

New Member
Reaction score
10
Ok, so i made 1 footman spawn every 2 seconds. Every thing was running good until it started to lag when a unit spawned. It was eventually lagging for like a split second every 3 seconds or so. If there a way to stop this lag?
 
Remove the leaks from creating the units.
 
Ok, assign each last created units, your footman, into variables with a name of your choice. Then call a custom script with...
Code:
call DestroyUnit(udg_yourunitvariable)
 
There's an action called Custom script, it's pretty near the top of the list. -Only in The Frozen Throne, though.

Also, units don't leak. Well they do, but they eventually die and clean up after themselves, so there's no worry there.

However, you should remove the point leak. -Where you create the unit. (Usually Center of *region, or Random point in *region.)
-This is done by creating a Point Variable, using set variable to set it.
set TempPoint = Center of (Playable Map)
Create 1 Footman for Player 1 (Red) at TempPoint facing 270.00
Custom Script call RemoveLocation(udg_TempPoint)

There are tons of leak tutorials around here, if you want more information.
 
The new EGUI thing is helpful. It has all the leak clean up scripts in GUI triggers.
 
Ack, this is confusing for me. Idk wat Gui and other stuff like that is.:D O, wait Gui is regular triggers. I just found that out. :p
 
Man, i only have RoC. :(

Then you can do it in JASS, just the same.

GUI is the opposite of JASS. GUI is what you know as triggers.
JASS is the programming language that WC3 uses.
GUI - Graphical User Interface, a simplified and more beginner-friendly way of creating triggers in JASS.

You should buy TFT, if you want to create maps in WC3.
RoC is horrible to work with. :p
 
Yes, im planning on buying TFT soon. Isn't it only like 15 dollars? So, i cant really fix the lag i guess :p
 
I don't know, I don't use dollars. :rolleyes:
-It's not very expensive, though.

Yes, you can fix your lag using JASS.
Click 'Edit -> Convert to Custom Text', and your trigger will converted into JASS. -Then you can use local variables to make it even more simple for yourself. :p
 
Um, im being dumb today. Where in the actions or whereever it is is teh Edit convert to custom text?
 
It is no action... Select your trigger go to the Edit drop down menu at top of the window of the trigger editor then select it.
 
Is it in actions or wat? Im asking where to find it, i already know wat to look for
 
I'm pretty sure RoC should have it..

Open the Trigger Editor (F4), Create a new trigger.
Add one event and one Action:
Code:
Untitled Trigger 001
    Events
        Map initialization
    Conditions
    Actions
        Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Then, at the very top of the screen, click 'Edit' and scroll down to 'Convert to Custom Text'.

You will get a warning message, telling you that you can't convert the trigger back to GUI, if you convert it to JASS - click yes to continue.
Your trigger should now look like this:
JASS:

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction

Here you can add tons of actions that RoC-GUI won't allow you to use. :p
 
Ahhh XD Thx, im being retarted today o_O It looks confusing. Also if this changes anything i made the units go to the middle of the map for my game.
 
>Also if this changes anything i made the units go to the middle of the map for my game.
-Yes, it changes things. :p

Now, to clean up the leaks:
JASS:

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
     local location temppoint = GetRectCenter(GetPlayableMapRect()  // This sets the point.
    call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), temppoint), bj_UNIT_FACING )
    call RemoveLocation(temppoint)    //This cleans up the leaks.
    set temppoint = null       //This cleans up the leaks.
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction


Simple enough. :p

// - Comments. Not needed for the trigger to work.
 
lol, ok. I don't feel like working on it now though :p mapmaking gets nerve wrecking sumtimes.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top