COLONIST_ENGINEERS, SPACECRAFT_FUSION_REACTOR & CARGO_WEAPONRY not using modded Desc

Machiavelli24

Mod creator
Joined
May 9, 2012
Messages
818
There is a consistent issue with COLONIST_ENGINEERS, SPACECRAFT_FUSION_REACTOR & CARGO_WEAPONRY. The UI does not seem to read in the modified text strings and instead uses the base game's description and short description.

Problem_Fusion_Weaponry.png

In the picture you can see Sqlite showing that the Fusion Reactor text and Weaponry text has been changed. But in game they will have the non-modded text. I put a print statement in the UI and it generated this:

Code:
[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 0 ShortDes: TXT_KEY_EOE_COLONIST_SCIENCE_SHORT Des: TXT_KEY_EOE_COLONIST_SCIENCE
[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 1 ShortDes: TXT_KEY_EOE_COLONIST_FOOD_SHORT Des: TXT_KEY_EOE_COLONIST_FOOD
[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 2 ShortDes: TXT_KEY_EOE_COLONIST_ENERGY_SHORT Des: TXT_KEY_EOE_COLONIST_ENERGY
[COLOR="Red"][10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 3 ShortDes: TXT_KEY_COLONIST_ENGINEERS_SHORT Des: TXT_KEY_COLONIST_ENGINEERS[/COLOR]
[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 4 ShortDes: TXT_KEY_EOE_COLONIST_CULTURE_SHORT Des: TXT_KEY_EOE_COLONIST_CULTURE
[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 5 ShortDes: TXT_KEY_EOE_COLONIST_CAPITAL_SHORT Des: TXT_KEY_EOE_COLONIST_CAPITAL
[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 6 ShortDes: TXT_KEY_COLONIST_MERCENARIES_SHORT Des: TXT_KEY_COLONIST_MERCENARIES



[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 0 ShortDes: TXT_KEY_EOE_SPACECRAFT_COAST_SHORT Des: TXT_KEY_EOE_SPACECRAFT_COAST
[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 1 ShortDes: TXT_KEY_EOE_SPACECRAFT_THRUSTERS_SHORT Des: TXT_KEY_EOE_SPACECRAFT_THRUSTERS
[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 2 ShortDes: TXT_KEY_EOE_SPACECRAFT_GEOTHERMAL_SHORT Des: TXT_KEY_EOE_SPACECRAFT_GEOTHERMAL
[COLOR="Red"][10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 3 ShortDes: TXT_KEY_SPACECRAFT_FUSION_REACTOR_SHORT Des: TXT_KEY_SPACECRAFT_FUSION_REACTOR[/COLOR]
[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 4 ShortDes: TXT_KEY_EOE_SPACECRAFT_ALIEN_SHORT Des: TXT_KEY_EOE_SPACECRAFT_ALIEN
[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 5 ShortDes: TXT_KEY_EOE_SPACECRAFT_PETROLEUM_SHORT Des: TXT_KEY_EOE_SPACECRAFT_PETROLEUM
[10487.650] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 6 ShortDes: TXT_KEY_EOE_SPACECRAFT_ARTIFACT_SHORT Des: TXT_KEY_EOE_SPACECRAFT_ARTIFACT




[10487.666] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 0 ShortDes: TXT_KEY_EOE_CARGO_FOOD_SHORT Des: TXT_KEY_EOE_CARGO_FOOD
[10487.666] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 1 ShortDes: TXT_KEY_EOE_CARGO_SCIENCE_SHORT Des: TXT_KEY_EOE_CARGO_SCIENCE
[10487.666] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 2 ShortDes: TXT_KEY_EOE_CARGO_PRODUCTION_SHORT Des: TXT_KEY_EOE_CARGO_PRODUCTION
[COLOR="Red"][10487.666] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 3 ShortDes: TXT_KEY_CARGO_WEAPONRY_SHORT Des: TXT_KEY_CARGO_WEAPONRY[/COLOR]
[10487.666] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 4 ShortDes: TXT_KEY_EOE_CARGO_CAPITAL_SHORT Des: TXT_KEY_EOE_CARGO_CAPITAL
[10487.666] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 5 ShortDes: TXT_KEY_EOE_CARGO_CULTURE_SHORT Des: TXT_KEY_EOE_CARGO_CULTURE
[10487.666] AdvancedSetup: EOE debug repop AdvancedSetup: ID: 6 ShortDes: TXT_KEY_CARGO_ULTRASONIC_EMITTER_SHORT Des: TXT_KEY_CARGO_ULTRASONIC_EMITTER

For some reason Engineers, Reactor and Weaponry aren't grabbing the text that matches the database. Mercenaries and Ultrasonic are untouched which is why they are using the base game strings.

Here is the first part of the function from AdvancedSetup.lua. The added debug statement is in blue:
Code:
["SeededStart"] =	{
	FullSync = function()
		local PullDown = {};

		pullDown = Controls.SelectColonists;
		pullDown:ClearEntries();		
		local controlTable = {};
		pullDown:BuildEntry( "InstanceOne", controlTable );
		controlTable.Button:LocalizeAndSetText( Locale.ConvertTextKey("TXT_KEY_RANDOM") );
		controlTable.Button:SetVoid1( -2 );
		for colonist in GameInfo.Colonists() do
			local available = false;

			--debug stuff
			[COLOR="Blue"]print("EOE debug repop AdvancedSetup: ID: " .. tostring(colonist.ID) .. " ShortDes: " .. tostring(colonist.ShortDescription) .. " Des: " .. tostring(colonist.Description));[/COLOR]

			-- Unlocked through Firaxis Live?
			if (colonist.FiraxisLiveUnlockKey ~= nil) then
				local value = FiraxisLive.GetKeyValue(colonist.FiraxisLiveUnlockKey);
				available = (value ~= 0);
			else
				available = true;
			end

			if ( available ) then
		        local controlTable = {};
		        pullDown:BuildEntry( "InstanceOne", controlTable );
				controlTable.Button:LocalizeAndSetText( colonist.ShortDescription );
				controlTable.Button:SetToolTipString( Locale.ConvertTextKey(colonist.Description) );
				controlTable.Button:SetVoid1( colonist.ID );
			end	
		end		
		pullDown:CalculateInternals();		
		pullDown:RegisterSelectionCallback( function(id)
			PreGame.SetLoadoutColonist(LoadoutUtils.GetPlayerID(), id);	
			PerformPartialSync();
		end);

It is very odd that these 3 things are treated differently. SinglePlayer.lua seems to call out these three choices as the default set for first time users, but the Lua doesn't seem to do anything. But it could mean there is some kind of hard coding in the C++. Has anyone dealt with this issue and know how to resolve it?
 
It's not only text, their icons also don't update properly, and these loadout options will frequently ignore "fake" FiraxisUnlockKeys that you can use to hide other loadout options.

I've tried a lot of stuff to fix that (because it really bothered me when working on my Awesome Loadout Mod), but nothing worked. There's definitely some hard-coding going on behind the scenes.

And while it's possible to hide them from the player via the UI-Files I -think- the logic that assigns random loadout is not available for modding? So that's no solution either, the AI and players who chose random loadout would still end up with those.

It's a mess.
 
I think this issue started when RT came out, because I don't seem to remember seeing this issue when modding loadouts in base BE.

Not even deleting the rows and re entering them solved this issue, so it does feel like its hard-coded somewhere.

It sounds like the best work around would be to give those hard coded loadouts the same effect as another row and then mod the UI to not show them.
 
Back
Top Bottom