
Originally Posted by
Spice Master
I guess what I was really thinking was a script that tests if the OOG capital is at Carn-Dum, as a condition for the WK to return.
Like I said: the script contains the logic to do just that, to figure out where the capital is so it knows where to build the building.
This should do it. Significantly helped by TATW already having a 'spawnpool' faction (hungary). You'll need to add CarnDumCapitalTest to Hungary's name list.
Code:
declare_counter carn_dum_is_capital
monitor_event PreFactionTurnStart FactionIsLocal
spawn_army
faction hungary
character CarnDumCapitalTest, named character, age 22, x 390, y 339
unit Bandits exp 0 armour 0 weapon_lvl 0
end
give_everything_to_faction hungary hre false
;reposition him on top of Carn Dum
console_command move_character CarnDumCapitalTest, 151, 307
;lock him there
console_command mp CarnDumCapitalTest -1
set_counter carn_dum_is_capital 1
move CarnDumCapitalTest, 151, 308
;wait for MultiTurnMove events to fire
while I_CompareCounter carn_dum_is_capital == 1
end_while
;move him out of visibility range and kill him
console_command move_character CarnDumCapitalTest, 390, 339
kill_character CarnDumCapitalTest
if I_CompareCounter carn_dum_is_capital == 0
;Carn Dum is not the capital
end_if
if I_CompareCounter carn_dum_is_capital == -1
;Carn Dum is the capital
end_if
end_monitor
monitor_event MultiTurnMove I_CompareCounter carn_dum_is_capital == 1
and DistanceCapital == 0
;the test character is standing on the capital
set_counter carn_dum_is_capital -1
end_monitor
monitor_event MultiTurnMove I_CompareCounter carn_dum_is_capital == 1
;the test character is NOT standing on the capital
set_counter carn_dum_is_capital 0
end_monitor
You can remove the FactionIsLocal if you want this to work on AI factions too. Just replace with TrueCondition or whatever conditions you need. It doesn't need to be PreFactionTurnStart either.