Jump to content

How to delay messagebox in script


amokrun1

Recommended Posts

So what I want is super basic I imagine but I am having trouble finding out how to do it.

 

I am working on a mod where you interact with an activator(a gate)to go to a new cell. Once placed in the new cell, I use a modified fade-from-white IMOD that finishes in 12 seconds. I want a messagebox to appear after 12 seconds, once the picture is completely faded in. What scripting do I need to do to apply a timer to the message so that it will always appear 12 seconds after I am placed in the new cell?

Link to comment
Share on other sites

Here you are:

scn ActivatorScript



int iStage

float fTimer





Begin OnActivate Player



if iStage == 0

   set iStage to 1

   set fTimer to 12 ; You may want to play around with this - to refine it to your liking.

   imod FadeFromWhite12Sec

endif



end



Begin Gamemode



if iStage == 1

   if (fTimer > 0)

      set fTimer to fTimer - GetSecondsPassed

   else
          if (IsImageSpaceActive FadeFromWhite12Sec != 1)

            showMessage MyMessageBox

            set iStage to 2

         endif
   endif

endif



end
Link to comment
Share on other sites

Ahhh I see you wanted it to follow you into the next cell...

 

Here's a script for the activator, we will call its variables from another script:

scn ActivatorScript


Begin OnActivate Player

if iStage == 0

   set Quest.iStage to 1
   set Quest.fTimer to 12 ; You may want to play around with this - to refine it to your liking.
   imod FadeFromWhite12Sec

endif
end

Here's the other script, just create a separate quest to manage the timer:


scn QuestScript

int iStage
float fTimer


Begin Gamemode

if iStage == 1

   if (fTimer > 0)

      set fTimer to fTimer - GetSecondsPassed

   else
          if (IsImageSpaceActive FadeFromWhite12Sec != 1)
            showMessage MyMessageBox
            set iStage to 2
         endif
   endif

endif



end

 

Link to comment
Share on other sites

Thanks, I'm going to try this tonight!

 

Another question, how do I get time to pass during cell transition? For example, if it takes two hours to travel from cell A to cell B and I want the time once in cell B to reflect this(say 9am when in cell A, go through gate, emerge in cell B and it's 11am).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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