is there a PlayerCanGetPolicy event?
id like to add tech prereqs to policies
(Lua) Added GameEvents.CityCanBuyAnyPlot(ownerID, cityID) (TestAll)
(Lua) Added GameEvents.CityCanBuyPlot(ownerID, cityID, plotX, plotY) (TestAll)
(Lua) Added GameEvents.CityCanCreate(ownerID, cityID, projectTypeID); (TestAll)
(Lua) Added GameEvents.CityCanMaintain(ownerID, cityID, processTypeID); (TestAll)
(Lua) Added GameEvents.CityCanPrepare(ownerID, cityID, specialistTypeID); (TestAll)
(Lua) Added GameEvents.CityCanTrain(ownerID, cityID, unitTypeID); (TestAll)
(Lua) Added GameEvents.PlayerAdoptPolicy(playerID, policyTypeID); (Hook)
(Lua) Added GameEvents.PlayerAdoptPolicyBranch(playerID, policyBranchTypeID); (Hook)
(Lua) Added GameEvents.PlayerCanAdoptPolicy(playerID, policyTypeID); (TestAll)
(Lua) Added GameEvents.PlayerCanAdoptPolicyBranch(playerID, policyBranchTypeID); (TestAll)
(Lua) Added GameEvents.PlayerCanConstruct(playerID, buildingTypeID); (TestAll)
(Lua) Added GameEvents.PlayerCanCreate(playerID, projectTypeID); (TestAll)
(Lua) Added GameEvents.PlayerCanEverReseearch(playerID, techtypeID); (TestAll)
(Lua) Added GameEvents.PlayerCanMaintain(playerID, processTypeID); (TestAll)
(Lua) Added GameEvents.PlayerCanPrepare(playerID, specialistTypeID); (TestAll)
(Lua) Added GameEvents.PlayerCanResearch(playerID, techTypeID); (TestAll)
(Lua) Added GameEvents.PlayerCanTrain(playerID, unitTypeID); (TestAll)
(Lua) Added GameEvents.TeamSetHasTech(teamID, techID); (Hook)
All changes to DebugDatabase (odd name but that is the one used by the game) should be done as OnModActivated changes, either by SQL directly or XML (which is translated to SQL). Don't even think about changing this DB in game. Values like combat str, etc., need to be changed in game via Lua functions listed at the wiki, and if that doesn't exist then you can't really change it.also, are those lua fields added from .sql files or from the lua code somehow?
is it possible to change the game DB from lua?
what it will lead to?Don't even think about changing this DB in game.
nothing, that's the problem.what it will lead to?
nothing, that's the problem.
1. You'll have to wait for my mods release, hopefully in April.Questions:
1) Do you have any ready mod with added xml tags through Lua?
2) Does OnModActivated event is activated only in SP or also in MultiPlayer mode?
GameEvents.GoldenAge.Add
function(iPlayer, beliefType)
local XiuhAge = GameInfo.Beliefs[beliefType].XiuhAge
local pPlayer = Players[iPlayer];
if pPlayer:GetBeliefType(Belief.Founder) == local GameInfo.Beliefs['BELIEF_XIUHMOLPILLI'] then
if XiuhAge = true and (Game.GetGameTurn() = 55 or 110 or 165 or 220 or 275 or 330 or 385 or 440 or 495') then return true
break
break
end)
If I had to guess as to why, I'd say its because GameEvents.GoldenAge was just a wild guess.
if pPlayer:GetBeliefType(Belief.Founder) == local GameInfo.Beliefs['BELIEF_XIUHMOLPILLI'] then
if XiuhAge = true and
(Game.GetGameTurn() = 55 or 110 or 165 or 220 or 275 or 330 or 385 or 440 or 495') then
return true
break
break
Player.ChangeGoldenAgeTurns.Add(
function(pPlayer, iChange)
local Player = Players[pPlayer]
if pPlayer:GetBeliefType(Belief.Founder) == local GameInfo.Beliefs['BELIEF_XIUHMOLPILLI'] then
if XiuhAge = true
return "10"
break
break
end)