I ended up getting this working by putting in my game my own default exit template (code below). I set objects with an enemy=1 attribute if they are combatants. If in a room with a combatant, it doesn't let you leave. It also respects the locked attribute of the exit so will never let you leave through a locked exit. Any feedback on this? Seem reliable? Any issues I need to be aware of?
<type name="defaultexit">
<displayverbs type="list">Go to</displayverbs>
<locked type="boolean">false</locked>
<lockmessage>That way is locked.</lockmessage>
<lookonly type="boolean">false</lookonly>
<script type="script">
locked_out = 0
if (this.locked) {
locked_out = 1
msg (this.lockmessage)
}
if (locked_out = 0) {
found_one = 0
foreach (enemy, ScopeVisibleNotHeld()) {
if (HasAttribute(enemy,"enemy")) {
if (enemy.enemy = 1) {
found_one = 1
}
}
}
if (found_one = 0) {
MoveObject (player, this.to)
}
else {
msg ("You can't move while in combat")
}
}
</script>