- Joined
- Mar 16, 2008
- Messages
- 955
When I add these conditions to this AI script, it seems to cause extreme lag to the point of freezing the game completely. When I disable them, the script seems to run fine. Any ideas why? I would say some king of leak but it doesn't seem to crash the game??? Thank you.
Here is the disabled version of the script. So when the /// is removed, it causes extreme lag about 5 mins in or so.
Here is the disabled version of the script. So when the /// is removed, it causes extreme lag about 5 mins in or so.
JASS:
function UpdateConditions takes nothing returns nothing
/// set gCond_Need_Exp1 = ( ( GetMinesOwned( ) < 2 ) and ( GetTownUnitCount( 'htow', 1, false ) == 0 ) )
/// set gCond_Need_Exp2 = ( ( GetMinesOwned( ) < 3 ) and ( GetTownUnitCount( 'htow', 2, false ) == 0 ) )
/// set gCond_Need_Exp3 = ( ( GetMinesOwned( ) < 4 ) and ( GetTownUnitCount( 'htow', 3, false ) == 0 ) )
/// set gCond_Need_Exp4 = ( ( GetMinesOwned( ) < 5 ) and ( GetTownUnitCount( 'htow', 4, false ) == 0 ) )
/// set gCond_Need_Exp5 = ( ( GetMinesOwned( ) < 6 ) and ( GetTownUnitCount( 'htow', 5, false ) == 0 ) )
/// set gCond_Need_Exp6 = ( ( GetMinesOwned( ) < 7 ) and ( GetTownUnitCount( 'htow', 6, false ) == 0 ) )
endfunction
JASS:
function BuildPriorities takes nothing returns nothing
...
/// if (gCond_Need_Exp1) then
call BuildExpansion( 'htow', 'htow' )
/// endif
...
/// if (gCond_Need_Exp2) then
call BuildExpansion( 'htow', 'htow' )
/// endif
...
...
/// if (gCond_Need_Exp3) then
call BuildExpansion( 'htow', 'htow' )
/// endif
/// if (gCond_Need_Exp4) then
call BuildExpansion( 'htow', 'htow' )
/// endif
/// if (gCond_Need_Exp5) then
call BuildExpansion( 'htow', 'htow' )
/// endif
/// if (gCond_Need_Exp6) then
call BuildExpansion( 'htow', 'htow' )
/// endif
endfunction