Having introduced Sukritact's events system into my Anno Domini mod, I've modified its use for the eras covered by the mod. I'm now converting some modders' extra events, such as the ones by JFD, to not be civ specific and to be "Anno-Dominised" for extra variety.
On the whole, I understand how to do this and am keeping it to one long lua script to cover all the possibilities. My questions surround the change in individual scripting of this:
Clearly I can delete the local civilisationID as long as I then delete the relevant line(s) below as I'm making the events generic (and changing the criteria and wording). However, how do I integrate the globals if it's just for that specific event? If I had it all on one separate lua script, would it still be available to be chosen? Should I instead do this, i.e. squeeze the locals between the local Event_ definition, or is it wrong? Would doing that still affect the whole file?
On the whole, I understand how to do this and am keeping it to one long lua script to cover all the possibilities. My questions surround the change in individual scripting of this:
Code:
----
Globals
----------------------------------------------------------------------------------------
local buildingIDThingstead = GameInfoTypes["BUILDING_JFD_THINGSTEAD"]
local civilisationID = GameInfoTypes["CIVILIZATION_JFD_ICELAND"]
local eraMedievalID = GameInfoTypes["ERA_MEDIEVAL"]
local isUsingPietyPrestige = JFD_IsUsingPietyPrestige()
local mathCeil = math.ceil
local religionID = nil
local unitBerserkerID = GameInfoTypes["UNIT_DANISH_BERSERKER"]
local unitSkaldID = GameInfoTypes["UNIT_JFD_SKALD"]
Clearly I can delete the local civilisationID as long as I then delete the relevant line(s) below as I'm making the events generic (and changing the criteria and wording). However, how do I integrate the globals if it's just for that specific event? If I had it all on one separate lua script, would it still be available to be chosen? Should I instead do this, i.e. squeeze the locals between the local Event_ definition, or is it wrong? Would doing that still affect the whole file?
Code:
-- Iceland: Religious Hermit
--------------------------------------------------------------------------------------------------------------------------
local Event_JFDIcelandHermit = {}
local eraMedievalID = GameInfoTypes["ERA_MEDIEVAL"]
local mathCeil = math.ceil
local religionID = nil
Event_JFDIcelandHermit.Name = "TXT_KEY_EVENT_JFD_ICELAND_RELIGIOUS_HERMIT"
Event_JFDIcelandHermit.Desc = "TXT_KEY_EVENT_JFD_ICELAND_RELIGIOUS_HERMIT_DESC"
Event_JFDIcelandHermit.Weight = 5
Event_JFDIcelandHermit.CanFunc = (
function(pPlayer)
(....etc)