Well, the problem is this. There are several diferent methods in the API for creating ships. One creates them by a specific ship class, this is the one used for creating player ships and contains the parameter "metaverseID". The API states this is the only method compatible with the dynaverse because it conatins the metaverseID which corresponds to the ship id in the database, thus connecting your ship in mission with your ship in the database. Whatever then happens to your ship in the mission is updated in the database at the end of the mission.
The other methods create ships by hull class and BPV. One you can set a specific hull class, the other you can set a range of hull classes. These methods I have been using for the most part of testing because they seen ideal. You can get the hull class of a player ship (say Heavy Cruiser) and then use the above latter method to create AI ships by setting the hull class range to say one above and one below the player ship hull class. This works very well at getting the right strength of enemy AI. There are two problem that we have discovered though using these methods. Principally, they use the client shiplist, not the server shiplist. It was for this reason that Gorn AI was not appearing because the shiplist uses doner ships for races to add in pfs to non-pf races. Secondly, the function in the API that returns the server date is broken, it always returns the same year. A mission script then (until that is fixed in the client code) has no direct way of knowing what year it is on the server and this we think is the reason why when using these methods that we get timewarping of ships hapenning.
We have been trying to get these functions to work anyway by making work arounds, since having control over what AI is being generated is very handy. We had made shiplists for each year that set ships to SPECIAL that were not yet available as a solution to the timewarping issue. We had adnjusted the hull class ranges and BPVs and variances numerous times to try and get the right ships to appear. However, the missing Gotn AI was the deal breaker. The only way to get that back in without changing the scripts was to remove pf's from the Federation list. The ED base assaults however generated Gorn AI just fine. So what was it that they did that these scripts did not?
Taking a look in the stock and ED mission source code, at first glance, there is no AI ship generation code whatsoever. How could this be? In fact, you can see in some of the stock scripts where AI generation code used to exist but was commented out. The only code that exists there is the player ship generation code. How do these scripts generate AI then? Well, I'm glad you asked. If the team that contains the player ship generation code is not a human team, it appears that the client code still tries to get data about the ship from the serverkit. The serverkit does not have a player ship for that slot and so an AI ship gets filled there instead. Ir would appear that this AI ship is being generated from the server side shiplist. The hull class and BPV of these ships are being entirely controlled from somewhere within the client code and we have no access to them.
As a last resort then, I have had to remove all the AI ship generation code from the missions, in order to use the same method that the stock missions and ED missions use to create AI ships. While this fixes the timewarping issue and the Gorn AI problem, it means we give up control over what AI ships are actually being made. We did not want to do this because it doesnt make AI ships very well, as we have seen, but I still have a few ideas that may help with this.
Now, using the above also presented another problem. Because the same function was now being used to generate both player and AI ships, we lost AI stripping. Previously because the functions were seperate I could simply just put in a conditional that says If this is a human team, use this function... else if this is not a PvP mission, create AI. I did find a way to get this working anyway though.
So, unfortunately, there way not be much we can now do about the strength of AI ships since we have basically given up control over how they are created. To fix the shop creation methods that give us that control requires access to the client source code in order to fix the OP scripting API. I also suspect it would be easy to fix if I had the source code.
Dont give up hope yet though, I still have another idea to try.