Jump to content

Recommended Posts

Posted (edited)

SOLVED.

 

 

I have scripted a timer it works 9 out of 10 times but every now and then it hits the problem and never ends.

Does anyone know how to fix it ?

 

 

  Reveal hidden contents

 

Edited by The-Wanderer
Posted

Okay it now seems that far from working 9 out of 10 time... the "Event OnUpdateGameTime()" is now never called at all.

I put a 'Debug.Notification("here") as the first line of that event it never displays. ???

Posted (edited)

I have change the script as follows, but still it does not work???

 

 

  Reveal hidden contents

 

 

I've replaced

RegisterForUpdateGameTime()

with

registerForSingleUpdateGameTime()

But there is still a problem....

 

Debug.Notification("Wait started... ") is displayed but...

Debug.Notification("Time up...") never gets displayed

 

Has anyone any idea why OnUpdateGameTime() is never called.

This script is attached to an actors Players Dialogue.

 

.

Edited by The-Wanderer
Posted

Thanks for input :)

 

I removed the event from the fragment script and added a new script to the quest under the scripts tap with just the Event in it
everything compiled and properties updated...
but still the OnUpdateGameTime() is not firing.

 

What I have in the fragment is...

 

-=-=-=-=-=-=-=-=-=-=-
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 2
Scriptname TIF__062E8C48 Extends TopicInfo Hidden

 

;BEGIN FRAGMENT Fragment_1
Function Fragment_1(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor

 

;BEGIN CODE
TWMHGHStage.SetValueInt( 2 )
Debug.Notification("Wait started... ")
registerForSingleUpdateGameTime(24.0)
;END CODE

 

EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

 

-=-=-=-=-=-=-=-=-=-=-

 

In the new script all I have is this...

 

-=-=-=-=-=-=-=-=-=-=-

 

Scriptname TWTimerScript extends Quest

 

GlobalVariable Property TWMHGHStage Auto

 

Event OnUpdateGameTime()

TWMHGHStage.SetValueInt( 3 )
Debug.Notification("Wait over.")

EndEvent

-=-=-=-=-=-=-=-=-=-=-

 

What have I got wrong ???

Posted (edited)

With that script you will register the fragment script for update, but needs to be on the quest script.
For that, you can add a function to the quest script like this:

Function StartRegister()
RegisterForSingleUpdateGameTime(24.0)
EndFunction

Then call the function from the fragment script

(GetOwningQuest() as TWTimerScript).StartRegister()


Also possible to use states for that purpose.
See: GotoState, OnBeginState

Edited by Ghaunadaur
Posted

Thanks that works :)

Simple once you know.

 

I may have to look into states at some point but for now I'll give those a miss I don't really need them for the mod I'm working on...

this timer problem is the only dialogue that is a bit more than just plain dialogue with a few stage/objective settings

  • Recently Browsing   0 members

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