Jump to content

[LE] Assistance needed with Trigger Boxes


cfinn

Recommended Posts

Hi there! I'm relatively new to modding, and have recently been working on a custom voiced follower. I've come across a bit of an impasse though. I'm trying to set it up so the actor I'm working on isn't even in the game until a certain point at a quest objective. The particular quest is TGCrown. He's been created for a while and I have started the game with him disabled.

 

I've tried several things and since modding vanilla quests isn't really a good idea, I'd prefer not to use the alias/reference method. So I've instead decided to try and enable him with a trigger box for when the player enters the Thieves Guild's Cistern. After researching everywhere, I have been unsuccessful in finding a script that will do a few things: 1) enable him and 2) enable him with the condition that TGCrown == 40. Obviously, since he's designed to be a follower, I'd like to keep him in game even after the completion of the quest and the end of the script.

 

Any information or assistance anyone could offer would be considered invaluable. And if anyone knows an exact script that would do that, it would be all the better. Anyhow, thank you for the assistance.

Edited by cfinn
Link to comment
Share on other sites

If you want to enable him when you enter a cell - use Story Manager Change location event to trigger a quest when you enter a location (GetinCurrentLoc = YourLocation and any other conditions you want - eg Getstage on a quest). Place a Xmarker with a LocRefType in the cell and you can make him appear when you enter at that location.

 

In your trigger quest you will have the following alias:

 

A Location Alias in your quest set to a Change Location Event.

A Reference Alias (eg NPCPosition) with a Location Alias Reference to whatever the LocRefType was you created

A Reference Alias (eg MyNPC) with a Create Reference to object which set your NPC to be created at NPCPosition.

 

This will happen as soon as the quest fires - You can then do anything in the quest stages or nothing up to you.

 

As a minimum your quest should have a start up stage and a shut down stage in the shut down stage you can put - Alias_MyNPC.GetReference().DeleteWhenAble()

This will remove him from the cell after you leave it.

Link to comment
Share on other sites

@cfinn

 

Sounds like you have already pre-placed the NPC and want to use a trigger box to enable him. Keep in mind there are a couple of entrances to your selected area so you may need multiple trigger boxes or just one really big one. At any rate, the script you specifcally asked for would be something along the lines of:

 

 

ScriptName MyTriggerBoxScript Extends ObjectReference

ObjectReference Property MyNPCRef Auto
{Assign the pre-placed disabled NPC}

Quest Property TGCrownQuest Auto
{Assign the desired thieves guild quest}

Bool DoOnce = false

Event OnTriggerEnter(ObjectReference akActionRef)
  ;only do this if we have not done it, if the player entered, and the quest is at a specific stage or higher
  If DoOnce == false && akActionRef == Game.GetPlayer() && TGCrownQuest.GetStage() >= 40
    MyNPCRef.Enable()
    DoOnce == true
  EndIf
EndEvent 

 

 

 

You may also wish to try the story manager method pointed out by agerweb. Since you want to have the NPC stick around, you may not want to have the quest shut down or simply not include code to re-disable the NPC if you do shut it down. You'll have to test for yourself as to what happens to the NPC when the quest shuts down, that is not something I have experience with.

Link to comment
Share on other sites

If you don't delete when able the npc will stay put and run any packets you put on him. Depends on what the author wants to achieve. It does mean you can make npcs appear where and when you want them with no scripting to worry about and SM gives full conditional control over whether the quest starts.

 

If you want to use a trigger box I would use a SM script event and drop the npc in the cell in the same way but that does require a script on the box of course and a bit more work. I tend to use this for exterior cells.

Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

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