TSL Functionality for a LUA Mapscript Question

40sw4rm

Chieftain
Joined
Aug 20, 2014
Messages
36
I'm currently in the process of recreating a LUA mapscript to Civilization VI. My question is, because for the life of me I can't figure it out at the moment, is there a way that I can just have a simple variable that goes directly off the civtype and creates that startingplot?

I'm looking for an override that is something simple like: if civtype == 'CIVILIZATION_NAME' then assigned x,y start plot, where I can just elseif the rest of the civilizations after that. Any help would be appreciated, thanks in advance.
 
Snippeted frankenstiened bit of code that checks for whether a player is alive and is CIVILIZATION_ROME. Runs through all players active in the game that are "alive", except for the Barbs. You will get results printed for city-states as well as major civs.
Code:
for iPlayer = 0, 62 do	--all players other than the barbs
	local pLoopPlayer = Players[iPlayer]
	if pLoopPlayer:IsAlive() then
		local sPlayerCivName = PlayerConfigurations[iPlayer]:GetCivilizationTypeName()
		local sPlayerLeaderName = PlayerConfigurations[iPlayer]:GetLeaderTypeName()
		print("[PrintAllPlayers:] Player # " .. iPlayer .. " is being used as " .. sPlayerCivName .. " with leader of " .. sPlayerLeaderName)
		local bAssertMonuments = (sPlayerCivName == "CIVILIZATION_ROME")
		if bAssertMonuments then
			print("[PrintAllPlayers:] Player # " .. iPlayer .. " is Roman!")
		else
			print("[PrintAllPlayers:] Player # " .. iPlayer .. " is NOT Roman!")
		end
	end
end
 
Last edited:
I apologize for the late reply. I've figured it out, your code snippet helped a lot in figuring it out. Thanks!

EDIT: Victoria says thanks!
Spoiler :
KW3t452.jpg
 
Last edited:
I also realised I left a function in there I never explained. so I removed it and just placed a direct print command in its place. no need to confuse anyone else looking at this thread later.

The offending "PrintToLog" function is one I use for debugging purposes and only actually executes the text string sent to it if variable bDebugPrint is set "true":
Code:
local bDebugPrint = false
	-- this controls debug printing
function PrintToLog(sMessage)
	if bDebugPrint then
		print(sMessage)
	end
end
 
Back
Top Bottom