*This feature requires "TyranoScript V400" or later.
TyranoScript comes with a ready-to-use CG Mode template.
The file `scenario/cg.ks` is the screen for CG Mode.
In other words, you simply need to jump to this scenario file from the title screen or similar.
Since this file is written entirely in TyranoScript, it's very easy to customize however you like.
This is the initial screen of CG Mode. In the template, two CGs that haven't been unlocked yet are displayed.
Now, let’s go ahead and register an image in CG Mode.
To register a CG, you need to "unlock" the image at the moment it is displayed during gameplay.
To do this, use the [cg] tag.
Let’s try applying this to the default game. There’s a part where the scene changes to a hallway, so we’ll unlock the CG at that moment.
Open the section of `scene1.ks` where the script moves to the hallway.
#Yuko
Alright, let’s move to the next scene.[p]
Heading to the hallway now.[p]
[bg time="3000" method="crossfade" storage="rouka.jpg"]
[cg storage="rouka.jpg"]
#
Oh, we’re now in the hallway.[p]
[cg_image_button graphic="toile.jpg" no_graphic="noise.jpg" x=60 y=100 width=160 height=140 folder="bgimage"]
This represents one CG image in CG Mode.
[cg_image_button graphic="rouka.jpg" no_graphic="noise.jpg" x=60 y=100 width=160 height=140 folder="bgimage"]
Next, let’s set up Replay Mode.
It’s super simple as well.
The template for the replay screen is the scenario/replay.ks file.
This is a basic setup with two initially locked replays displayed.
Let’s go ahead and register a scene for replay.
The setup is easy—just wrap the section you want to mark as a replay scene with:
[setreplay] and [endreplay]
Let’s create a sample replay using the hallway scene.
[setreplay name="rouka_scene" storage="scene1.ks" target="rouka_scene_label"]
*rouka_scene_label
[if exp="tf.system.flag_replay==true"]
[position layer="message0" left=20 top=400 width=920 height=200 page=fore visible=true]
[position layer=message0 page=fore margint="45" marginl="50" marginr="70" marginb="60"]
@layopt layer="message0" visible=true
[endif]
[bg storage="rouka.jpg"]
This is the hallway replay scene[p]
Still in the hallway replay scene[p]
Replay ends here[p]
[endreplay]
With this, the scene can be used in Replay Mode.
[replay_image_button name="rouka_scene" graphic="rouka.jpg" no_graphic="noise.jpg" x=60 y=100 width=160 height=140 folder="bgimage"]
Set the `name` to match the one you used earlier.
[if exp="tf.system.flag_replay==true"]
This checks whether the scene was accessed from Replay Mode. If so, the variable tf.system.flag_replay will be set to true.