Keeping in mind that I am a total, complete, utter n0000b when it comes to scripting:
Code:
local function alhoon_test (context)
if context:faction():is_human() == false
then
local region_count = context:faction():region_list():num_items()
local faction = context:faction():name()
local num_vass_allies = context:faction():num_allies()
if region_count > 0
then
if num_vass_allies > 0
then
scripting.game_interface:apply_effect_bundle("alhoon_stuff_1" ,faction, 1)
.... then you can put a lot of things and variables
end
end
end
end
-- ###---------------------------------- END*
-- ###------------------------- START *******
-- CALLBACKS ---------------------------------------------------------------------
-- ###-------------------------
scripting.AddEventCallBack("FactionTurnStart", alhoon_test);
-- ###---------------------------------- END*
Would that check each faction, at the start of each of their turns to see if: they have at least one region and if yes, if they have at least one vassal \ ally and if both are true go and do stuff?
I have added my changes on Jake's code in red to make them visible.