How to make custom .aip files work

Modding, Map Editor, IES Scripting and Other Questions
User avatar
calsch03
Posts: 43
Joined: 04 Dec 2015, 11:24
Location: The Netherlands
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: How to make custom .aip files work

Post by calsch03 »

Sorry to hear that it is still crashing. It seems that there is no easy way to make a custom aip.

Sat42
Posts: 130
Joined: 03 Dec 2018, 18:01
Has thanked: 6 times
Been thanked: 1 time

Re: How to make custom .aip files work

Post by Sat42 »

calsch03 wrote: 29 Mar 2020, 20:25 You need to make a new aip file and start with the following code:

Code: Select all

// $Header: /run/AIPS/Skirmish_Default.aip 38    5/05/05 3:46p Kwasserman $
// The basic skirmish aip, EVERYONE should load this first, then override only the interesting bits

#include "AipStructures.h"
After that you only copy the stuff from the Skirmish_Default.aip that you want to change and change it in the new file.
In your script you need to first load the unmodified Skirmish_Default.aip and after that load your custom aip. The game will now load the vanilla aip and overwrite some values with your custom aip.

Code: Select all

AI_ChangePersonality(2, "Skirmish_Default.aip");
AI_ChangePersonality(2, "Civ_Turkish.aip");
AI_ChangePersonality(2, "Skirmish_Custom.aip");
In my tests this removed the crashing problem when the ai captures a new territory.
That first bit of code needed to start the new AIP file: are you sure that's the exact transcript for it to work? the first 2 lines look like comments.

I am looking to have my own custom AIP file for the scenario I'm working on: mostly, I want default aggressive behaviour, but also want to force the AI to NOT build some buildings and STILL function within the constraints (with tech disabled in the script, but I don't want this to block the AI from working so will say "NOTTECH" for "block?" value in the "BuildListElement baseList[]") and wish to enforce a strict cap on the number of buildings of certain types.
On that note, I don't understand the subtle difference here (in "BuildListElement baseList[]"):
"(min desired count), (max desired count), (max build count)"
OK for min desired count, I suppose max desired can be higher than min desired (is that affected by priority?) but what is the point of max build count?

That's all for now, I'll probably have more questions when I can actually do stuff in near future!
User avatar
Dr.MonaLisa
High Representative
Posts: 8707
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: How to make custom .aip files work

Post by Dr.MonaLisa »

I myself never made a custom AIP file (I actually don't like touching AIs due to first UP1.5 versions trauma caused by them).

I can confirm that NOTTECH allows AI to continue placing the buildings in "queue", without waiting for it to be built. So if you disable buildings by the .ies script (SetTechEnabled FALSE or whatever that function was), then NOTTECH will allow the AI to continue the building queue. If it was set to YES, then AI would freeze / stop, because it would be unable to finish the previous step. You could also use NO for the similar behaviour as NOTTECH, but then they would skip the building even if tech was enabled, but they were missing resources or place in the city. I'm not 100% sure about it, just guessing.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Sat42
Posts: 130
Joined: 03 Dec 2018, 18:01
Has thanked: 6 times
Been thanked: 1 time

Re: How to make custom .aip files work

Post by Sat42 »

Hey Mona,
Thanks for the reply! yes I think your guess is correct, looking at a default "BuildListElement baseList[]" posted in some other Build AI Order thread, it indicates that the Dock is set to "NO" which works to unlock the AI in case there's no sea.
Post Reply

Return to “Questions”