Popup Modding Help!!

bismark439

Chieftain
Joined
Aug 26, 2013
Messages
34
Code:
---------------------------------------------------------------------
GameEvents.PlayerDoTurn.Add(function(iPlayer) 

    	-- Only on first player's turn
	if (iPlayer > 0) then
		return false;
	end

		if (Game.GetGameTurn() == 1 ) then 
		 DoBriefing (iPlayer);
		end

end);

I made a popup called Briefing to pop out in TUrn 1

Code:
-------------------------------------------------
-- Disaster Popup
-------------------------------------------------

local lastBackgroundImage = "Test.dds"
-------------------------------------------------
-- On Popup
-------------------------------------------------
function DoBriefing (iPlayer)	
local pPlayer=Players[iPlayer]
	if pPlayer:IsHuman() then	
	Controls.DisasterImage:SetHide(false);	
	Controls.DisastersPopBox:SetHide(false);	
	Controls.DisasterBox:SetHide(false);	

	
	lastBackgroundImage = "Test.dds";	
	

	Controls.DisasterImage:SetTexture(lastBackgroundImage);		
	Controls.TitleLabel:LocalizeAndSetText("TXT_KEY_BRIEFING");	
	Controls.DescriptionLabel:LocalizeAndSetText("TXT_KEY_BRIEFING_CONTENT");	
	end
end


-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
function OnClose()		

	Controls.DisasterImage:SetHide(true);	
    Controls.DisasterImage:UnloadTexture();		
	Controls.DisastersPopBox:SetHide(true);		
	Controls.DisasterBox:SetHide(true);		
end
Controls.CloseButton:RegisterCallback( Mouse.eLClick, OnClose);

-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
This is the content of popup.lua. Its basically modified NewEraPopup.Era
It shows Test.dds picture with a caption below. However, in game it does not show up.
http://cafeptthumb2.phinf.naver.net/20140611_42/lewis46_1402498028653Sfqhe_PNG/3.PNG?type=w740
This is what the lua.log says, but I dont know what the problem is. I clearly added image files but it says value is nil.

Does anyone have any idea?:confused::confused::confused:
 
I don't have permission to view your Lua.log screenshot, so it's kind of tough to help.

Basics: Did you set your Test.dds VFS=true? Do you have (one or more of) your Lua files set to use InGameUIAddin? If you're using include() to add other Lua files, have you set those files to VFS=true?

It'd be easier if you just attach the built mod (either the .civ5mod from the ModBuddy project's Packages folder, or a zip of the copy in your CiV Mods folder).
 
Back
Top Bottom