City States Mod

kragen2179

Chieftain
Joined
Oct 30, 2008
Messages
31
OK - Mod uploaded to Mod Browser - search for "City State Challenge"... NOW VERSION 3


15th June 2011 - Update Version 3
==========================
Version 3 Uploaded to Mod Browser...

AI no longer builds Settlers for other Civs,
Giant Death Robot (hopefully) removed from game.
Updated Collective Rule Policy text to inform players that the policy is currently disabled and a new policy benefit will follow shortly (am thinking of granting courthouses to annexed cities - but maybe just one or two)
Included (with permission) BINARYGOD's "Tall Empires" .SQL script which modifies AI Civ flavors to make them more aggresive.


10th June 2011 - Update Version 2
==========================
On version 2 already, however there is slight issue. - I don't seem to have stopped the AI from building Settlers :( any ideas?

Thanks go to takkyon, magzhi, and especially whoward69 for your help and interest. (and Kael for his Mod Guide)


9th June 2011 - Original Post
======================
Hi - Am completely new to modding, although I do have a VERY basic knoweledge of programming in VB, and am prepared to learn :P

What I want to do is make it so that no country can expand via settlers. All expansion to be done via culture or war, basically turning every civilisation into a city state.

Questions.

Is this possible? My first thought is to disable Settlers - easy enough to delete them from units.xml but suspect that will crash the game as you require a settler to found the civ. And what other xmls to edit to clear up any broken links?

Otherwise is it possible just to be able to remove the unit from the build queue without deleting it from the game?

Finally - do I build it with the mod buddy, and just put in the xml files im changing, or can I go ahead and directly edit the game xml files (faving backed them up first :P)
 
Isn't there an advanced option available by default called like 'one city challenge' or something that does exactly what you're talking about?

EDIT: Actually, it only affects the human players.
 
Giving a settler a negative cost will mean that no player (human or AI) can build/buy a settler, however there are other situations you will need to take into account

1) The higher starting Eras give you more than one settler unit at the start of the game (pretty sure that's StartingUnitMultiplier in CIV5Eras.xml)

2) There is a social policy (top left one in the Liberty tree - can't remember what it's called) that gives you a free settler (that's IncludesOneShotFreeUnits and the corresponding row in Policy_FreeUnitClasses in CIV5Policies.xml)

3) At lower difficulty settings one of the Goody Huts gives a settler (that's in Civ5GoodyHuts.xml)

There may be others

When you've done all of that you may find that the AI player just sits there doing nothing in some cases, as there is an AI strategy that attempts to produce settlers, so it may get very confused. Then you're off into the realms of AI flavours and strategies to fix that!
 
thanks whoward I didn't think it would be as easy as one .xml file lol. However right now I just need to concentrate on removing the unit from the build queue before I go onto the other parts.

to which I am having an issue.

So I have created my mod project in modbuddy and created an XML/Units/NoSettler.xml object with the following code...

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/10/2011 8:07:59 AM -->
<GameData>
	
	<Units>
		<Row>
			<ID>0</ID>
			<Class>UNITCLASS_SETTLER</Class>
			<Type>UNIT_SETTLER</Type>
			<cost>-1</cost>
			<Moves>2</Moves>
			<Capture>UNITCLASS_WORKER</Capture>
			<CivilianAttackPriority>CIVILIAN_ATTACK_PRIORITY_HIGH_EARLY_GAME_ONLY</CivilianAttackPriority>
			<Domain>DOMAIN_LAND</Domain>
			<DefaultUnitAI>UNITAI_SETTLE</DefaultUnitAI>
			<Description>TXT_KEY_UNIT_SETTLER</Description>
			<Civilopedia>TXT_KEY_CIV5_ANTIQUITY_SETTLER_TEXT</Civilopedia>
			<Strategy>TXT_KEY_UNIT_SETTLER_STRATEGY</Strategy>
			<Help>TXT_KEY_UNIT_HELP_SETTLER</Help>
			<Requirements>TXT_KEY_NO_ACTION_SETTLER_SIZE_LIMIT_HARDCODED</Requirements>
			<Food>true</Food>
			<Found>true</Found>
			<CombatLimit>0</CombatLimit>
			<UnitArtInfo>ART_DEF_UNIT__SETTLER</UnitArtInfo>
			<UnitArtInfoCulturalVariation>true</UnitArtInfoCulturalVariation>
			<PortraitIndex>0</PortraitIndex>
			<IconAtlas>UNIT_ATLAS_1</IconAtlas>
		</Row>
	</Units>
	
</GameData>

basically copied from the main CIV5Units.xml, but I had to add
Code:
<cost>-1</cost>
as it did not exist.

Also under [Actions] I have added [OnModActivated] [UpdateDatabase] [XML\Units\NoSettler.xml]

I have also checked the [Reload Unit System] option.

With all that done, I built the mod and ran Civ V.

on the main menu I selected Mods > Accept > Bowse Mods > ticked [City State Mod] > Back > Single Player > Setup Game > Play

But as the Settler is still in the build queue, and as soon as my pop hit 2 I am able to build the unit.

Any ideas where I'm going wrong?
 
You need to update the existing database record, not create a new one, so

Code:
<GameData>
  <Units>
    <Update>
      <Where Type="UNIT_SETTLER"/>
      <Set Cost="-1"/>
    </Update>
  </Units>
</GameData>

If you check the database.log file it will no doubt contain an error message about a duplicate ID/Type, so it would have thrown your changes away and just used the standard Settler.

Also note that XML is case sensitive, so "Cost", not "cost"
 
you sir are a scholar and a gentleman - worked perfectly in a duel game - ironicly the random countries were America and Arabia lol

just need to edit the goody huts and policies now.

Thank you
 
okies gonna play with this now :)
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/10/2011 8:07:59 AM -->
<GameData>
	<GoodyHuts>
		<Update>
			<Delete Type="GOODY_SETTLER"/>
		</Update>
	</GoodyHuts>
	<Units>
		<Update>
			<Where Type="UNIT_SETTLER"/>
			<Set Cost="-1"/>
		</Update>
	</Units>
	<Policies>
		<Update>
			<Where Type="POLICY_COLLECTIVE_RULE"/>
			<Set IncludesOneShotFreeUnits="false"/>
		</Update>
	</Policies>	
</GameData>
 
okies gonna play with this now :)
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/10/2011 8:07:59 AM -->
<GameData>
	<GoodyHuts>
		<Update>
			<Delete Type="GOODY_SETTLER"/>
		</Update>
	</GoodyHuts>
	<Units>
		<Update>
			<Where Type="UNIT_SETTLER"/>
			<Set Cost="-1"/>
		</Update>
	</Units>
	<Policies>
		<Update>
			<Where Type="POLICY_COLLECTIVE_RULE"/>
			<Set IncludesOneShotFreeUnits="false"/>
		</Update>
	</Policies>	
</GameData>

Not quite ;)

A delete is a delete not an update, so

Code:
<GameData>
	<GoodyHuts>
		<Delete Type="GOODY_SETTLER"/>
	</GoodyHuts>
</GameData>

Except that will break the game on lower difficulties settings, as there are a references to GOODY_SETTLER which will no longer be valid. You need to delete the references to the goody type, not the goody type itself. Check out my "Goody Huts - No Maps" mod for an example of how to do it.

And you'll also need to delete the free unit type associated with the policy, not just set it to false (which you probably won't be able to get working, as it seems to expect the value of 0 not false - see http://forums.2kgames.com/showthread.php?107336-Changing-boolean-to-false-XML-gotcha )

Good luck!

W
 
Sorry to be a pain, can you please link me to your no maps mod - I can't seem to find it on here, and as posted elsewhere on this site I have an issue where running Civ V disables my internet so I cannot download from the mod hub :(
 
Sorted - used my phone as a portable wifi hotspot and that connected to mod hub, so issue lies with my router rejecting mod hub.
 
okies using your no maps mod, have adjusted the code accordingly :) thanks for the help
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/10/2011 8:07:59 AM -->
<GameData>
	<HandicapInfo_Goodies>
		<Delete GoodyType="GOODY_SETTLER"/>
	</HandicapInfo_Goodies>
	<Policies>
		<Update>
			<Where Type="POLICY_COLLECTIVE_RULE"/>
			<Set IncludesOneShotFreeUnits="false"/>
		</Update>
	</Policies>
	<Units>
		<Update>
			<Where Type="UNIT_SETTLER"/>
			<Set Cost="-1"/>
		</Update>
	</Units>
</GameData>
 
You still need to delete the actual "gift of unit" from the policy

Code:
<GameData>
	<Policy_FreeUnitClasses>
		<Delete UnitClassType="UNITCLASS_SETTLER"/>
	</Policy_FreeUnitClasses>
</GameData>
 
ok think I got it working - at last :)

Settler removed from build queue - CHECK
Settler Removed from Goody Hut - Seems to be the case - 16 Huts, no Settlers, and no Crashes.
Free Settler removed from Policy - CHECK!

yoour second suggestion of code was causing the game to crash, as was using "false" in the boolean. however, switching to using "0" in the boolean, and ignoring the latter code suggestion, results in no crash (Good start :) ) and when selecting "Collective Rule" Policy NO SETTLER SPAWNED

many many thanks
 
On version 2 already, however there is slight issue. - I don't seem to have stopped the AI from building Settlers :( any ideas?

Almost certainly related to my previous comment about flavours and strategy

"When you've done all of that you may find that the AI player just sits there doing nothing in some cases, as there is an AI strategy that attempts to produce settlers, so it may get very confused. Then you're off into the realms of AI flavours and strategies to fix that!"

Which is not a place I've venture in depth, so hopefully someone else can help you out.
 
Back
Top Bottom