Scenes

A scene is the basic file of ChoiceScript, containing your story narrative as well as the scripting (simple programming, in essence, also often referred to as "the code") necessary to turn it into a ChoiceScript game. Scene files are located in the scenes folder of the game directory (..\web\mygame\scenes). 场景是ChoiceScript的基本文件,包含你的故事叙述以及将其转化为ChoiceScript游戏所需的脚本(本质上是简单编程,也常被称为“代码”)。场景文件位于游戏目录的scenes文件夹中(..\web\mygame\scenes)。

Format and naming 格式与命名

A scene file must use only basic text format so should only ever be edited using a standard Text Editorarrow-up-right such as Notepad++arrow-up-right. Furthermore, a scene file must always be saved with the file extension .txt. You may however name each individual file whatever you like: it is equally common to use descriptive names such as "dungeon.txt" as it is to use sequential names like "chapter3.txt". The actual players of your game do not themselves ever see your individual file names. Scene file names should not contain any spaces or capital letters. 场景文件必须仅使用纯文本格式,因此应始终使用诸如Notepad++之类的标准文本编辑器进行编辑。此外,场景文件必须始终以.txt文件扩展名保存。不过,您可以为每个单独的文件任意命名:使用描述性名称(如"dungeon.txt")与使用顺序性名称(如"chapter3.txt")同样常见。游戏的实际玩家本身永远不会看到您的单个文件名。场景文件名不应包含任何空格或大写字母。

When you create a new scene .txt file in your "scenes" folder (..web\mygame\scenes) remember to edit startup.txtarrow-up-right and add the new scene name (excluding only the .txt file extension) to your *scene_listarrow-up-right there, in sequential order. By this simple means you are effectively adding the future content of that file to your game. 当您在"scenes"文件夹(..web\mygame\scenes)中创建新的场景.txt文件时,请记得编辑startup.txt,并将新场景的名称(仅排除.txt文件扩展名)按顺序添加到您的*scene_list中。通过这种简单的方式,您实际上是在将该文件的未来内容添加到您的游戏中。

Scene file size limitations 场景文件大小限制

There is no hard and fast rule where the size of a single scene file is concerned, but generally speaking it is perhaps not wise to often exceed about 250k (or, say, 2,500 lines of code with dense narrative) due to possible issues with loading speed -- especially when played in a web browser with a poor internet connection. Bear in mind that this is very much a global medium and not everyone enjoys the latest technology. 对于单个场景文件的大小,并没有硬性规定,但一般来说,或许不宜经常超过约250千字节(或者说,大约2500行叙事密集的代码),以免可能影响加载速度——尤其是在网络连接不佳的网页浏览器中运行时。请记住,这是一个全球性的媒介,并非所有人都能享受最新的技术。

Moreover, there is no limit to the actual number of individual scene .txt files you can include in your game, using the *finisharrow-up-right and / or *goto_scenearrow-up-right commands to string them together into a complete and (almost) seamless whole, loading each scene file in turn as required, and even reloading earlier files if needed. For this reason alone there is rarely a good reason to ever use excessive file sizes in your game. 此外,您可以在游戏中包含的独立场景.txt文件数量没有限制,通过使用finish和/或goto_scene命令将它们串联起来,形成一个完整且(几乎)无缝的整体,根据需要依次加载每个场景文件,甚至在需要时重新加载之前的文件。仅凭这一点,就很少有必要在游戏中使用过大的文件。

Note that it is also possible to load new scenes completely at random, using *goto_random_scenearrow-up-right, although this is rarely a good idea except for games of a very particular nature and design. 请注意,虽然也可以通过使用*goto_random_scene来完全随机加载新场景,但这通常不是一个好主意,除非是针对特定性质和设计的游戏。

choicescript.stats.txt

In addition to your own scene files and startup.txt, there is one other essential game file always located in the "scenes" folder, called choicescript_stats.txt This file governs the appearance, layout and content of the Stats Screenarrow-up-right when a player clicks the Show Stats button in your game. It can be edited in the same way as an ordinary scene file. 除了你自己的场景文件和startup.txt之外,在"scenes"文件夹中始终还有另一个重要的游戏文件,名为choicescript_stats.txt。该文件控制着玩家在游戏中点击"显示状态"按钮时,状态屏幕的外观、布局和内容。它可以像普通场景文件一样进行编辑。

circle-exclamation