And is it also possible to set diplomatic relationships via LUA which won't change during the game?
I've a Christian Nations civ, which represents all the minor European Nations during the 16th century. They should only get into war with the Ottoman Empire. With all other major European Nations there should be a peace treaty during the complete game which can't be change.
At the moment, you can set it so that treaties can only be changed by event, by placing a line
Code:
diplomacy.setEventTreatiesOnly(eventTreatiesMsg)
The way it works is that for every unit activation, the game looks at what the treaties "should" be for all players, and restores them. Using the diplomacy module's functions changes the expected treaties.
Code:
-- Provides Functionality related to diplomacy
-- diplomacy.warExists(tribe1,tribe2)-->bool
-- diplomacy.setWar(tribe1,tribe2)
-- diplomacy.clearWar(tribe1,tribe2)
-- diplomacy.contactExists(tribe1,tribe2)-->bool
-- diplomacy.setContact(tribe1,tribe2)
-- diplomacy.clearContact(tribe1,tribe2)
-- diplomacy.ceaseFireExists(tribe1,tribe2)-->bool
-- diplomacy.setCeaseFire(tribe1,tribe2)
-- diplomacy.clearCeaseFire(tribe1,tribe2)
-- diplomacy.peaceTreatyExists(tribe1,tribe2)-->bool
-- diplomacy.setPeaceTreaty(tribe1,tribe2)
-- diplomacy.clearPeaceTreaty(tribe1,tribe2)
-- diplomacy.allianceExists(tribe1,tribe2)-->bool
-- diplomacy.setAlliance(tribe1,tribe2)
-- diplomacy.clearAlliance(tribe1,tribe2)
-- diplomacy.hasEmbassyWith(ownerTribe,hostTribe) -->bool
-- diplomacy.setEmbassyWith(ownerTribe,hostTribe)
-- diplomacy.clearEmbassyWith(ownerTribe,hostTribe)
-- diplomacy.hasVendettaWith(angryTribe,offendingTribe)-->bool
-- diplomacy.setVendettaWith(angryTribe,offendingTribe)
-- diplomacy.clearVendettaWith(angryTribe,offendingTribe)
I should probably change this so that only some treaties are fixed while others are not.
I'm sure @Prof. Garfield can offer something better, but I am sure Lua allows different models of civ-relations, using humanonly and computeronly talkers.
Under the rules events, there is the negotiationSettings.lua file, which has this function
Code:
function negotiationSettings.negotiation(talker,listener)
Talker and listener are tribe objects. If this function returns true, the two tribes can talk to each other, and if false, they can't. At the moment, if false is returned, the talker can't see the listener in the list of tribes in the foreign minister report, which is slightly different than the regular behaviour (where you could check intelligence reports even if you couldn't talk).