Auto Workers No Overwrite Fix (V.1)

Mwellrett

Chieftain
Joined
Oct 5, 2010
Messages
8
This tiny mod fixes the habit for your workers to destroy your precious improvements by spamming trading posts.

This enforces the PLAYEROPTION_SAFE_AUTOMATION from

{Game Directory}\Assets\Gameplay\XML\GameInfo\CIV5PlayerOptions.xml

This was supposed to be triggered by the AutoWorkersDontReplace = 1 game setting in your user settings, but it never worked for me.

I do have this on the in-game browser as well.
 

Attachments

Oh thanks for this! I like being able to automate in the very late game, and this always bugged me. I had no idea it could be fixed with a simple XML edit, that's a great discovery for this annoying problem! Downloaded it. :)

By the way, you might try this method:

PHP:
<GameData>
	<PlayerOptions>
		<Update>
			<Where Type="PLAYEROPTION_SAFE_AUTOMATION" />
			<Set Default="true" />
		</Update>
	</PlayerOptions>
</GameData>

instead of:

PHP:
<GameData>
	<PlayerOptions>
		<Row>
			<Type>PLAYEROPTION_SAFE_AUTOMATION</Type>
			<Description>TXT_KEY_PLAYER_OPTION_WORKERS_LEAVE_OLD_IMPS</Description>
			<Help>TXT_KEY_PLAYER_OPTION_WORKERS_LEAVE_OLD_IMPS_HELP</Help>
			<Default>true</Default>
		</Row>
	</PlayerOptions>
</GameData>

The first method is usually for updating existing data, and the second is for adding something new that did not previously exist. You might have already tried the first, and the second might work for what you're doing, though I don't know if there might be unpredictable side-effects from the second one.
 
Hi..it sounds good but, this is only configurable by changing the code, so it s not operate "in-game" by pressing a button or something like that.

i m wrong ?
 
Spoiler :
Oh thanks for this! I like being able to automate in the very late game, and this always bugged me. I had no idea it could be fixed with a simple XML edit, that's a great discovery for this annoying problem! Downloaded it. :)

By the way, you might try this method:

PHP:
<GameData>
	<PlayerOptions>
		<Update>
			<Where Type="PLAYEROPTION_SAFE_AUTOMATION" />
			<Set Default="true" />
		</Update>
	</PlayerOptions>
</GameData>

instead of:

PHP:
<GameData>
	<PlayerOptions>
		<Row>
			<Type>PLAYEROPTION_SAFE_AUTOMATION</Type>
			<Description>TXT_KEY_PLAYER_OPTION_WORKERS_LEAVE_OLD_IMPS</Description>
			<Help>TXT_KEY_PLAYER_OPTION_WORKERS_LEAVE_OLD_IMPS_HELP</Help>
			<Default>true</Default>
		</Row>
	</PlayerOptions>
</GameData>

The first method is usually for updating existing data, and the second is for adding something new that did not previously exist. You might have already tried the first, and the second might work for what you're doing, though I don't know if there might be unpredictable side-effects from the second one.

Yeah, to be honest, I'm a little slow with this stuff, i gave up working with sql and xml a while ago, now i just wait tables, and the second method there worked for me. I had tried to adapt the <update> function from another mod, but I failed ha ha.

Anyway, I'll swap out that code and credit you when i have a moment. thanks!
 
can you please make a version of this to leave forests (esp for Iroquois) I have been trying forever, but could not figure it out.
 
Back
Top Bottom