I am trying and trying the characters in the Watch mode and I am frustrated. I have a lot of problems with the AI files. Sometimes the character flees and flees and he does not do anything more. Other times he receives blows and is not capable of throwing any beam or to do one melee attack. When I want the character to do an area attack when he is swarmed he does not do it. When I want the character land, he flies. And more and more...
I would like to know how works basically the AI, what type of attacks have priority...
There is a fairly detailed description of all that in the FFX manual. It should have been installed with FFX. There is a section called M25 AI.
Yes I read this manual but, for example, commands as 'swarmed' or 'clustered' seem not work often. The same happens with priority or pct sometimes.
Well... I continue trying
I was having similar issues in Watch Mode and I think it's due to the fact that the 'swarmed' and 'clustered' subtypes use the 'nearenemy' subtype which detects if the target is near an enemy. If the target is near an enemy, even an enemy to the user, they won't use the power. I made a new subtype: 'enemynearally' which seems to work better.
Open up the m25ai.py file and add these lines:
def ST_enemynearally(char,target=None,param=None,param2=None):
p = param
if param == None:
p = m25distance.DISTANCE_AREA_MEDIUM
ally_list = AI_GetNearEnemies(char)
if len(ally_list):
for a in ally_list:
if a != target:
pos1 = Get_ObjectPos(a)
pos2 = Get_ObjectPos(char)
dist = cshelper.distance2D(pos1, pos2)
if dist <= p:
hasPortrait=ffx.FFX_HasPortrait(a)
pcAIEnabled=AIInWatch(a)
team=GetTeam(a)
myTeam=GetTeam(target)
if team == myTeam:
if pcAIEnabled or hasPortrait:
return 1
break
else:
if Mission_GetAttr('ffxSkirmish')!=0:
return 1
break
else:
return 0
if team != myTeam:
return 0
else:
return 0
else:
return 0
else:
return 0
Then do a search through the m25ai.py file for nearenemy and replace it with enemynearally. Just don't replace the def ST_nearenemy.
Next, open m25aiopt.py and do a search for nearenemy and replace every one you find with enemynearally.
Hey, thanks again TrajkLogik. I'll try this.
Recently I had problems too with the command 'not nearally', but now I use 'alone' and seems to work better.
The best way I've found around this is to change something like "TMeleeArea" to just "TMelee." Yes, allied models may get caught, but I don't mind that. Actual area attackes won't trigger for the same reason. I don't know a way around it, I just decided that allies should get hit, too.
I may not be setting up these files correclty.