Interactive Director link

Interactive Director は Ren'Py 自身の内部でゲームスクリプトを編集できるようにし、編集結果をライブプレビューできます。Director はテキストエディターの使用を完全に置き換えるものではありません。テキストエディターは台詞や選択肢、ビジュアルノベルの論理を記述するにはまだ必要です。

以下を加えて、ゲームスクリプトの監督を助けます。 :

  • Image (say, show, hide) statements.

  • Transition (with) statements.
  • Audio (play, queue, stop, voice) statements.

Director の使用 link

D (Shiftなし) キーを押しながらゲームを開始すると Director にアクセスできます。初回起動時はゲームを再起動し、編集に必要なデータを用意します。

The first director screen you'll see shows a list of lines that ran before the current line. Click outside the lines window to advance the script, or rollback outside it to roll back. Click the + between a lines to add a line, or the ✎ before a line to edit that line.

When editing a line, the statement type can be selected, along with appropriate parameters. Choose "Add" to add the new line, "Change" to change an existing line, "Cancel" to cancel editing, and "Remove" to remove an existing line.

編集が終わったら "Done" をクリックしてください。

変数 link

名前空間 director には Interactive Director の機能を制御する定義された多くの変数があります。これらは define ステートメントや Python の変更によって設定出来ます。

Scene, Show, and Hide link

director.tag_blacklist = { "black", "text", "vtext" } link
A blacklist of tags that will not be shown for the show, scene, or hide link
statements. link
director.scene_tags = { "bg" } link
The set of tags that will be presented for the scene statement, and hidden link
from the show statement. link
director.show_tags = set() link
If not empty, only the tags present in this set will be presented for the link
show statement. link
director.transforms = [ "left", "center", "right" ] link
A list of transforms that will be presented as part of the editor. link
In addition to these, any transform defined using the transform link
statement outside of Ren'Py itself will be added to the list of link
transforms, which is then sorted. link

With link

director.transitions = [ "dissolve", "pixellate" ] link
A list of transitions that are available to the with statement. Since link
transitions can't be auto-detected, these must be added manually. link

Play, Queue, Stop, and Voice link

director.audio_channels = [ "music", "sound", "audio" ] link
The name of the audio channels that can be used with the play, show link
and stop statements. link
director.voice_channel = "voice" link
The name of the audio channel used by voice. link
director.audio_patterns = [ "*.opus", "*.ogg", "*.mp3" ] link
The default list of audio patterns that are used to match the files link
available in an audio channel. link
director.audio_channel_patterns = { } link
A map from a channel name to the list of audio patterns that are link
available in that audio channel. For example, if this is set to link
``{ 'sound' : [ 'sound/*.opus' ], 'music' : [ 'music/*.opus' ] }`` the link
music and sound channels get their own lists of patterns. link

Access link

director.button = True link
If True, the director displays a screen with a button to access the link
director window. If False, the game can provide it's own access, by link
making available the director.Start action. link

Line Spacing link

director.spacing = 1 link
The spacing between a director (scene, show, hide, with, play, queue, and voice) line link
and a non-director line, or vice versa. These spacings should be 0 or 1 lines, a higher spacing link
may not work. link
director.director_spacing = 0 link
The spacing between two consecutive director lines. link
director.other_spacing = 0 link
The spacing between two consecutive non-director lines. link

Viewport link

director.viewport_height = 280 link
The maximum height of scrolling viewports used by the director. link

Audio Filename Functions link

There are a number of audio filename functions that can be used to convert filenames on disk to filenames in Python source code. This can be used to match Ren'Py functionality that maps filenames. For example, if one has:

define config.voice_filename_format = "v/{filename}.ogg"

関数を定義できます。

init python in director:

    def audio_code_to_filename(channel, code):
        """
        This converts the name of an audio filename as seen in the code,
        to the filename as seen on disk.
        """

        if channel == "voice":
            return "v/" + code + ".ogg"

        return code

    def audio_filename_to_code(channel, fn):
        """
        This converts the name of an audio filename on disk to the filename
        as seen in code.
        """

        if channel == "voice":
            return fn.replace("v/", "").replace(".ogg", "")

        return fn

    def audio_filename_to_display(channel, fn):
        """
        This converts the audio filename as seen on disk so it can be
        presented to the creator.
        """

        if channel == "voice":
            return fn.replace("v/", "").replace(".ogg", "")

        return fn

to match it.