Ignis010 Posted November 23, 2010 Share Posted November 23, 2010 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 endifend 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 More sharing options...
Aragron Posted November 23, 2010 Share Posted November 23, 2010 Something like this in a quest: Short Days1Short Days2 begin gamemodeif "Global" == 1 ;use a Global here so the 1 day starts when you find your refset Days1 to GameDaysPassedset Global to 2 ;Keep the valueendifif Global == 2set Days2 to GameDaysPassed ;get Current daySet Days2 to Days2 -Days1 ;If the difference between those 2 are >= 1,1 day have passed.if Days2 >= 1MyRef.enableset Global to 3endifend Link to comment Share on other sites More sharing options...
Ignis010 Posted November 23, 2010 Author Share Posted November 23, 2010 Thank you, I'll try it right away. Link to comment Share on other sites More sharing options...
Ez0n3 Posted November 24, 2010 Share Posted November 24, 2010 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 More sharing options...
Recommended Posts