Jump to content

[Help] Enable/Disable objects after quest.


PANDArek

Recommended Posts

I'm currently remaking Harbinger's Room to PlayerHome and I could use some help in scripting.
I want some Kodlak's stuff disabled and my objects enabled after you complete quest Glory of the Dead.

I have everything set. I Connected objects to two xmarkers - one to disable and one to enable stuff (enableparent) and xmarker with my objects is 'initially disabled'.


Now I don't know what to do. I've heard you can play with aliases in quest. I tried to figure it out by tracking objects in Whiterun e.g. houses appear destroyed after Battle for Whiterun (CWSiegeObj). My plan is similar but I can't do that.


I would be happy if someone write me a simple script and point me the way.

Let's say xmarkers are called DisableobjectsMarker and EnableobjectsMarker and the quest's ID is C06


Thanks.

Link to comment
Share on other sites

No idea how you intend to listen for the status of the quest C06.

I know you can use an object or other quest that you have started by some other means and use that to listen for the appropriate point in C06 to perform your actions by means of an update loop.

IsCompleted for when the quest completes

IsStopped for when the quest is stopped (even if it does not complete)

IsStageDone for when it needs to happen while the quest is still running at some mid-point stage.

 

An example for this method:

 

 

Create some quest and devise a way for it to start before C06 completes or even starts, then every one second of real time you'll check to see if C06 is at the correct spot (whether that be completed / stopped or at a certain stage)

 

 

ScriptName SomeScript Extends Quest
 
Quest Property C06 Auto
ObjectReference Property DisableObjectsMarker Auto
ObjectReference Property EnableObjectsMarker Auto
 
Event OnInit()
 RegisterForSingleUpdate(1.0)
EndEvent
 
Event OnUpdate()
 If C06.IsCompleted() ;change to appropriate function call depending upon needs
  DisableObjectsMarker.Disable()
  EnableObjectsMarker.Enable()
 Else
  RegisterForSingleUpdate(1.0)
 EndIf
EndEvent

 

 

 

 

 

 

That said, there is a matching condition function for one of the above which you can use within a particular stage of a different quest

GetStageDone for when it needs to happen while the quest is still running at some mid-point stage.

 

If you go this route, you just need the following within the stage fragment (after making the properties of course)

DisableObjectsMarker.Disable()
EnableObjectsMarker.Enable()

The final option and a poor choice for compatibility reasons is to edit C06 directly and put the enable / disable stuff in the appropriate stage fragment.

 

There are probably other possible methods out there. There always seems to be multiple ways to skin a cat... These are just the ones I can think of off the top of my head.

Link to comment
Share on other sites

I did it my way but Thank You for pointing me in the right direction.

Your method is too complicated for me and it is my first time with modding.

 

 

CustomQuest has 2 stages:

Stage 1 begins when u walk in setstageontriggerplayeronly placed in Ysgramor's Tomb

Condition: GetStageDone C06 Stage 200

I added two xmarks to Quest Aliases and xmarker with my new stuff is allowed to be disabled.

script:

Alias_DisableKodlakstuffMarker.GetReference().Disable()
Alias_DragonbingerPlayerHome.GetReference().Enable()

(Dragonbinger is the name of my mod)

 

Stage 2

ends when u walk in setstageontriggerplayeronly placed in doors to Kodlak's room

 

I had to put everywhere conditions (GetStageDone) even on triggers.

 

 

Apparently everything works as I wanted but I wrote quest name and log entry and it doesn't pop out. It is just hidden and runs in the background.

 

Is my solution good and compatibility friendly ?

 

Now I have to fix my weapon racks becouse I can't pick up weapons I put in there and it's done.

Edited by PANDArek
Link to comment
Share on other sites

Without seeing what you modified, I cannot begin to speculate about compatibility. If everything you worked with was added by you, then compatibility should not be an issue (unless someone else directly modified the C06 quest and changed what the stages to, but that would be rare most likely).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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