Jump to content

Guards on a Toggle?


Kraeten

Recommended Posts

I have a question concerning guard NPC's; it's a little complicated though, so please bear with me. I'd like to add guards to my player home, but I want their presence to be dependent on the player's choice. Ideally, the home would would only have guards if the player brought a specific journal to the Jarl. How would I go about doing this? Assuming this is even possible in the first place. :sweat:
Link to comment
Share on other sites

Well you would put them into your house, and set them as initialy disabled in the reference box, and on the quest stage in which you give the journal to the jarl,, you would put the code to enable them(you will probably need to create an alias for each of the guards). I would give you the exact code but steam is being an *ss right now and dont let me open my mod in which I did the same thing.
Link to comment
Share on other sites

Well you would put them into your house, and set them as initialy disabled in the reference box, and on the quest stage in which you give the journal to the jarl,, you would put the code to enable them(you will probably need to create an alias for each of the guards). I would give you the exact code but steam is being an *ss right now and dont let me open my mod in which I did the same thing.

 

Thanks for the response, now I roughly know where to begin. :woot:

Link to comment
Share on other sites

I dont know if there is a tutorial but I helped myself by looking at the quest dark brotherhood forever, they pretty much do what you want to do with their targets, just look at the quest stage and the good code should be there. Feel free to pm if you need more help.
Link to comment
Share on other sites

I dont know if there is a tutorial but I helped myself by looking at the quest dark brotherhood forever, they pretty much do what you want to do with their targets, just look at the quest stage and the good code should be there. Feel free to pm if you need more help.

 

Thanks, I'll take a look at that quest later this evening.

Link to comment
Share on other sites

You can either put the guards directly in your house and set the as "initially disabled", or you can put them in the Jarl's castle, then give them a conditioned package that will start when you give the journal to the Jarl.

 

For the 1st case:

 

- put a number of guards in the house and set all of them to "initially disabled"

 

- put an xMarker somewhere in the house, and set it too as "initially disabled"

 

- go back to each guard, find the "enable parent" tab. Create a new one and select the xMarker. Do it with all the guards. Now, enabling the xMarker will enable all the guards.

 

- Create the journal you want.

 

- Set the journal as an alias in the quest in wich you talk to the Jarl to give him this journal.

 

- Put a new script on the journal alias:

 

ObjectReference property EnableMarker auto

ObjectReference property theJarl auto

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
                if akNewContainer == theJarl && akOldContainer == Game.GetPlayer()
                           EnableMarker.Enable()
                endif
endEvent

 

- compile, exit, double click on the script, select the 2 properties and select the correct object to point at in the dropdown.

 

- Now go into the last dialogue with the Jarl (the one in wich you actually give him the journal), and call a SetStage() in the fragment.

 

- Now go into the stage you just called. In the fragment write

 

Alias_Jarl.GetReference().Additem(Alias_Journal.GetReference())

 

if the Jarl is an alias. If not, click on properties, add a new ObjectReference property and call it Jarl. Fill it with the Jarl Reference, and use this script instead.

 

Jarl.Additem(Alias_Journal.GetReference()

Link to comment
Share on other sites

  • Recently Browsing   0 members

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