There's basically 3 events.
1st sets the flag TAG_PROV number (in this case it's AFG_2166) - which then causes the sleeping flag event to fire (in another file currently) The sleeping flag event makes sure that nobody apart from AFG can now get a flag on 2166.
Code:
event = {
id = 1257619
random = no
country = LUX
trigger = { control = { province = 2166 data = AFG }
random = 30 }
name = "Control"
desc = "DESCCTRa2166AFG"
style = 0
picture = "news_paper"
date = { day = 0 month = january year = 2064 }
offset = 90
deathdate = { day = 29 month = december year = 2100 }
action_a = {
name = "OK"
command = { type = local_setflag which = AFG_2166 }}}
Second then secedes the province into the country (as opposed to be owned by XXX/controled by Wasteland (LUX)) and fires for LUX
Code:
event = {
id = 1257620
random = no
country = LUX
trigger = { control = { province = 2166 data = AFG }
owned = { province = 2166 data = LUX }
local_flag = AFG_2166
random = 30}
name = "Total control"
desc = "DESCCTRb2166AFG"
style = 0
picture = "news_paper"
date = { day = 0 month = january year = 2064 }
offset = 90
deathdate = { day = 29 month = december year = 2100 }
action_a = {
name = "OK"
command = { type = secedeprovince which = AFG value = 2166 }
command = { type = trigger which = 1257621 }}}
The third makes it work for the recieving country
Code:
event = {
id = 1257621
random = no
country = AFG
name = "NAMCTRc2166"
desc = "DESCCTRc2166"
style = 0
picture = wastelands_wanderer
action_a = {
name = "Great"
command = { }}}
If you could make an event that fires so that
If any tag other than rebels or LUX takes a province, it gets an event that transfers control and stops the event firing again for any other nation.
And then do that for 950 provinces
