Community-patch-dll: Feature Request: Trait Column IgnoresMinPopulation

Created on 26 Feb 2020  路  26Comments  路  Source: LoneGazebo/Community-Patch-DLL

It would be really great to have a Boolean trait for OCC civs that allows them to ignore the minimum population requirements for national wonders.

Feature request

Most helpful comment

i'll just do it as an integer for flexibility.

All 26 comments

I can just have the code ignore that min requirement if the player only has one city. Seems logical. One less memory value.

I would like this code for Phoenicia, and it is technically possible for the civ to have >1 city (Phoenicia gets to keep conquered capitals).

Maybe a national population modifier? ie setting it to -100 would mean the civ ignores minimum pop requirements, but setting it at -50 means it still requires half the normal amount? That could be useful for semi-OCC civs like Venice.

Right now the OCC trigger cuts cost to 1/3 of normal value. What's the UA element for Phonecia? I can just add that to the check.

Just the UA Trait?
it's 'TRAIT_PHOENICIAN_METROPOLIS'
Yeah, 1/3 should definitely be enough

No, the trait column value. i.e. <SettlersAsCS>true</SettlersAsCS>

I haven't made one because the trait runs entirely off lua right now.
Maybe I just add one, maybe called 'ReducedNWRequirement'?

Well the trait has to be seeded in the DLL, otherwise I won't know what it is. You don't have any custom variables in the 'traits' column(s)?

None. The UA works off a lua that checks if the civ is in the game and applies a dummy policy.

ah, ok, so what's the dummy policy? :)

does it have a unique column value I can borrow?

I just need something that is already rooted in the DLL to grab onto

The dummy policy only has CSResourcesCountForMonopolies = 1 and IsDummy = 1.
It basically confers the Statecraft trade Confederacy monopoly bonus at the beginning of the game. I don't think that's what you're looking for though.
I haven't created any unique columns because there hasn't been any need for them up until now. the lua mostly just uses GetCivilizationtype()

hmmm

sounds like a trait value is necessary, then.

Sounds like the easiest thing to do is add a column that confers the OCC NW reduction to a civ if set to 'true'

i'll just do it as an integer for flexibility.

So -100 equals ignore, and -67 is OCC levels, default is 0?
Or would it be 0 is ignore and 33 is OCC, default is 100?

0 = ignore, 25 = 25% of real, 50= 50% of real, etc.

so 0 and 100 would be the same thing.

it'll default to zero

Sounds good. So you could still set 200 if you wanted to give a civ a malus for extra pop requirement that way.

yeah

How about a lua method/hook ForceCanBuild or similar? Currently the hook lua CanBuild allows you to block something which otherwise can be built. Being able to ignore the game's CanBuild check would work for this, be useful for other scenarios, and not take a memory value.

@pineappledan It's actually going to work like this:

int iModifier = GetPlayerTraits()->GetNationalPopReqModifier();

                //If OCC... 1/2 the value
                if (GC.getGame().isOption(GAMEOPTION_ONE_CITY_CHALLENGE))
                    iModifier += 50;

                iNationalPop *= 100;
                iNationalPop /= max(1, iModifier)

So if you want a 66% reduction, you'll need to make it 66.

Trait column is 'NationalPopReqModifier'

Not sure I understand: reducing by x% should be a multiplication by (1-x/100), or (100-x) here since we deal with integers only.
Here when iModifier < 100 we're increasing iNationalPop.

Another possibility is division by 100+iModifier since I believe Civ 5 uses this (odd) definition of "reduce by" in quite a few places?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MRS-OBAMA picture MRS-OBAMA  路  3Comments

UndeadDevel picture UndeadDevel  路  4Comments

dape6509 picture dape6509  路  5Comments

SOEBxxxx picture SOEBxxxx  路  7Comments

UndeadDevel picture UndeadDevel  路  3Comments