Posted: Tue Mar 19, 2019 7:51 pm Post subject:
AI avoiding Ares' Prerequisite.Negative tag
Subject description: RA2 AI destroying my dreams since ever
For context, I added a second Tech Lab for Yuri, called YABIOS. This building is meant to be built to give access to toxins-based arsenal and disable the original Tech Lab (YATECH). When the vanilla tech lab is built it gives access to paychic-based arsenal and disables YABIOS.
Spoiler (click here to read it):
[YATECH]
...
Prerequisite.Negative=YABIOS
...
[YABIOS]
...
Prerequisite.Negative=YATECH
This logic works just fine with a HUMAN player, but not with a AI player.
I mean, the AI build both Tech Labs and get access to both arsenals, unbalancing gameplay and f*cking with TeamTypes
Is there a way to "Fix" this? It is quite clear that the AI is simply avoiding "Prerequisite.Negative" tag, and I was unable to fix this issue, wich is frustrating
Help _________________ I'll throw bananas at your general direction. QUICK_EDIT
I assume he wants it to be random, so the AI sometimes builds the regular one, and sometimes builds the bio one, but not both. kind of a "Branching Tech Tree" setup. _________________ MIdAS - Turning wages into beer since 2002 QUICK_EDIT
I assume he wants it to be random, so the AI sometimes builds the regular one, and sometimes builds the bio one, but not both. kind of a "Branching Tech Tree" setup.
You're right. In my head, doing what I did would make it random, but I dunno, I'm kinda confused _________________ I'll throw bananas at your general direction. QUICK_EDIT
AI ignores Prerequisite= but if your triggers are based owning the building, then it's always possible that early game it will choose differently, which can boost the weighting of it, and continue preferencing it later. Likewise if one of them is detroyed, only the other trigger will fire. _________________ http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai QUICK_EDIT
Try AIBuildCounts=0,0,0 and AIExtraCounts=1,1,1
iirc AI seems to respect prerequisite for buildings otherwise it would just build tech lab before war factory.
AI Triggers are another independent thing I guess you need to rewrite them. _________________ QUICK_EDIT
Make an AI general that builds it and one that doesn't. AI will respect Country restrictions (AKA it won't build snipers as Americans) _________________ QUICK_EDIT
Make an AI general that builds it and one that doesn't. AI will respect Country restrictions (AKA it won't build snipers as Americans)
Yeah, but that takes the randomness out of it, I had a similar idea, give Yuri a branching tech-tree, one at RADAR one at Battle Lab, so it's 4 sides in 1, so you're not sure what to expect as a player, it's also a fun thing to do as a player. _________________ MIdAS - Turning wages into beer since 2002 QUICK_EDIT
when it builds everything also you don't know what to expect :V one of them must come first anyways...
in any case, if the AI truly ignores prerrequisites (eg can actually build kirovs without tech lab, which you don't see but may be AI scripting), it woudn't do any good if it builds it or not (except maybe for superweapons) _________________ QUICK_EDIT
AI ignores Prerequisite= but if your triggers are based owning the building, then it's always possible that early game it will choose differently, which can boost the weighting of it, and continue preferencing it later. Likewise if one of them is detroyed, only the other trigger will fire.
Wait, are you telling me I can create triggers for the AI to build structures? I thought that this was somehow "hardcoded"? I never actually meddled too far on this AI scripting sorcery, so [thinkingemoji]
cxtian39 wrote:
Try AIBuildCounts=0,0,0 and AIExtraCounts=1,1,1
how dos this work exactly? I have to add both tags on both structures?
Mig Eater wrote:
It's not possible to make the AI randomly chose between the two. The best option is to make the AI only build one of them.
I figured this out and did it, added a whole new Yuri house just to solve this issue. I'm satisfied with the results, but I feel that this is not what I wanted.
Edit: sorry for the late reply, been busy with school, yay. _________________ I'll throw bananas at your general direction. QUICK_EDIT
Wait, are you telling me I can create triggers for the AI to build structures?
No, he is saying you can make the triggers fire when the AI owns a specific structure. Then depending on which of the two buildings the AI builds first it might decided to use the triggers associated with that structure more then the other. _________________
No, he is saying you can make the triggers fire when the AI owns a specific structure. Then depending on which of the two buildings the AI builds first it might decided to use the triggers associated with that structure more then the other.
This is exactly what I did. Added a set (let's call it SET A) of triggers to YATECH wich is made of specific units you get only when you build YATECH, and the same with YABIOS (SET B). My problem here is the AI simply ignoring Prerequisite.Negative= , building both Labs and then attacking with both sets of units, thus causing balancing and building problems. _________________ I'll throw bananas at your general direction. QUICK_EDIT
Is it possible to give AI a fake building, which fires a self-targeting-auto-fire UnitDelivery SW deliverying the real tech center? AI do respect SW.NegBuildings=, and this can be set to the other tech center so that AI will never be able to have both, as the SW deliverying it is not available with the other one at presence.
The only problem here is that wether AI will keep rebuilding the fake one it lost and doesn't build anything new, as it doesn't own one yet. QUICK_EDIT
Is it possible to give AI a fake building, which fires a self-targeting-auto-fire UnitDelivery SW deliverying the real tech center? AI do respect SW.NegBuildings=, and this can be set to the other tech center so that AI will never be able to have both, as the SW deliverying it is not available with the other one at presence.
The only problem here is that wether AI will keep rebuilding the fake one it lost and doesn't build anything new, as it doesn't own one yet.
You can set the "Spawned" building to have Negative buildings for the "fake building too, so that might work. _________________ MIdAS - Turning wages into beer since 2002 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