Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Nah it won't work that wayIs there another way to do it, like say, by scaling unit sizes down?
From how to make TD map! Can help here I guess!Although some might argue, you can destroy your initialization triggers (on map initialization).
You know, the ones you'll never need again 100% for sure once they execute properly the first time.
You can also remove corpses of creeps - unless you have towers that can raise the dead in which case you might want to rethink that, but for the most part, removing corpses is amazing for anti-lag purposes.
Simply create a trigger that runs whenever a unit owned by the creep player dies, wait 2 seconds, and then remove the unit from the game, corpse and all.
However, the largest anti-lag issue relates to creating large numbers of units at one time, and ordering them to move.
Try to limit how many creeps appear per level to 20 or so.
dead units

Events


Unit - A unit Dies

Conditions


((Triggering unit) is A Hero) Equal to False

Actions


Wait 15.00 seconds


Unit - Remove (Triggering unit) from the game
Anti Lag

Events


Unit - A unit Dies

Conditions


((Triggering unit) is A Hero) Equal to False

Actions


Set MaxCount = (MaxCount + 1)


Set CurrentUnit[MaxCount] = (Triggering unit)


Set CurrentTime[MaxCount] = 15.00


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Anti Lag 2 <gen> is on) Equal to False



Then - Actions




Trigger - Turn on Anti Lag 2 <gen>



Else - Actions
Anti Lag 2

Events


Time - Every 0.05 seconds of game time

Conditions

Actions


For each (Integer A) from 1 to MaxCount, do (Actions)



Loop - Actions




Set CurrentTime[(Integer A)] = (CurrentTime[(Integer A)] - 0.05)




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






CurrentTime[(Integer A)] Less than or equal to 0.00





Then - Actions






Unit - Remove CurrentUnit[(Integer A)] from the game






Set LocalCount = (LocalCount - 1)






Custom script: if udg_LocalCount <= 0 then






Custom script: if udg_CurrentUnit[GetForLoopIndexA()] == null then






Custom script: call DisableTrigger(GetTriggeringTrigger())






Custom script: endif






Custom script: endif





Else - Actions
That's true, triggering unit is always MUI, trigger posted by millzy will work.millzy said:the removed unit is TRIGGERING UNIT = STILL MUI WITH WAIT
this can also help for mass unit maps
more conditions may be needed depending on your map
dead units
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to False
Actions
Wait 15.00 seconds
Unit - Remove (Triggering unit) from the game
That's because "Triggering unit" is an event response. It's no variable stored that can be overwritten it just checks whatever made it go off. (or am I wrong?)
hmm.. sry
what you sayd above does this:
a unit dies,
its a hero == false,
wait 15 seconds (aha! allready destroyed mui!)
remove unit.
i wanna hear what happends when using wait with many units?
1 dies, and another 1 dies at the distance of 1 ~ 15 seconds.
what happends?
1 unit is removed, the other WILL not.
so this is not helping.
most'ly ill do this:
Anti Lag
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to False
Actions
Set MaxCount = (MaxCount + 1)
Set CurrentUnit[MaxCount] = (Triggering unit)
Set CurrentTime[MaxCount] = 15.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Anti Lag 2 <gen> is on) Equal to False
Then - Actions
Trigger - Turn on Anti Lag 2 <gen>
Else - Actions
make sure Anti Lag 2 is intially off.
Anti Lag 2
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to MaxCount, do (Actions)
Loop - Actions
Set CurrentTime[(Integer A)] = (CurrentTime[(Integer A)] - 0.05)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CurrentTime[(Integer A)] Less than or equal to 0.00
Then - Actions
Unit - Remove CurrentUnit[(Integer A)] from the game
Set LocalCount = (LocalCount - 1)
Custom script: if udg_LocalCount <= 0 then
Custom script: if udg_CurrentUnit[GetForLoopIndexA()] == null then
Custom script: call DisableTrigger(GetTriggeringTrigger())
Custom script: endif
Custom script: endif
Else - Actions
Events

Unit - A unit Dies
Conditions

((Triggering unit) is A Hero) Equal to False
Actions

Set DyingUnit = (Dying unit)

Unit Group - Add DyingUnit to UnitGroup

Set UnitCountReal = (UnitCountReal + 1.00)

If (All Conditions are True) then do (Then Actions) else do (Else Actions)


If - Conditions



UnitCountReal Greater than or equal to 2.00


Then - Actions



Set UnitCountReal = 0.00



For each (Integer A) from 1 to 3, do (Actions)




Loop - Actions





Unit Group - Pick every unit in UnitGroup and do (Actions)






Loop - Actions







Unit - Remove (Random unit from UnitGroup) from the game


Else - Actions
-Kobas- said:change unit death time in Gameplay Constants!
There is no need for corpse in TD maps for example, up to 5 sec is ok, just to show unit dead animations and a little of bones ^^