Jump to content

Help with a small script


Tobias44142

Recommended Posts

Hi, just  trying to get a simple ObjectReference to enable upon completion of "Under New Management" in SkyrimSE.  However for conflict reasons, I don't want to edit the actual script.

I created a new stand alone quest that References Under New Management Quest but I'm having trouble getting it to fire.

Scriptname TGLeaderVaultScriptTOBIAS extends ObjectReference Conditional

ObjectReference Property TGLeaderVaultXMarkerTOBIAS Auto

Quest Property TGLeaderVaultQuestTOBIAS Auto
Actor Property PlayerRef  Auto
Quest Property TGLeadership Auto


Event OnActivate(ObjectReference akActionRef)
	If akActionRef == Game.GetPlayer()
		If TGLeadership.GetStage() <= 60
		Debug.Notification ( "Sucess!" )
		TGLeaderVaultXMarkerTOBIAS.enable()

		EndIf        
	EndIf
EndEvent

I think the problem is I don't know what event to best use.  Any pointers would be greatly appreciated

Link to comment
Share on other sites

I would recommend using the story manager and use the location change event to trigger your quest when the player changes location after completing the desired quest.  However, if you want it to start right away or at the very least when the player leaves the general area, you can use either a single large trigger volume box that covers a large portion of the room where the other quest ends save an edge near the exit, or you can use multiple smaller trigger volume boxes in front of each exit to the room.  With the large box, the script would use the OnTriggerLeave event with a condition that it is the player and the desired quest is at the correct stage.  With the smaller boxes, the script would use the OnTriggerEnter event with a condition that it is the player and the desired quest is at the correct stage.  And in case the area is one that the player can revisit, disable the trigger volume boxes once they have done their thing or use a bool condition alongside the other conditions to cut processing short when the player goes through the trigger volume box additional times.

OnActivate is an event on the ObjectReference script as such quests will not receive that event.  For a list of events that quests will receive, see the Quest script.

Sample script and brief instructions for using OnTriggerEnter: https://ck.uesp.net/wiki/Complete_Example_Scripts#A_Trigger_That_Detects_When_The_Player_Enters

Link to comment
Share on other sites

Hey thanks for the reply.  Yea so what i've been doing is using the EnableonEnter and that works good.
Here's an example i use to shut off lights in other rooms in order to get around the 4 shadow light source limit
 

Spoiler

Scriptname EnableOnEnter extends ObjectReference


Event OnTriggerEnter(ObjectReference akActionRef)

    If akActionRef == Game.GetPlayer()
        LightControlXmarker.Enable()
    EndIf
    
EndEvent

Event OnTriggerLeave(ObjectReference akActionRef)

    If akActionRef == Game.GetPlayer()
        LightControlXmarker.Disable()
    EndIf
    
EndEvent

ObjectReference Property LightControlXmarker  Auto

I suppose I could do the same for this particular event.  Just trying to try something different that might have been more direct to a quest completion.

 

But what about something like:

 

Spoiler

ObjectReference Property TGLeaderVaultXMarkerTOBIAS Auto

Quest Property TGLeadership Auto

Quest Property QuestCheckingQuest Auto

 

Event OnActivate(ObjectReference akActionRef)

If akActionRef != None

If TGLeadership.GetStage() == 200

TGLeaderVaultXMarkerTOBIAS.enable()

QuestCheckingQuest.Stop() GoToState("Done")
EndIf

EndIf

EndEvent

State Done Event OnActivate(ObjectReference akActionRef)

EndEvent

EndState

But I think this is ultimately what i'm going to end up doing:
 

Spoiler

Scriptname TGLeaderVaultScriptTOBIAS extends ObjectReference Conditional

ObjectReference Property TGLeaderVaultXMarkerTOBIAS1 Auto
ObjectReference Property TGLeaderVaultXMarkerTOBIAS2 Auto
ObjectReference Property TGLeaderVaultXMarkerTOBIAS3 Auto
Actor Property PlayerRef  Auto
Quest Property TGLeadership Auto


Event OnTriggerLeave(ObjectReference akActionRef)
    If akActionRef == Game.GetPlayer() && (TGLeadership.GetStageDone(200))

        Debug.Notification ( "Sucess!" )
    
        Self.RegisterForSingleUpdateGameTime(3 * 24)
        TGLeaderVaultXMarkerTOBIAS1.Enable()

        Self.RegisterForSingleUpdateGameTime(3 * 24)
        TGLeaderVaultXMarkerTOBIAS2.Enable()

        Self.RegisterForSingleUpdateGameTime(3 * 24)
        TGLeaderVaultXMarkerTOBIAS3.Enable()

    EndIf
EndEvent

 

This way there will be a gradual set of items loaded around the Thieves Guild. 

Edited by Tobias44142
Link to comment
Share on other sites

  • Recently Browsing   0 members

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