Logo Platform
logo amplifiers simplified

[question] is there a way to make AI not to produce specific ship size?

Reply
Copied to clipboard!
0Send private message
7 years ago
Feb 1, 2018, 3:19:17 PM

Hey Omatkoicorko!


There are two solutions for this:

- AI modding

- Make the AI not want to use them. It's complex but I guess it can be done.

- Changing the cost of these ships/hulls/roles for AIs only:

- Override SimulationDescriptors such as GameDifficultyAINormal 

- Add a modifier which increases the value of a Property

- Use this property as multiplier for costs of the ships you don't want the AI to build.

Updated 7 years ago.
0Send private message
7 years ago
Feb 1, 2018, 3:48:44 PM

thanks but link does not work.


im still at work so cant check files now so i will ask blindly: is there any varation or percent that says to Ai how many ships of specific size it want to build?


what i want to do is make AI build one or non from Large ships , i wish it would be just one at a time, to make it more unique - im playing exactly same way, one large as capital ship. so one large and everything else should be medium and small...

Updated 7 years ago.
0Send private message
7 years ago
Feb 2, 2018, 9:01:52 AM

Whoops, AI modding is not officially available yet and that's why the link doesn't work, my bad.


Unfortunately the AI's decisions are done via code in a specific DLL and stuff, and thus cannot be accessed via XML.

However if you want players and AIs to be unable to build more than one large ship, you can add a prerequisite on the large hulls which make them unavailable for construction once the empire already owns one.

Simply override HullDefinitions such as HullLarge01Cravers or HullLarge01Sophons, by copying their content into your mod and adding the prerequisites to their list.


This prerequisite will restrict the construction of Large ships to one per empire, player included:

<PathPrerequisite Flags="Prerequisite,Discard" Inverted="true">../ClassEmpire//ClassShip,ShipSizeLarge</PathPrerequisite>

While these ones will restrict it only for AIs:

<PathPrerequisite Flags="Prerequisite,Discard" Inverted="true">../ClassEmpire,GameDifficultyAINewbie//ClassShip,ShipSizeLarge</PathPrerequisite>
<PathPrerequisite Flags="Prerequisite,Discard" Inverted="true">../ClassEmpire,GameDifficultyAIEasy//ClassShip,ShipSizeLarge</PathPrerequisite>
<PathPrerequisite Flags="Prerequisite,Discard" Inverted="true">../ClassEmpire,GameDifficultyAINormal//ClassShip,ShipSizeLarge</PathPrerequisite>
<PathPrerequisite Flags="Prerequisite,Discard" Inverted="true">../ClassEmpire,GameDifficultyAIHard//ClassShip,ShipSizeLarge</PathPrerequisite>
<PathPrerequisite Flags="Prerequisite,Discard" Inverted="true">../ClassEmpire,GameDifficultyAISerious//ClassShip,ShipSizeLarge</PathPrerequisite>
<PathPrerequisite Flags="Prerequisite,Discard" Inverted="true">../ClassEmpire,GameDifficultyAIImpossible//ClassShip,ShipSizeLarge</PathPrerequisite>
<PathPrerequisite Flags="Prerequisite,Discard" Inverted="true">../ClassEmpire,GameDifficultyAIEndless//ClassShip,ShipSizeLarge</PathPrerequisite>

You can also replace PathPrerequisites with InterpreterPrerequisites to check for a specific amount, instead of "one or zero":

<InterpreterPrerequisite Flags="Prerequisite,Discard" Inverted="true">Count(Context,@'../ClassEmpire//ClassShip,ShipSizeLarge') ge 1</InterpreterPrerequisite>

0Send private message
7 years ago
Feb 2, 2018, 1:49:40 PM
MonAmiral wrote:


This prerequisite will restrict the construction of Large ships to one per empire, player included:

<PathPrerequisite Flags="Prerequisite,Discard" Inverted="true">../ClassEmpire//ClassShip,ShipSizeLarge</PathPrerequisite>


this idea is exactly what i wish for, one per everyone, including me, but i wont produce more than ona anyway ;)


but im trying to understand this code and i cant find where it is said that it will restrict factions. you know g2g xml is always problematic for me compared to any other game that im modding.



edit, ok i made my mod and added lines to each file, hopefully i didnt break anything,  THANKS!


i will let you know if it works, sooner o later i will find out in new game :)


chears and thanks for help. 


ps. still dont know how you know what this Prerequisite will do :P

Updated 7 years ago.
0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message