Every combat rule returns false when the player has no tracked combat targets. Combat lookups operate on Playback.state.combatTargets, which is an array of live actor objects in insertion order.
combatTargetExact
Playback.rules.combatTargetExact(validTargets) -> booleanReturns true when any current target's lowercased display name is a true key in validTargets.
local NamedTargets = {
['dagoth ur'] = true,
['vivec'] = true,
}
isValidCallback = function()
return Playback.rules.combatTargetExact(NamedTargets)
endcombatTargetMatch
Playback.rules.combatTargetMatch(validTargetPatterns) -> booleanReturns true when any target's lowercased display name contains one of the supplied plain-string patterns.
local DaedraNames = { 'dremora', 'clannfear', 'golden saint' }
isValidCallback = function()
return Playback.rules.combatTargetMatch(DaedraNames)
end
Patterns are substring matches, not Lua patterns. Keep the input lowercase.
combatTargetType
Playback.rules.combatTargetType(targetTypeRules) -> booleanMatches any current target against one of these true-valued keys: npc, humanoid, undead, daedra, or creatures.
local UndeadOrDaedra = {
undead = true,
daedra = true,
}
isValidCallback = function()
return Playback.rules.combatTargetType(UndeadOrDaedra)
end
These are hash sets. Only true enables a type.
combatTargetClass
Playback.rules.combatTargetClass(classes) -> booleanMatches any NPC target whose class is a true-valued key in classes. Creature targets do not have NPC classes.
local MartialClasses = {
guard = true,
warrior = true,
}
isValidCallback = function()
return Playback.rules.combatTargetClass(MartialClasses)
end
Class keys must be lowercase.
combatTargetFaction
Playback.rules.combatTargetFaction(factionRules) -> booleanMatches when any target has a faction rank inside one of the requested ranges. Each range accepts an optional min and max; omitted bounds use 1 and infinity.
local FactionRanks = {
hlaalu = { min = 1, max = 3 },
ashlanders = { min = 1 },
}
isValidCallback = function()
return Playback.rules.combatTargetFaction(FactionRanks)
end
Faction names are passed to OpenMW's faction-rank query. Use the faction IDs used by the game data.
combatTargetLevelDifference
Playback.rules.combatTargetLevelDifference(levelRule) -> booleanMatches when any target falls inside an absolute or relative level range. Supply exactly one of absolute or relative; each range can use min and max. Either bound may be omitted; an omitted lower bound is unbounded below and an omitted upper bound is unbounded above.
absolute is the target level minus the player's level. Negative values mean the player is higher level. relative is the target level divided by the player's level.
local StrongOpponents = {
absolute = { min = 0, max = 5 },
}
isValidCallback = function()
return Playback.rules.combatTargetLevelDifference(StrongOpponents)
end
For a level-20 player, { relative = { min = 0.5, max = 2.0 } } accepts targets from half the player's level through twice the player's level.
dynamicStatThreshold
Playback.rules.dynamicStatThreshold(statThreshold) -> booleanChecks target health, magicka, and/or fatigue as percentages of each target's base value. Each stat accepts an optional min and max between 0 and 1.
Unlike the other combat predicates, every current combat target must pass every supplied threshold. The rule requires combat and returns false when there are no active combat targets.
local WoundedTargets = {
health = { max = 0.25 },
fatigue = { max = 0.5 },
}
isValidCallback = function()
return Playback.state.isInCombat
and Playback.rules.dynamicStatThreshold(WoundedTargets)
endfightingVampires
Playback.rules.fightingVampires() -> booleanReturns true when any current target has an active vampirism effect. Use combatTargetFaction when a specific vampire clan matters.
isValidCallback = function()
return Playback.rules.fightingVampires()
endcombatTargetTagged
Playback.rules.combatTargetTagged(tagTable) -> booleanReturns true when any current target's record has one of the supplied FlexTag tags. This requires the optional FlexTag integration. Without it, S3maphore logs a diagnostic and returns false.
local MarkedEnemies = { 'npcassassin', 'npcbandit' }
isValidCallback = function()
return Playback.rules.combatTargetTagged(MarkedEnemies)
end
Tags are defined by FlexTag, not by S3maphore.