After several hours of nonsense... I ended up just enabling the nanban trade port for the player and not the AI at the first turn. The condition the FactionIsHuman(context) is a bit strange... Specially the "context" thing. I tried enabling like "enable building (nanban_port, context)", but it will just not take it. I ended up having to do 7 or 8 ifs or elseifs to enable for each specific clan.
The code wont work either on the function OnCampaignStart. i think it is because the "factionishuman" is still not loaded or something like that. I could also not use the elseifs with the condition of not being multiplayer, but the ifs worked fine. Anyway, here is the final code just below "TURN ONE EVENTS":
Code:
if conditions.FactionName("date", context) and conditions.FactionIsHuman("date", context) then scripting.game_interface:remove_restricted_building_level_record_for_faction("SHO_Port_3_Nanban_Trade_Port", "date")
elseif conditions.FactionName("mori", context) and conditions.FactionIsHuman("mori", context) then
scripting.game_interface:remove_restricted_building_level_record_for_faction("SHO_Port_3_Nanban_Trade_Port", "mori")
elseif conditions.FactionName("chosokabe", context) and conditions.FactionIsHuman("chosokabe", context) then
scripting.game_interface:remove_restricted_building_level_record_for_faction("SHO_Port_3_Nanban_Trade_Port", "chosokabe")
elseif conditions.FactionName("oda", context) and conditions.FactionIsHuman("oda", context) then
scripting.game_interface:remove_restricted_building_level_record_for_faction("SHO_Port_3_Nanban_Trade_Port", "oda")
elseif conditions.FactionName("takeda", context) and conditions.FactionIsHuman("takeda", context) then
scripting.game_interface:remove_restricted_building_level_record_for_faction("SHO_Port_3_Nanban_Trade_Port", "takeda")
elseif conditions.FactionName("tokugawa", context) and conditions.FactionIsHuman("tokugawa", context) then
scripting.game_interface:remove_restricted_building_level_record_for_faction("SHO_Port_3_Nanban_Trade_Port", "tokugawa")
elseif conditions.FactionName("iga_ninja", context) and conditions.FactionIsHuman("iga_ninja", context) then
scripting.game_interface:remove_restricted_building_level_record_for_faction("SHO_Port_3_Nanban_Trade_Port", "iga_ninja")
elseif conditions.FactionName("hojo", context) and conditions.FactionIsHuman("hojo", context) then
scripting.game_interface:remove_restricted_building_level_record_for_faction("SHO_Port_3_Nanban_Trade_Port", "hojo")
elseif conditions.FactionName("uesugi", context) and conditions.FactionIsHuman("uesugi", context) then
scripting.game_interface:remove_restricted_building_level_record_for_faction("SHO_Port_3_Nanban_Trade_Port", "uesugi")
elseif conditions.FactionName("ikko_ikki", context) and conditions.FactionIsHuman("ikko_ikki", context) then
scripting.game_interface:remove_restricted_building_level_record_for_faction("SHO_Port_3_Nanban_Trade_Port", "ikko_ikki")
end
Does what I want but its not elegant... I think my first code should have worked... I also dont like to modify the entire script to add this, but there seems to be no other way... Altho Im not a pro in this