Posted: Tue Jul 25, 2017 3:10 pm Post subject:
Country-specific base defense...
Subject description: ...except everyone else wants it too
This type of shit is why sometimes I lack the motivation to work on my mod. Simple straightforward problems take me several rounds to finally get it. I believe this is normal but damn is it annoying. Its also been a while since I worked on this mod so I'm kinda rusty right now.
Anyways onto the problem at hand: initially I wanted to give a country a unique aa defense that replaces the default one. So I just gave it like so:
Code:
SovietBaseDefenses=NALASR,TESLA,NAFLAK,RASAM,NAATGN,NATOWER ;if i don't put it here, ai will never build it
[NAFLAK] ;standard aa
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,YuriCountry
ForbiddenHouses=Russians
[RASAM] ;unique aa
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,YuriCountry
RequiredHouses=Russians
ForbiddenHouses=British,French,Germans,Americans,Alliance,Confederation,Africans,Arabs,YuriCountry
But the other countries were still able to build [RASAM] regardless. Then I decided to upgrade it into a unique higher tier aa defense instead so the ForbiddenHouses=Russians tag no longer applies. They still fucking build the unique aa!
At this point, I assume that all defenses included in SovietBaseDefenses= (along with it's Allied/Yuri counterpart tags) are used regardless of country ownership. The only solution so far is to only put Russians in both [RASAM]'s Owners= and RequiredHouses= tags but this means no other country can get it in anyway, even with FactoryOwners.HaveAllPlans=yes. This was similar to an earlier issue I had with starting units but that got resolved ever since Ares 0.D allowed you to set country specific starting units. And from I read, AI ignores FactoryOwners= and FactoryOwners.Forbidden= on buildings so thats also a no-no. _________________ The future belongs to The Forgotten!
I'd suggest making each country it's own side. With Ares it isn't that hard & will only take a day or two of coding. Once done it opens up a lot more options to customize each country however you want. _________________
I mean, you're a n00bcake for not explaining how you do that.
I think you're making it overly complicated. Can you not just include AIBuildThis=yes on the defense and remove it from the BaseDefenses list like the Grand Cannon is? Heck, in all practicality you could just copy from the Grand Cannon. _________________ "Don't beg for things; Do it yourself or you'll never get anything." QUICK_EDIT
^^^ I was just about to say the same. Although even RequiredHouses isn't necessary so long as the particular country(ies) are under Owner and everyone else is under ForbiddenHouses.
Your problem here is that the other Soviet countries are still listed under Owner. For non-base defenses, this is fine as long as you have RequiredHouses. But for non-base defenses, you have to follow the above format, because for whatever reason, the AI of any country listed under Owner will build a defense if it's listed under faction defenses (SovietBaseDefenses in this case), regardless of RequiredHouses or ForbiddenHouses.
Remove from SovietBaseDefenses or equivalent. It won't be taken into
account in SovietBaseDefenseCounts, can reduce the numbers.
Code:
SovietBaseDefenses=NALASR,TESLA,NAATGN,NATOWER
[NAFLAK]
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,YuriCountry
ForbiddenHouses=Russians
IsBaseDefense=yes ; AI will consider this as base defense for targeting
AIBuildThis=yes ; Tells the AI to build
AIBuildCounts=5,5,3 ; Number of buildings needed (Ares)
AIExtraCounts=2,2,0 ; Additional random count (Ares)
[RASAM]
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,YuriCountry
RequiredHouses=Russians
IsBaseDefense=yes ; AI will consider this as base defense for targeting
AIBuildThis=yes ; Tells the AI to build
AIBuildCounts=5,5,3 ; Number of buildings needed (Ares)
AIExtraCounts=2,2,0 ; Additional random count (Ares)
Keep all houses in Owner, it is easier when doing changes. Human players
can build anything if prereqs are met, Forbidden/Required houses permit
and any one house from that side is listed, even if that particular house is
left out in Owner. But AI can't build it if not listed in Owner.
Using one of ForbiddenHouses or RequiredHouses is sufficient.
If countries are distinct enough, can make them as different sides too,
AIMD will bulge as it would need triggers for every side. QUICK_EDIT
@4StarGeneral: AIBuildThis= only causes it to build once. Not much of a problem for uber defenses like the Grand Cannon but it kinda defeats the purpose on regular defenses.
@Atomic_Noodles, PePsiCola and Josh Is 25% Larger: I've already tried that if you read my post. I also pointed out a limitation to using that method (i.e cannot be gained via FactoryOwners.HaveAllPlans=).
@E1 Elite: Well, thats new. Should've read the docs about that >_>. Anyways it works now. Still gotta do some tests to double confirm it. Thanks pal _________________ The future belongs to The Forgotten!
Aah, I see now. The method is probably the best you can get without Ares, but I hadn't considered enough what Ares allows us to do now regarding AI prerequisites. That's really cool, actually.
@E1 Elite: I use AIBuildCounts and AIExtraCounts effectively for non-defense structures, but I'm wondering that by removing defense structures from FactionNameBaseDefenses and FactionNameBaseDefenseCounts, are the AntiInfantryValue, AntiArmorValue, and AntiAirValue rendered obsolete? _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
but I'm wondering that by removing defense structures from FactionNameBaseDefenses and FactionNameBaseDefenseCounts, are the AntiInfantryValue, AntiArmorValue, and AntiAirValue rendered obsolete?
Yes, when using AIBuildCounts, counts would be fixed for a single building type. QUICK_EDIT
Joined: 05 Sep 2013 Location: LocationNotFoundException at RealLife.Location.find() at line: -1
Posted: Thu Jul 27, 2017 12:03 pm Post subject:
Setting FactoryOwners=(The country) and Owner=(Only the country) on the exclusive defence, and adding FactoryOwners.Forbidden=(The country) and removing (The country) from the Owner= of the normal defence works fine for limiting the defence for both players and AI as far as I can see. (In addition to adding the defence in the base defence list and having the correct AIBasePlanningSide of course.) QUICK_EDIT
I can't say I doubt that, honestly. After all, TS only ever had owner. But there were also only two factions, and I'm sure RA2's expansions to the prerequisite system were likely to accommodate for the addition of sub-factions/countries. _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 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