Add to faction after door unlock

Post » Mon Mar 18, 2013 1:12 am

I'm currently working on an update to my Populated Prisons mod, that'll make the prisoners added by that mod escape prison when you open their cells. So far, I've gotten them to run away and flee the prison when they're freed, but the guards just stand there and let them run away. So, what I'm trying to do is to make the guards hostile to the prisoners as soon as their cell is opened and they flee.

To do this, I've made a PrisonEscape faction, that is friendly to the player (they won't attack you, since you freed them) and enemy to the respective Guard faction of their Hold. The problem now is that the guards kill the prisoner before they've even tried to escape.

So, I want to write a script that adds the PrisonEscape faction to the prisoner, only after their cell is opened, to simulate the guards reacting to an attempted prison break. How do I do that, and what script should I use? I'm a noob when it comes to scripting, and would be very grateful for the help.
User avatar
Barbequtie
 
Posts: 3410
Joined: Mon Jun 19, 2006 11:34 pm

Return to V - Skyrim