TK_civftcs
Chieftain
Hello everyone, I'm new to modding ciV. Nice to be here. After some weeks of exploring different problems by google and trial-error, I decided to save my time by just asking people directly when the next arises.
The problem was solved. Check 4th post in thread if interested.
Currently I'm working with a script that gives a player free technologies, and I would like to hide the TechAwardPopup that comes as a byproduct of getting a new technology. I need to hide the tech-popups only when granting the free techs. I've tried the following solutions:
First, DequeuePopup inside the function that gives the techs:
Second, changing the GameEvent which gets called when a popup needs to appear:
Any help is appreciated, as neither of the solutions have worked. The technologies are starting technologies to civs, I'm working on a "historical spawn date" -functionality. I have read through the existing HSD mod by Gedemon, but I want to do things slightly differently.
Thanks,
TK
The problem was solved. Check 4th post in thread if interested.
Currently I'm working with a script that gives a player free technologies, and I would like to hide the TechAwardPopup that comes as a byproduct of getting a new technology. I need to hide the tech-popups only when granting the free techs. I've tried the following solutions:
First, DequeuePopup inside the function that gives the techs:
Code:
function SpawnTechs(pPlayer, year)
*stuff that gives the technology I want, this part is working*
UIManager:DequeuePopup(ContextPtr:LookUpControl("/InGame/TechAwardPopup"));
end
Second, changing the GameEvent which gets called when a popup needs to appear:
Code:
function HideTechPopup(popupInfo)
UIManager:DequeuePopup(ContextPtr:LookUpControl("/InGame/TechAwardPopup"));
end
GameEvents.PlayerDoTurn.Add( function(iPlayer)
*Stuff*
local Year = Game.GetGameTurnYear();
if (*Conditions to spawn tech*) then
*More stuff*
Events.SerialEventGameMessagePopup.Add( HideTechPopup )
SpawnTechs(Players[iPlayer], Year);
Events.SerialEventGameMessagePopup.Remove( HideTechPopup )
*Code stuff*
end
end)
Any help is appreciated, as neither of the solutions have worked. The technologies are starting technologies to civs, I'm working on a "historical spawn date" -functionality. I have read through the existing HSD mod by Gedemon, but I want to do things slightly differently.
Thanks,
TK