I could have sworn there was a condition exactly like what you're looking for, something like I_FactionNearFaction, but I can't find it in the Docudemons - maybe I'm just imagining it. At any rate, the I_CharacterTypeNearCharacterType condition seems to work as advertised in the Docudemons. Are you sure you're feeding it the correct parameters? This seems like a pretty good condition to use for what you're trying to do. You can, for example, use only conditions with named_character and general (for captains) if you want to see if these two factions have any military forces near each other. Or if you wanted to check proximity of
any characters of faction A to
any characters of faction B, i.e. whenever anyone from either faction is near anyone from the other faction, then you just use a bunch of I_CharacterTypeNearCharacterType conditions as such:
Code:
set_counter england_france_interaction 0
if I_CharacterTypeNearCharacterType england named_character 10 france named_character ;named character <-> named character
inc_counter england_france_interaction 1
end_if
if I_CharacterTypeNearCharacterType england named_character 10 france general ;named character <-> captain
inc_counter england_france_interaction 1
end_if
if I_CharacterTypeNearCharacterType england named_character 10 france spy ;named character <-> spy
inc_counter england_france_interaction 1
end_if
;... all other combos
if I_CompareCounter england_france_interaction > 0
;do stuff
end_if
This is how we do "or" statements without having an actual "or" logical operator in Medieval II's scripting language. Obviously this will only catch character-to-character distances, no interactions with settlements, forts, ports, etc.
Other conditions you could investigate (perhaps in combination with the above), include: InBarbarianLands, InUncivilizedLands, InEnemyLands, EndedInEnemyZOC, I_IsFactionUndiscovered. The barbarian and uncivilized conditions look like they're left over from RTW, I would be interested to know if they do anything at all. The other conditions do work and somewhat cover the case of distances between characters and non-character objects (setts, forts, etc. that can only exist in foreign-controlled regions). I'm not actually sure how a faction can be "discovered" without scripting it to be, but that might be useful if the script is meant for the player.