Monogatari Documentation
HomepageGitHubDiscordTwitter
v2.1.0
v2.1.0
  • Welcome
  • Getting Started
    • Step 1: Setup Your Environment
    • Step 2: Download Monogatari
    • Step 3: Get Familiarized
    • Step 4: Make Your First Visual Novel
  • Upgrading from v1.4.1
  • F.A.Q.
  • Diagnosing Errors
  • Building Blocks
    • Script & Labels
    • Characters
    • Variables & Data Storage
    • Actions
      • Life Cycle
    • Components
      • Life Cycle
      • Built-in Properties
      • Built-in Functions
  • Script Actions
    • Choices
    • Clear
    • Conditionals
    • Dialogs
    • End
    • Gallery
    • Hide Canvas
    • Hide Character
    • Hide Character Layer
    • Hide Image
    • Hide Particles
    • Hide Video
    • Input
    • Functions
    • Jump
    • Next
    • Placeholder
    • Play Music
    • Play Sound
    • Play Voice
    • Show Canvas
    • Show Background
    • Show Character
    • Show Character Layer
    • Show Image
    • Show Message
    • Show Notification
    • Show Particles
    • Show Scene
    • Show Video
    • Stop Music
    • Stop Sound
    • Stop Voice
    • Vibrate
    • Wait
  • Components
    • Credits Screen
    • Quick Menu
    • Loading Screen
    • Main Screen
    • Choice Container
    • Save Slot
    • Text-Box
  • Configuration Options
    • Game Configuration
      • Asset Preloading
      • Internationalization
      • Saving
      • Skip Main Menu
      • Storage
    • Player Preferences
    • Split Files
  • Style & Design
    • Responsiveness
    • CSS Classes
    • HTML Data Attributes
    • Icons
    • Image Menus
  • Releasing Your Game
    • Chrome App
    • Desktop App
    • Mobile
    • Web
  • Advanced: Monogatari Development
    • Core Libraries
      • Artemis
      • Kayros
      • Pandora
    • Actions
    • Components
    • Translations
    • Events
  • Releases
    • v2.0.0.alpha.8
    • v2.0.0.alpha.7
    • v2.0.0.alpha.6
    • v2.0.0.alpha.5
    • v2.0.0.alpha.4
    • v2.0.0.alpha.3
Powered by GitBook
On this page
  • Description
  • Parameters
  • Waiting a certain amount of time
  • Waiting for player interaction

Was this helpful?

  1. Script Actions

Wait

Wait an amount of time before continuing

Description

'wait [time]'

The wait action allows us to make the game wait for a certain amount of time or for before continuing. Once the time has passed, the game will automatically continue to the next statement.

Action ID: Wait

Reversible: Yes

Requires User Interaction: Optional

Parameters

Name

Type

Optional

Description

time

number

Yes

The time in milliseconds that you want the game to wait.

Waiting a certain amount of time

monogatari.script ({
    'Start': [
        'Hello there! I want you to wait 5 seconds now',
        'wait 5000',
        'Wow, that was a long time!',
        'end'
    ]
});

In this case, the first dialog will be shown, then, when the player clicks to continue, the wait statement will make it wait for 5 seconds before the next dialog is shown.

You may be wondering why it says 5000 instead of just 5 in order to wait for 5 seconds, the reason behind it is that the wait action accepts the time in milliseconds, therefore we have to make the conversion from seconds to milliseconds for it to work as we want.

Waiting for player interaction

monogatari.script ({
    'Start': [
        'Hello there! I want you to wait 5 seconds now',
        'wait',
        'Wow, that was a long time!',
        'end'
    ]
});

If no time was provided, then when the player reaches the wait statement, the game will just stop and the player will have to click/interact again for it to continue to the next dialog.

PreviousVibrateNextCredits Screen

Last updated 4 years ago

Was this helpful?