Hello,
Im working on trying to add some behaviors to sea unit (other than the subHunt).
I've been adding a lot of code into original RED mod; preference target related and logging sea attack and defenses to be able to assign those 'visibility action'.
Right now, I believe I've successfully provided good movement and target for AI to use but I feel don't understand the PushMission command correctly.
Anyone can help me out ?
Here's basically my code:
Dprint (" - Naval unit moving then attacking !", g_bAIDebug)
unitopMission()
unitushMission(
MissionTypes.MISSION_MOVE_TO,
withingMovingRangeBestTargetdestinationPlot:GetX(),
withingMovingRangeBestTargetdestinationPlot:GetY(),
0,
1,
0,
MissionTypes.MISSION_MOVE_TO,
withingMovingRangeBestTargetdestinationPlot,
unit)
unitushMission(
MissionTypes.MISSION_RANGE_ATTACK,
withingMovingRangeBestTargetPlot:GetUnit(0):GetX(),
withingMovingRangeBestTargetPlot:GetUnit(0):GetY(),
0,
1,
0,
MissionTypes.MISSION_RANGE_ATTACK,
withingMovingRangeBestTargetPlot,
unit)
Somehow, I feel that the AI don't use my mission.
I have no clues what are the 3 integers included in the PushMission do; I kept the values of other PushMission I saw in Gedemon code.
I saw that Gedemon also seem to set move pts of unit to zero for the planes in the beginning of the script (REDAI_Global.lua)
I did not do that for the sea units.
Anyone knows what I do wrong ?
Im working on trying to add some behaviors to sea unit (other than the subHunt).
I've been adding a lot of code into original RED mod; preference target related and logging sea attack and defenses to be able to assign those 'visibility action'.
Right now, I believe I've successfully provided good movement and target for AI to use but I feel don't understand the PushMission command correctly.
Anyone can help me out ?
Here's basically my code:
Dprint (" - Naval unit moving then attacking !", g_bAIDebug)
unitopMission()
unitushMission(
MissionTypes.MISSION_MOVE_TO,
withingMovingRangeBestTargetdestinationPlot:GetX(),
withingMovingRangeBestTargetdestinationPlot:GetY(),
0,
1,
0,
MissionTypes.MISSION_MOVE_TO,
withingMovingRangeBestTargetdestinationPlot,
unit)
unitushMission(
MissionTypes.MISSION_RANGE_ATTACK,
withingMovingRangeBestTargetPlot:GetUnit(0):GetX(),
withingMovingRangeBestTargetPlot:GetUnit(0):GetY(),
0,
1,
0,
MissionTypes.MISSION_RANGE_ATTACK,
withingMovingRangeBestTargetPlot,
unit)
Somehow, I feel that the AI don't use my mission.
I have no clues what are the 3 integers included in the PushMission do; I kept the values of other PushMission I saw in Gedemon code.
I saw that Gedemon also seem to set move pts of unit to zero for the planes in the beginning of the script (REDAI_Global.lua)
I did not do that for the sea units.
Anyone knows what I do wrong ?