Total War: WARHAMMER II

Total War: WARHAMMER II

Loreful Empires: Great Leader Bonuses (Updated For Silence and Fury)
DrunkFlamingo  [developer] 21 Jun, 2018 @ 2:49pm
MODDER API
I've had a few requests for other modders to integrate or take this mod. My solution to that is that I have created an API to modify the lists (and some of the settings) which this mod uses to determine how it influences the game. This will serve as the documentation for that API.

The recommended method is to create an export helper script file with the following listener.



core:add_listener(
"MYNAME_loreful_empires_additions",
"LorefulEmpiresActivated",
true,
function(context)
if not not _G.lem then
lem = _G.lem
--your changes here
--the following is an example.
lem:add_faction_to_major("wh_main_emp_stirland")
lem:set_nearby_player_restriction(false)
lem:remove_faction_from_secondary("wh2_main_vmp_vampire_coast")
--end of example
end
end,
false)


API FUNCTIONS:

--v function(self: LOREFUL_EMPIRES_MANAGER, faction_key: string)
lem:remove_faction_from_major("faction_key")

--v function(self: LOREFUL_EMPIRES_MANAGER, faction_key: string)
lem:remove_faction_from_secondary("faction_key")

--v function(self: LOREFUL_EMPIRES_MANAGER, faction_key: string)
lem:add_faction_to_major("faction_key")

--v function(self: LOREFUL_EMPIRES_MANAGER, faction_key: string)
lem:add_faction_to_secondary("faction_key")

--v function(self: LOREFUL_EMPIRES_MANAGER, option: boolean)
lem:set_defensive_battles_only(true/false)

--v function(self: LOREFUL_EMPIRES_MANAGER, option: boolean)
lem:set_nearby_player_restriction(true/false)

--v function(self: LOREFUL_EMPIRES_MANAGER, option: boolean)
lem:set_enable_script_for_allies(true/false)

These functions are heavily error checked, and should output a file yelling at you if you use them wrong.
Last edited by DrunkFlamingo; 9 Jul, 2018 @ 12:04pm