Let’s take a closer look at the character-related tags.
Here is the sample we will be creating in this section.
Sample Screen:
TyranoScript includes a wide range of built-in functions for controlling characters,
which are essential for visual novel creation. Here are the main tags used for character control:
;Register character Akane
[chara_new name="akane" storage="akane1.png" jname="Akane"]
;Register character Yamato
[chara_new name="yamato" storage="yamato1.png" jname="Yamato"]
;Register character Akane
[chara_new name="akane" storage="akane1.png" jname="Akane"]
;Register character Yamato
[chara_new name="yamato" storage="yamato1.png" jname="Yamato"]
;Display character Akane
[chara_show name="akane"]
;Display character Yamato
[chara_show name="yamato"]
As it is, it’s hard to tell who is speaking, right?
Let’s display the name of the character who is currently speaking.
First, define an area where the character’s name will be shown:
[ptext name="chara_name_area" layer=message0 width="200" color=white x=40 y=300 size=26]
This creates a text area for the message window using the [ptext] tag.
[ptext name="chara_name_area" layer=message0 width="200" color=white x=40 y=300 size=26]
[chara_config ptext="chara_name_area"]
#akane
Nice to meet you. I’m Akane.[l][cm]
#yamato
Hello. I’m Yamato. [l][cm]
It can be tedious to specify a different image every time you want to change a character's expression.
If you pre-register a set of facial expressions, you can switch expressions just by specifying them.
; Register facial expression
[chara_face name="yuko" face="angry" storage="newface.png"]
; Apply the expression
[chara_mod name="yuko" face="angry"]
; Change both expression and speaker name
[chara_ptext name="yuko" face="angry"]
; Shortcut syntax. The following line means the same
#yuko:angry
; The image registered in [chara_new] can be called with the name "default"
#yuko:default
So, what do you think? In addition to what we covered, there are other functions like hiding characters and changing facial expressions.
They’re just as easy to use—simply specify the character’s name
attribute that you defined earlier.
Here’s a sample that includes all of the above. Feel free to use it as a reference.
@wait time=1000
[title name="Character Tag Sample"]
@hidemenubutton
; Adjust message window size
; Load useful plugins for visual novels
[call target=*start storage="tyrano.ks"]
; Adjust text speed
[delay speed=30]
; Temporarily hide the message window
@layopt layer=message0 page=fore visible=false
@layopt layer=message0 page=back visible=false
; Show background
[bg storage="stage.jpg" ]
; Set ptext area for displaying character names
[ptext name="chara_name_area" layer=message0 width="200" color=white x=40 y=300 size=26]
; Position message box at the bottom and set frame image
[position height=200 top=280 ]
[position layer=message0 page=fore frame="frame.png" margint="50" marginl="30" marginr="40" marginb="30"]
[cm]
; Show message layer
@layopt layer=message0 visible=true
[chara_config ptext="chara_name_area"]
[chara_new name="akane" storage="akane1.png" jname="Akane"]
[chara_new name="yamato" storage="yamato1.png" jname="Yamato"]
Now displaying characters[l][r][cm]
[chara_show name="akane"]
[chara_show name="yamato"]
#akane
Nice to meet you. I’m Akane[l][cm]
#yamato
Hi, I’m Yamato. [l][cm]
I'm going to exit now[l][cm]
[chara_hide name=yamato]
#akane
Looks like Yamato is gone.[l][cm]
#akane
I'll disappear too[l][cm]
[chara_hide name=akane]
; Writing just # hides the name display
#
No one’s left now.[l][cm]
Akane is back on screen[l][cm]
[chara_show name="akane"]
Now changing facial expression[l][cm]
[chara_mod name="akane" storage="akane2.png"]
[l]
That concludes the sample.
[s]