Manual control of Convoys?

A forum to discuss custom scenarios, campaigns and modding in general.

Moderators: Slitherine Core, The Lordz

Post Reply
kirk23
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 155
Joined: Wed Jul 18, 2012 1:23 pm

Manual control of Convoys?

Post by kirk23 »

Hi guys in the mod I'm working on, you can control Convoys manually, that is not the problem. The problem is I can't seem to get the pop up message to appear, telling you that you have UNMOVED CONVOYS? All the other pop up messages appear for ,UNMOVED TRANSPORTS and UNMOVED COUNTRIES.
DanielHerr
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 117
Joined: Sun Jan 11, 2015 7:51 pm
Contact:

Re: Manual control of Convoys?

Post by DanielHerr »

I think you can get this working in main_panel.lua by changing "PreEndTurn".
danielherr.github.io
kirk23
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 155
Joined: Wed Jul 18, 2012 1:23 pm

Re: Manual control of Convoys?

Post by kirk23 »

Hi thanks for reply, I believe you are right, only problem is I'm now trying to get the script right, as it appears something is a miss. Trial and error will solve it I think, thanks for telling me where to find the solution cheers!!
DanielHerr
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 117
Joined: Sun Jan 11, 2015 7:51 pm
Contact:

Re: Manual control of Convoys?

Post by DanielHerr »

I inserted two lines after "if check == "research"":

Code: Select all

    ui.convoyPanel:Show()
  elseif check == "convoys" then
Here is the corrected code:

Code: Select all


function PreEndTurn(check)

  function TransportWarning()
    if settings.transportWarning == 1 then
      ui.transportPanel:Show()
      return true
    end
    PreEndTurn("transports")
  end

  function UnmovedFactionWarning()
    if settings.nomovesWarning == 1 then
      ui.factionPanel:Show()
      return true
    end
    PreEndTurn("unmovedfaction")
  end

  function NoResearch()
    if settings.researchWarning == 1 then
      local techCategories = {"ground", "artillery", "air", "naval", "armour"}
      local techId
      for faction in playerAlliance.factions do
        for i=1, # techCategories do
          techId = faction.luaData.currentTech
          if techId == -1 and faction.luaData.labs[techCategories[i]] > 0 then
            function YesFunc() PreEndTurn("research") end
            PopupDialog("research_warning", YesFunc)
            ui.mainPanel:SwitchTab(ui.mainPanel.researchTab)
            hud:GetPanel("research_panel"):Hide()
            return true
          end
        end
      end
    end
    PreEndTurn("research")
  end

  if check == "research" then
    ui.convoyPanel:Show()
  elseif check == "convoys" then
    EndTurnProcess()
  elseif check == "transports" then
    NoResearch()
  elseif check == "unmovedfaction" then
    TransportWarning()
  else
    UnmovedFactionWarning()
  end

end

danielherr.github.io
kirk23
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 155
Joined: Wed Jul 18, 2012 1:23 pm

Re: Manual control of Convoys?

Post by kirk23 »

Thank you that worked a treat first time, very much appreciated. Now I can spend some more time trying to improve the AI? :D
Post Reply

Return to “Commander the Great War : Mods & Scenario Design”