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.
native SetGroupsFlee takes boolean state returns nothing
native SetHeroesFlee takes boolean state returns nothing
native SetUnitsFlee takes boolean state returns nothing
I think those functions make units / heroes / groups flee when their health goes below a certain level.
Element of Water, do you know what this AI functions do ? Is it related to his problem ?
JASS:native SetGroupsFlee takes boolean state returns nothing
JASS:native SetHeroesFlee takes boolean state returns nothing
JASS:native SetUnitsFlee takes boolean state returns nothing
You mean the "Dodge AI" the OP ... Or do you never want them to engage in battle and always avoid enemy units? Not sure exactly what you want to do.Yes thats it.
EDIT: If you want to make an AI file, look ... number of bugs.
Well, I tried long ago but there are some functions I wasn't able to understand.
There are function that you can understand what they do just by they name, like AddAssult function but also there are many more I couldn't understand what they do. Are there some tutorials around explaing what do each function do ?
You can also write your own functions to replace the ones in common.ai (as I did to suit what I wanted to accomplish and to overcome some AI bugs).
To add your own functions, just write a jass function that does what you want it to do. I'm not sure I understand the rest of your statement.
native CreateUnit takes player id,integer unitid,real x,real y,real face returns unit
//============================================================================
function xBuildLoop takes nothing returns nothing
call xOneBuildLoop()
call StaggerSleep(1,2)
loop
call xOneBuildLoop()
call Sleep(2)
endloop
endfunction
//============================================================================
function xStartBuildLoop takes nothing returns nothing
call StartThread(function xBuildLoop)
endfunction
//============================================================================
function xPlayGame takes nothing returns nothing
call xStartBuildLoop()
call SleepForever()
endfunction
//===========================================================================
// Main startup function
//===========================================================================
function main takes nothing returns nothing
// Initialize Blizzard AI
//
call InitAI()
call SetMeleeAI()
call SetHeroLevels(function SelectHeroAbility)
call Sleep(0.1)
call StartThread(function UpdateLoop)
call StartThread(function MainBuildLoop)
call StartThread(function MainAttackLoop)
call xPlayGame()
endfunction
