vJASS & Zinc DocumentationFor the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:Jasshelper documentation - Zinc documentation
The first thing is to start using some libraries to speed up your code, the first one is an indexing library like ALLOC: http://blizzardmodding.info/5012/snippet-allocloop-aka-alloc-2/With this one the allocation of things would be dramatically increased. And it works because it's slower to create/destroy handles than reusing it.
Let's start with timers:Code: jass [Select] function RunThis takes nothing returns nothing // code here. The timer hancle can be managed in this function to destroy or pause... endfunction function InitTrig_test takes nothing returns nothing call TimerStart(CreateTimer(),0.25,true,function RunThis) // with this you save a variable assignation... endfunctionUsing periodic triggers is a BIG no no. triggers are not recyclable as timers. And for time recycling there's a tool called timerutils.
About Unit grouping, the fastest way is the one you posted:Code: jass [Select] function GroupExec takes nothing returns nothing // As you can see, I use an already created group, a bj one in order to make it faster in use, and you don't need to destroy it, it's cleaned up by the same loop... local unit c = GetTriggerUnit() local real x = GetUnitX(c) local real y = GetUnitY(c) local unit temp call GroupEnumUnitsInRange(bj_lastCreatedGroup,x,y,300,null) loop set temp = FirstOfGroup(bj_lastCreatedGroup) exitwhen temp == null if IsUnitEnemy(temp,GetOwningPlayer(c)) then //execute each valid unit endif call GroupRemoveUnit(bj_lastCreatedGroup,temp) endloop set c = null endfunction
Started by nestharusBoard Jass Tutorials
Page created in 1.277 seconds with 36 queries.