"NANIKA"
Documents - Script References -


Basic Structure

Many scripts are composed by "entry name" and "main body". The following examples are part of the "SAKURA" main script source:
#timeout alternate
count4
#timeout alternate0
\s4Select quickly!!\w8\1Hmm... Perhaps User is busy.\e
#timeout alternate1
\s4Ah....\nI was ignored??\w8\1Hmm... User is playing.\e
#timeout alternate2
\s4Hmm...\w8I was not seen!!\w8\1How irritating!!\e
#timeout alternate3
\s4A long\w8long\w8time ago, If you did not wait for the timeout... There was an adventure game in which the player died no matter what was selected?\w8\1ONI-GA-SHIMA?\e
The entry is described by #[id]. The following line is the main body.
All lines that are not an entry or main body are considered to be a comment line.
*
Many scripts have [SAKURA] as the header in the first line.

Tags

A character string which begins with \(US - backslash , Japan - The yen symbol) is a tag used for controls and command execution.
Basically, the main body describes the lines. However, a better definition of the tag usage is that it is required to correctly display lines.
Form Control Type
\eEnd of script. Return to normal operation.
\0Start of a command sent to the main body
\1Start of a command sent to the unyu body
\s[id]Changes the active body surface to id number [id]
\b[id]Changes the active body baloon surface to id number [id]
\nLine feed
\w?Wait. Wait 50*[?]ms. Be careful about the usage of square bracket. (That was the old specification.)
\_w[?]High resolution wait. Wait [?]ms.
\j[id]Jump. If the [id] is an entry name, it will jump to this entry. If [id] is a URL, it will call the url in a web browser. The URL is required to be in the complete format. (It must start with " http://... ")
\cClear the active scope display area and move the cursor location to (0,0). Usually, this tag is used to clear a text box after using the \x command.
\xPause and wait for a mouse click. When a click is received, it will go to the next line.
\tStart a time critical session. In a time critical session, the methods by which the situation is usually destroyed is not possible.(Such as opening the right click menu, double clicking, auto check, etc.) A critical session is effective until \e is received.
\_qStart a quick session. In a quick session, all message are displayed with no delay. A quick session is effective until \_q is received again or \e is received.
\_sStart a synchronized session. In a synchronized session, all of the main body and unyu messages are displayed at the same time. A synchronized session is effective until \_s is received again or \e is received.
\_l[x,y]Forces the cursor location for the active body to be moved to location [x,y].
Fonts
basic - \f[color,255,0,0]
\f[color,r,g,b]if idstring == color, Change font color temporary. r,g and b is RGB value.
\f[shadowcolor,r,g,b]if idstring == shadowcolor, Change font shadow color temporary. r,g and b is RGB value.
expression Type
\_b[filename,x,y]Display bitmap file named [filename] to location (x,y) of the active body display area window. Usually, the bitmap format used is the png format. In bitmap display, the color at location(0,0) is transparent. Bitmap only displays the current sentence.
Selection Control Type
\q?[id][string] Displays choices with the title as [string]. [id] is the "SAKURA" script entry when selected or event identifier for SHIORI OnChoiceSelect event. [?] is the number of available choices. set unique number by each choices.(\q0 - \q9)
\*The next selection will not time out.
Misc Executable Type
\vSets to be foreground window.
\6Connect to sntp server, and fix local time just now.
\7Connect to sntp server, and calculate delay for local time, and go to OnSNTP series session.
\4Active scope characters move a constant distance in the direction where two characters.
\5Active scope characters move to the distance where two charactors comes in contact.
\_v[filename]Play the wave file named [filename]. The file is required to be located in the data/ directory. (For a skin, set to skin current directory). If file doesn't exist, an error will not occur.
\_VWait for the wave file which was started with \_v to finish playing. If no wave file was played or it already finished, this script is ignored.
\i[id]Start Animation pattern specified id number.
\_eCauses the active body display area window to be closed.
\-Ends the program immediately.
\+ Changes the current ghost. The ghost that will be changed to is the next ghost in sequential order. If all currently installed ghosts are changed through, the order is repeated without overlapping.
\_+Changes the current ghost. The ghost selected is random.
Special type
\m[umsg,wparam,lparam](SSTP authority level only!!)execute postmessage(hwnd,umsg,wparam,lparam) to window handle which sent beforehand by WHnd header.
Faked AI type
\aExecute GET Sentence request to SHIORI. And talks as one like.
\_c[sentence]Execute GET Sentence with Sentence request with sentence to SHIORI. And insert response just behind tag.
\__cDisplays COMMUNICATE box
\__tDisplays TEACH box

Environent Variable

The character string which starts with % is a meta string. These strings are replace with appropriate strings when displayed.
Basic Information
%monthCurrent month
%dayCurrent day
%hourCurrent hour
%minuteCurrent minute
%secondCurrent second
%usernameUser name(called name)
%selfnameMain body name(correct)
%selfname2Main body name(Wrong)
%keronameUnyu body name
Special Information
%screenwidth
%screenheight
Screen width and height, If the system uses multiple monitors, it returns only primary monitor information.
%exhCurrent uptime displayed in minutes.Unit sign is not added
%etCurrent uptime - Incorrect display, randomly appends different measurement types.
%songnameSong name showing the last identified song.
Faked AI type
%msNoun - Someone's name
%mzNoun - Inorganic substance
%mlNoun - Collectives
%mcNoun - A company name
%mhNoun - A shop name
%mtNoun - Skills, techniques, etc.(specifically "Waza" ; for example, "Judo-Chop")
%meNoun - A type of food
%mpNoun - A place name
%m?Noun - unlimited
%dmsNoun - Long noun which connects two or more parts of speech. Like "AA by which BB to CC"
Structure Type
%j[#entry]entry of specified #entry. For example:
#temp
\0\s0%j[#temp0]\e
#temp0
CardCaptor %ms


Escape Sequence

\ is escaped with \\. And, % is escaped with \%.
Only the right square bracket, ] is escaped with \].

Multiple Entry

Two or more reactions can be prepared for the same situation at the script level.
  • Example 0:
    #hoge
    hoge
          
    In this example, #hoge entry returns the string "hoge".
  • Example 1:
    #hoge
    count2
    #hoge0
    hoge
    #hoge0
    uge
          
    When used like this, the #hoge entry returns either "hoge" or "uge" with a 50% / 50% chance.

return to specifications page

This page is based on phase 104.00 (2001/07/31)
This page was translated by:Yoshiyuki.Sakakibara