Thanks you two. I've been piecing together the LUA code to try and run the thing. I've got something basic working as a firetuner button, although I havent yet built it into the mod. Would there happen to be any documentation or tutorials on the g_UnitPlopper stuff? So far I've just been piecing it together from the Firetuner buttons.
Now when I actually put it in the mod, would I run it through SerialEventStartGame or something else? I'm worried that putting the commands in there would make the planes spawn whenever a save game was loaded.
Would either of you be up for looking at what I have? I'm not so worried about making it elegant, but I don't want to introduce new issues with the code.
--Find out Who is playing Japan and US
local pPlayer = Players[0];
local JapanNumber = nil;
local PacificNumber = nil;
local description = nil;
description = pPlayer:GetCivilizationShortDescription();
if description == ("Combined Fleet") then JapanNumber= 0 end
if description == ("Pacific Fleet") then PacificNumber= 0 end
local pPlayer = Players[1];
description = pPlayer:GetCivilizationShortDescription();
if description == ("Combined Fleet") then JapanNumber= 1 end
if description == ("Pacific Fleet") then PacificNumber= 1 end
local pPlayer = Players[2];
description = pPlayer:GetCivilizationShortDescription();
if description == ("Combined Fleet") then JapanNumber= 2 end
if description == ("Pacific Fleet") then PacificNumber= 2 end
local pPlayer = Players[3];
description = pPlayer:GetCivilizationShortDescription();
if description == ("Combined Fleet") then JapanNumber= 3 end
if description == ("Pacific Fleet") then PacificNumber= 3 end
local pPlayer = Players[4];
description = pPlayer:GetCivilizationShortDescription();
if description == ("Combined Fleet") then JapanNumber= 4 end
if description == ("Pacific Fleet") then PacificNumber= 4 end
local pPlayer = Players[5];
description = pPlayer:GetCivilizationShortDescription();
if description == ("Combined Fleet") then JapanNumber= 5 end
if description == ("Pacific Fleet") then PacificNumber= 5 end
print ("Japan is Player")
print (JapanNumber)
print ("Pacific is Player")
print (PacificNumber)
local iX = 0;
local iY = 0;
local PlaneUnitType = 0;
local newPlot = nil;
g_PlopperSettings.Player = JapanNumber;
--First Aircraft Carrier
iX = 73;
iY = 51;
PlaneUnitType=131;
newPlot = Map.GetPlot(iX, iY);
g_UnitPlopper.UnitType = PlaneUnitType;
g_UnitPlopper.Plop( newPlot );
iX = 73;
iY = 51;
PlaneUnitType=122;
newPlot = Map.GetPlot(iX, iY);
g_UnitPlopper.UnitType = PlaneUnitType;
g_UnitPlopper.Plop( newPlot );
iX = 73;
iY = 51;
PlaneUnitType=122;
newPlot = Map.GetPlot(iX, iY);
g_UnitPlopper.UnitType = PlaneUnitType;
g_UnitPlopper.Plop( newPlot );