Looking for a script command...

Post » Fri Feb 18, 2011 10:54 pm

Hello. I am looking to set the "set fQuestDelayTime to .1" in order to quickly update a dialog option.

But I only want that script to run long enough to update the dialog option.

So I am looking for a command which causes the script to "wait" for a few seconds, and then after said wait, set the delay time back to 5 seconds.

Something like this

Set (quest).Fquestdelaytime to .1
Wait 2 seconds
Set (quest).Fquestdelaytime to 5

Does anyone know the name of a "wait" function that I could use in such a case? I can't find it in google.
User avatar
Sophie Louise Edge
 
Posts: 3461
Joined: Sat Oct 21, 2006 7:09 pm

Post » Sat Feb 19, 2011 10:54 am

GetSecondsPassed might be useful.
User avatar
lolly13
 
Posts: 3349
Joined: Tue Jul 25, 2006 11:36 am

Post » Sat Feb 19, 2011 9:12 am

edit: scrap that. I misread the OP.

But still, you can't implement a delay or wait function over one run of a script's execution. Your game will freeze for as long it takes this delay to end.
You will have to let your script run to its end so other scripts and processes get the chance to run and do something.

You can use GetSecondsPassed to make a timer run down which is checked against < 0 for the next run through your script, basically making your script wait for the timer to run out before it does anything again.
    ...    set timer to timer - GetSecondsPassed    if timer > 0        return ; ends execution of your script for this frame so others can execute    endif    ...    ; some place in your script where the updated dialog option shall be used    if waitForDlgOptToUpdate == 1 ; we were waiting 2 seconds for it to update        set (quest).fQuestDelayTime to 5        set waitForDlgOptToUpdate to 0 ; execute this block only once        ; do whatever you had to wait for the update for    endif    ; ---    ...    ; some place in your script where you want the dialog option to update        set timer to 2 ; will make it wait 2 seconds, as in not pass the initial check above before 2 seconds are over        set (quest).fQuestDelayTime to 0.1        set waitForDlgOptToUpdate to 1    ; ---    ...

User avatar
Jason Wolf
 
Posts: 3390
Joined: Sun Jun 17, 2007 7:30 am

Post » Fri Feb 18, 2011 11:31 pm

This might be useful:

http://planetelderscrolls.gamespy.com/View.php?id=103&view=Other.Detail
User avatar
Russell Davies
 
Posts: 3429
Joined: Wed Nov 07, 2007 5:01 am


Return to IV - Oblivion