[MODCOMP] Random Cottage Placement

TheLopez

Deity
Joined
Jan 16, 2006
Messages
2,525
Location
Oregon
Random Cottage Placement Mod v0.1BtS
By: TheLopez

Last Updated 08/23/10

Version: v0.1BtS
Patch Compatibility: Beyond the Sword v3.19
MP Compatible: ?
Download Mod v0.1BtS

Description:
Randomly places cottages on the map depending on how the mod has been
configured. If random cottage placement is enabled and default values are used
then cottages have a maximum 1% chance of appearing each turn with that
percentage decaying each turn in the game.


Installation Instructions:

1) Unzip this into the "bts_install_folder\Mods\" folder.
2) Open the CivilizationIV.ini configuration file
3) Change the Mod line to read: Mod = Mods\Random Cottage Placement
4) Load the game.
5) Then play as normal.


-----Game Play-----
Spoiler :

- Workers can no longer build cottages

- Cottages are randomly placed during the game


-----Notes to Modmakers-----

If you want to use the Random Cottage Placement in your mod I have tried to
make things as easy as possible for you. In the XML files modified sections
are enclosed by:
<!-- -->
<!-- Random Cottage Placement Start -->
<!-- -->
and
<!-- -->
<!-- Random Cottage Placement End -->
<!-- -->

In the SDK files I have added // < Random Cottage Placement Start > and
// < Random Cottage Placement End > in all of the places that I have made
changes to the original files.

The python included is only used to tweak the configurable values for the mod.
If this mod is to be included in a mod like BUG, etc. then care should be taken
to make sure that tweaking the configurable options is ported to host mod.

This mod provideds the following methods through the CyGame object for tweaking
the configurable options:
bool isCityCottagePlacementTechRequired();
void setCityCottagePlacementTechRequired(bool bRequired);
int getCityCottagePlacementRequiredTech();
void setCityCottagePlacementRequiredTech(int eTech);
bool isWildCottagePlacement();
void setWildCottagePlacement(bool bEnabled);
bool isCityCottagePlacement();
void setCityCottagePlacement(bool bEnabled);
bool isCityHappinessAffectsCottagePlacement();
void setCityHappinessAffectsCottagePlacement(bool bEnabled);
bool isCityHealthAffectsCottagePlacement();
void setCityHealthAffectsCottagePlacement(bool bEnabled);
bool isCottagePlacementAffectCitySize();
void setCottagePlacementAffectCitySize(bool bEnabled);
int getMinimumCottageHostCitySize();
void setMinimumCottageHostCitySize(int iSize);
int getBaseCottageSpawnChance();
void setBaseCottageSpawnChance(int iChance);

-----Version Information-----

-----v0.1BtS------

- Setup Random Cottage Placement infrastructure

- Removed workers ability to create cottages in the XML

- Added to the SDK the ability to spawn cottages randomly in plots not owned by
any civilizations

- Added to the SDK the ability to spawn cottages randomly in plots owned by
civilizations.

- Added to the SDK infrastructure the following options:
- Enable/Disable tech prereq for city cottage placement. Default set to enabled
- tech prereq for city cottage placement. Default set to TECH_POTTERY
- when this is added
- Enable/Disable random cottage placement in the wild. Default set to enabled
- Enable/Disable random cottage placement in city plots. Default set to enabled
- Enable/Disable city unhappiness affects randow cottage placement. Default set to enabled
- Enable/Disable city unhealthiness affects randow cottage placement. Default set to enabled
- Enable/Disable city cottage placement costs city population. Default set to enabled
- Minimum host city size. Default set to 3
- base cottage spawn chance. Default set to 5, the 5 represents 0.5%

-----To Do-----


-----===Credits & Thanks===-----

- Exavier - Composite Mod - readme.txt format

- Sam Ro - For the idea for the mod
 
Luck. But that's actually a problem. Free Speech and Universal Suffrage are now less useful.

Probably right :/.


:lol: you've really been long gone, right? I thought everyone here knew that.
CE = cottage economy, basing your complete science output on the commerce you get from cottages.
 
Probably right :/.



:lol: you've really been long gone, right? I thought everyone here knew that.
CE = cottage economy, basing your complete science output on the commerce you get from cottages.

Ah... I see. Well it shouldn't be a problem... from the 25-30 games I simulated there was a fairly good distribution in cottages... but then of course thats what configurable values are there for.
 
Uh, any guess how to play a CE with this :crazyeye:?

BTW, there is nothing that says that you couldn't go back into the CvUnitInfos.xml file and re-enable the ability for workers to build cottages... you would just still have the random cottages being built.
 
Cool - thanks Lopez - can't wait to give it a go! :D




(In regards to the above comments about playing a CE, i would probably go back to my original suggestion that if workers can't build cottages, settlers can.

I tried to do this myself by inserting what i thought was the relevant code under the build line of the settler's section in the CvUnitInfos.xml file, but this caused several errors so i just re-enabled the worker's option as suggested above.
If anyone would be willing to tell me how to give settlers this ability, i'd be interested to know.)
 
Hey again nice idea, the placement of cottages is interfered by cities size in anyway, they appear near cities and only appear on clear tiles, and on forest?
I've just though, would it be able to base cottage growth upon a random value, also not needing a city to be working on it?

Sam_Ro i agree with you, settlers should build cottages, since those are small towns. Maybe it's possible that the AI is causing the errors, after all they only use settlers to found cities.
 
Hey again nice idea, the placement of cottages is interfered by cities size in anyway, they appear near cities and only appear on clear tiles, and on forest?
I've just though, would it be able to base cottage growth upon a random value, also not needing a city to be working on it?

Sam_Ro i agree with you, settlers should build cottages, since those are small towns. Maybe it's possible that the AI is causing the errors, after all they only use settlers to found cities.

Thanks - could be. I'd love to get into modding to implement this more fully.
In particular, the extra goodie huts would be sweet. :)
 
Top Bottom