Mod-Modders Guide to Fall Further

Keep in mind, that losing the last city, because of the "complete kills" option, doesn't necessarily mean, that the player has lost the game

Hmmm. Point taken - though I've shelved the idea for the time being until I cook up a complete way to do it right, given Jean's note and the fact that I can't even proof of concept it (Couldn't find "capture" anywhere in the Callbacks. Assuming those are stored in PythonCallbackDefines.xml. But I also couldn't find anything related in any of the event managers in Python...)

Anyways, I have a new question for a new problem. I know the two Scion leaders with slightly different trees have their uniques blocked off by LeaderTrait, in the Python code. It even pops up in the Technology Adviser stating it requires you to be the trait, so that's good.

Is there any way to either 1) Have something similar only show up in the Technology Advisor when you meet the requirements or 2) set a unit's requirements in Python so the unit doesn't appear in the Tech Adviser at all.

A little background, so maybe this makes more sense - I want a leader to have a custom set of disciples like the Dural have with Students of *** (only not students.) Anyways, as this is a multi-civ leader ala Decius the only thing I can really do is lock the units away behind a Leader Trait. (Locking the existing units away is easy, and I have no problem with.)

Problem is, doing it this way the unit comes up in everyone's tech adviser (though saying you don't meet the requirements) and I think it might clutter the adviser up too much to have a copy of this for each religion. Hence why I'd even rather them show up for nobody than the leader they attach to (I was wondering if I could assign them to NEVER in the XML but make a python code that gives the leader the ability to build them at the right tech and with the right trait.)

Of course, if there was a way to assign Unique Units to leaders as opposed to civs, that'd be spiffy - but I'm pretty sure there's not or the Scions would be using it...
 
There was a request for new XML tags some time ago. These are the ones I've just added to the internal version:

  • iMinNumCitiesConquered: minimum number of razed or conquered enemy cities by this player
  • iMinNumVassals: minimum number of vassalized civs, including colonies
  • bFullCiv: name valid for non-minor civilizations
  • bMinorCiv: valid for minor civilizations
  • bSovereign: valid for non-vassalized civilizations
  • bVassal: valid for vassalized civilizations, inlucluding colonies
  • bColony: valid for colonies
  • bFemaleLeader: valid for female leaders only
  • PrereqLeader: valid for a certain leader only
Removed XML Tags: bNoVassal, bNoMinor

I'm open for suggestions to put them to good use. For now I've added "<civname> Colony" for colonies and "<civname> Horde" for evil players running despotism and having at least conquered or razed one city.
 
I have recently imported some more of the custom promotion fields and must say they make modder's life much easier. Thanks!

However, I run into two problems.
First, does iCollateralLimitCap and related fields really work? I tried them (both in FF and imported to Orbi) and they do not seem to change anything.

Second, iExtraSupport always display as positive, even if the amount is negative. It works fine, only display is broken (again, both in FF and Orbi).

Am I right or it is just some stupid mistake I make... ?

By the way, a small question. The ability to build foreign palaces in tolerant/conqueror owned cities is really broken IMHO. A lot of special features of civs are linked to them, so building one in fact transforms a civ to some kind of hybrid. Any idea how to block it? I tried to and think the fix probably is short and simple, but my programming skills are far from sufficient.
Also, one more complicated question. Is there any way to make sprawling trait increase city radius as normal, but making settlements normal cities limited to one-tile radius?
 
I haven't written iCollateralLimitCap yet. That a a couple other fields are from when I was just learning how to mod the DLL and I was slowly working my way up from Boolean->INT->String->Array->NestedArray. There were a TON of INT fields to import from UnitInfos to PromotionInfos, and about in the middle of them I wound up needing a couple of Strings and Arrays. Turns out that by that point my learning curve was VERY advanced and I just kinda took off. Haven't made it back to finishing those fields, but since I always did the .h work in advance of the .cpp work they exist, and do nothing (but they are available to python, so I suppose they COULD do something...)


ExtraSupport I made a note to fix for myself, and again.. it got burried because nothing really uses the field. Will have to check that one out again sometime...


But yes, you did proper on the import, my code just contains a few dropped projects still :) And I agree that many of the fields make modding cakewalk :)


To block building foreign palaces, you just have to intercept the ::canConstruct(eBuilding) function with a check like:

if kBuildingInfo.isGovernmentCenter() && getCivilizationType != GET_PLAYER(getOwner()).getCivilizationType
return false;

You can get slightly more complex and make it allow you to build your palace in captured cities INSTEAD of the other person's palace, but that would require me actually opening the code, and then I would get sucked in and try fixing bugs all weekend (got to work on a project instead though).


The settlement modification would be quite simple. I have modified how the radius is applied to city/settlement so that the Worldbuilder control would work a bit smoother, so the main important areas are marked for you (for controlling workable radius). For making the settlements function like a normal city (can build things) you just have to search for isSettlement() across the whole project and you'll see that it shows up at the start of numerous fairly self-explanatory functions (ie - CvCity::getMaintenance(), or CvCity::canConstruct...). Clip the check and return out of those functions you want to re-enable for settlements and you are done (presumably... But if you imported my worldbuilder modification then it is REAL easy to check and be certain)



EDIT:

The fields which are written and don't do anything yet in PromotionInfos are:

iCollateralLimitCap
iCollateralLimitBoost
iCollateralTargetsLimit
iCollateralExtraTargets
iHammerSacrifice
iExtraHammerPerPop
iFoodSacrifice
iPopulationAdd
iBeakerSacrifice
iExtraBeakerPerPop
iGoldSacrifice
iExtraGoldPerPop
iCultureSacrifice
iExtraCulturePerPop
iChanceDieInCombat
iXPTranserRate


Well, the last 2 might not be written yet, but I am pretty sure all the Great Person Mission tags and the Collaterals are written. Till I get around to them (Collateral might happen sometime soonish, the GP ones aren't too likely, though I guess if you just lost the promotion instead of being KILLED then they would be nicer fields which were likely to get used.... Hrm, could be great rewards from lairs actually.... hrm... DAMNIT! This is why I am refusing to open the code BTW. Too many ideas....).

Anyway, till those are written they are just nice bonus fields for someone to utilize in python for their own nefarious purposes.
 
You can get slightly more complex and make it allow you to build your palace in captured cities INSTEAD of the other person's palace, but that would require me actually opening the code
That would be ian ideal solution :)
I tried the code you posted but could not make it work (not with limited abilities I have). I will then patiently wait till you have time to look into it - that is, if you do not mind...
The settlement modification would be quite simple. I have modified how the radius is applied to city/settlement so that the Worldbuilder control would work a bit smoother, so the main important areas are marked for you (for controlling workable radius).
Well, the problem is the last source I have comes from the main download (26/01/2009), while the last patch dll is from 08/02/2009. I guess it might be added in that gap (as I could not find any wourldbuilder/workable radius marks), but I am confused where to get an up-to date source. Patches do not seem to contain it (tried d to g)...
For making the settlements function like a normal city (can build things) you just have to search for isSettlement() across the whole project and you'll see that it shows up at the start of numerous fairly self-explanatory functions (ie - CvCity::getMaintenance(), or CvCity::canConstruct...). Clip the check and return out of those functions you want to re-enable for settlements and you are done
Thanks - works great. I was able to make settlements to work as I want them to. Well, I was not able to make wonders not to show in city building menu, but they are still unbuildable so it is just my inner perfectionist speaking ;)

Edit: Ok, now I know what you meant. I managed to limit settlements to radius 1 :)
 
Hrm, the DLL should show up in your Fall Further directory (Mods\Fall Further 050\dll). But the changes for worldbuilder happen in python mostly. Loading up my copy of our official release it claims to have Patch G installed and the button does show up in worldbuilder (select the EDIT CITY mode, choose a city and there is a checkbox just under the city name edit bar)

Wonders aren't buildable, but still show up? That means you placed the block for them inside of an "if (!bVisible)" check. So when it is checking if it should show the button it says yes, but whenever checking to allow you to build it, it says no.


Anyway, next weekend post about the palaces again. Will be spring break for the college, so I'll have half the week off (and spring break for the gradeschool the next week, so I'll have the short half of THAT off...). I finish all my big tests/projects during this week, so I should be pretty free over the two spring breaks.
 
Hrm, the DLL should show up in your Fall Further directory (Mods\Fall Further 050\dll).
It does, but it seems that source came with the main download and was not updated by patches (and the dll itself was). I tried to unpack patches to other directory and no dll directory was even created (other were fine).
Wonders aren't buildable, but still show up? That means you placed the block for them inside of an "if (!bVisible)" check.
That I did. It was the only thing I tried that did not cause crash when viewing settlements.
By the way, It seems that I placed setPlotRadius(1); in wrong place. It still has 2 plot radius, unless the settlement was build after the city limit was reached... I will keep trying, but if anyone can give me a pointer to a section I should put the code (and tell me if above is all I should insert...), that would save me a lot of trouble. SDK changes are still really painfull...

Edit: I forgot to edit the popup result as well... Now it seems to work.
Anyway, next weekend post about the palaces again. Will be spring break for the college, so I'll have half the week off
Thanks :) I will.
 
Ah, I'll talk to Vehem about making sure that the DLL file is updated each patch. I'll pack up the last source I have and make it available, should still run fine with the current XML.

Ah, that's explains a few things.
 
Is it possible to remove features via Python, rather than simply change it to a different type? Tried pPlot.setFeatureType(gc.getInfoTypeForString(),0), but it does nothing... Trying to make it so scorching a plains forest tile has a chance to reduce the forest to scrub. That much works, but I can't remove the forest if it fails the check, so I still have desert forests....
 
Ha. I THOUGHT I had tried that, actually, but it turns out I had only made the edit in my mod folder, not in the actual installation... Never made it in game for me to test. :goodjob:

Edit: Doesn't seem to work with features. Thought I had something horribly wrong, so I finally just reduced my code to
Code:
	if pPlot.getTerrainType() == gc.getInfoTypeForString('TERRAIN_DESERT'):	
		pPlot.setFeatureType(-1)
Still doesn't remove the forest. Exact same code applied to improvements works just fine.
 
Ha. I THOUGHT I had tried that, actually, but it turns out I had only made the edit in my mod folder, not in the actual installation... Never made it in game for me to test. :goodjob:

Edit: Doesn't seem to work with features. Thought I had something horribly wrong, so I finally just reduced my code to
Code:
	if pPlot.getTerrainType() == gc.getInfoTypeForString('TERRAIN_DESERT'):	
		pPlot.setFeatureType(-1)
Still doesn't remove the forest. Exact same code applied to improvements works just fine.

setFeatureType has 2 arguments - the first is the feature, the second is the "variety" (so for trees, that'd be temperate, snowy etc).

Code:
pPlot.setFeatureType(-1, -1)

...should remove the feature for the plot.

EDIT:
Code:
pPlot.setFeatureType(gc.getInfoTypeForString(),0)

That one was almost right, but getInfoTypeForString requires 1 argument, so it'd need to be getInfoTypeForString("") [which is an empty string as an argument]. As Magister said though, no need to do it that way as all it will return is -1. Also not sure what it would make of specifying "variety 0" for a NO_FEATURE - but I suspect that would be ok.
 
Back
Top Bottom