View Single Post
Old 08-07-22, 04:55 AM   #100
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by Jeff-Groves View Post
And may be why one needs to increase the speed of the Plane in some situations.
It would be even better if one could order the plane to lead the target. Now there's a TurnToFaceTargetTrajectory function but when I tried to apply it to planes game kept crashing on me.

As for land units, gap certainly can elaborate on this but from what I see, the workaround used by them was to assign ship AI commander controller to land unit, which allows it to use ship strategies (and since it cannot move, only ship strategy that's available to it is shooting at any detected target that moves into range). That works very well, only downside being that bunkers bounce up and down as if they were floating on waves.

I tried to add another .aix file with instructions for CoastalDefense AI "commander":

 
strategy CoastalDefense(CoastalDefense)
{
precond
{
Ship:IsType(LANDUNIT) and Plane:HasCannons() and Ship:CanFireCannons()
}
action
{
Ship:FireCannons();
}
}


Game accepts it (as in, does not CTD on me. When I added the file including obvious syntax errors just to see if game even "sees" the file, it CTD'd on loading the mission) but after checking with AI script debugger - land units using CastalDefense AI do not use the strategy from that file.

EDIT: it just occured to me that unlike modified "ship" bunker from TWoS, stock land units don't have any sensors so they might not fire cannons because they cannot detect any target...
kapuhy is offline   Reply With Quote