DLL - Lua API requests

Setting OpenBorders would be useful. Is that possible to add?

SetOpenBorders ?
 
I'll look into it. Any particular reason?
G

I'm trying to have a modded civ with peace with Barbarians, and I'd like to remove the zone of control. I can set all the Barbarians to have the move through borders promotion, but that doesn't help the zone of control issue.
 
I'm trying to have a modded civ with peace with Barbarians, and I'd like to remove the zone of control. I can set all the Barbarians to have the move through borders promotion, but that doesn't help the zone of control issue.

Why don't you just give them the promotion that allows them to ignore ZOC? I'm pretty sure that promotion exists.
G
 
Why don't you just give them the promotion that allows them to ignore ZOC? I'm pretty sure that promotion exists.
G

That would affect all units, not just barbarians. I want the barbarians within the borders of the civ to not exert a ZOC. Adding it to the civs units would make them ignore it for all other units as well.
 
Any way to push a reformation belief choice, similar to what exists for founding and enhancing? Something like:

Code:
Game.AddReformationBelief(religionID, beliefID)

Yep, that's an easy addition. Does it matter if the event is announced to other players or not?

G
 
It would be nice if it announced it with the Reformation Added notification automatically, but that can be added in manually if need be.

The announcement is built into the dll, so it should work as normal. Was an easy add. The lua will look like this:

Code:
Game.AddReformation(ePlayer, eReligion, eBelief)

G
 
I'm not certain if this is the best place to ask this, but what exactly is up with adding new specialists, and why does it cause the game to have a fit? For instance, in my P&P mod I added a Monk specialist which generated Great Prophet points - this would, however, occasionally bug out, resulting in Great Prophets spawning every turn for X turns. I've since removed that effect, but I'd very much like to see it return (it's mostly a flavour thing). This problem has been reported to me - though rarely - for my Prussia mod, too, which adds a General specialist which generates Great General points. Is there any way for this project to fix this issue?
 
I'm not certain if this is the best place to ask this, but what exactly is up with adding new specialists, and why does it cause the game to have a fit? For instance, in my P&P mod I added a Monk specialist which generated Great Prophet points - this would, however, occasionally bug out, resulting in Great Prophets spawning every turn for X turns. I've since removed that effect, but I'd very much like to see it return (it's mostly a flavour thing). This problem has been reported to me - though rarely - for my Prussia mod, too, which adds a General specialist which generates Great General points. Is there any way for this project to fix this issue?

Did you add the XML for the <GreatPerson> table? Search for that table in the CP and add the appropriate information to make it work. If you don't have that table information, the DLL will never initialize a 'pool' (i.e. 0/100) for great people, so any amount of GPP for that specialist will spawn a GP (because the pool is 0/0, so any amount of points over 0 will trigger it).

G
 
Did you add the XML for the <GreatPerson> table? Search for that table in the CP and add the appropriate information to make it work. If you don't have that table information, the DLL will never initialize a 'pool' (i.e. 0/100) for great people, so any amount of GPP for that specialist will spawn a GP (because the pool is 0/0, so any amount of points over 0 will trigger it).

G

I never realised this table existed (in CP). Lo and behold, that's probably the issue. Thanks. Will add to that table. CP shines once again :p

Another request:

I see that you're added to the trade logic behind how much a resource is worth to an AI - this already elevates the stress of being left with Firaxis' shallow function. But how difficult - or large - a task would it be to hook up resource flavours to this trade logic? So that leaders value resources a bit differently depending upon their flavours. By default all (luxury) resources have the happiness flavour, so there should be no effect by default, but I would wish to give them their own according to other functions I want to give them. Of course, I understand if this is too much of an ask to be implemented. It's something I would certainly undertake myself, but I wouldn't really know how to begin (but if it's a matter of copying laborious code over and over, then I could do that).
 
I never realised this table existed (in CP). Lo and behold, that's probably the issue. Thanks. Will add to that table. CP shines once again :p

Another request:

I see that you're added to the trade logic behind how much a resource is worth to an AI - this already elevates the stress of being left with Firaxis' shallow function. But how difficult - or large - a task would it be to hook up resource flavours to this trade logic? So that leaders value resources a bit differently depending upon their flavours. By default all (luxury) resources have the happiness flavour, so there should be no effect by default, but I would wish to give them their own according to other functions I want to give them. Of course, I understand if this is too much of an ask to be implemented. It's something I would certainly undertake myself, but I wouldn't really know how to begin (but if it's a matter of copying laborious code over and over, then I could do that).

Not too hard at all, actually. I'd just grab the resource flavor as an integer, and multiply it by the leaders equivalent flavor, adding said value to the resource value. Is the resource flavor table already in existence?
G
 
Yes, there is ("Resource_Flavors"); all luxury resources have a happiness flavour (at 10), whilst all bonus resources have a growth flavour (at 10), and strategic resources have MOBILE, PRODUCTION, and OFFENSE. I suppose they're used when the AI evaluates when/what resources to improve/settle near, but that's just a guess. So I'd just be adding various other flavours (e.g. a FLAVOR_WONDER to Marble, so that AI's with a high wonder flavour like Ramesses would pay a little more for marble than for whale) to make the AI a bit wiser in the new system that I'm working on. Pleased to hear that it wouldn't be too much work.
 
Here's what will be in the next CP:

Code:
#if defined(MOD_BALANCE_CORE_RESOURCE_FLAVORS)
			int iResult = 0;
			int iFlavors = 0;
			if(MOD_BALANCE_CORE_RESOURCE_FLAVORS)
			{
				//Let's look at flavors for resources
				for(int i = 0; i < GC.getNumFlavorTypes(); i++)
				{
					int iResourceFlavor = pkResourceInfo->getFlavorValue((FlavorTypes)i);
					int iPersonalityFlavorValue = GetPlayer()->GetFlavorManager()->GetPersonalityIndividualFlavor((FlavorTypes)i);
					//Has to be above average to affect price. Will usually result in a x2-x3 modifier
					iResult += ((iResourceFlavor + iPersonalityFlavorValue) / 5);
					if(iResourceFlavor > 0)
					{
						iFlavors++;
					}
				}
				if((iResult > 0) && (iFlavors > 0))
				{
					//Get the average mulitplier from the number of Flavors being considered.
					iResult = (iResult / iFlavors);
					iItemValue *= iResult;
				}
			}
#endif

This will be added to the DealAI.cpp for Luxury and Strategic Resources.

G
 
Top Bottom