Many gwa2.au3 files have this situation where there is no default values in the function...
New scriptors miss this alot... So when you see a function like this in your gwa2 version, it is best to update all functions with default values.... For example:
Code:
;~ Description: Tests if an agent is dead.
Func GetIsDead($aAgent)
If IsDllStruct($aAgent) = 0 Then $aAgent = GetAgentByID($aAgent)
Return BitAND(DllStructGetData($aAgent, 'Effects'), 0x0010) > 0
EndFunc ;==>GetIsDead
becomes ...
Code:
;~ Description: Tests if an agent is dead.
Func GetIsDead($aAgent = -2)
If IsDllStruct($aAgent) = 0 Then $aAgent = GetAgentByID($aAgent)
Return BitAND(DllStructGetData($aAgent, 'Effects'), 0x0010) > 0
EndFunc ;==>GetIsDead
if you do this to all your functions in gwa2, it would solve 50-70% of your errors when trying to get new bots to work...
keep in mind this fix only comes into play when the function is called like this:
GetIsDead()
with no values...
u can still call GetIsDead(-1) (to see if your target is dead) or GetIsDead( and a actual agentID ) with no problem...
also keep in mind that an agentID is not a PlayerNumber/ModelID... A agentID is given to all agents on the map from 1 to however many agents there is within a certain range or distance from your character... and as you move the list is extended as non numbered agents come into a certain range...
A PlayerNumber/ModelID stays the same for all maps and matches the image used for that particular monster or NPC Group. Once you know a PlayerNumber / model ID you can get their current closest Agent Array with the GetAgentByPlayerNumber($aPlayerNumber) function.
Once you have the Agent Array you can get all the information about the agent by pulling data from the array returned with DLLStructGetData().