dbergan
Warlord
Does anyone know how I could go about allowing Missionaries to join an escort formation with, say, a Galley? I haven't been able to find anything in the database that controls how "yes settlers can create an escort formation with boats" but "no a missionary cannot". Both units have the FormationClassType "FORMATION_CLASS_CIVILIAN" yet they aren't treated the same when it comes to Escort Formations. What gives?
As far as I can tell, the relevant lua code is near line 387 of Base\Assets\UI\Panels\UnitPanel.lua:
Can anyone help me understand what's going on?
Kind regards,
DB
As far as I can tell, the relevant lua code is near line 387 of Base\Assets\UI\Panels\UnitPanel.lua:
Code:
if (actionHash == UnitCommandTypes.ENTER_FORMATION) then
--Check if there are any units in the same tile that this unit can create a formation with
--Call CanStartCommand asking for results
local bCanStart, tResults = UnitManager.CanStartCommand( pUnit, actionHash, nil, true);
if (bCanStart and tResults) then
if (tResults[UnitCommandResults.UNITS] ~= nil and #tResults[UnitCommandResults.UNITS] ~= 0) then
local tUnits = tResults[UnitCommandResults.UNITS];
for i, unit in ipairs(tUnits) do
local pUnitInstance = Players[unit.player]:GetUnits():FindID(unit.id);
if (pUnitInstance ~= nil) then
local toolTipString :string = Locale.Lookup(commandRow.Description, GameInfo.Units[pUnitInstance:GetUnitType()].Name);
local callback :ifunction = function() OnUnitActionClicked_EnterFormation(pUnitInstance) end
AddActionToTable( actionsTable, commandRow, isDisabled, toolTipString, actionHash, callback );
end
end
end
end
elseif (actionHash == UnitCommandTypes.PROMOTE) then
Can anyone help me understand what's going on?
Kind regards,
DB