You're welcome!Amen Brick wrote:Thanks for the help!
Without any programming effort on your side there are three alternatives for you in the pre-existing role/AI-set.Amen Brick wrote:As far as the battleship goes, what ai should I give it? I don't think I'm up to programming one yet (as my really basic error making confirms!)
It could be a hostile Battleship. Hostile to just anybody. That would practically make it behave like a pirate. And pirates have a pre-programmed AI that could be used for your hostile battleship as well. The only thing you would have to do is exchange the roles "trader" with "pirate". Don't insert an ai_type-entry at all, the engine will take care by itself that anything with roles "pirate" gets the correct AI.
Or it could be a Battleship of any force, probably a planetary government, probably an alien force? But not GalCop. Then it would not attack harmless traders, but bad guys only. This is very similar to what within the pre-existing roles/AIs a hunter does. So replace "trader" with "hunter" and you're there. Again, no AI needs to be specified, the engine chooses the correct AI all by itself.
Or it could be an addition to GalCop-force itself, a "big brother" of the Viper etc. Then you should replace the "trader" with "police", and again the engine will choose the corresponding AI. But in this case you should also add the lines
Code: Select all
<key>scanClass</key>
<string>CLASS_POLICE</string>
If you want to go for the GalCop-police/military option, it could be worthwhile to use the Behemoth's AI instead.
*****
All of the above said is true if you want to confine yourself with the standard roles in Oolite. So the engine would choose your Battleship randomly instead of other pirates/hunters/police when populating a system. But probably you want to create your ship for sure in specific circumstances. In that case you have to give it a unique, custom role (which can go together with one of the standard roles). Something like amen_brick_battleship. And then you would add it with that role. In this case you need to specify which AI shall be used, because the engine knows only for the standard roles which AI has to go with them. So you will have to add the ai_type-key. In the first case (pirate) you have to assign "pirateAI.plist" to that key. In the two latter cases (hunter or police/military) the AI is the same "route1patrolAI.plist". Or, as I mentioned above, probably the AI used by the Behemoth (look into that OXP).
One last remark on naming: You should give your ships unique entity-identifiers (like I gave the example with the unique role). And also all file-names should be unique. That is because two identical entries or two identical file-names will overwrite each other. "Yacht", "Battleship" or "Hospital" do not qualify as unique. Who knows, some other ship designer may wish to create a "Battleship" as well, and he would effectively delete yours (or you his). Not nice. So instead of "Battleship" your entity should be called "Amen-Brick-Battleship" or "YourOXPname-Battleship" or even "Brick-YourOXPname-Battleship". And the same goes for all the files involved: not "Battleship.dat", but "Amen-Brick-Battleship.dat"; not "Battleship.png", but "Amen-Brick-Battleship.png". You're free to decide how to name it all, whether you want to use your real-life name, your avatar, the name of the OXP you want the ships to be in, or anything else. But make it unique enough that nobody ever will use that exact name again. Something as general as "Yacht" does not qualify.