Posted: Fri Jul 03, 2026 2:01 pm Post subject:
Help with AI Trigger [SOLVED]
Subject description: Change UseMinDefenseRule= to no for testing.
I was able to make AI Triggers to work on a map before back in 2023 but I don't understand why I could make it work anymore
Things that I did:
- Set the Basic->Ignore global ai Triggers to yes.
- Created an AI Trigger Type to create a Rhino Tank if the player has 0 or more credits.
- Have the weights set to 1500, 1300, 1500.
- Also have that AI Trigger Type enabled.
- Have a trigger with the action 3 Production Begins, 74 AI triggers begin, and 38 Make Enemy.
- Gave both Russia and America(Me) credits in House.
I think this is all that I need to do to make the AI work correct?
Changing Basic->Ignore global ai Triggers to no does make the AI create units but I need the AI to be using the local ones only.
Below I provide a map that could just be put in the directory to test immediately.
It can be played in the Allied first mission for YR. This is down to the things I did,
narrowing it down to just those.
Please help. I had been practicing on another mod since I wanted to actually push forward.
Working on my personal mod made me realize I was more hesitant to do anything since I'm afraid it wouldn't be what I wanted. So I started practicing on a different mod.
Even adding new stuff(tilesets, as in completed tileset and other stuff for practice) I couldn't make in my personal mod because I'm thinking too much on what should be added.
Just need to make the AI actually use the local AI Triggers and that should be enough.
ICFRA Practice 2.png
Description:
Completed tilesets with new ore and gem + fence, and other miscellaneous stuff
Filesize:
365.42 KB
Viewed:
350 Time(s)
ICFRA Practice.png
Description:
Actually use WAE now. I found out what was causing the slowdown
Tried your map and your map has the Basic->Ignore Global AI Trigger set to no,
which would've use the Global ones with the Local ones. Check image below.
Setting it to yes makes the AI not build anything at all. I had made a map before that I could still use,
that had the Ignore Global AI Trigger set to yes and it works. Problem is that I couldn't recreate it anymore.
I wanted the AI to use the Local AI Triggers only. Like I had done on my map before.
The map I provided had Ignore Global AI Trigger set to yes. But if it was changed, then yes it would work,
but with Global AI Triggers as well.
PS. It does actually build something, which is the 2 Conscripts. Which is weird because
I thought it worked because it had IsBaseDefense checked but no. Another things that's
weird is that if I change it to the 2 HTNK Taskforce it doesn't work anymore. What does it mean?
Does your map work with Ignore Global AI Trigger set to yes? Like it only creates the Local AI Triggers?
UPDATE: Nevermind, IT DOES WORK! In ICFRA. Hold on I'll update if the I can recreate it in my map.
UPDATE 2: Tried to recreate your map but it still doesn't work. I don't understand what I'm missing.
Your map works great! But when I set mine it doesn't work. Please check the map file below.
Retry the steps you do when you try to make the AI Triggers to see which step I am missing or done incorrectly
I've retried this multiple times. Copied the code from your map. Opening it in a VSCode
and remaking the teamtypes exactly.
The only thing I was able to accomplish is making the first Teamtypes come out,
when I copy only the TeamTypes, Scripts, Taskforces, AITriggerTypes, and AITriggerTypesEnable
from your map.
I got it to work flawlessly and exactly how I thought the AI Triggers work in Project Phantom.
I don't know what is wrong. If it is the Map Editor (Tried both WAE and FA2) or just my files.
Because in both ICFRA and my main mod, I couldn't get it to work.
Something else is wrong but I don't know what is. Because like I said in my previous post,
your map works! Opening it and copying every bit seem to make the exact same map,
which work exactly the same and creates ALL of the teamtypes.
Is it my ini files? Can't be. Because ICFRA isn't my mod and I didn't touch any of the code aside from adding Phobos codes in it.
Is it the map editor? Possibly, this I haven't test out yet. But I did open your map in WAE try saving from it and it still works fine.
Is it Phobos? Probably not because your map works fine and I had it when I first tested your map.
But at least Project Phantom immediately confirms that what I was doing was correct.
Which is a sigh of relief. I thought the army needs to be bigger or the base should be bigger.
But even with 2 building on mine and a Cloudpatch Helicopter, the AI still build the 2 Oppressor Tanks,
and that was the only TeamType in the AITriggers.
I think this is already beyond asking for help with AI Triggers, because I was able to make it work,
even if it was on Project Phantom.
Something else is wrong. The AITriggers that I did was correct.
Thanks for the map E1 Elite . It at least motivated me to try to really make the AI Triggers to work. QUICK_EDIT
Checklist:
- AI house should have credits.
- AI house should have factories.
- Make enemy trigger action 38.
- AI production 3 and AI Trigge begins 74 trigger actions.
- Teantype with proper Owner. Can use BaseDefense=yes for test.
- AI Trigger with correct side and condition. Can use 5000 weights for testing.
Other parameters for teamtype or AI trigger can be checked at ModEnc. Enabling/disabling global AI triggers is your choice. QUICK_EDIT
WHAT THE HECK! IT WORKS NOW! But only if there is IsBaseDefense checked!
I was actually getting ready, expecting it still won't work but the IsBaseDefense
made it actually work!
That was why I had the screenshot ready to show because again, I've retried this multiple
times already and the only time it worked was with Project Phantom.
I even tried it on another mod, RA20XX, my mod, and a fresh copy of the game. Still nothing.
Check this video without IsBaseDefense Units
And this with one:
Unfortunately, the only teams that were create was the one I cloned. I know it's only the clone one
because there are no grenadier team or yak attacks. Still it finally used the AITriggers!
I thought IsBaseDefense doesn't do anything or at least that's what I heard.
Regardless, is this the only way to make it work? The version that I was going to stick
with was the "Action 4 Create Team" Triggers as you can see from the list in the triggers.
The units right now can be created with either Create Team or IsBaseDefense.
Is there still anything missing to make it work like yours? Because your teamtypes actually
works with and without IsBaseDefense.
IT WORKS NOW! But only if there is IsBaseDefense checked!
If UseMinDefenseRule= is set to yes in the rules ini (the default setting) then the AI will only build IsBaseDefense= teams until it meets the amount set by MinimumAIDefensiveTeams=, only after that will the AI then build normal offensive teams. _________________
And I had a longer post about confusing results but I retried again and again to really test
if I could make it similar to the Project Phantom, and this was it. And it was exactly the same.
Undeniably.
So if testing on the vanilla game, have a TeamType with IsBaseDefense, or just set UseMinDefenseRule=
to no.
Finally, this is solved. If it weren't for E1 Elite's BaseDefense=yes (which is technically is IsBaseDefense,
since BaseDefense=yes is in AITrigger, which doesn't do anything. But I confused it for the TeamType one ),
I wouldn't have had the default vanilla setting to work. And for you Mig, for noticing that.
Still weird though. I rechecked E1 Elite's map, and it doesn't have a team with IsBaseDefense.
But it was still able to create units to attack. Doesn't matter, at least it works the way I thought
it should be set up.
Thanks for not giving up and making it work for me! It's nice to see the Grenadier Paradrop
and Yak Attack working without Create Team. QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum