Condition - MeridiusIX/Modular-Encounters-Systems GitHub Wiki

Condition Profiles in RivalAI allow you to define some extra conditions that must be met before a Trigger Profile can execute its Actions. It is important that you use a unique SubtypeId for each Condition Profile you create, otherwise they may not work correctly.

Here's an example of how a Condition Profile Definition is setup:

<?xml version="1.0"?>
<Definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <EntityComponents>

    <EntityComponent xsi:type="MyObjectBuilder_InventoryComponentDefinition">
      <Id>
          <TypeId>Inventory</TypeId>
          <SubtypeId>RAI-ExampleConditionProfile</SubtypeId>
      </Id>
      <Description>

      [RivalAI Condition]
      
      [UseConditions:true]
      [MatchAnyCondition:true]
      
      </Description>
      
    </EntityComponent>

  </EntityComponents>
</Definitions>
Tag:                                UseConditions
Tag Format: [UseConditions:Value]
Description: This tag specifies if the Condition Profile should be active / used.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                MatchAnyCondition
Tag Format: [MatchAnyCondition:Value]
Description: This tag allows you to require if all conditions in the profile must be met (false), or if any condition can be met (true).
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CheckAllLoadedModIDs
Tag Format: [CheckAllLoadedModIDs:Value]
Description: This tag allows you to check for mods currently loaded in your game world. For this condition to be satisfied, all mod IDs included in AllModIDsToCheck must be present in the world.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                AllModIDsToCheck
Tag Format: [AllModIDsToCheck:Value]
Description: Specifies a mod ID you want to have checked if CheckAllLoadedModIDs is true.
Allowed Values: Any Mod ID
Multiple Tag Allowed: Yes
Tag:                                CheckAnyLoadedModIDs
Tag Format: [CheckAnyLoadedModIDs:Value]
Description: This tag allows you to check for mods currently loaded in your game world. For this condition to be satisfied, any mod IDs included in AnyModIDsToCheck must be present in the world.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                AnyModIDsToCheck
Tag Format: [AnyModIDsToCheck:Value]
Description: Specifies a mod ID you want to have checked if CheckAnyLoadedModIDs is true.
Allowed Values: Any Mod ID
Multiple Tag Allowed: Yes
Tag:                                CheckTrueBooleans
Tag Format: [CheckTrueBooleans:Value]
Description: This tag allows you to check for Boolean Variables stored in the Drone Behavior that are true. All provided variables must be true for this condition to be satisfied.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                TrueBooleans
Tag Format: [TrueBooleans:Value]
Description: Specifies the name of a Boolean Variable you want to have checked if CheckTrueBooleans is true.
Allowed Values: Any name string excluding characters :, [, ]
Multiple Tag Allowed: Yes
Tag:                                AllowAnyTrueBoolean
Tag Format: [AllowAnyTrueBoolean:Value]
Description: This tag allows you to specify if the condition should pass if any of the provided boolean names evaluate as true.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CheckCustomCounters
Tag Format: [CheckCustomCounters:Value]
Description: This tag allows you to check for Integer Counter Variables stored in the Drone Behavior. All provided variables must be equal or higher for this condition to be satisfied.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CustomCounters
Tag Format: [CustomCounters:Value]
Description: Specifies the name of an Integer Counter Variable you want to have checked if CheckCustomCounters is true. You must also provide a value to CustomCountersTargets as well for this tag to work.
Allowed Values: Any name string excluding characters :, [, ]
Multiple Tag Allowed: Yes
Tag:                                CustomCountersTargets
Tag Format: [CustomCountersTargets:Value]
Description: Specifies the target value of an Integer Counter Variable you want to have checked if CheckCustomCounters is true. You must also provide a value to CustomCounters as well for this tag to work.
Allowed Values: Any interger equal or greater than 0
Multiple Tag Allowed: Yes
Tag:                                CounterCompareTypes
Tag Format: [CounterCompareTypes:Value]
Description: Specifies the logic used to determine if the behavior counter check passes or not for each provided counter. If no value is provided for a counter name, then GreaterOrEqual is used by default.
Allowed Values: GreaterOrEqual
Greater
Equal
NotEqual
Less
LessOrEqual
Multiple Tag Allowed: Yes
Tag:                                AllowAnyValidCounter
Tag Format: [AllowAnyValidCounter:Value]
Description: This tag allows you to specify if the condition should pass if any of the provided counters pass their check.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CheckTrueSandboxBooleans
Tag Format: [CheckTrueSandboxBooleans:Value]
Description: This tag allows you to check for Boolean Variables stored in the Save File that are true. All provided variables must be true for this condition to be satisfied.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                TrueSandboxBooleans
Tag Format: [TrueSandboxBooleans:Value]
Description: Specifies the name of a Sandbox Boolean Variable you want to have checked if CheckTrueSandboxBooleans is true.
Allowed Values: Any name string excluding characters :, [, ]
Multiple Tag Allowed: Yes
Tag:                                AllowAnyTrueSandboxBoolean
Tag Format: [AllowAnyTrueSandboxBoolean:Value]
Description: This tag allows you to specify if the condition should pass if any of the provided boolean names evaluate as true.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CheckCustomSandboxCounters
Tag Format: [CheckCustomSandboxCounters:Value]
Description: This tag allows you to check for Integer Counter Variables stored in the Save File. All provided variables must be equal or higher for this condition to be satisfied.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CustomSandboxCounters
Tag Format: [CustomSandboxCounters:Value]
Description: Specifies the name of an Integer Counter Variable you want to have checked if CheckCustomSandboxCounters is true. You must also provide a value to CustomSandboxCountersTargets as well for this tag to work.
Allowed Values: Any name string excluding characters :, [, ]
Multiple Tag Allowed: Yes
Tag:                                CustomSandboxCountersTargets
Tag Format: [CustomSandboxCountersTargets:Value]
Description: Specifies the target value of an Integer Counter Variable you want to have checked if CheckCustomSandboxCounters is true. You must also provide a value to CustomSandboxCounters as well for this tag to work.
Allowed Values: Any interger equal or greater than 0
Multiple Tag Allowed: Yes
Tag:                                SandboxCounterCompareTypes
Tag Format: [SandboxCounterCompareTypes:Value]
Description: Specifies the logic used to determine if the sandbox counter check passes or not for each provided counter. If no value is provided for a counter name, then GreaterOrEqual is used by default.
Allowed Values: GreaterOrEqual
Greater
Equal
NotEqual
Less
LessOrEqual
Multiple Tag Allowed: Yes
Tag:                                AllowAnyValidSandboxCounter
Tag Format: [AllowAnyValidSandboxCounter:Value]
Description: This tag allows you to specify if the condition should pass if any of the provided counters pass their check.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CheckGridSpeed
Tag Format: [CheckGridSpeed:Value]
Description: This tag allows you to check the current NPC grid speed. For this condition to be satisfied, the grid speed must be between MinGridSpeed and MaxGridSpeed.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                MinGridSpeed
Tag Format: [MinGridSpeed:Value]
Description: The minimum grid speed that must be met if CheckGridSpeed is true.
Allowed Values: Any number equal or greater than 0
Must be lower than MaxGridSpeed
Multiple Tag Allowed: No
Tag:                                MaxGridSpeed
Tag Format: [MaxGridSpeed:Value]
Description: The maximum grid speed that must be met if CheckGridSpeed is true.
Allowed Values: Any number equal or greater than 0
Must be higher than MinGridSpeed
Multiple Tag Allowed: No
Tag:                                CheckMESBlacklistedSpawnGroups
Tag Format: [CheckMESBlacklistedSpawnGroups:Value]
Description: This tag allows you to check the Modular Encounters Spawner NPC SpawnGroup Blacklist for entries. For this condition to be satisfied..
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                SpawnGroupBlacklistContainsAll
Tag Format: [SpawnGroupBlacklistContainsAll:Value]
Description: Specifies the name of a SpawnGroup SubtypeID you want checked for if CheckMESBlacklistedSpawnGroups is true. If this tag contains values, then All values must be present in the BlackList for the condition to be satisfied.
Allowed Values: Any name string excluding characters :, [, ]
Multiple Tag Allowed: Yes
Tag:                                SpawnGroupBlacklistContainsAny
Tag Format: [SpawnGroupBlacklistContainsAny:Value]
Description: Specifies the name of a SpawnGroup SubtypeID you want checked for if CheckMESBlacklistedSpawnGroups is true. If this tag contains values, then Any of values must be present in the BlackList for the condition to be satisfied.
Allowed Values: Any name string excluding characters :, [, ]
Multiple Tag Allowed: Yes
Tag:                                UseRequiredFunctionalBlocks
Tag Format: [UseRequiredFunctionalBlocks:Value]
Description: Specifies if the condition should check for certain blocks that exist in a functional status on the grid.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                RequiredAllFunctionalBlockNames
Tag Format: [RequiredAllFunctionalBlockNames:Value]
Description: Specifies the name of a Block you want checked for if UseRequiredFunctionalBlocks is true. If this tag contains values, then the grid must have All blocks (in a working/functional state) with names specified for the condition to be satisfied.
Allowed Values: Any name string excluding characters :, [, ]
Multiple Tag Allowed: Yes
Tag:                                RequiredAnyFunctionalBlockNames
Tag Format: [RequiredAnyFunctionalBlockNames:Value]
Description: Specifies the name of a Block you want checked for if UseRequiredFunctionalBlocks is true. If this tag contains values, then the grid must have Any blocks (in a working/functional state) with names specified for the condition to be satisfied.
Allowed Values: Any name string excluding characters :, [, ]
Multiple Tag Allowed: Yes
Tag:                                RequiredNoneFunctionalBlockNames
Tag Format: [RequiredNoneFunctionalBlockNames:Value]
Description: Specifies the name of a Block you want checked for if UseRequiredFunctionalBlocks is true. If this tag contains values, then the grid must have No blocks (in a working/functional state) with names specified for the condition to be satisfied.
Allowed Values: Any name string excluding characters :, [, ]
Multiple Tag Allowed: Yes
Tag:                                CheckTargetAltitudeDifference
Tag Format: [CheckTargetAltitudeDifference:Value]
Description: Specifies if the condition should check the altitude difference between itself and its current target. Only works if NPC has a valid target and the NPC is in planetary gravity.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                MinTargetAltitudeDifference
Tag Format: [MinTargetAltitudeDifference:Value]
Description: The minimum target altitude difference that must be met if CheckTargetAltitudeDifference is true.
Allowed Values: Any number equal or greater than 0
Must be lower than MaxTargetAltitudeDifference
Multiple Tag Allowed: No
Tag:                                MaxTargetAltitudeDifference
Tag Format: [MaxTargetAltitudeDifference:Value]
Description: The maximum target altitude difference that must be met if CheckTargetAltitudeDifference is true.
Allowed Values: Any number equal or greater than 0
Must be higher than MinTargetAltitudeDifference
Multiple Tag Allowed: No
Tag:                                CheckTargetDistance
Tag Format: [CheckTargetDistance:Value]
Description: Specifies if the condition should check the distance difference between itself and its current target. Only works if NPC has a valid target.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                MinTargetDistance
Tag Format: [MinTargetDistance:Value]
Description: The minimum target distance difference that must be met if CheckTargetDistance is true.
Allowed Values: Any number equal or greater than 0
Must be lower than MaxTargetDistance
Multiple Tag Allowed: No
Tag:                                MaxTargetDistance
Tag Format: [MaxTargetDistance:Value]
Description: The maximum target distance difference that must be met if CheckTargetDistance is true.
Allowed Values: Any number equal or greater than 0
Must be higher than MinTargetDistance
Multiple Tag Allowed: No
Tag:                                CheckTargetAngleFromForward
Tag Format: [CheckTargetAngleFromForward:Value]
Description: Specifies if the condition should check the angle difference between itself (forward direction) and its current target. Only works if NPC has a valid target.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                MinTargetAngle
Tag Format: [MinTargetAngle:Value]
Description: The minimum target angle difference that must be met if CheckTargetAngleFromForward is true.
Allowed Values: Any number equal or greater than 0
Must be lower than MaxTargetAngle
Multiple Tag Allowed: No
Tag:                                MaxTargetAngle
Tag Format: [MaxTargetAngle:Value]
Description: The maximum target angle difference that must be met if CheckTargetAngleFromForward is true.
Allowed Values: Any number equal or greater than 0
Must be higher than MinTargetAngle
Multiple Tag Allowed: No
Tag:                                CheckIfTargetIsChasing
Tag Format: [CheckIfTargetIsChasing:Value]
Description: Specifies if the condition should check the velocity direction angle from the current target to the NPC. Only works if NPC has a valid target.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                MinTargetChaseAngle
Tag Format: [MinTargetChaseAngle:Value]
Description: The minimum target velocity angle difference that must be met if CheckIfTargetIsChasing is true.
Allowed Values: Any number equal or greater than 0
Must be lower than MaxTargetChaseAngle
Multiple Tag Allowed: No
Tag:                                MaxTargetChaseAngle
Tag Format: [MaxTargetChaseAngle:Value]
Description: The maximum target velocity angle difference that must be met if CheckIfTargetIsChasing is true.
Allowed Values: Any number equal or greater than 0
Must be higher than MinTargetChaseAngle
Multiple Tag Allowed: No
Tag:                                CheckIfGridNameMatches
Tag Format: [CheckIfGridNameMatches:Value]
Description: Specifies if the condition should check the name of the NPC CubeGrid matches a provided value.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                AllowPartialGridNameMatches
Tag Format: [AllowPartialGridNameMatches:Value]
Description: Specifies if the NPC CubeGrid name can be a partial match instead of exact.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                GridNamesToCheck
Tag Format: [GridNamesToCheck:Value]
Description: Specifies the name(s) to check against the NPC CubeGrid name.
Allowed Values: Any Grid Name
Multiple Tag Allowed: Yes
Tag:                                AltitudeCheck
Tag Format: [AltitudeCheck:Value]
Description: Specifies if the Altitude of the NPC should be checked for min/max values.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                MinAltitude
Tag Format: [MinAltitude:Value]
Description: The minimum NPC altitude that must be met if AltitudeCheck is true.
Allowed Values: Any number equal or greater than 0
Must be lower than MaxAltitude
Multiple Tag Allowed: No
Tag:                                MaxAltitude
Tag Format: [MaxAltitude:Value]
Description: The maximum NPC altitude that must be met if AltitudeCheck is true.
Allowed Values: Any number equal or greater than 0
Must be higher than MinAltitude
Multiple Tag Allowed: No
Tag:                                CheckIfDamagerIsPlayer
Tag Format: [CheckIfDamagerIsPlayer:Value]
Description: If trigger was activated by a Damage event, this tag specifies if the Damager should be a Player Identity.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CheckIfDamagerIsNpc
Tag Format: [CheckIfDamagerIsNpc:Value]
Description: If trigger was activated by a Damage event, this tag specifies if the Damager should be an NPC Identity.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CheckIfTargetIsPlayerOwned
Tag Format: [CheckIfTargetIsPlayerOwned:Value]
Description: Specifies if the current NPC targer should be a Player Owned entity.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CheckIfTargetIsNpcOwned
Tag Format: [CheckIfTargetIsNpcOwned:Value]
Description: Specifies if the current NPC targer should be an NPC Owned entity.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CheckCommandGridValue
Tag Format: [CheckCommandGridValue:Value]
Description: If trigger was activated by a Command event, this tag specifies if a check should be performed on the Grid Value (aka Threat Score) of the NPC that sent the command.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CommandGridValue
Tag Format: [CommandGridValue:Value]
Description: If using CheckCommandGridValue, this tag specifies the Grid Value that the received Grid Value from the command should be compared against.
Allowed Values: Any Number Greater Than 0
Multiple Tag Allowed: No
Tag:                                CheckCommandGridValueCompare
Tag Format: [CheckCommandGridValueCompare:Value]
Description: If using CheckCommandGridValue, this tag specifies how the Received Grid Value is compared against the value provided in CommandGridValue.
Allowed Values: Equal
NotEqual
Greater
GreaterOrEqual
Less
LessOrEqual
Multiple Tag Allowed: No
Tag:                                CompareCommandGridValue
Tag Format: [CompareCommandGridValue:Value]
Description: If trigger was activated by a Command event, this tag specifies if a check should be performed on the Grid Value (aka Threat Score) of the NPC that sent the command. This check compares the received Grid Value directly against the value of the NPC that received the command / activated the trigger.
Allowed Values: true
false
Multiple Tag Allowed: No
Tag:                                CompareCommandGridValueMode
Tag Format: [CompareCommandGridValueMode:Value]
Description: If using CompareCommandGridValue, this tag specifies how the Received Grid Value is compared against the Grid Value of the NPC.
Allowed Values: Equal
NotEqual
Greater
GreaterOrEqual
Less
LessOrEqual
Multiple Tag Allowed: No
Tag:                                CompareCommandGridValueSelfMultiplier
Tag Format: [CompareCommandGridValueSelfMultiplier:Value]
Description: If using CompareCommandGridValue, this tag specifies a multiplier that is applied to the Grid Value of this NPC before the comparing of values is completed.
Allowed Values: Any Number Greater Than 0
Multiple Tag Allowed: No
Tag:                                CommandGravityCheck
Tag Format: [CommandGravityCheck:Value]
Description: This tag allows you to specify if both NPCs involved with transmission of a command are inside the same gravity field.
Allowed Value(s): true
false
Multiple Tags Allowed: No
Tag:                                CommandGravityMatches
Tag Format: [CommandGravityMatches:Value]
Description: This tag allows you to specify if the gravity of both NPCs involved with the transmission of a Command should match.
Allowed Value(s): true
false
Multiple Tags Allowed: No
Tag:                                UseFailCondition
Tag Format: [UseFailCondition:Value]
Description: This tag specifies if the Condition Profile should pass if the conditions fail. Should all conditions pass, then the profile would evalate as failed.
Allowed Value(s): true
false
Multiple Tags Allowed: No
Tag:                                CheckForBlocksOfType
Tag Format: [CheckForBlocksOfType:Value]
Description: This tag specifies if certain working/functional block types should be searched for on the grid. If all provided types are found (at least one block of each type), then this condition passes.
Allowed Value(s): true
false
Multiple Tags Allowed: No
Tag:                                BlocksOfType
Tag Format: [BlocksOfType:Value]
Description: This tag specifies the types of blocks that are searched for on the grid.
Allowed Value(s): Any Block TypeId
eg: MyObjectBuilder_BatteryBlock
Multiple Tags Allowed: Yes
Tag:                                CheckHorizonAngle
Tag Format: [CheckHorizonAngle:Value]
Description: This tag allows you to check the NPC current forward direction against the angle of the horizon (90 degree from 'up' on a planet)
Allowed Value(s): true
false
Multiple Tags Allowed: No
Tag:                                MinHorizonAngle
Tag Format: [MinHorizonAngle:Value]
Description: This tag allows you to specify the minimum angle that is checked against the horizon if using CheckHorizonAngle
Allowed Value(s): Any Number Greater/Equal To 0
Value must be Less Than or Equal to MaxHorizonAngle if provided.
Multiple Tags Allowed: No
Tag:                                MaxHorizonAngle
Tag Format: [MaxHorizonAngle:Value]
Description: This tag allows you to specify the maximum angle that is checked against the horizon if using CheckHorizonAngle
Allowed Value(s): Any Number Greater/Equal To 0
Value must be Less Than or Equal to MinHorizonAngle if provided.
Multiple Tags Allowed: No
Tag:                                CheckForSpawnConditions
Tag Format: [CheckForSpawnConditions:Value]
Description: This tag allows you to check if the encounter was spawned using a specific SpawnCondition Profile.
Allowed Value(s): true
false
Multiple Tags Allowed: No
Tag:                                RequiredSpawnConditions
Tag Format: [RequiredSpawnConditions:Value]
Description: This tag allows you to specify one or more SpawnCondition Profile SubtypeIds that will be checked against if using CheckForSpawnConditions.
Allowed Value(s): Any String Value
Multiple Tags Allowed: Yes
Tag:                                CheckForPlanetaryLane
Tag Format: [CheckForPlanetaryLane:Value]
Description: This tag allows you to check if the encounter is currently inside or outside of a Planetary Lane.
Allowed Value(s): true
false
Multiple Tags Allowed: No
Tag:                                PlanetaryLanePassValue
Tag Format: [PlanetaryLanePassValue:Value]
Description: This tag specifies whether the grid must be in a planetary lane in order for the CheckForPlanetaryLane check to pass.
Allowed Value(s): true
false
Multiple Tags Allowed: No
Tag:                                IsAttackerHostile
Tag Format: [IsAttackerHostile:Value]
Description: This tag allows you to specify if the condition should check if the attacking entity has a hostile relation with the NPC. This tag should only be used on triggers using the Damage type.
Allowed Value(s): true
false
Multiple Tags Allowed: No
Tag:                                IsAttackerNeutral
Tag Format: [IsAttackerNeutral:Value]
Description: This tag allows you to specify if the condition should check if the attacking entity has a neutral relation with the NPC. This tag should only be used on triggers using the Damage type.
Allowed Value(s): true
false
Multiple Tags Allowed: No
Tag:                                IsAttackerFriendly
Tag Format: [IsAttackerFriendly:Value]
Description: This tag allows you to specify if the condition should check if the attacking entity has a friendly relation with the NPC. This tag should only be used on triggers using the Damage type.
Allowed Value(s): true
false
Multiple Tags Allowed: No
⚠️ **GitHub.com Fallback** ⚠️