unit naming

Winged Hussar

Warlord
Joined
Feb 18, 2002
Messages
112
Location
Chicago, IL
Hi all,

What do I need to change in order to have the ability to name my units right from the start instead of on the 2nd promotion?
 
It's not directly exposed to an XML field anywhere I can find. It is controlled in the UI by this chunk of code in the unit-panel lua-file
Code:
elseif (actionHash == UnitCommandTypes.NAME_UNIT) then
	local bCanStart = UnitManager.CanStartCommand( pUnit, UnitCommandTypes.NAME_UNIT, true) and GameCapabilities.HasCapability("CAPABILITY_RENAME");
	if (bCanStart) then			
		local toolTipString = Locale.Lookup(commandRow.Description);
		AddActionToTable( actionsTable, commandRow, isDisabled, toolTipString, actionHash, OnNameUnit );
	end
"CAPABILITY_RENAME" is merely defined in the GameCapabilities.xml but no useful settings are included there related to when things can be renamed. Rename as a GameCapability seems to be treated as a boolean as to whether you can ever rename anything such as a city or a unit in the game.

"UNITCOMMAND_NAME_UNIT" in <UnitCommands> isn't useful really either as it has no values to set that would effect when a unit can be renamed.

From what I've looked at so far it appears you would have to re-write the UnitPanel.lua file since there doesn't seem to be anything related to the unit's level as a setting anywhere in the xml that controls when a unit can be renamed.
 
Back
Top Bottom