Skip to content

Object Functions: Cutscenes and Level Loading

Richard Kettering edited this page Jun 20, 2016 · 5 revisions
Switching levels, and Pausing level execution
  • resume_level() — Resume the most recently suspended level. See suspend_level(string) for details.
  • suspend_level(string level_file_name) — Similar to teleport('level.cfg'), but stores the previous level as level.suspended_level in the new level. Calling resume_level() will restore the old level. Multiple calls to suspend_level are allowed, and will stack appropriately. As opposed to using level.paused when drawing a pause dialog, suspend_level gives better isolation to the dialog code. However, you can't display a suspended level behind the pause dialog. For cutscenes, however, this isn't an issue.
  • teleport(string dest_level, (optional)string dest_label, (optional)string transition, (optional)playable) — teleports the player to a new level. The level is given by dest_level, with null() for the current level. If dest_label is given then the player will be teleported to the object in the destination level with that label. If transition is given, it names a type of transition (such as 'flip' or 'fade') which indicates the kind of visual effect to use for the transition. If a playable is specified it is placed in the level instead of the current one. If no_move_to_standing is set to true, rather than auto-positioning the player on the ground under/above the target, the player will appear at precisely the position of the destination object - e.g. this is useful if they need to fall out of a pipe or hole coming out of the ceiling.
Loading/Saving
  • load_game() — loads the saved game
  • load_game(transition) — loads the saved game. If transition (a string) is given, it will use that type of transition.
  • can_load_game() — returns true if there is a saved game available to load
  • checkpoint_game() — saves a checkpoint of the game
  • save_game() — saves the current game state
  • set_save_slot((optional) int slot) — Allows the user to select the save slot, if no slot is specified a dialog is displayed.
  • get_save_document(int slot) — gets the FFL document for the save in the given slot
Speech
  • show_modal(dialog) — Displays a modal dialog on the screen.

  • speech_dialog(...) — schedules a sequence of speech dialogs to be shown modally. Arguments may include a list of strings, which contain text. An integer which sets the duration of the dialog. An object which sets the speaker. A string by itself indicates an option that should be shown for the player to select from. A string should be followed by a list of commands that will be executed should the player choose that option.

  • paused_speech_dialog(...) : Like speech_dialog(), except the game is paused while the dialog is displayed.

  • transient_speech_dialog(...) — schedules a sequence of speech dialogs to be shown. Arguments may include a list of strings, which contain text. An integer which sets the duration of the dialog. An object which sets the speaker.

  • begin_skip_dialog_sequence() — command that will cause everything up until the next time end_skip_dialog_sequence() is called to be considered a single storyline sequence. If the player selects to skip the sequence between now and then everything up until the call to end_skip_dialog_sequence() will be skipped.

  • end_skip_dialog_sequence() — ends the sequence begun with begin_skip_dialog_sequence().

Miscellaneous
  • title(string text, int duration=50) — shows level title text on the screen for duration cycles

  • end_game() — Displays 'to be continued...', and returns to titlescreen.

  • begin_script(string id) — begins the script with the given ID.

  • end_script() — ends the most recent script to have begun.

  • dialog(obj, template) — Creates a dialog given an object to operate on and a template for the dialog.

Clone this wiki locally