pepperman35 Posted July 9, 2022 Share Posted July 9, 2022 (edited) Does anyone have a link to where interaction conditions are published/described on the Creation Kit? I am struggling to understand Interaction Conditions placed on a Trigger. What I desire if for the Trigger to fire only if an enemy enters or is within the Trigger. I have tried Subject isAttacking and Subject GetInFaction PlayerEnemyFaction but not getting the desired results. Conditions are being used with a modified version of the Trigger.psc script. Thoughts/suggestions welcomed and appreciated. Scriptname FBR:FBR_PlinthTrigger extends ObjectReference {Trigger that watches for a target(s) to enter and exit. fireTriggerEvent function is called whenever the targets enters or leaves the trigger. fireTriggerEvent function for whatever you need -- you can use IsTargetInTrigger to check if the target has just entered or left.} Group Required_Properties ObjectReference property FBR_EaglesLandingPlinth01 auto const mandatory Faction Property pPlayerEnemyFaction Auto Const mandatory EndGroup bool bTargetInTrigger = false conditional Actor property targetRef auto { if None (default), watching for player otherwise, watching for this reference } Event onLoad() if targetRef == None targetRef = game.getPlayer() endif endEvent Event onTriggerEnter(objectReference triggerRef) if(triggerRef == targetRef) ;target has entered the trigger SetTargetInTrigger(true) ; debug.trace(self + " target has entered the trigger") endif endEvent Event onTriggerLeave(objectReference triggerRef) if (triggerRef == targetRef) ;target has left the trigger SetTargetInTrigger(false) ; debug.trace(self + " target has left the trigger") endif endEvent bool function IsTargetInTrigger() return bTargetInTrigger endFunction ; PRIVATE function - do not call from outside this script function SetTargetInTrigger(bool isInTrigger) bTargetInTrigger = isInTrigger fireTriggerEvent() endFunction function fireTriggerEvent() ; perform as set of actions when an enemy target enters/leaves trigger if (bTargetInTrigger == true) ; open the secret doors on the plinth when the enemies enter FBR_EaglesLandingPlinth01.SetOpen(True) else ; close the secret doors on the plinth when the enemies leave or die ; Utility.Wait(1.5) FBR_EaglesLandingPlinth01.SetOpen(False) endif endFunction Edited July 9, 2022 by pepperman35 Link to comment Share on other sites More sharing options...
LarannKiar Posted July 9, 2022 Share Posted July 9, 2022 The only condition list I know is this. It's for Skyrim but hopefully it helps. What I desire if for the Trigger to fire only if an enemy enters or is within the Trigger. I have tried Subject isAttacking and Subject GetInFaction PlayerEnemyFaction but not getting the desired results. Conditions are being used with a modified version of the Trigger.psc script. Thoughts/suggestions welcomed and appreciated. To detect an enemy (NPC with red name and health bar), try IsHostileToActor "PlayerRef", Run on: Subject. It's worth mentioning that some NPCs have aggro behavior and turn hostile only after you get too close to them. Link to comment Share on other sites More sharing options...
pepperman35 Posted July 9, 2022 Author Share Posted July 9, 2022 Thanks, much appreciated, and congrats on having a mod in the top mods slot this week. Link to comment Share on other sites More sharing options...
LarannKiar Posted July 10, 2022 Share Posted July 10, 2022 Thanks :) And glad I could help. Link to comment Share on other sites More sharing options...
hereami Posted December 13, 2022 Share Posted December 13, 2022 (edited) So, i'm just interested, if Interaction Conditions on Activator even work, or maybe pool of suitable condtion functions is limited? For example, what i need for now - Subject.GetEquipped() - doesn't work here. Edited December 13, 2022 by hereami Link to comment Share on other sites More sharing options...
hereami Posted December 14, 2022 Share Posted December 14, 2022 (edited) So, i'm just interested, if Interaction Conditions on Activator even work, or maybe pool of suitable condtion functions is limited? For example, what i need for now - Subject.GetEquipped() - doesn't work here.Nailed it! Fortunately, Conditions work for trigger boxes, silly me. I've never touched those Activators in CreationKit, and it appears that XEdit doesn't update Conditons Count there, so they are ignored by game or just vanish, if the file is saved in CK. Same thing happened to keywords in aliases, as i remember, but was fixed already. Edited December 14, 2022 by hereami Link to comment Share on other sites More sharing options...
Recommended Posts