Jump to content

(Creation kit help) 24 hour timed delay after quest stage hit?


Recommended Posts

Need a tutorial or document on how to do this. Chat GPT gave me this code but i dont know if this is useful or if there is another way of doing it.

 

Scriptname QF_PackageScript extends ObjectReference

Event OnActivate()

; Change the quest stage

QF_Quest.SetStage(20)

; Add a delay of 24 in-game hours before the NPC starts traveling

Game.GetPlayer().UpdateTravelWait(24)

; Start the NPC's package

NPCRef.AddPackage(QF_Package)

; Remove this script instance

Self.Disable()

EndEvent

Link to comment

The  normal way of testing code to see if it works is to try it out in game.

 

That said, I'm pretty sure that that instance of chatgpt conned you. Or, at least, I can't find any evidence that anyone has written an UpdateTravelWait function for fallout4, and even if they did, I suspect that calling it on the player wouldn't be the way to get it to work on the npc.

 

You might try instead utility.WaitGameTime(24.0) before sending the npc on their way.

Link to comment

Also worth looking at is RegisterForSingleUpdateGameTime()

 

Say you want to quest to wait 24 hours at stage 20, then proceed to stage 30.

 

In the stage 20 fragment, put a RegisterForSingleUpdateGameTime(24.0)

 

Then attach this script to the quest as a whole:

 

Quote

ScriptName YourQuest extends quest

 

Event OnUpdate()

    If (self.GetStage()==20)

        self.setstage(30)

    EndIf

EndEvent

 

Link to comment
On 12/23/2023 at 9:52 AM, GasMaskGhoul said:

Need a tutorial or document on how to do this. Chat GPT gave me this code but i dont know if this is useful or if there is another way of doing it.

 

Scriptname QF_PackageScript extends ObjectReference

Event OnActivate()

; Change the quest stage

QF_Quest.SetStage(20)

; Add a delay of 24 in-game hours before the NPC starts traveling

Game.GetPlayer().UpdateTravelWait(24)

; Start the NPC's package

NPCRef.AddPackage(QF_Package)

; Remove this script instance

Self.Disable()

EndEvent

 

It would be surprising if it worked. Because UpdateTravelWait is not a known function (to me).

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use