Page 1 of 1

Manual control of Convoys?

Posted: Thu Apr 28, 2016 12:00 pm
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.

Re: Manual control of Convoys?

Posted: Thu Apr 28, 2016 8:13 pm
by DanielHerr
I think you can get this working in main_panel.lua by changing "PreEndTurn".

Re: Manual control of Convoys?

Posted: Thu Apr 28, 2016 8:47 pm
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!!

Re: Manual control of Convoys?

Posted: Thu Apr 28, 2016 9:39 pm
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


Re: Manual control of Convoys?

Posted: Thu Apr 28, 2016 9:56 pm
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