Exide
I am amazingly focused right now!
- Reaction score
- 448
If I remember correctly you can use FirstOfGroup (FoG) to check a group within the same function:
http://wiki.thehelper.net/wc3/jass/common.j/Group_API#FirstOfGroup
Here's another pro tip on how to use ForGroup:
http://wiki.thehelper.net/wc3/jass/common.j/Group_API#boolexpr_as_callback
You've got an awful lot of BJs in your code.
As a JASSer you should know that BJs are the devil!
One of the reasons for converting from GUI to JASS is to get rid of the BJs, in order to improve your code.
(BJs are highlighted in red within the code tags.)
BJs usually call one (or more) extra functions.
The most common BJ is probably DoNothing() - which does nothing.
It will be easier for you to further optimize your code when you've figured out how to get rid of your BJs.
Here's an example of how to fix one of the BJs that you are using:
=
Note: GetLastCreatedUnit() is also a BJ. However, in a real code you should replace it with a local unit variable, so I leave it as it is.
http://wiki.thehelper.net/wc3/jass/common.j/Group_API#FirstOfGroup
Here's another pro tip on how to use ForGroup:
http://wiki.thehelper.net/wc3/jass/common.j/Group_API#boolexpr_as_callback
You've got an awful lot of BJs in your code.
As a JASSer you should know that BJs are the devil!
One of the reasons for converting from GUI to JASS is to get rid of the BJs, in order to improve your code.
(BJs are highlighted in red within the code tags.)
BJs usually call one (or more) extra functions.
The most common BJ is probably DoNothing() - which does nothing.
It will be easier for you to further optimize your code when you've figured out how to get rid of your BJs.
Here's an example of how to fix one of the BJs that you are using:
JASS:
function UnitApplyTimedLifeBJ takes real duration, integer buffId, unit whichUnit returns nothing
call UnitApplyTimedLife(whichUnit, buffId, duration)
endfunction
JASS:
call UnitApplyTimedLifeBJ( 3.50, 039;BTLF039;, GetLastCreatedUnit() )
=
JASS:
call UnitApplyTimedLife(GetLastCreatedUnit(), 039;BTLF039;, 3.5)
Note: GetLastCreatedUnit() is also a BJ. However, in a real code you should replace it with a local unit variable, so I leave it as it is.