View Single Post
Old 08-09-22, 04:50 AM   #109
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by kapuhy View Post
 
strategy BombCourseStrafe(Plane)
{
precond
{
Plane:HasCannons() and Plane:CanFireCannons() and Plane:GetContactRelDistOnWater() <= 3500 and Ship:GetContactSpeed() > 5 and !Plane:StrafingTooClose()
}
action
{
Plane:Strafe(1.0);
Ship:SetThrottleRatio(1.0);
}
}

strategy BombCourseSlow(Plane)
{
precond
{
Plane:GetContactRelDistOnWater() <= 3500 and Ship:GetContactSpeed() <= 5 and !Plane:StrafingTooClose()
}
action
{
Plane:SetCourseBombs();
#Ship:SetThrottle(1.0);
}
}
Probably I am going to ask some silly questions but...
  • Does the question mark before a precondition, work the same way as the logical operator 'not' in other programming languages?

  • Why 'Plane:HasCannons() and Plane:CanFireCannons()'? Wouldn't 'Plane:HasBombs() and Plane:CanFireBombs()' be more logical preconditions for the 'BombCourseStrafe(Plane)' and 'BombCourseSlow(Plane)' strategies?

  • Do the 'Ship:SetThrottleRatio(1.0)' commands apply to the attacking aircraft or to the attacked sea unit? In the latter case, shouldn't them be part of ship, rather than aircraft, AI strategies?
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote