I'm working on a mod that replaces a lot of melee units with their campaign variants. However, the AI refuses to build any unit that got replaced by said variant (e.g. Marines replaced by War Pigs, Zealots by Sentinels.), only building unchanged units like Adepts, Hellions, among others. My guess is that it happens because the AI is trying to build units with specific IDs, yet can't find them. Is there any way I can make it build the Campaign variants instead? I'd like to try and change the build orders, but the SC2 Editor doesn't even allow me to do that.
RequirementsAI.galaxy (under TriggerLibs) is what you want. You can then define or replace the units in the stock files as necessary. You'll need to extract these from the various archives and then add them to your dependency.
The editor is not terribly useful for AI stuff outside of the attack wave triggers, which don't really expose a lot of the functionality of the melee (such as defense).
Thaaaank you! I found it! I can change the IDs now! Though... Do I need to add the RequirementsAI file anywhere, or can I just import it into my mod?
EDIT: It's now giving me a script error when I create the custom script in my mod's library. Most likely the default RequirementsAI is trying to run after my mod's, but since the variables are already declared, it returns an error. How do I fix this? I added a screenshot of the error.
EDIT 2: After some messing around with the components folder, I've managed to make it work! The AI has managed to make Sentinels and Instigators perfectly! Thank you so much for your help, IskatuMesk!
EDIT 3: For those that might find this thread in the future, to make the galaxy file work, you have to save your mod as Components Files, and in the Base.SC2Data folder, you need to create a TriggerLibs folder, and copy the RequirementsAI.galaxy file into it. That'll override the default RequirementsAI.