Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 11:41 am
All times are UTC + 0
Country-specific base defense...
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [15 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
freedom fighter
General


Joined: 14 May 2009

PostPosted: Tue Jul 25, 2017 3:10 pm    Post subject:  Country-specific base defense...
Subject description: ...except everyone else wants it too
Reply with quote  Mark this post and the followings unread

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! #Mad

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!

Back to top
View user's profile Send private message
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Tue Jul 25, 2017 4:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.

_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Tue Jul 25, 2017 6:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

I use house specific defenses....

Don't mind me no nothing though, I'm a n00bcake.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
4StarGeneral
General


Joined: 14 Sep 2006
Location: Limbo

PostPosted: Tue Jul 25, 2017 11:37 pm    Post subject: Reply with quote  Mark this post and the followings unread

G-E wrote:
I use house specific defenses....

Don't mind me no nothing though, I'm a n00bcake.


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."

Back to top
View user's profile Send private message Send e-mail YouTube User URL
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Wed Jul 26, 2017 8:34 am    Post subject: Reply with quote  Mark this post and the followings unread

The key is the owner tags.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
Atomic_Noodles
Defense Minister


Joined: 05 Oct 2011

PostPosted: Wed Jul 26, 2017 10:03 am    Post subject: Reply with quote  Mark this post and the followings unread

Have you tried just making it like:

Code:

Owner=Russians
RequiredHouses=Russians
ForbiddenHouses=[EveryOtherCountry...]


This is how i've set up the Unique Buildings for me and it seems to work out.

_________________
~ Excelsior ~

Back to top
View user's profile Send private message Visit poster's website
PePsiCola
Cyborg Specialist


Joined: 28 Dec 2010
Location: The United States

PostPosted: Wed Jul 26, 2017 1:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

^^^ 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.

freedom fighter wrote:
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,YuriCountry
RequiredHouses=Russians
ForbiddenHouses=British,French,Germans,Americans,Alliance,Confederation,Africans,Arabs,YuriCountry


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.

Basically, changing to the following will work.
Code:
Owner=Russians
ForbiddenHouses=British,French,Germans,Americans,Alliance,Confederation,Africans,Arabs,YuriCountry

_________________
Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Wed Jul 26, 2017 2:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.

Back to top
View user's profile Send private message
Josh Is 25% Larger
Vehicle Drone


Joined: 17 Apr 2013

PostPosted: Wed Jul 26, 2017 2:20 pm    Post subject: Reply with quote  Mark this post and the followings unread


Back to top
View user's profile Send private message
freedom fighter
General


Joined: 14 May 2009

PostPosted: Wed Jul 26, 2017 5:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

@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 Smile

_________________
The future belongs to The Forgotten!

Back to top
View user's profile Send private message
PePsiCola
Cyborg Specialist


Joined: 28 Dec 2010
Location: The United States

PostPosted: Wed Jul 26, 2017 7:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

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

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Wed Jul 26, 2017 8:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

PePsiCola wrote:
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.

Back to top
View user's profile Send private message
Agent Z
AA Infantry


Joined: 05 Sep 2013
Location: LocationNotFoundException at RealLife.Location.find() at line: -1

PostPosted: Thu Jul 27, 2017 12:03 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.)

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Thu Jul 27, 2017 7:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

All these words are irrelevant, all it takes is Owner= changes.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
PePsiCola
Cyborg Specialist


Joined: 28 Dec 2010
Location: The United States

PostPosted: Sat Jul 29, 2017 7:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

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

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [15 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
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


Powered by phpBB © phpBB Group

[ Time: 0.1536s ][ Queries: 11 (0.0096s) ][ Debug on ]