Jump to content

Detect if an actor is near a dynamically placed activator?


Recommended Posts

I was looking at ways to detect if the player or another actor gets within a certain distance of an activator. It seemed the best way to do with was with Trigger Boxes, but unfortunately the only documentation I can find on them talks about how to create them in a cell and link them to the activator. This won't work for me, as the activator is a duplicate of the base object created by the placeatme command and could exist anywhere.

 

Is there a way to place a trigger box with papyrus as well, that can be linked to the the activator? Or is there some other way of having an event trigger when an actor is nearby? I don't want to run a script every few seconds to check, as there could be several of these activators and the performance impact is not worth it. The feature is pretty minor, so if there is no event-driven way to trigger it then I'll just have to cut it, but I wanted to see if anyone had ideas.

 

Thank you.

Link to comment
Share on other sites

You can't set linked refs at runtime in Skyrim. You have to track placed refs a different way, and there are plenty of methods to do so. Property/variable up top is likely the most common route. Or an alias, etc

Also... the Game script has a function called FindClosestActorFromRef()  and ObjectReference script has OnTriggerEnter() which could be useful if you know who you are waiting for to trigger it

Brief answers like this won't really answer your questions, but hopefully can be of some help

Link to comment
Share on other sites

It looks like the only viable option for my requirements is the Spawnable Trigger Boxes mod with the OnTriggerEnter() event. Might have to save this feature for a later update to the mod, that's a lot of work just to enable an activator when the player is within range.

Thank you both for your quick responses.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...