Hmm, sadly I don't seem to be getting anywhere. I guess I keep doing the same mistake over and over which I seem unable to locate/understand. It's getting frustrating.
Here's the latest iteration of my IsOverseasLocation function & test. The last few of attempts with different codes always returned "Not an Overseas Location".
Two things I don't understand in your previous post (which probably account for my repetitive failures):

Here's the latest iteration of my IsOverseasLocation function & test. The last few of attempts with different codes always returned "Not an Overseas Location".
Code:
function IsOverseasLocation(iX, iY, iPlayer)
local pPlot = Map.GetPlot(iX, iY)
if pPlot:IsWater() then
return false
end
for iPlayer = 0, GameDefines.MAX_MAJOR_CIVS-1, 1 do
local pPlayer = Players[iPlayer]
if not (pPlayer:IsAlive()) then
return false
end
local capitalPlot = pPlayer:GetStartingPlot()
if capitalPlot:GetArea() ~= pPlot:GetArea() then
return true
end
end
end
local function InputHandler(uiMsg, wParam, lParam)
-- Quit if not the input is not "left button pressed down"
if uiMsg ~= MouseEvents.LButtonDown then return end
local pPlot = Map.GetPlot(UI.GetMouseOverHex()) -- Clicked plot
local pPlayer = Players[Game.GetActivePlayer()]
if (IsOverseasLocation(pPlot, pPlayer)) == true then
print ("Overseas Location")
return
else
print ("Not an Overseas Location")
end
end
ContextPtr:SetInputHandler(InputHandler);
Two things I don't understand in your previous post (which probably account for my repetitive failures):
Why is that? 'x' doesn't seem to refer to anything above.At point epsilon you can see x (2, the value of v in A). But not u, v and w.
But the function's arguments don't get to be defined in the function, right? Definitely, even though I reread our whole discussion and the short chapter on arguments in the Lua documentation the use of arguments as well as what they refer to remains unclearAlso all of this answer one of you questions: what is passed from one function to the other? The function's arguments are passed. Nothing else.
