Guadalcanal Scenario

Assuming there's another "end" at the bottom of the CreateRogueSubs function that you snipped out when you copied to the forum that should work.

Yes, it should look better now.
 
Spoiler :
Code:
-- RandomFleetSpawn
-- Author: nokmirt
-- DateCreated: 5/15/2015 5:47:00 PM
--------------------------------------------------------------

function CreateNagumosCarrierFleet(pPlayer)
	--these are the data positions for the "NorthEastEntry"
	--if the random getting chooses "NorthEastEntry" these are not reset because there is no need to
		local ShokakuX = 61
		local ShokakuY = 43
		local KuroshioX = 64
		local KuroshioY = 45
		local OyashioX = 58
		local OyashioY = 42
		local ZuikakuX = 61
		local ZuikakuY = 43
		local RyujoX = 62
		local RyujoY = 41
		local KageroX = 63
		local KageroY = 40
		local KamakazeX = 61
		local KamakazeY = 42
		local MikumaX = 62
		local MikumaY = 44
		local ToneX = 61
		local ToneY = 44
		local MutsuX = 55
		local MutsuY = 42
		local HieiX = 57
		local HieiY = 42
		local KirishimaX = 59
		local KirishimaY = 42
		local KawakazeX = 59
		local KawakazeY = 40
	-------------------------------------------------------------------------------------------------------------
	--following specifies the four possible entry points and then chooses one of them
	-------------------------------------------------------------------------------------------------------------
	NagumosRandomEntryDesignations = { "NorthEastEntry", "EastEntry", "SouthCentralEntry", "NorthWestEntry" }
	local sFleetEntry = NagumosRandomEntryDesignations[math.random(#NagumosRandomEntryDesignations)]
	-------------------------------------------------------------------------------------------------------------
	--following groups of lines update the positional X,Y info based on the selection of the Fleet Entry Point
	-------------------------------------------------------------------------------------------------------------
	if sFleetEntry == "EastEntry" then
		ShokakuX = 74
		ShokakuY = 25
		KuroshioX = 72
		KuroshioY = 26
		OyashioX = 73
		OyashioY = 21
		ZuikakuX = 75
		ZuikakuY = 25
		RyujoX = 70
		RyujoY = 28
		KageroX = 73
		KageroY = 25
		KamakazeX = 69
		KamakazeY = 29
		MikumaX = 75
		MikumaY = 26
		ToneX = 75
		ToneY = 24
		MutsuX = 74
		MutsuY = 19
		HieiX = 75
		HieiY = 20
		KirishimaX = 75
		KirishimaY = 21
		KawakazeX = 72
		KawakazeY = 21
	elseif sFleetEntry == "SouthCentralEntry" then
		ShokakuX = 41
		ShokakuY = 15
		KuroshioX = 42
		KuroshioY = 20
		OyashioX = 42
		OyashioY = 16
		ZuikakuX = 42
		ZuikakuY = 15
		RyujoX = 42
		RyujoY = 13
		KageroX = 42
		KageroY = 14
		KamakazeX = 42
		KamakazeY = 12
		MikumaX = 39
		MikumaY = 14
		ToneX = 46
		ToneY = 14
		MutsuX = 36
		MutsuY = 12
		HieiX = 36
		HieiY = 13
		KirishimaX = 37
		KirishimaY = 14
		KawakazeX = 38
		KawakazeY = 16
	elseif sFleetEntry == "NorthWestEntry" then
		ShokakuX = 18
		ShokakuY = 45
		KuroshioX = 20
		KuroshioY = 45
		OyashioX = 17
		OyashioY = 45
		ZuikakuX = 19
		ZuikakuY = 45
		RyujoX = 13
		RyujoY = 47
		KageroX = 14
		KageroY = 47
		KamakazeX = 25
		KamakazeY = 41
		MikumaX = 24
		MikumaY = 42
		ToneX = 24
		ToneY = 40
		MutsuX = 21
		MutsuY = 41
		HieiX = 9
		HieiY = 47
		KirishimaX = 6
		KirishimaY = 49
		KawakazeX = 7	--needs to be edited
		KawakazeY = 49	--needs to be edited
	end
	--------------------------------------------------------------------------------------------------------------------------
	--Spawn the fleet based on the positions loaded
	--------------------------------------------------------------------------------------------------------------------------

	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], OyashioX, OyashioY, 0, 0, "Oyashio", "NO_PROMOTION")
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], KuroshioX, KuroshioY, 0, 0, "Kuroshio", "NO_PROMOTION")
	PromotionList = { "PROMOTION_FLIGHT_DECK_1", "PROMOTION_FLIGHT_DECK_2", "PROMOTION_FLIGHT_DECK_3" }
	--spawn Shokaku with three flight deck promotions
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CARRIER"], ShokakuX, ShokakuY, 0, 0, "Shokaku", PromotionList)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], ShokakuX, ShokakuY, 0, 0)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], ShokakuX, ShokakuY, 0, 0)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], ShokakuX, ShokakuY, 0, 0)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], ShokakuX, ShokakuY, 0, 0)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], ShokakuX, ShokakuY, 0, 0)
	pUnit = pPlayer:InitUnit(GameInfoTypes["UNIT_GREAT_ADMIRAL"], ShokakuX, ShokakuY)
	pUnit:SetName("ADM Nagumo")
	--spawn Zuikaku with three flight deck promotions
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CARRIER"], ZuikakuX, ZuikakuY, 0, 0, "Zuikaku", PromotionList)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], ZuikakuX, ZuikakuY, 0, 0)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], ZuikakuX, ZuikakuY, 0, 0)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], ZuikakuX, ZuikakuY, 0, 0)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], ZuikakuX, ZuikakuY, 0, 0)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], ZuikakuX, ZuikakuY, 0, 0)
	--spawn Ryujo
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CARRIER"], RyujoX, RyujoY, 0, 0, "Ryujo", "NO_PROMOTION")
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], RyujoX, RyujoY, 0, 0)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], RyujoX, RyujoY, 0, 0)
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], KageroX, KageroY, 0, 0, "Kagero", "NO_PROMOTION")
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], KamakazeX, KamakazeY, 0, 0, "Kamakaze", "NO_PROMOTION")
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], MikumaX, MikumaY, 0, 0, "Mikuma", "NO_PROMOTION")
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], ToneX, ToneY, 0, 0, "Tone", "NO_PROMOTION")
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BATTLESHIP"], MutsuX, MutsuY, 0, 0, "Mutsu", "NO_PROMOTION")
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BATTLESHIP"], HieiX, HieiY, 0, 0, "Hiei", "NO_PROMOTION")
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BATTLESHIP"], KirishimaX, KirishimaY, 0, 0, "Kirishima", "NO_PROMOTION")
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], KawakazeX, KawakazeY, 0, 0, "Kawakaze", "NO_PROMOTION")
	print("Admiral Nagumos Fleet has Arrived")
end

--this is the sub-function that actually creates Rogue Subs
function CreateRogueSubs(pPlayer)

                --these are the data positions for the "ZoneOne"
	        --if the random getting chooses "ZoneOne" these are not reset because there is no need to
		local I19X = 76
		local I19Y = 25
		local I15X = 76
		local I15Y = 23
        -------------------------------------------------------------------------------------------------------------
	--following specifies the three possible entry points and then chooses one of them
	-------------------------------------------------------------------------------------------------------------
	RogueSubsRandomEntryDesignations = { "ZoneOne", "ZoneTwo", "ZoneThree" }
	local sSubsEntry = RogueSubsRandomEntryDesignations[math.random(#RogueSubsRandomEntryDesignations)]
	-------------------------------------------------------------------------------------------------------------
	--following groups of lines update the positional X,Y info based on the selection of the Subs Entry Point
	-------------------------------------------------------------------------------------------------------------
        if sSubsEntry == "ZoneTwo" then
		        I19X = 72
		        I19Y = 2
		        I15X = 70
		        I15Y = 2
        elseif sSubsEntry == "ZoneThree" then
		        I19X = 63
		        I19Y = 49
		        I15X = 61
                                    I15Y = 49
        end
        --------------------------------------------------------------------------------------------------------------------------
	--Spawn the Subs based on the positions loaded
	--------------------------------------------------------------------------------------------------------------------------

	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_SUBMARINE"], I19X, I19Y, 0, 0, "I-19", "PROMOTION_WOLFPACK_1")
	SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_SUBMARINE"], I15X, I15Y, 0, 0, "I-15", "PROMOTION_WOLFPACK_1")
        print("Rogue Subs have Arrived")
end

TokyoExpressUnits.lua

Spoiler :
Code:
-- TokyoExpressUnits
-- Author: LeeS
-- DateCreated: 5/11/2015 7:44:55 AM
--------------------------------------------------------------

include("UnitSpawnHandler.lua")

include("RandomFleetSpawn.lua")

function TokyoExpress(iPlayer)
	local pPlayer = Players[iPlayer]
	if not pPlayer:IsAlive() then return end
	---------------------------------------------------------------------------------------------------------
	--CODE FOR JAPAN
	---------------------------------------------------------------------------------------------------------
	if pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_JAPAN"] then
		if Game.GetGameTurn() == 2 then
		   SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 61, 19, 0, 0, "5th Batt/Yokosuka Reg", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 61, 18, 0, 0, "2nd Batt/28th Reg", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 62, 18, 0, 0, "2nd FA/28th Reg", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 59, 17, 0, 0, "32nd MG Batt", "NO_PROMOTION")
       
                 elseif Game.GetGameTurn() == 3 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], 46, 20, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], 46, 20, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BOMBER"], 46, 20, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BOMBER"], 46, 20, 0, 0)

			print("Tokyo Express Units Added")


		--creates Nagumos Carrier Fleet
		elseif Game.GetGameTurn() == 4 then
			CreateNagumosCarrierFleet(pPlayer)





		elseif Game.GetGameTurn() == 5 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], 52, 19, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], 52, 19, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BOMBER"], 52, 19, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BOMBER"], 52, 19, 0, 0)
			print("Tokyo Express Units Added")

		elseif Game.GetGameTurn() == 6 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], 49, 17, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BOMBER"], 49, 17, 0, 0)
			print("Tokyo Express Units Added")

		elseif Game.GetGameTurn() == 7 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 60, 18, 0, 0, "2nd Batt/124th Reg", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 58, 17, 0, 0, "1st Batt/124th Reg", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 57, 17, 0, 0, "3rd Batt/124th Reg", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 59, 17, 0, 0, "42nd MG Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], 54, 15, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], 54, 15, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BOMBER"], 54, 15, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BOMBER"], 54, 15, 0, 0)
			print("Tokyo Express Units Added")

		elseif Game.GetGameTurn() == 8 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 56, 18, 0, 0, "Kuma Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 55, 18, 0, 0, "Oka Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 56, 17, 0, 0, "71st SW Batt", "NO_PROMOTION")

			print("Tokyo Express Units Added")


			--creates Rogue Subs
		elseif Game.GetGameTurn() == 9 then
			CreateRogueSubs(pPlayer)

		elseif Game.GetGameTurn() == 11 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 48, 22, 0, 0, "1st Batt/4th", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 47, 21, 0, 0, "2nd Batt/4th", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 48, 22, 0, 0, "1st Batt/29th", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 53, 12, 0, 0, "2nd Batt/29th", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 52, 12, 0, 0, "1st Batt/16th", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 51, 12, 0, 0, "2nd Batt/16th", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 47, 23, 0, 0, "1st Batt/2nd FA", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], 46, 20, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], 46, 20, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BOMBER"], 46, 20, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_BOMBER"], 46, 20, 0, 0)
			print("Tokyo Express Units Added")

		elseif Game.GetGameTurn() == 13 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ANTI_TANK_GUN"], 48, 16, 0, 0, "11th Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ANTI_AIRCRAFT_GUN"], 47, 22, 0, 0, "17th Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_TANK"], 46, 21, 0, 0, "5th Comp", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 46, 19, 0, 0, "2nd Batt/2nd FA", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ANTI_AIRCRAFT_GUN"], 53, 10, 0, 0, "18th Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 52, 10, 0, 0, "12 Mt Gun", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 51, 10, 0, 0, "13th Mt Gun", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 49, 24, 0, 0, "15th HW", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_JAPANESE_ZERO"], 49, 17, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], 49, 17, 0, 0)
			print("Tokyo Express Units Added")
		end
	end
	---------------------------------------------------------------------------------------------------------
	--CODE FOR AMERICA
	---------------------------------------------------------------------------------------------------------
	if pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_AMERICA"] then
		if Game.GetGameTurn() == 7 then
			--here is where we would create the units

			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 60, 20, 0, 0, "1st Batt/7th Reg", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 61, 21, 0, 0, "2nd Batt/7th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 62, 20, 0, 0, "3rd Batt/7th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 63, 20, 0, 0, "1st Batt/11th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 59, 20, 0, 0, "4th Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 61, 22, 0, 0, "12 Batt", "NO_PROMOTION")

			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], 60, 21, 0, 0, "USS Salt Lake City", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], 61, 21, 0, 0, "USS Helena", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], 62, 22, 0, 0, "USS Cole", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], 62, 23, 0, 0, "USS Clark", "NO_PROMOTION")

			--spawn USS Hornet with three flight deck promotions
			PromotionList = { "PROMOTION_FLIGHT_DECK_1", "PROMOTION_FLIGHT_DECK_2", "PROMOTION_FLIGHT_DECK_3" }
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CARRIER"], 70, 24, 0, 0, "USS Hornet", PromotionList)

			--spawn some fighters and bombers on the same plot as USS Hornet
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)

			print("American Units Added")

		elseif Game.GetGameTurn() == 15 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 61, 21, 0, 0, "3rd Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 62, 20, 0, 0, "7th Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 63, 20, 0, 0, "8th Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 60, 20, 0, 0, "4th SW", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 64, 20, 0, 0, "61st Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ANTI_AIRCRAFT_GUN"], 64, 20, 0, 0, "43rd Batt", "NO_PROMOTION")
			print("American Units Added")
		end
	end
end
GameEvents.PlayerDoTurn.Add(TokyoExpress)


print("Tokyo Express Units Loaded")
 
Map for you.
 
This is the code that would make a center-screen "scroll-up" message appear for a human player only that says We have detected enemy units near the city of Washington if the city near where this was detected was Washington. It would also make the same message print-out in the lua.log
Code:
local Message = "We have detected enemy units near the city of " .. pCity:GetName()
print(Message)
if (pPlayer:IsHuman()) then
	Events.GameplayAlertMessage(Message)
end

-------------------------------------------------------------------------------------------------------------------------

this is a sample for making a NOTIFICATION to the human player:
Code:
	if pPlayer:IsHuman() then
		pPlayer:AddNotification(NotificationTypes.NOTIFICATION_GENERIC, "Building!" ,"One of your captured wolves created the special building!", -1, -1);
	end
but it has been a loooong time since I used that as an experimental thing so I would have to double-check that I don't have my settings shown in the wrong order.

JFD also recently showed me how to do a notification with a specific unit Icon, but I have not had a chance to experiment with that method yet to be sure I am understanding it correctly.
 
Does this look right.

Spoiler :
Code:
---------------------------------------------------------------------------------------------------------
	--CODE FOR AMERICA
	---------------------------------------------------------------------------------------------------------
	if pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_AMERICA"] then
		if Game.GetGameTurn() == 7 then
			--here is where we would create the units

			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 60, 20, 0, 0, "1st Batt/7th Reg", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 61, 21, 0, 0, "2nd Batt/7th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 62, 20, 0, 0, "3rd Batt/7th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 63, 20, 0, 0, "1st Batt/11th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 59, 20, 0, 0, "4th Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 61, 22, 0, 0, "12 Batt", "NO_PROMOTION")

			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], 60, 21, 0, 0, "USS Salt Lake City", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], 61, 21, 0, 0, "USS Helena", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], 62, 22, 0, 0, "USS Cole", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], 62, 23, 0, 0, "USS Clark", "NO_PROMOTION")

			--spawn USS Hornet with three flight deck promotions
			PromotionList = { "PROMOTION_FLIGHT_DECK_1", "PROMOTION_FLIGHT_DECK_2", "PROMOTION_FLIGHT_DECK_3" }
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CARRIER"], 70, 24, 0, 0, "USS Hornet", PromotionList)

			--spawn some fighters and bombers on the same plot as USS Hornet
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)

			if pPlayer:IsHuman() then
		pPlayer:AddNotification(NotificationTypes.NOTIFICATION_GENERIC, "Reinforcements!" ,"The Navy has arrived with Chesty Puller and the 7th Marines", -1, -1);
	end

			print("American Units Added")

		elseif Game.GetGameTurn() == 15 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 61, 21, 0, 0, "3rd Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 62, 20, 0, 0, "7th Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 63, 20, 0, 0, "8th Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 60, 20, 0, 0, "4th SW", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 64, 20, 0, 0, "61st Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ANTI_AIRCRAFT_GUN"], 64, 20, 0, 0, "43rd Batt", "NO_PROMOTION")
			print("American Units Added")

			if pPlayer:IsHuman() then
		pPlayer:AddNotification(NotificationTypes.NOTIFICATION_GENERIC, "Reinforcements!" ,"The Army is finally here", -1, -1);
         end
		end
	end
end
GameEvents.PlayerDoTurn.Add(TokyoExpress)


print("Tokyo Express Units Loaded")
 
Spoiler :
Code:
---------------------------------------------------------------------------------------------------------
	--CODE FOR AMERICA
	---------------------------------------------------------------------------------------------------------
	if pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_AMERICA"] then
		if Game.GetGameTurn() == 7 then
			--here is where we would create the units

			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 60, 20, 0, 0, "1st Batt/7th Reg", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 61, 21, 0, 0, "2nd Batt/7th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 62, 20, 0, 0, "3rd Batt/7th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 63, 20, 0, 0, "1st Batt/11th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 59, 20, 0, 0, "4th Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 61, 22, 0, 0, "12 Batt", "NO_PROMOTION")

			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], 60, 21, 0, 0, "USS Salt Lake City", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], 61, 21, 0, 0, "USS Helena", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], 62, 22, 0, 0, "USS Cole", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], 62, 23, 0, 0, "USS Clark", "NO_PROMOTION")

			--spawn USS Hornet with three flight deck promotions
			PromotionList = { "PROMOTION_FLIGHT_DECK_1", "PROMOTION_FLIGHT_DECK_2", "PROMOTION_FLIGHT_DECK_3" }
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CARRIER"], 70, 24, 0, 0, "USS Hornet", PromotionList)

			--spawn some fighters and bombers on the same plot as USS Hornet
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)

			if pPlayer:IsHuman() then
		pPlayer:AddNotification(NotificationTypes.NOTIFICATION_GENERIC, "Reinforcements!" ,"The Navy has arrived with Chesty Puller and the 7th Marines", -1, -1);
	end

			print("American Units Added")

		elseif Game.GetGameTurn() == 15 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 61, 21, 0, 0, "3rd Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 62, 20, 0, 0, "7th Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 63, 20, 0, 0, "8th Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 60, 20, 0, 0, "4th SW", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 64, 20, 0, 0, "61st Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ANTI_AIRCRAFT_GUN"], 64, 20, 0, 0, "43rd Batt", "NO_PROMOTION")
			print("American Units Added")

			if pPlayer:IsHuman() then
		pPlayer:AddNotification(NotificationTypes.NOTIFICATION_GENERIC, "Reinforcements!" ,"The Army is finally here", -1, -1);
	end
		end
	end
end
GameEvents.PlayerDoTurn.Add(TokyoExpress)


print("Tokyo Express Units Loaded")

See how it looks like crap?
 
it does look ugly but the code itself looks ok. If you're seeing the same sort of jumbled look, have you tried using only leading TABS everywhere instead of using leading SPACES

Plus, as mentioned in our last chat, the forum does not like multiple leading spaces (even in code blocks, it seems) whereas it is better at displaying multiple leading TABS
 
Compare to this where I put in more TABS at the front of those ugly lines. I did this by first copying your post via the quote post method, then copy/pasting in notepad where it is easier to see all the code line-ups, and then copy/pasting the result back onto the forum.
Spoiler :
Code:
---------------------------------------------------------------------------------------------------------
	--CODE FOR AMERICA
	---------------------------------------------------------------------------------------------------------
	if pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_AMERICA"] then
		if Game.GetGameTurn() == 7 then
			--here is where we would create the units

			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 60, 20, 0, 0, "1st Batt/7th Reg", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 61, 21, 0, 0, "2nd Batt/7th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 62, 20, 0, 0, "3rd Batt/7th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 63, 20, 0, 0, "1st Batt/11th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 59, 20, 0, 0, "4th Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 61, 22, 0, 0, "12 Batt", "NO_PROMOTION")

			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], 60, 21, 0, 0, "USS Salt Lake City", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], 61, 21, 0, 0, "USS Helena", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], 62, 22, 0, 0, "USS Cole", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], 62, 23, 0, 0, "USS Clark", "NO_PROMOTION")

			--spawn USS Hornet with three flight deck promotions
			PromotionList = { "PROMOTION_FLIGHT_DECK_1", "PROMOTION_FLIGHT_DECK_2", "PROMOTION_FLIGHT_DECK_3" }
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CARRIER"], 70, 24, 0, 0, "USS Hornet", PromotionList)

			--spawn some fighters and bombers on the same plot as USS Hornet
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)

			if pPlayer:IsHuman() then
				pPlayer:AddNotification(NotificationTypes.NOTIFICATION_GENERIC, "Reinforcements!" ,"The Navy has arrived with Chesty Puller and the 7th Marines", -1, -1);
			end

			print("American Units Added")

		elseif Game.GetGameTurn() == 15 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 61, 21, 0, 0, "3rd Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 62, 20, 0, 0, "7th Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 63, 20, 0, 0, "8th Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 60, 20, 0, 0, "4th SW", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 64, 20, 0, 0, "61st Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ANTI_AIRCRAFT_GUN"], 64, 20, 0, 0, "43rd Batt", "NO_PROMOTION")
			print("American Units Added")

			if pPlayer:IsHuman() then
				pPlayer:AddNotification(NotificationTypes.NOTIFICATION_GENERIC, "Reinforcements!" ,"The Army is finally here", -1, -1);
			end
		end
	end
end
GameEvents.PlayerDoTurn.Add(TokyoExpress)


print("Tokyo Express Units Loaded")

See how it looks like crap?
However, I've been playing around with the code that JFD put me onto for making notifications with customized unit Icons instead of just the generico notifications, so there are some possibilties there, as in where I've made changes below:
Spoiler :
Code:
---------------------------------------------------------------------------------------------------------
	--CODE FOR AMERICA
	---------------------------------------------------------------------------------------------------------
	if pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_AMERICA"] then
		if Game.GetGameTurn() == 7 then
			--here is where we would create the units

			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 60, 20, 0, 0, "1st Batt/7th Reg", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 61, 21, 0, 0, "2nd Batt/7th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 62, 20, 0, 0, "3rd Batt/7th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MARINE"], 63, 20, 0, 0, "1st Batt/11th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 59, 20, 0, 0, "4th Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 61, 22, 0, 0, "12 Batt", "NO_PROMOTION")

			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], 60, 21, 0, 0, "USS Salt Lake City", "PROMOTION_MORALE")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CRUISER"], 61, 21, 0, 0, "USS Helena", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], 62, 22, 0, 0, "USS Cole", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DESTROYER"], 62, 23, 0, 0, "USS Clark", "NO_PROMOTION")

			--spawn USS Hornet with three flight deck promotions
			PromotionList = { "PROMOTION_FLIGHT_DECK_1", "PROMOTION_FLIGHT_DECK_2", "PROMOTION_FLIGHT_DECK_3" }
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_CARRIER"], 70, 24, 0, 0, "USS Hornet", PromotionList)

			--spawn some fighters and bombers on the same plot as USS Hornet
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_DIVE_BOMBER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_FIGHTER"], 70, 24, 0, 0)

			if pPlayer:IsHuman() then
				local sMessageShort = "Reinforcements!"
				local sMessageFull = "The Navy has arrived with Chesty Puller and the 7th Marines"
				Players[Game.GetActivePlayer()]:AddNotification(NotificationTypes["NOTIFICATION_GREAT_PERSON_ACTIVE_PLAYER"], sMessageFull, sMessageShort, 70, 24, GameInfoTypes["UNIT_CARRIER"], -1, false)
			end

			print("American Units Added")

		elseif Game.GetGameTurn() == 15 then
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 61, 21, 0, 0, "3rd Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 62, 20, 0, 0, "7th Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_INFANTRY"], 63, 20, 0, 0, "8th Batt/16th Reg", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_MACHINE_GUN"], 60, 20, 0, 0, "4th SW", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ARTILLERY"], 64, 20, 0, 0, "61st Batt", "NO_PROMOTION")
			SpawnAtPlot(pPlayer, GameInfoTypes["UNIT_ANTI_AIRCRAFT_GUN"], 64, 20, 0, 0, "43rd Batt", "NO_PROMOTION")
			print("American Units Added")

			if pPlayer:IsHuman() then
				local sMessageShort = "Reinforcements!"
				local sMessageFull = "The Army is finally here"
				Players[Game.GetActivePlayer()]:AddNotification(NotificationTypes["NOTIFICATION_GREAT_PERSON_ACTIVE_PLAYER"], sMessageFull, sMessageShort, 61, 21, GameInfoTypes["UNIT_INFANTRY"], -1, false)
			end
		end
	end
end
GameEvents.PlayerDoTurn.Add(TokyoExpress)


print("Tokyo Express Units Loaded")
Note the use of a plot reference and a unit designation right after the "sMessageShort" argument. Don't fool with "-1, false" at the end. You could also use a great admiral or great general designation and their in-game icon would appear, but I'm not sure which era variation icon would be used.
 
Add this to the end of your RandomFleetSpawn.lua
Spoiler :
Code:
function RadarScanForPeavaInvaders(pPlayer)
	local pPlot = Map.GetPlot(37, 17)	--this is referencing Peava's plot X,Y
	iNumberAmericanCarriers = 0	--reset the number of detected carrier to 0 before starting this turns scan and detection
	iNumberAmericanInfantry = 0	--reset the number of detected infantry to 0 before starting this turns scan and detection
	iNumberAmericanMarines = 0	--reset the number of detected infantry to 0 before starting this turns scan and detection
	local iInfantry = GameInfoTypes["UNIT_INFANTRY"]
	local iCarrier = GameInfoTypes["UNIT_CARRIER"]
	local iMarines = GameInfoTypes["UNIT_MARINE"]
	for pAreaPlot in PlotAreaSpiralIterator(pPlot, 8, SECTOR_NORTHEAST, DIRECTION_CLOCKWISE, DIRECTION_INWARDS, CENTRE_EXCLUDE) do
		--print(pAreaPlot:GetX(), pAreaPlot:GetY())
		if pAreaPlot and pAreaPlot:IsUnit() then
			for i = 0, pAreaPlot:GetNumUnits() do
				local pUnit = pAreaPlot:GetUnit(i)
				if pUnit then
					if Players[pUnit:GetOwner()] ~= pPlayer then
						if pUnit:GetUnitType() == iInfantry then
							iNumberAmericanInfantry = iNumberAmericanInfantry + 1
						elseif pUnit:GetUnitType() == iMarines then
							iNumberAmericanMarines = iNumberAmericanMarines + 1
						elseif pUnit:GetUnitType() == iCarrier then
							iNumberAmericanCarriers = iNumberAmericanCarriers + 1
						end
					end
				end
			end
		end
	end
	return iNumberAmericanCarriers, iNumberAmericanInfantry, iNumberAmericanMarines
end
function MakeMessage([COLOR="Blue"]pPlayer,[/COLOR] Message)
	print(Message)
	if (pPlayer:IsHuman()) then
		Events.GameplayAlertMessage(Message)
	end
end
In the TokyoExpressUnits.lua change this:
Code:
	---------------------------------------------------------------------------------------------------------
	--CODE FOR JAPAN
	---------------------------------------------------------------------------------------------------------
	if pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_JAPAN"] then
		if Game.GetGameTurn() == 3 then
to read as this:
Code:
	---------------------------------------------------------------------------------------------------------
	--CODE FOR JAPAN
	---------------------------------------------------------------------------------------------------------
	if pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_JAPAN"] then
		local iNumberAmericanCarriers, iNumberAmericanInfantry, iNumberAmericanMarines = RadarScanForPeavaInvaders(pPlayer)
		MakeMessage([COLOR="Blue"]pPlayer,[/COLOR]"Number detected American Carriers near Peava was " .. iNumberAmericanCarriers)
		MakeMessage([COLOR="Blue"]pPlayer,[/COLOR]"Number detected American Infantry near Peava was " .. iNumberAmericanInfantry)
		MakeMessage([COLOR="Blue"]pPlayer,[/COLOR]"Number detected American Marines near Peava was " .. iNumberAmericanMarines)
		if Game.GetGameTurn() == 3 then

What this should do is print a meassage in the lua.log and in Live Tuner for the number of American Carriers, Marines, and Infantry detected near Peava.

So if you use IGE to plop a few American units of each of these three unit types, and then exit IGE and press next turn, you should get a message printed in live tuner and in the lua.log reporting how many of each. This will occur as part of Japan's turn, but it will print into the two logs even so. It should match the numbers you plopped down in IGE.

-----------------------------------------------------------------------------------

[edit] Simple error because I am the stooopid. Change as shown in the edited blue bits.
 
Reminder to myself to randomize the location of the American carrier fleet, at the outset of the campaign. This will make each game different. And you may not get your carriers where you may want them. They may have to be moved at flank speed towards any Jap threat. I want to make this change, because it will make the scenario have a bit of "what if" attached to it.
 
The Jap carrier fleet seems to spawn in the same place every time. Oh well I'll try it again tomorrow. I thought it would get past 6.66 MB but it didn't! :lol:
 
I don't know if something is wrong with this code. I made a few slight adjustments. Perhaps some changes could be made to improve it. The code works great until about turn 25, then stops working and reverts back to the civ 5 calendar. When this happens the date is way out of whack. If there is nothing that can be done so be it. I'll just have to use the default civ 5 calendar. From what gedemon told me about his code here, is that it reverts to the Civ 5 calendar when a save game is uploaded. He says it needs more works to fix that.

Spoiler :
Code:
-- Update date
g_Calendar = {}
local monthList = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }
local dayList = { "1", "7", "14", "21", "28" }
local turn = 0
for year = 1939, 1946 do -- see large
	for month = 1, #monthList do
		for day = 1, #dayList do
			local bStart = (month >= 8 and year == 1942) -- Start date = august, 1st 1942
			if bStart or (year > 1946) then
				local numMonth, numDay
				if month < 10 then numMonth = month; else numMonth = month; end
				if tonumber(dayList[day]) < 10 then numDay = dayList[day]; else numDay = dayList[day]; end
				g_Calendar[turn] = { Text = monthList[month] .. " " .. dayList[day] .. ", " .. year, Number = tonumber(year..numMonth..numDay)}
				turn = turn + 1
			end		
		end
	end
end
                local date = Game.GetTurnString();
		Controls.CurrentDate:SetText(date);
                local realDate = g_Calendar[Game.GetGameTurn()].Text or "You should really end this war now !"
		Controls.CurrentDate:SetText(realDate)
	end
end
 
I think the issue with 25 turns is probably related to this:
Spoiler :
Month Date Turn
August'42 1 1
7 2
14 3
21 4
28 5
September'42 1 6
7 7
14 8
21 9
28 10
October'42 1 11
7 12
14 13
21 14
28 15
November'42 1 16
7 17
14 18
21 19
28 20
December'42 1 21
7 22
14 23
21 24
28 25
January'43 1 26
I'd have to see Gedemon's original code again to get a better idea of how it was intended to work.
 
I think the issue with 25 turns is probably related to this:
Spoiler :
Month Date Turn
August'42 1 1
7 2
14 3
21 4
28 5
September'42 1 6
7 7
14 8
21 9
28 10
October'42 1 11
7 12
14 13
21 14
28 15
November'42 1 16
7 17
14 18
21 19
28 20
December'42 1 21
7 22
14 23
21 24
28 25
January'43 1 26
I'd have to see Gedemon's original code again to get a better idea of how it was intended to work.

Original code

Spoiler :
Code:
g_Calendar = {}
local monthList = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }
local dayList = { "1", "5", "10", "15", "20", "25" }
local turn = 0
for year = 1939, 1946 do -- see large
	for month = 1, #monthList do
		for day = 1, #dayList do
			local bStart = (month >= 7 and year == 1939) -- Start date = july, 1st 1939
			if bStart or (year > 1939) then
				local numMonth, numDay
				if month < 10 then numMonth = "0"..month; else numMonth = month; end
				if tonumber(dayList[day]) < 10 then numDay = "0"..dayList[day]; else numDay = dayList[day]; end
				g_Calendar[turn] = { Text = monthList[month] .. " " .. dayList[day] .. ", " .. year, Number = tonumber(year..numMonth..numDay)}
				turn = turn + 1
			end		
		end
	end
end
                local date = Game.GetTurnString();
		Controls.CurrentDate:SetText(date);
                local realDate = g_Calendar[Game.GetGameTurn()].Text or "You should really end this war now !"
		Controls.CurrentDate:SetText(realDate)
	end
end
 
If anyone is interested in play testing be my guest. This is being designed as a US only scenario. Although, right now both sides can be played.
 
I don't know if something is wrong with this code. I made a few slight adjustments. Perhaps some changes could be made to improve it. The code works great until about turn 25, then stops working and reverts back to the civ 5 calendar. When this happens the date is way out of whack. If there is nothing that can be done so be it. I'll just have to use the default civ 5 calendar. From what gedemon told me about his code here, is that it reverts to the Civ 5 calendar when a save game is uploaded. He says it needs more works to fix that.

Spoiler :
Code:
-- Update date
g_Calendar = {}
local monthList = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }
local dayList = { "1", "7", "14", "21", "28" }
local turn = 0
for year = 1939, 1946 do -- see large
	for month = 1, #monthList do
		for day = 1, #dayList do
			local bStart = (month >= 8 and year == 1942) -- Start date = august, 1st 1942
			if bStart or (year > 1946) then
				local numMonth, numDay
				if month < 10 then numMonth = month; else numMonth = month; end
				if tonumber(dayList[day]) < 10 then numDay = dayList[day]; else numDay = dayList[day]; end
				g_Calendar[turn] = { Text = monthList[month] .. " " .. dayList[day] .. ", " .. year, Number = tonumber(year..numMonth..numDay)}
				turn = turn + 1
			end		
		end
	end
end
                local date = Game.GetTurnString();
		Controls.CurrentDate:SetText(date);
                local realDate = g_Calendar[Game.GetGameTurn()].Text or "You should really end this war now !"
		Controls.CurrentDate:SetText(realDate)
	end
end

It's the saved game's name itself that shows the old calendar, it works fine in game when reloading.
 
It's the saved game's name itself that shows the old calendar, it works fine in game when reloading.
ah, okay. Yeah, the saved game labels are coming out bizarre. I misunderstood the problem. Not really sure what there is to do about that.

Tho he did say at Turn 25 the in-game text changes coming from the altered TopPanel.lua stopped showing properly and reverted back to showing the "year" as calculated by the normal method. This would coincide with the year rolling over from 1942 to 01Jan1943, though the code ought to display it as January 1, 1943 if the alterations in the TopPanel.lua are still effective and there is not a gotcha left in the code. Though if there is I can't see it, and I went back to essentially the same code as Gedemon originally gave, with minimum changes.
 
New Georgia text file.
 

Attachments

Back
Top Bottom