Jump to content

Setting delay


Ignis010

Recommended Posts

So I have a problem and here's a basic example of a script:

 

scn MyScript

 

short Button

 

begin onActivate player

 

ShowMessage MyMessageWith2Buttons

 

end

 

begin MenuMode 1001

 

if ( Button == 0 )

ShowMessage MessageDone

 

* * *

 

MyREF.Enable

 

endif

end

 

What I want to achieve is to find some way to insert a 24/48h delay (in-game time) after the ShowMessage MessageDone. I want the message displayed right after the player presses the button, but additionally I want MyREF.Enable to kick in after some delay - i.e 24h, not instantly.

 

Can you help me?

Link to comment
Share on other sites

Something like this in a quest:

 

Short Days1

Short Days2

 

begin gamemode

if "Global" == 1 ;use a Global here so the 1 day starts when you find your ref

set Days1 to GameDaysPassed

set Global to 2 ;Keep the value

endif

if Global == 2

set Days2 to GameDaysPassed ;get Current day

Set Days2 to Days2 -Days1 ;If the difference between those 2 are >= 1,1 day have passed.

if Days2 >= 1

MyRef.enable

set Global to 3

endif

end

 

 

Link to comment
Share on other sites

scn MyScript

int bMsgBox
int iButton
int iDelay

Begin OnActivate
if (IsActionRef Player)
	if (bMsgBox == 0 && iDelay == 0)
		set bMsgBox to 1
		ShowMessage MyMessageWith2Buttons
	endif
endif
Rnd

Begin MenuMode
if (bMsgBox)
	set iButton to GetButtonPressed
	if (iButton > -1)
		if (iButton == 0)
			set iDelay to (GameDaysPassed + 2)
			ShowMessage MessageDone
		endif
		set bMsgBox to 0
	endif
endif
End

Begin GameMode
if (iDelay)
	if (GameDaysPassed >= iDelay)
		MyREF.Enable
		set iDelay to 0
	endif
endif
End

Link to comment
Share on other sites

  • Recently Browsing   0 members

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