Reserved Syntax | Keywords or labels with predefined functions |
F Commands | Commands that may only be used in the definition block |
E Commands | Commands that may only be used in the program block |
F/E Commands | Commands that may be used in the program or the definition block |
Special Text Commands | Special characters that may be used as command substitutes within displayed text blocks |
NAME | Case-insensitive string of alphanumerics and/or '_'; must begin with an alphabet letter or '_' |
LABEL | Character string consisting of '*' followed by a NAME |
NUM | Numeric expression: string(s) of numeric digits possibly connected by any of the operators '+', '-', '*', '/' |
STR | Character string enclosed by '"'s; (originally) intended for full-width Japanese chars |
%VAR | Variable that may store numeric values |
$VAR | Variable that may store character strings |
COLOR | RGB value: '#' followed by 6 hexadecimal chars |
EFFECT | Built-in effect number w/duration, or number defined by an earlier "effect" command |
ENUM | Argument must be one of the comma-separated values within the {}s |
CONDITION | Expression that returns a true/false value |
SENTENCE | A single command, or multiple commands separated by ':' |
'' | Surrounds a string literal |
[] | Surrounds optional argument(s) |
... | Follows an argument pattern that may be repeated |
Variable Number | 0 - 4095 | If 4096 is used, the initial value is undefined. |
Array Number | 0 - | Unbounded? This could cause memory issues. |
Sprite Number | 0 - 999 | Use of 1000 will cause an error. |
Enhanced Sprite Number | 0 - 255 | Use of 512 will cause an error. |
Effect Number | 2 - 255 | Use of 256 will cause an error. |
Button Number | 1 - | Unbounded? This could cause memory issues. |
Channel Number | 0 - 49 | NScr ver2.82+ allows (0-199) |
NScripter (WayBack Machine Link) | A game scripting engine |
ONScripter (WayBack Machine Link) | An open-source NScripter emulator |
ONScripter-EN (WayBack Machine Link) | English branch of ONScripter |
PONScripter (WayBack Machine Link) | Proportional ONScripter: supports Unicode and proportional fonts |
Builds an expression, where
the second number is subtracted from the first number.
The expression result is used as a numeric argument for a command.
Waits for the specified number of milliseconds, then
continues. This state can be canceled with a click.
The given number must be a normal number, not a variable - if you want
to use a variable, please use the
delay
command.
Changes the speed of text display (in milliseconds).
The number
must
be a normal number, not a numeric variable. To
use a variable, try the
textspeed
command instead.
Sets text display to the current default speed. You may set the three possible default speeds with the defaultspeed command.
Waits for the specified number of milliseconds, then
continues. This state cannot be canceled with a click.
The given number must be a normal number, not a variable - if you want
to use a variable, please use the
wait
command.
Changes
the color of the text, using HTML hexadecimal color codes (e.g. #000000
for black, #ffffff for white, and #ffffaa for pale yellow).
Please note that it only changes the color of text displayed after this
command, and not any of the text that came before.
Works much as for numeric
variables -- like the general vs. global designation -- except for
character strings.
The default value for character variables is "".
Tag for character string variables. Use this to access their contents within text.
Numeric variables can range
from %0 to %4095 -- 4096 total.
0 to 199 are general variables, while 200 and above are globals.
General variables are reinitialized upon game restart, reset, and such,
while global variables retain their values.
In other words, general variables are saved and loaded on savetime and
loadtime, but global variables remain constant throughout.
Therefore, it's best to use general variables when doing math, and to
use global variables for things like stage-clear flags, etc.
To use global variables, you'll have to specify the command
globalon
in the definition block.
The default value of a numeric variable is 0.
Tag for numeric variables. Use this to access their contents within text.
This text command produces ruby text, often used for furigana (Japanese phonetic characters that show the pronunciation of a kanji phrase).
*define rubyon game *start setwindow 10,10,20,20,24,24,0,12,0,1,1,#ffffff,0,0,639,479 ルビ機能の(暫定仕様/ざんていしよう)です。@ rubyon時、(文字/もじ)は(下詰/したづめ)で表示されます。@ (縦/たて)の(字間/じかん)を、ルビが入る分とって下さい。@ 「(承/うけたまわ)」る、とか、「(論理的/ロジカル)」みたいに、文字幅をあわせようとする機能がついてます。 ルビは折り返し改行されませんのでご注意ください。\ end
*define rubyon game *start setwindow 10,10,20,20,24,24,0,12,0,1,1,#ffffff,0,0,639,479 `This is a script that displays ruby text.@ `You can use it with Japanese examples, `(文字/もじ)`, for example.@ br `In ONScripter-EN you can even do things like `(文字/moji)` or `(`DREADFUL`/horrible)`, if not very well.@ `Be sure to use vertical spacing or insert a blank line above rubied text, so that the ruby doesn't overlap earlier lines.\ end
Creates a label with the
given name. You can use statements like
goto
to jump to this
label.
The name may contain numbers (except in the first position), single-byte
characters, and underscores, but nothing else.
OK:
*HAJIMARI
*Mike_Tom
*day01
NOT OK:
*始まり (uses
double-byte chars)
*Mike&Tom
(uses ampersand)
*01day (starts
with a number)
*asterisk
Builds an expression, where the first number is
multiplied by the second number.
The expression result is used as a numeric argument for a command.
Jumps to this label whenever
a
csel
command is executed.
Code for handling a custom select display follows this label.
*customsel skipoff *csel_st btndef clear getcselnum %0 getcursorpos %1,%2 cselbtn 0,500,%1,%2 add %2,21 cselbtn 1,501,%1,%2 if %0>2 add %2,21:cselbtn 2,502,%1,%2 if %0>3 add %2,21:cselbtn 3,503,%1,%2 if %0>4 add %2,21:cselbtn 4,504,%1,%2 *csel_loop selectbtnwait %0 if %0=-2 systemcall lookback:goto *csel_loop if %0=-1 gosub *rclk:goto *csel_st if %0>=500 & %0<=504 saveon:sub %0,500:cselgoto %0 goto *csel_loop
A special label that denotes the start of the definition block.
*define game
This label denotes the start of the program block proper.
*start end
If you write a newline directly after this slash, then the newline will be ignored.
Builds an expression, where
the first number is divided by the second number.
The expression result is used as a numeric argument for a command.
You can use colons in place of carriage returns to
separate out distinct commands.
These are most often used in if statements, e.g.
if CONDITION command1:command2:command3 ...
btnwait %0 if %0=-1 allsphide:systemcall lookback
A command that starts with ';' is a comment - Nscr will skip these.
defsub abs ; This is just a comment.
An array variable, declared
via the
dim
command.
They may range from ?0 to ?199 -- 200 in total.
Arrays may not be used as global variables.
Tag for array variables. Use this to access their contents within text, but note that you must reference exactly one array element within the array range(s) defined by dim .
*define dim ?0[10][20] start ;populate ?0[2][5] with value 20. mov ?0[2][5],20 ;used in text VAL=?0[2][3]@
`Array value = `?0[2][5]`.@
Specifies tag data accessible to gettag within a pretextgosub routine, called immediately before the following text is displayed.
[太郎/0001.wav]「太郎の台詞」
[`Taro Mendo`/0001.wav]`Taro speaking.`
Enters end-of-page wait state -- any new characters following this symbol on the same line are ignored. Once the player clicks, he is sent to the next page.
Use
this character to enter ponscripter text mode.
The following text commands work within ponscripter text mode:
@ / \ !w !s !d !sd $VAR %VAR #rrggbb
You may use '#' before any of the characters @, /, \, $, %, !, #, and _
to display the literal character, thereby preventing it from parsing as a
text command.
PONScripter text mode supports
~
-marked formatting tags; a
literal ~ can be displayed with '~~'.
Also note that carets can be used in place of double-quotes for string
arguments to commands (e.g. puttext ^Hello there^). Strings delimited in
this manner are parsed like regular double-quoted strings, but with
additional parsing for
~
formatting tags (e.g. ^~b~Hello~b~
there^ displays as "
Hello
there").
If you write a click-wait char (or newline, if linepage is active) immediately after this underscore, then the wait state/page feed is ignored.
Use
this character to enter single-byte text mode.
Japanese ONScripter must be compiled with ENABLE_1BYTE_CHAR defined to
use this mode; ONScripter-EN has it available by default.
The following text commands work within single-byte mode:
@ / \ !w !s !d !sd $VAR #rrggbb
You may use '$$' to produce the character '$'. Other text commands must
be outside single-byte mode to work - the backquote can work as a toggle
in these cases:
`I have ` %0 ` apples.@
Also note that backquotes can be used in place of double-quotes for
string arguments to commands, to have the strings be used in single-byte
mode (e.g. puttext `Hello there`; otherwise, backquotes may be used
within strings to toggle single-byte mode (e.g. ":s;#FF0000`Red text
sprite")
*define numalias name,0 clickstr `.?"`,2 savename `Save the scene`, `Load the scene`, "Memory " rmenu `Save to file`,save,`Load from file`,load game *start `Hi, this is a test. `#FF0000This is another test.#FFFFFF `_"He said so." `_"She said so." `Does it work?? mov $name,`Mion Sonozaki` `Hello there $name.@ How are you?@ br selgosub `Say "Turn to the right."`, *right, `Say "Turn to the left."`, *left, "`Do nothing.", *nothing end *right `You turned to the right.\ return *left `You turned to the left.\ return *nothing `You didn't do anything.\ return
This allows assigning a
value to a variable from within a text block.
To do so, enclose the variable and value within parentheses.
Please note that aliases may not be used - only regular variable
numbers, numeric and string values.
If multiple variable/value pairs are provided, as in { Var, Value, Var,
Value }, then all the given substitutions will be executed.
mov %2,4 : mov $3,"いない" ;the following text sets values ここでは %2 $3 、@このように{%2,15,$3,テキスト}。@ ここでは %2 $3。\
mov %2,4 : mov $3,`zilch` ;the following text sets values `Right now we have `%2` $3,@ and want to change`{%2,15,$3,`TEXT`}` values.@ `Now we have `%2` $3.\
Tags
that are targets for jumpf and jumpb.
Please do not place any display text between a jumpf/jumpb command and a
~.
Sets a PONScripter formatting tag region, which can
contain one or more of the following formatting tag values (possibly
delimited by spaces):
Font Style:
(Note that most of the tags in this section assume a font slot layout as
described in the
pmapfont
command definition.)
c
NUM
select
the font in slot NUM (0-7)
d
select the default font style (same as
c0
)
r
disable italics (default)
i
toggle italics
t
disable bold (default)
b
toggle bold
f
select the 'text' face (default)
s
select the 'display' face
Text Size:
(In this section, 'base size' refers to the font size for the active
window, while 'current size' refers to the current font size as
specified using prior text size formatting tags.)
=
NUM
set
the current size to exactly NUM pixels (0 will reset to the base size)
%
NUM
set
the current size to NUM-percent of the base size
+
NUM
increase
the current size by NUM pixels
-
NUM
decrease
the current size by NUM pixels
Text Position:
x
NUM
set
the horizontal text position to NUM pixels right of the active window's
left margin
y
NUM
set
the vertical text position to NUM pixels below the active window's top
margin
x+
NUM
adjust
the current horizontal text position NUM pixels to the right
y+
NUM
adjust
the current vertical text position NUM pixels down
x-
NUM
adjust
the current horizontal text position NUM pixels to the left
y-
NUM
adjust
the current vertical text position NUM pixels up
Indentation:
n
set the indent to the current horizontal position;
new text lines will start from this offset until the end of the current
page
u
reset the indent to the left margin; note that
this will only apply to later text lines, so use it at the end of the
last line of an indented section
The indent is also set automatically when the first character of a page
is an indenting character, as set using
pindentstr
.
puttext ^~c1~Hello there^
^Bruce: ~n~What's that you say?@ ^You don't understand indenting?~u~@ br ^Rick shuffled his feet.\
^~i %120 x-20 y-40~Heading~i =0~
Builds an expression, where the second number/string
is added/concatenated to the first number/string.
This will cause an error if the arguments are not both strings or both
numbers.
The expression result is used as a numeric/string argument for a
command.
mov ?0[0],?0[0]+1
mov $1,"●" mov $2,"あいうえお"+$1+"さしすせそ" ;Now $2 contains "あいうえお●さしすせそ".
mov $0,`Text` mov $0,$0+` String` ;Now $0 contains "Text String".
A character string enclosed by '<' and '>' is converted into a text button.
`This is a `<3`textbutton`>`.@
This syntax allows providing a numeric literal
value in hexidecimal instead of regular decimal, which can be more
convenient in some cases.
PONScripter allows this format almost everywhere regular numeric
literals are allowed, with the exception of ! and ~ text directives and
tags.
numalias ascii_slash,0x2F
This works the same as setcursor , but uses absolute onscreen coordinates, not text-relative coordinates.
Add a number to a numeric variable. If used with strings, performs string concatenation instead.
add %0,6
add $5,"ああああ"
This specifies additional characters to be treated
as "kinsoku" - forbidden at line start/end - beyond the default sets of
kinsoku characters.
The first string contains characters forbidden at the start of a line,
while the second string contains characters to be forbidden at the end
of a line.
Hides all extended sprites at the same time. (Works essentially the same as allsphide .)
Redisplays the extended sprites that were hidden by allsp2hide . (Works essentially the same as allspresume .)
Similar to msp , but moves the sprite to an absolute instead of relative position.
amsp 2,5,2,100
Similar to msp2 , but this command changes the given extended sprite's position, scale, rotation, and opacity to absolute values instead of relatively.
amsp2 0,10,20,10,10,5
Designate an archive
decompression plugin.
The character string's form is "archive-name|plugin-dll-name".
Although this can dearchive sounds, music, and images, it will not run
archived scripts.
By combining this with registry read commands, you can do many things.
For instance, as in the second example below, you could easily read the
Windows registry, find out that the machine had "To Heart" installed,
and designate the proper archive to decompress accordingly.
arc "arc.sar|scrunarc.dll"
getreg $0,"software\leaf\toheart","datadir" add $0,"\lvns3dat.pak|axlfpak.spi" arc $0
Converts a character string into a numeric variable. This works the same way as the corresponding command in C.
atoi %0,"123" atoi %3,$0
If the designated time (in
milliseconds) passes during a click wait state, proceed automatically as
if the mouse button was clicked. This command is especially useful in
engine cutscenes.
If the number specified is 0, then this command will not activate.
This
is a command developed especially for the commercial software
"Gin'iro". When you use this command, you can enter Auto Mode from the
menu. It is similar in concept to the "skip to next choice" option, but
displays characters much more slowly (with a delay defined by
automode_time). This makes it almost like a mode in which the computer
reads the text to you.
You can adjust sound playback volume from the NScr menus while Auto Mode
is progressing (MP3(BGM), voice(DWAVE 0), and SE(DWAVE 1+) are all
active and adjustable).
There are future plans to add more functionality to this command, and to
make things conform to predefined syntaxes.
When in Auto Mode (as defined by mode_ext), and when text display is not instantaneous, this sets the delay at clickwaits in milliseconds.
Disables
automatic save points beyond the first displayed sentence.
saveon
and
saveoff
commands will be ignored if this is
used.
(Savepoints will still be updated at the beginning of a display
sentence, as usual.)
Use the
savepoint
command to manually update savepoints at places
other than the beginning of sentences (e.g. at a clickable map).
Timing issues may slow down returns from data updates, for example when
recording a save point after drawing over the entire screen, so please
use common sense.
Plays the designated AVI file. If the number is 1, then if the player clicks in the middle of movie playback, the movie will be cut short. If the number is 0, then the player is forced to watch the movie in its entirety.
Initializes and displays a (horizontal) bar. The width and height variables denote how large the bar will be when it is at max value. When it is not at max value, the bar will be proportionally smaller, of course. The bar is left-justified. As the bar simply is filled in left-to-right in the designated color, please make sure that the background color for the non-filled in area doesn't match the bar color itself. Finally, if you do not call a print command (or something similar), then of course the bar (or the bar's current status) will not be displayed onscreen.
Clears
out bars.
You can think of the bars as being like life bars in fighting games,
kind of.
By
default (since ver.2.94),
bexec
won't return on arrow key or
Spacebar/Enter keypresses.
To force returning those keypresses as well, execute
bcursor
after
bclear
and before
bexec
.
Specifies behavior for when no sprite buttons are being moused over. Uses the same control string format as exbtn and spstr .
bdef "C0"
If bdown is executed after bclear and before bexec , bexec will return on a left-click even before the mouse button press is released.
Executes button processing. Both a string variable
and a numeric variable may be provided as arguments.
Button processing settings remain until
bclear
is executed.
Both the timeout setting and elapsed button processing time remain until
btime
is executed.
Possible string variable return values:
"LCLICK"
- on mouse left-click
anywhere but a sprite button
"S
(sprite-num)
"
- on mouse
left-click within a sprite button, e.g. clicking Sprite 12 returns "S12"
"TIMEOUT"
- on button processing
timeout
"RCLICK"
- on mouse right-click
"MCLICK"
- on mouse middle-click
Letter/digit/symbol keypresses return the pressed key character (e.g.
"1", "W"); note that alphabet letters will be uppercase.
Other keypress return values:
"SPACE"
- Spacebar
"RETURN"
- Return or Enter key
"CTRL"
- any Ctrl key
"SHIFT"
- any Shift key
"UP"
,
"DOWN"
,
"LEFT"
,
"RIGHT"
- Up, Down, Left, or Right arrow keys
"F1"
to
"F12"
- Function keys
"PAGEUP"
,
"PAGEDOWN"
- PageUp
or PageDown keys
The numeric variable (if provided) will contain the sprite number of the
button that was left-clicked, if applicable; if button processing ends
without a sprite button being pressed, the numeric variable will have a
return value of -1.
Since
bexec
will finish on any kind of click or keypress, be sure
to put this command within a loop if you need to check for a desired
return condition.
bexec $0,%0
Loads the background image, using the given effect and final image/color.
This command should be used when you wish to create a
background of special size or position.
A background pane of dimensions (width, height) is set at absolute
screen position (X, Y).
The
same as
bgcpy
; the current screen gets copied to the background
screen.
The text window, etc. can be displayed on top of this.
Plays the given compressed music file in a loop. Equivalent to the mp3loop command.
bgm "bgm01.mp3"
Sets whether the BGM volume should be lowered while a voice sound is playing.
bgmdownmode 1
Plays the given compressed music file one time through. Equivalent to the mp3 command.
bgm "bgm01.mid"
Changes the volume of the BGM. This applies to both bgm and mp3 commands.
bgmvol 100
Use this command if you want to blit images
instantaneously on screen (as in AIR's opening engine-driven cutscene,
for instance).
This utilizes the button image buffer, so please populate said buffer
using
btndef
beforehand.
In cases where the width of the image button is larger than the width of
the screen, the image scales accordingly.
(For instance, if one were to load 4 half-sized images and then use
blt
,
then they would instantly be blitted one after another with no
afterimage effects, like a high-speed animation. This effect was used in
AIR.)
This command writes directly to the screen, not to the backbuffer.
Therefore, after the end of the blitting, the contents of the screen may
be uncertain, in which case you should use
ofscpy
(to save the
old state) followed by
bg
(to load a new background).
Even if one saves in the midst of this blitting, the images will not be
screenshotted for the save caption.
Therefore, please limit your usage of this technique (for instance, a
demo, or a status screen/save/load menu in an SLG).
Splits a BMP image file into multiple pieces (new files) while preserving the original file. The piece files are named accordingly based on the original filename and the piece position.
bmpcut "test.bmp",3,2
Inserts
a linefeed into the text window.
Use this when you want a blank line or something similar.
Breaks
out of a single loop, proceeding to the line immediately after the
loop's
next
statement.
You cannot use this command by itself to break completely out of nested
loops - you'll need to first
break
out of the inner loop, then
break
out of the outer loop.
Unrecommended method:
BREAK *(label name)
This syntax does exist; it has the same functionality as a goto
statement.
It can break you out of nested loops, but leaves the state of the inner
loop intact.
This causes a fragmentation of the stack, making it hard to debug your
script later, so use this syntax with extreme caution.
*define game *start for %0=1 to 8 for %1=6 to 2 step -2 %0, %1 if %0=4 & %1=4 break next next click end
Creates a button from the given sprite.
If the optional parameters are omitted, the sprite displays like so:
Cell 0 on mouseoff, Cell 1 on mouseover, and (if the sprite contains at
least 3 cells) Cell 2 on mousepress.
The three optional parameters are sprite control strings, with the same
format used for
exbtn
and
spstr
. The first string executes
when the mouse is not over the button (mouseoff), the second on
mouseover of the button, and the third on mousepress of the button.
Since a control string "" does nothing, use empty control strings when
you don't want one of the three mouse button events to change the
display.
bsp 1
bsp 2,"P3,0","P3,1","P4,1"
Specifies timeout duration
for button processing.
If an optional parameter 1 is given after the timeout value, button
processing will allow the voice channel (dwave 0) to finish playing
before counting down the timeout; this is used for auto mode, etc.
btime 2000
btime 1000,1
From left to right, this is: button #, x, y, width,
height, x3, y3.
This is the command you use to create and initialize buttons. Button
numbers start from 1.
The resultant button starts at position (x,y) and is (width,height) big.
When a mouse cursor comes over the button, it will shift leftward and
upward by x3 and y3 pixels, respectively.
Look in the "btndemo" folder of the SDK for an example script.
Use this after a call to
btndef
. It will set a
region of the screen that, during a
btnwait
, will return -4 upon
mouseover.
If the given Y-value is positive, the mouseover area goes from top of
screen to Y; if the Y-value is negative, the mouseover area goes from -Y
to bottom of screen.
btndef clear btnarea -400
Sets up an image button. The previously-defined
button is cleared.
For an example, see the "btndemo" folder in the NScr SDK.
Use this between
btndef
and
btnwait
commands.
If the given flag value for
btndown
is 1, then
btnwait
will return even while the mouse button is down (normally it only
returns after the mouse button has been released after a click).
btndown 1
This designates a time limit in milliseconds for the next btnwait or btnwait2 period. When this command is used and a btnwait is activated, and if nothing happens in the specified time period, then btnwait will return -2.
This is the same as btntime , except that the timeout will wait for voices to finish.
btntime2 1000
This serves as a button
listener. The result value of the button is returned in the numeric
variable.
Return Values
:
0: no button was clicked
-1: A right-click occured
>=1: Number of clicked button
If btnwait returns a value <=0 (no button clicked), then you can
invoke btnwait again to enter the identical button wait state. But if
btnwait returns a value >=1 (some button was pressed), then the
images will stay, but all button definitions will be cleared (to save
memory).
Please consult the "btndemo" folder in the SDK for examples.
This serves as a button
listener. The result value of the button is returned in the numeric
variable.
Unlike
btnwait
, this command does not clear any button
definitions. Therefore, it will keep reading the button graphic files.
Since the buttons remain in memory even after there is no use for them,
you should call
btndef ""
after you're finished using them in
order to free up the memory.
All Possible Return Values for btnwait
(most require a separate
cmd to activate):
>=1: Number of clicked button
(user-defined via
spbtn
)
0: left-click, not on a button
-1: right-click
-2:
btntime
timeout (without
usewheel
)
-2: mouse wheel-up (if
usewheel
)
-3: mouse wheel-down (if
usewheel
)
-4: btnarea mouse-over (if
btnarea
)
-5:
btntime
timeout (if
usewheel
)
-10: Esc key (if
useescspc
)
-11: Spacebar (if
useescspc
)
-12: PageUp key (if
getpage
)
-13: PageDown key (if
getpage
)
-19: Enter key (if
getenter
)
-20: Tab key (if
gettab
)
-21 to -32: F1 to F12 key (if
getfunction
)
-40 to -43: ↑→↓← key (if
getcursor
)
-50: Insert key (if
getinsert
)
-51 to -53: Z, X, C key (if
getzxc
)
-60: Skip Mode turned off (if
getskipoff
)
-61: Auto Mode turned off (if
getskipoff
)
-70: Mouse middle-button click (if
getmclick
)
Executing btrans after bclear and before bexec will cause button processing to treat transparent areas of sprite buttons as outside the respective buttons.
When given a string "(imagename)", this generates an
NScripter-style alpha image from the two files "(imagename)_w.bmp" and
"(imagename)_b.bmp".
This produces the same output as the
bw2aconv.exe
program
included with the NScr SDK.
bw2a "test"
When given an image
filename, this looks for image files by that name in folders "w" and
"b", then generates an NScripter-style alpha image from them.
This works much the same as
bw2a
otherwise.
bw2a3 "test.bmp"
Designate the fade-out time of CD-DA audio, in milliseconds.
Designate the displayed cell for a sprite. As this is an internal state change only, it is your duty to have it reflected on the screen afterward with a print command or other such method.
This is the
exbtn
version of
cellcheckspbtn
, with the same arguments as
exbtn
.
It will only generate a complex button for sprites with two or more
cells.
Check the Samples and Customization for more information on making
complex buttons.
cellcheckexbtn 1,100,"P1,1P2"
Works the same as
spbtn
, except that it
doesn't make buttons from sprites with less than two cells.
This can be used effectively during CG mode.
(In other words, this version of
spbtn
can be quickly looped over
a set of thumbnails that may have single cells.)
for %0=0 to 9 cellcheckspbtn %0,%0+1 next
Attaches the given image
onto the right-side edge of "out.bmp".
This creates "out.bmp" from the image if it does not already exist.
Checks if there was a specified keypress at the last
btnwait
command, returning 1 if the desired key was pressed.
Allowed key types are single half-width alphabet characters, digits, or
spaces, or else one of the following macros:
"SPACE" - Spacebar
"RETURN" or "ENTER" - Enter key
"CTRL" - any Ctrl key
"UP"/"DOWN"/"LEFT"/"RIGHT" -
Up/Down/Left/Right arrow key
"F1" ... "F12" - the given Function key
"PAGEUP"/"PAGEDOWN" - PageUp/PageDown key
"SHIFT" - any Shift key
btnwait %0 checkkey %1," " checkkey %2,"ENTER"
Checks whether the log string of a backlog page is
available (to
getlog
, for example).
The second parameter tells the number of pages prior to the current one
to check for.
The first parameter will be set to 1 if the page is available, 0 if not.
Please provide a value of 1 or more for the second parameter, noting
that, since 0 is the current page, it would always be available.
checkpage %5,1
This checks for the given file on the CD drive.
If it cannot find the file, it displays the given error message in a
popup box with buttons "Retry" and "Cancel".
chkcdfile "file.dat","CDがありません"
This checks for the given file on the CD drive.
It sets the result to 1 if it finds the file, 0 otherwise.
chkcdfile_ex %0,"file.dat"
Changes the volume of the given DWAVE channel.
chvol 3,100
Clear a standing image from the current picture.
If you specify 'a', then that will clear all of them.
Returns the position of the last click - the first variable is x, the second variable is y.
The script will wait at clickwaits as usual, except that if a click happens while text is being output, then display will jump to the next pagewait (instead of the next clickwait as normal).
This function forces a click
wait state when the interpreter encounters one of the characters in the
given string.
However, if there happens to be a click wait command directly after that
character, or if that character is prefaced by a 1-byte underscore (_),
then this forced click wait state will not occur.
The second parameter decides whether this will be a simple click-wait or
a new-page wait. If the clickstr char occurs on a line past (max
textwindow lines - number), then it will use a new-page wait.
This function is convenient, but be careful -- exceptionally long lines
may still overflow the textarea. In such situations, you may want to use
a standard new-page wait or some other manual adjustment.
Please note that the character string should only contain double-byte
chars.
clickstr "」。!?",2
Specifies sounds to play when a button is clicked during a click wait state. The first string is the name of the WAV file played for a click wait state, while the second string is the WAV file played for a new-page click wait state.
Compares two character strings. Returns 0 if equal, a positive value if the first string comes before in sorting order, and a negative value if the second string comes before in sorting order.
Acquires the trigonometric cosine of the given angle, and returns the value multiplied by 1000.
cos %1,60 ;%1=500, since cos(60)=0.5
Creates a dummy 640x480
image file of the given name.
The image will contain the file name in large black letters on a white
background.
createdummy "test.bmp"
Sets a selection of choices to display using system customization. *customsel is called to handle the customized display. This command uses the same syntax as select .
csel "Choice1",*s1,"Choice2",*s2,"Choice3",*s3
Creates a button from the text of the given choice number - no need to specify the string or sprite number.
cselbtn 0,500,%1,%2
Jumps to the label of the given choice index set by csel .
cselgoto %0
Erases the given extended sprite.
If the given value is -1, it erases all extended sprites.
Closes an open CSV file. Please use this command when finished with the file; otherwise it will remain open.
(For use in read mode only)
Detects whether or not the end of a CSV file has been reached.
Returns 1 if so, 0 if not.
csveof %1
Opens a given CSV file, using the given file access
mode.
The possible modes are:
"r"
- read mode; reads a standard CSV
file
"rc"
- read encrypted mode; reads a
CSV file written in "wc" mode
"w"
- write mode; write to a standard
CSV file
"wc"
- write encrypted mode; writes
an encrypted CSV file
Note that it's possible to open a CSV file inside an NSA archive, but
only for reading.
csvopen "test.csv","r"
csvopen "angou.csv","wc"
(For use in read mode only)
Reads data items from a CSV file, in the specified order.
csvread $0,$1,%0,%2
(For use in write mode only)
Writes data items to a CSV file, in the specified order.
csvwrite 12,"test",%1,$2
If enabled, saves the message displayed in the debug window to "debuglog.txt".
Defines a default font.
NScripter defaults to MS Gothic if this command is not used.
Designate text speeds (character delays, in msec) to
use when the interpreter encounters
textspeeddefault
or the
special text command
!sd
.
From left to right, the numbers correspond to 低速(Slow), 普通(Medium), and
高速(Fast) in the textspeed menu.
defaultspeed 50,20,0
This is a special reset command that forces reinterpretation of the script starting at *define .
Sets the default volume for mp3s (BGM), from a range of 0-100. Is 100 by default.
Sets default volume for sound effects (DWAVE 1+). Ranges from 0 to 100. Is 100 by default.
This creates a user-defined command.
It will be called as a subroutine (i.e. via
gosub
).
Even though this follows variable naming conventions, user-defined
command names may not begin with "_".
defsub subname ; stuff happens here subname ; just returned from calling *subname end *subname ; got here via a gosub or call to user-def command return
*define defsub *texton game *start texton ; does "gosub *texton" _texton ; calls the original "texton" command
Sets default volume for voices (DWAVE 0). Ranges from 0 to 100. Default value is 100.
Causes a delay of specified time (in milliseconds)
that may be escaped out of by clicking.
This works the same as the special text command '!d', but here you can
supply a variable as the argument.
Completely removes the Windows menubar from NScripter.
Removes
a screenshot image from memory.
This command is meant to be used with
savescreenshot2
.
This defines BASIC-style arrays. For example, "dim
?0[10][20]" makes an array named ?0, with array slots from 0-10, and
each slot has subslots from 0-20.
In this fashion, you can use arrayed variables as if they were simple
numeric variables.
You can also make your code easier to read by using
numalias
, as
in the second example.
mov ?0[2][5],20 ;populates ?0[2][5] with value 20. mov %4,?0[3][1] ; populates %4 with the value from ?0[3][1]. VAL=?0[2][3]@ ;used in text
numalias enemyparam,10 dim ?enemyparam[10]
Sends
images created via demo draw commands (e.g.
drawbg
,
drawsp
)
directly to the screen.
Otherwise, the results of the draw commands will not be displayed.
*test saveoff ;Demo image processing is faster with saveoff. Don't forget to reenable saveon when you're done! mov %0,0 bg "bg.bmp",1 *lp resettimer drawclear drawbg2 320,240,100,100,%0*2 draw wait 5 ;ウェイトを多少いれないと、メッセージ処理が遅れがちになります。 gettimer %1 if %1>=50 add %0,%1/50 if %1<50 waittimer 50:inc %0 ;掛かった処理時間に比例して変数を変化させます。 goto *lp
Draws
the background image to the screen.
Must be followed by the
draw
command.
Draws the background image to the screen, using the
given center coordinates, scaling factors, and rotation.
The previous image can still be seen in sections outside the rotated
image rectangle; use
drawclear
beforehand if this is undesirable.
This command must be followed by the
draw
command.
drawbg2 320,240,200,300,15
Paints
over the entire screen with the color black.
Must be followed by the
draw
command.
Paints over the entire screen with the given color,
as provided with separate R,G,B levels.
Must be followed by the
draw
command.
drawfill 255,0,128
Draws a sprite to the
screen, using the given sprite number, cell number, opacity, and
top-left coordinates.
The position and show/hide status of the actual sprite are not used,
just the image itself.
The sprite will be drawn on top of previous drawn items, like from other
drawsp
or
drawtext
.
This command must be followed by the
draw
command.
drawsp 2,1,128,20,40
Draws a sprite to the screen, using the given sprite
number, cell number, opacity, center coordinates, scaling factors, and
rotation.
The position and show/hide status of the actual sprite are not used,
just the image itself.
The sprite will be drawn on top of previous drawn items, like from other
drawsp
or
drawtext
.
This command must be followed by the
draw
command.
drawsp2 2,1,128,20,40,150,60,-10
Like
drawsp
, this command draws a sprite to
the screen - but it first applies a linear transformation.
It uses the given sprite number, cell number, opacity, and linear
transformation matrix.
The given matrix coefficients will be divided by 1000 before being
applied, so that, for example, a parameter of 1600 yields a coefficient
of 1.6.
This command must be followed by the
draw
command.
drawsp3 2,1,128,20,40,1500,300,800,1200
Draws
the text window.
Sprites drawn earlier (e.g. with
drawsp
) will appear below the
text, and sprites drawn after this command will appear above the text.
This command must be followed by the
draw
command.
You use this in the define block in order to turn on DirectSound. You'll need DirectX 2+ in order to use this command. In the later versions of NScripter (1.97+), it is no longer necessary to set this command.
This is a shorthand command
for playing voice files.
It is equivalent to
dwave 0,"voice\(num).wav"
.
dv0001:「これが0001番のせりふだよー」
Plays a WAV file using DirectSound, using the
specified number as the channel number (from 0-49). Different WAV files
will be mixed automatically this way as they are encountered. If you
wanted all voices to be played in succession (text waits for voice) in
Auto Mode, you'd set all voices to channel 0. Only PCM files can be
played using this command.
This command is used in the same way as the wave command, with the added
advantage of the mixing -- so if you were playing an mp3 as background
music, you'd want to use dwave for voices and sound effects.
dwave 0,"test.wav"
Loads a WAV file into memory for use with the commands dwaveplay and dwaveplayloop .
dwaveload 0,"test.wav" dwaveplay 0
The same as dwave , but in this case it loops the WAV file.
Plays the file loaded by dwaveload .
Build an Effect Number from a built-in effect.
Once you have an Effect Number assigned, you can use it in image display
commands.
From left to right, the variables are: effect number, built-in effect
index, effect runtime (in milliseconds), and pattern image filename.
For some built-in effects, you may omit the last two variables.
Effect 0 is reserved for storing image changes to be displayed at the
next image display command, so please number your effects starting at 1.
When you use Effect 0, please remember to call an image display command
as soon as possible afterwards.
By default, built-in effect 1 is not an effect at all - it sets the
effect runtime to 0 for instantaneous display.
Built-in effect index:
1. Instantaneous display. No runtime
variable needed.
2. Left-sided shutter
3. Right-sided shutter
4. Upwards shutter
5. Downwards shutter
6. Left-moving curtain
7. Right-moving curtain
8. Upwards curtain
9. Downwards curtain
10. Pixelwise crossfade
11. Left-moving scroll
12. Right-moving scroll
13. Upwards scroll
14. Downwards scroll
15. Fade via mask pattern. You must provide a
filename pointing to a mask image (of either 256 colors or full color).
Within a masked image, the white areas fade slowly, and the black areas
fade quickly.
16. Mosaic out. After this effect is called,
the state of the screen will be uncertain (like with Effect 0), so
please call a display command, like print, immediately afterwards.
17. Mosaic in
18. Crossfade via mask. This works similarly
to Effect 15, except it is far more processor intensive, so use it with
care.
Special Plugin Effects:
(added NScr ver2.03)
99. This "built-in effect" is a placeholder
for plugin-provided effects, but cannot be used to define an Effect
Number using
effect
(in Nscripter). It may be used anywhere else
an effect specification is allowed. See
print
for more details.
effect 2,4,1000
effect 3,15,2000,"m3.bmp"
This simply sets (in milliseconds) how long the
interpreter should wait after an effect is finished before interpreting
the next command.
If the effect was built-in effect 1, then the delay from this command
doesn't take place.
Specifies whether effects can be skipped if a click
occurs during the effect.
The default value is 1 (skip allowed); setting this to 0 means effects
cannot be skipped using mouse clicks.
effectskip 1
Enables
NScripter English mode. Only half-width alphabetical sentences will be
displayed correctly.
Please begin text with the ">" character when using this mode.
*define english game *start >Peter Piper picked a peck of pickled peppers;@ end
After exiting a button wait, if a textbutton was pressed, then this command will set the textbutton back to its original color.
If 0, the text window stays during effect runtime.
If 1 (this is the default), the text window is hidden during effect
runtime.
This command specifies that, when an error occurs, the current game state should be stored automatically in Savefile 999; this may be useful for game debugging purposes.
This is exactly the same as
spbtn
,
with the addition of a trailing control string.
In short, when the player mouses over a button controlled by
exbtn
,
the button isn't just shifted - control over screen graphics is exerted
as per the sprite control string.
The control string can contain any of the following commands:
"
C
(sprite-num)": hides the sprite
with the given number.
"
P
(sprite-num)": displays the sprite
with the given number.
"
P
(sprite-num),(cell-num)": displays a
particular cell of the given sprite.
"
M
(sprite-num),(x),(y)": moves the
given sprite to coordinates (x,y).
"
S
{channel-num},({sound-file})":
plays the given sound file.
For example:
"S1(beep.wav)" plays "beep.wav" on channel 1.
You can combine any number of these options in your control string.
When using composite buttons, there needs to be an assignment for what
occurs when the mouse cursor isn't touching any part of the button - set
this using
exbtn_d
.
Buttons, like any other graphic, can be loaded as image filename
character strings or as sprites.
spstr "C10"
spstr "C11P10"
spstr "C11P10,2P9"
Determines the state of the composite button when the mouse cursor is on no part of it. See the documentation for exbtn for the format of the control string.
exbtn_d "P3C4C5C6P7,0"
Calls the given DLL with the specified parameters.
exec_dll "execdll.dll/テストですよー。"
Checks to see whether an
image tag has been recorded in the file log.
This is used as a conditional for an
if
statement. If the image
has been loaded and may be used in-game, this returns true; if not, or
if the filename was incorrect, this returns false.
ld c,":a;test.bmp",1 if fchk ":a;test.bmp" ;returns true if fchk "test.bmp" ;same result
Assigns 1 to the given variable if the file exists, 0 if not. This will also check within NSA archives.
This allows for creation of a
file log.
Every single resource used by the program will be recorded in that file
log as a tag.
If you specify neither this command nor
globalon
, then nscr.exe
will not generate any files, and will be able to run from CD.
Special effect; may be
graphic-intensive.
Ends with a white background, so please load a background in one of the
next instructions.
Changes the text display
font.
If the text window is already displayed, the new font will only take
effect the next time the window is cleared.
font "MS 明朝"
This is essentially the same
as a BASIC loop. The
for
loop starts at the first number, and
then increments (or decrements) by the step value until it has gone
beyond the second number (or below, in the case of a negative step). The
step value is 1 by default.
If you use commands like
goto
or
select
inside a
for
loop, this will leave the NScripter stack in an inconsistent and
easily-crashable state - so please don't do that.
All commands in the loop between the
FOR
and the
NEXT
will
be executed. If you wish to prematurely break out of the loop, issue a
BREAK
command.
You can also use
gosub
commands to no ill effect within a loop;
thus, it is highly recommended that you compartmentalize what is
inside
a loop from what is
outside
of it.
for %0=1 to 10 add %1,%0 next
Sets a name to use for a (P)ONScripter game savedata
folder, which is filed in AppData (or similar applicable directory for
non-Windows operating systems).
If a
gameid
is not specified, (P)Onscripter creates a savedata
folder name from a hash of the game script.
;gameid ToHeart-Extra
Gets the amount of time (in milliseconds) spent in btnwait . You would use this to, say, restart the button timer in its proper place after a pause initiated by the player (by right-clicking, perhaps).
Retrieves the total number of csel choices.
getcselnum %0
Acquires a character string given as a csel choice.
getcselstr $0,0
Use
this between
btndef
and
btnwait
commands.
The wait command will return -40 on up-arrow keypress, -41 on
right-arrow, -42 on down-arrow, and -43 on left-arrow.
Retrieves the text-window position of the text cursor - where a character would next be displayed.
getcursorpos %0,%1
The same as getcursorpos , except that this command returns the pixel coordinates of the top-left of the last displayed text character.
getcursorpos2 %0,%1
Use
this between
btndef
and
btnwait
commands.
The wait command will return -19 when the Enter key is pressed.
Use
this between
btndef
and
btnwait
commands.
The wait command will return -21 to -32 for presses of keys F1 to F12.
Use
this between
btndef
and
btnwait
commands.
The wait command will return -50 when the Insert key is pressed.
Retrieves the character
string of the given backlog page, including newlines and ruby text data.
The second parameter gives the backlog page number, the same as provided
to
checkpage
.
getlog $0,%5
Works the same as
getlog
,
but intended to be used in combination with
strsp
.
Later versions of NScr (and ONScripter) have a
strsp
command that
can work with
getlog
text, so this command is basically
unnecessary.
Use
this between
btndef
and
btnwait
commands, like with
getfunction
.
The wait command will return -70 if the middle mouse button is clicked.
Set this between
btndef
and
btnwait
to collect button mouseovers during the wait.
It will only exit the btnloop for mouseovers of buttons within the given
range, returning the applicable button number.
btndef clear getmouseover 0,9 btnwait %0
Sets the given result variables to the current mouse
cursor coordinates.
Unlike
clickpos
, this command can collect cursor position without
first waiting for a click.
getmousepos %0,%1
Retrieves the position of the start of the following line of text in the text window.
getnextline %0,%1
Use
this between
btndef
and
btnwait
commands.
The wait command will return -12 on PageUp keypress and -13 on PageDown.
Takes the values provided as
parameters to a user-defined command and assigns them, in order, to the
given variables. For example, given the following subroutine
call/getparam code:
defsub usercmd1
. . .
usercmd1 %14,$15,2,"blat"
. . .
*usercmd1
getparam %0,$0,%1,$1
After the
getparam
command, %0 will contain the numeric value of
%14, $0 the string value of $15, %1 the numeric value 2, and $1 the
numeric value "blat".
The
s%VAR
and
i%VAR
argument types allow for passing
variables by reference - s%VAR for a string variable, i%VAR for a
numeric variable.
For example, in this code:
defsub usercmd2
. . .
usercmd2 %14,$15
; same result as
inc %14 : add $15,"/"
. . .
*usercmd2
getparam i%0,s%1
inc %%0 : add $%1,"/" : return
After the
getparam
command, %0 will contain the numeric value
14
and %1 the numeric value
15
- the reference numbers of the
provided variables. The variables are then accessed or modified by
referring to
%%0
and
$%1
.
Finally, label names may be passed and accessed as string values, as
follows:
defsub usergoto
. . .
usergoto *alabel
. . .
*usergoto
getparam $0
goto $0
;
goto "*alabel"
same as
goto
*alabel
Opens the Windows registry and queries for a
variable.
Will search only in HKEY_CURRENT_USER.
getreg $0,"software\leaf\toheart","datadir"
Retrieves a value returned
from a DLL call via
exec_dll
. Numeric and string values may be
collected separately.
This command may also be used to retrieve a value returned by
textfield
or a call to
layermessage
.
Retrieves the character string that was stored with a particular save number using savegame2 .
getsavestr $1,12
Collects a screenshot. This only stores the image in memory - you will need to call savescreenshot to save it to a file.
getscreenshot 160,120
Set this between btndef and textbtnwait to collect skipoff keystrokes during the wait. textbtnwait will return -60 if skip mode off is requested, -61 if auto mode off.
btndef clear getskipoff textbtnwait %0 if %0=-60 gosub *clearskipicon
This returns 1 if the given sprite is displayed, 0 if the sprite is hidden.
getspmode %2,10
Retrieves the size of the
given sprite.
This will also return the sprite cell number if the optional variable is
provided.
getspsize 0,%0,%1,%2
Use
this between
btndef
and
btnwait
commands.
The wait command will return -20 when the Tab key is pressed.
This command is called from within a
pretextgosub
routine in order to extract data from a pretext tag.
It is not necessary to use
split
- the
gettag
command
itself will do the job, delimiting on "/".
If there is no tag data for a variable (no tag was provided, or there
are more parameters to
gettag
than elements in the tag), then the
variable in question is given a null value: "" for strings, 0 for
numerics.
If a tag
[太郎/0001.wav]
is processed via the command
gettag
$0,$1
, then as a result $0 will be "太郎" and $1 will be "0001.wav".
If
gettag $0,$1
is called but no tag was provided, then as a
result both $0 and $1 will be "".
Pretext tag processing is especially intended for handling names and
voice files for dialog text.
gettag $0,$1
Retrieves the last pretext
tag of the given backlog page.
This can be convenient for custom backlogs in scripts that provide
character name and voice file via tags.
Returns the empty string if no pretext tag was available.
Note that this command does not split the tag and populate variables
automatically, like
gettag
does; such functionality may be added
later.
Retrieves the text currently displayed in the text window.
gettext $0
Retrieves the text of the textbutton with the given
number.
Returns a value of "" if the textbutton doesn't exist.
gettextbtnstr $0,12
Retrieves the current state of the internal timer.
This returns a value in milliseconds corresponding to the amount of time
that has elapsed since
resettimer
was last called.
Gets the current version string, as a 3-digit number: for instance. version 1.90 would be returned as 190.
Retrieves the size of the program window (the drawing area, not including the menubar). By default, the return values are 640 and 480.
getwindowsize %0,%1
Use
this between
btndef
and
btnwait
commands.
The wait command will return -51 on Z keypress, -52 on X, and -53 on C.
Turns on the use of global variables. If you enable this or filelog , nscr.exe cannot be run from write-protected media.
Jumps to and begins
execution at the given label name.
Jumps back to the command directly after the original
gosub
when a
return
command is encountered.
Specifies characters that allow linebreaks. Equivalent to the pbreakstr command.
h_breakstr ^ ,-^
Sets the default text styling. Equivalent to the command pfontstyle .
h_fontstyle ^si^ ^Here is a page of italic text.\ ^And it's still italic!\ h_fontstyle ^d^ ;back to regular style
Specifies characters that will set an indent. Equivalent to the pindentstr command.
h_indentstr ^"'‘“^
Adds or removes shortcut sequences. Equivalent to the command pligate .
Maps a font file to the given font slot. Equivalent to the command pmapfont .
h_mapfont 0,"myprettyfont.ttf"
Configures the Freetype text rendering mode. Equivalent to the command prendering .
Specifies the overlapping priority for standing images.
humanorder "rcl",1
Specifies the standard x-coordinates for standing
image positions "l", "c", and "r".
The center vertical axis of a standing image will be matched to the
coordinates given by this command.
The default values are 160, 320, and 480.
Designates the image priority when sprites and
standing pictures overlap (the z-order).
The sprite of the given number will be drawn immediately above the
standing images.
The default value is 25.
The commands following the
if statement are executed if the conditional statement(s) evaluate true;
if you want branch control in which a command executes if a conditional
statement is false, use
notif
.
The conditions compare numerical values, else you can employ
fchk
.
&
and
&&
are logical 'ands', and are
equivalent to each another.
Conditions:
(numerical variable)
{>,<,=,>=,<=,==,!=,<>} (numeric variable)
- or -
fchk
(character string)
<
,
>
,
=
,
>=
,
and
<=
should already be known to you.
==
and
=
are identical, as are
!=
and
<>
.
fchk
returns true when the image
whose name corresponds to the character string is being used.
if %0=1 quakex 2,500 ;basic conditional form
if %0=1 && %2=5 end ;more complex form - both conditionals must be true
if %0=2 mov %1,1:skip 2 ;execute multiple commands sep. by ':'
When continuing a line after a
line break, it will indent by the amount specified via this command.
For example, a
pretextgosub
routine could use this command to add
indenting for a line of dialog, but then set the indent level to 0 for
regular text.
indent 2
Presents a text input box,
much like
inputstr
; however,
input
must have a default
character string.
Depending on whether the double-byte flag is 0 or 1, you can force your
user to input 2-byte characters or not.
Creates an input dialog that assigns the user's
input to the given numeric variable.
The character string serves as the dialog message text.
The last 4 arguments may be omitted; in order they are (window size x),
(window size y), (text input window size x), (text input window size y).
Creates an input dialog that captures all input to
the character variable.
The character string serves as the dialog message text.
The first number is the max input length, the second (0 or 1) determines
whether the user is forced to enter 2-byte characters or not.
The last 4 arguments may be omitted; in order they are (window size x),
(window size y), (text input window size x), (text input window size y).
Adds a menubar item. It always adds at the head position.
insertmenu "終了",END insertmenu "バージョン情報",VERSION insertmenu "次の選択肢に進む",SKIP insertmenu "オートモード",AUTO insertmenu "環境設定",SUB ;SUB indicates the top of a submenu, which will contain following items of deeper level. ;This one contains everything that follows. insertmenu "フォント",FONT,1 insertmenu "ウェーブ",SUB,1 insertmenu "ON",WAVEON,2 insertmenu "OFF",WAVEOFF,2 insertmenu "ボリューム",DWAVEVOLUME,2 insertmenu "テキスト",SUB,1 insertmenu "遅い",TEXTSLOW,2 insertmenu "普通",TEXTMIDDLE,2 insertmenu "速い",TEXTFAST,2 insertmenu "画面",SUB,1 insertmenu "フルスクリーン",FULL,2 insertmenu "ウィンドウ",WINDOW,2 insertmenu "CD-DA",SUB,1 insertmenu "ON",CDON,2 insertmenu "OFF",CDOFF,2 insertmenu "クリック設定",SUB,1 insertmenu "普通",CLICKDEF,2 insertmenu "ページごと",CLICKPAGE,2
Restricts the value of an
numerical variable. If it exceeds the set maximum, it becomes reset to
the set maximum; if it goes below the set minimum, it resets to the set
minimum.
In order, the numbers in the command are: numerical variable number, min
value, max value.
intlimit 0,10,20
Sets the result variable based on whether the left
mouse button is pressed down.
It returns 1 if pressed, 0 if not pressed.
*waitloop btnwait %0 if %0=0 goto *onlclick end *onlclick isdown %1 if %1=1 puttext "0/":goto *onlclick puttext "" goto *waitloop
Retrieves the current full-screen status (full or windowed).
isfull %0 if %0==0 menu_full notif %0==0 menu_window
Within a textgosub routine, this will set the return variable to 1 if the current clickwait is for a new page, 0 if not.
ispage %0
Retrieves the current skip mode setting. Returns 0 if no skip, 1 if skip to next choice mode, and 2 if auto mode.
Converts a number into a (half-width digit) character string. Similar to the itoa function in C.
itoa $0,120 itoa $1,%2
This is the same as itoa , except that it converts a number into a full-width digit character string, for more convenient Japanese text display.
itoa2 $0,%4
Return to the last ~ symbol.
Jumps to the next appearance of a ~ symbol. Use this when it's bothersome to use a proper label. However, as you can't really do deeply nested control with this kind of command, try not to overuse it.
jumpf ;I am a line that gets skipped. ~ ;I am a line that isn't skipped.
Toggles between regular kidoku skip (stops at first unread text) and forced "skip to next choice" mode.
If
you use this command, you can enter "skip to next choice" mode. The
script will keep track of previously-read text, so that whenever you
encounter unread text, Skip Mode will automatically terminate.
Kidoku (read text) data is stored in the file "kidoku.dat".
This deletes menu items,
counted from left to right.
0 is the leftmost item number, with each item to the right incrementing
in number.
Once you have deleted a menu item, the numbers for all menu items after
it shift down one, so please be careful.
kinsoku on causes "kinsoku" (forbidden start/end character) rules to be enforced, while kinsoku off causes those rules to be ignored.
Assigns 1 to the given variable if the label exists, 0 if not.
labelexist %0,*message if %0==1 gosub *message
This command behaves
somewhat like
filelog
, except in this case it keeps a record of
labels.
Whenever a
goto
,
gosub
or similar command is called, a
record of which label was called will be stored if
labellog
was
specified.
This sets the preferred text display language in
ONScripter-EN, more-or-less replacing the FORCE_1BYTE_CHAR compilation
option.
The right-click menu will use the preferred language for display
messages, and text display will take preferred language, kinsoku
settings, and whether a chunk of text contains single-byte and/or
double-byte characters into account when performing linebreaks.
This command can be used within either the define or program block, and
may be set by default from the command line or depending on the
executable filename (i.e. "onscripter-en.exe" is assumed to prefer
English).
Note that ENABLE_1BYTE_CHAR must be set at ONScripter compile time to be
able to use
language english
.
language japanese
An arbitrary character
string is sent to the specified layer.
This command can be useful for achieving various effects within a layer.
To use this command, a layer plugin should export a function with this
declaration:
BOOL Message(char *message, int *returnint,
char *returnstr);
Like
fchk
, this
command is used in
if
statement conditionals. It checks to see
whether the given label has been used/accessed.
Any of the following are allowed syntax:
lchk *test
lchk "*test"
lchk $0
Loads a standing picture. Use
l for left, r for right, c for center.
The character string is the image filename; the image tag is
automatically generated as well.
Finds the length of the given character string.
len %0,$0
Setting
this causes new-page clickwaits to occur at the end of each line, even
if you do not specify it using '
\
'.
This means that you never have to manually specify a line/page feed.
Please take care if you decide to use
@
,
\
, or
clickstr
along with this command.
Sets the button colors for
textbuttons.
The default colors are yellow and cyan.
linkcolor #FFFF88,#88FF88
Loads the save data
corresponding to the given save number. This does not prompt for
confirmation, so be careful.
This command gives no error indication if savefile cannot be loaded, and
simply proceeds to the next command without stopping.
Specifies a routine to call immediately after a game
is loaded and its save state has been restored.
Please take care when scripting to be sure that all saveable points will
work properly when restored with this
loadgosub
routine.
This command was created especially to handle games that use plugins for
music reproduction.
loadgosub *loadlb
Changes a string or set of strings related to the
default right-click menu.
There are three separate types of localestring commands: standard dialog
items, localization lists, and processed dialog items.
1) Standard dialog items
- localestrings meant to be displayed
exactly as provided, except for parsing any
~
formatting tags.
message_reset_confirm
(default:
"Return
to Title Menu?"
)
- confirmation
message after requesting a game reset
message_end_confirm
(default:
"Quit?"
)
- confirmation
message after requesting to exit the game
message_yes
(default:
"Yes"
)
- affirmative
response to confirmation message
message_no
(default:
"No"
)
- negative
response to confirmation message
message_space
(default:
" "
)
- used for
displaying spaces in processed items
message_empty
(default:
"-"
)
- used for
filling in unused slots in the Save/Load menu
2) Localization lists
- sequences of localestrings related to
date, time, and numbers, that are used when filling in processed dialog
items. Items of a sequence are
not
required to be the same
length.
days
(default:
"Sun","Mon","Tue","Wed","Thu","Fri","Sat"
)
- days of the
week, starting with Sunday; must be exactly 7 comma-separated strings
months
(default:
"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
)
- months of the
calendar year, starting with January; must be exactly 12 comma-separated
strings
am_pm
(default:
"AM","PM"
)
- distinguish
between before-noon and after-noon times in 12-hour time systems; must
be exactly 2 comma-separated strings
digits
(default:
"0","1","2","3","4","5","6","7","8","9"
)
- decimal digits
starting with 0; must be exactly 10 comma-separated strings
3) Processed dialog items
- localestrings parsed for special
character sequences related to saved games and the Save/Load menu save
slots.
message_save_label
(default:
"%s%n"
)
- used to
display the label and number of a slot in the Save/Load menu
message_save_exist
(default:
"%b
%d%i %-H:%i%M"
)
- used to
display the date and time information of a saved game
message_save_confirm
(default:
"Save
in %s%n?"
)
- confirmation
message for saving the current game in a particular slot of the
Save/Load menu
message_load_confirm
(default:
"Load
from %s%n?"
)
- confirmation
message for loading a game from a particular slot of the Save/Load menu
Processed dialog character sequences
The syntax of character sequences parsed within save/load related items
comes largely from the UNIX
date
format syntax.
%%
- a literal '%'
%s
- Save/Load menu savefile slot
heading (set via
savename
)
%n
- Savefile number
%a
- day of the week, retrieved from
days
localization list
%b
- month of the year, retrieved
from
months
localization list
%d
- date of the month ('01'-'31')
%H
- hour, 24-hour system ('00'-'23')
%I
- hour, 12-hour system ('01'-'12')
%M
- minute ('00'-'59')
%p
- AM/PM time indicator, retrieved
from
am_pm
localization list
%S
- second ('00'-'59')
%Y
- year (full)
%y
- year (last 2 digits)
The following optional flags may follow the
%
in the previous
code sequences:
-
(hyphen) - do not pad
_
(underscore) - pad with spaces
0
(zero) - pad with zeroes
After the flag, if any, may come a decimal number specifying field
width, and then an optional
O
to indicate that the locale's
digits should be used. For example,
"%_4OH:%M"
will display the
hour with field width 4, padded with spaces, and using locale digits:
"
8:45"
.
There are also two sequences used specifically within
message_save_exist
for formatting Save/Load menu slots:
%i
- Indent point
%t
- Tab area
An indent point is a location within the slot text where all non-empty
slots
must
line up with each other. For example, with the slot
text
"%H:%i%M"
, the colons in the 'hour:minute' time will line up
across the entire list of slots.
In order to make the indent points line up, whitespace is added to the
beginning of the string (or just after the last indent point in the
string). If one of those points shouldn't have whitespace, the
whitespace tab area can be specified with
%t
. For example, in the
text
"%H:%i%M %t(%a)%i"
('hour:minute (weekday)'), setting the
tab just before the '(weekday)' prevents whitespace after the colon in
the ':minute' part.
Try the following examples of localestring settings.
localestring months "janv.","févr.","mars","avr.","mai","juin","juill.","août","sept.","oct.","nov.","déc." localestring days "Dim","Lun","Mar","Mer","Jeu","Ven","Sam"
localestring digits "0","1","2","3","4","5","6","7","8","9" localestring message_space " "
localestring message_save_confirm "Сохранить %s%n?" localestring message_load_confirm "Загрузить %s%n?" localestring message_reset_confirm "Выйти в главное меню?" localestring message_yes "Да" localestring message_no "Нет"
localestring message_save_exist "%b %d%i %_H:%i%M" ;e.g. "Feb 06 0:45"
localestring message_save_exist "%Y/%m/%d %H:%M" ;e.g. "2008/02/06 00:45" localestring message_save_exist "%m/%d/%Y %i%I:%M %i%p" ;e.g. "02/06/2008 12:45 AM" localestring message_save_exist "%a, %b %d, %I:%M %p" ;e.g. "Wed, Feb 6, 12:45 AM"
Changes the (absolute)
position of text insertion within the text window.
Note that the position values are in text metrics, not pixels.
Creates a sprite from backlog text retrieved via
getlog
,
positioned at the given coordinates.
If no color is specified, the sprite text will be white (#FFFFFF). If
only one color is specified, then the sprite will have just one cell -
provide additional colors if you need more cells, like for use as a
button.
logsp 8,$0,60,90
logsp 8,$0,60,90,#FFFF88
logsp 8,$0,60,90,#888888,#FFFF88
Same as logsp , but allows specifying the text character size.
logsp2 2,$0,150,20,17,17,0,1
Loads buttons for use in Log Mode.
By default, these are
"uoncur.bmp","uoffcur.bmp","doncur.bmp","doffcur.bmp".
The images must be of the same size or else this command will fail.
Log mode buttons cannot be animated.
The button to enter log mode is located at the upper right of the text
window. Its position cannot be changed once set, so please make sure you
set it right the first time around.
Sets the text color for Log
Mode.
The color is an #rrggbb hex value, like that used in HTML.
Stops collecting Log Mode data; data collection can be restarted with lookbackon .
Turns on accumulation of Log Mode data; use this to return regular log buffering after turning it off with lookbackoff .
Uses the given sprites as lookback buttons instead of the defaults.
lookbacksp 2,3
Designates a WAV file to play back when the pageup/pagedown button is clicked in Log Mode.
Plays the first music file, then once it's finished, loops the second file until stopped.
loopbgm "bgm_s.wav","bgm_l.wav"
Traps left and right clicks (or turns said trap off), directing the interpreter to the given label name.
Similar to lr_trap , except this one functions in "skip to next choice" mode.
Waits
for either a left or right click.
The type of click of occurred can be retrieved using
getret
:
getret %0
This will return 0 for a right-click and 1 for a left-click.
Loads and displays a sprite.
Sprite numbers may range from 0 to 999.
The other numbers are, from left to right: x coordinate of upper left
pixel, y coordinate of upper left pixel, and optional opacity value (0
for transparent up to 255 for opaque).
The only difference between
lsp
and
lsph
is the beginning
condition of the sprite -
lsp
displays the sprite, while
lsph
keeps the sprite hidden (which may later be displayed with
vsp
).
Image processing tag format:
"[:
(trans-mode)
[/
(animation)
];](filename)"
OR
"
:s
[
/(string-params);
]
(color)
[(color)...](text-string)"
(added Ver.1.80)
OR
"[:(trans-mode)[/(animation)];]
>(width),(height),(color)
[(color)...]"
(added Ver.2.93)
The first format is for processing image files - note that the
(filename)
by itself is fine for single-cell default transparency images. The
possible arguments are:
(transmode)
:
l
- for
'leftup'; the color of the top-left pixel will be used as the
transparent color
r
- for
'rightup'; the color of the top-right pixel will be used as the
transparent color
c
- for
'copy'; shows the image as-is, no transparency settings
a
- for
'alphablend'; the right half of the image contains alpha-level data for
the left half
m(filename)
- for 'mask'; uses the given file as alpha-level data for the main
image
Note that for alpha-levels, black (#000000) =
opaque and white (#ffffff) = completely transparent.
If
(transmode)
is omitted, it assumes
the default transparency setting provided via the
transmode
command.
(animation)
:
(num-cells)
,
(delay)
,
(loop-type)
This optional parameter set tells how to
animate a sprite with multiple cells.
The image gets 'cut' into
(num-cells)
pieces, going from left to right. If the image contains alpha-level
data, then each cell contains its own alpha-data in its right-half.
The
(delay)
can either be a single
value, telling the number of milliseconds to spend on each cell; or else
it can have the format
<(cell-1-delay),(cell-2-delay,...(cell-n-delay)>
,
giving varying delays per cell.
The
(loop-type)
is a number telling
how to cycle between the cells:
0
- a
repeated cycle (0,1,...n,0,1,...)
1
-
single time through (0,1,...n)
2
- a
'bouncing' cycle (0,1,...n,n-1,...1,0,1,...)
3
- no
cycle (0); cell number is changed via
cell
command or sprite
control (see
spstr
)
The second tag format is for creating string sprites:
"
:s
[
/(string-params);
]
(color)
[(color)...](text-string)"
Note that at least one color setting (#rrggbb) must be provided with the
text. Other arguments are:
(string-params)
:
(char-width),(char-height),(X-spacing),
(decor)
The character width, height, and spacing are
the same kinds of numeric values used for
setwindow
, for
example.
The
(decor)
value describes a style
for the text:
0
-
standard
1
- none
2
- open
face
If
(string-params)
are omitted, the
text uses the sizing, spacing and style set by
setwindow
or
spfont
.
If multiple
(color)
values are
provided, it creates a string sprite with multiple cells - each cell
with each different color. This can be useful for making text buttons.
For finer control and/or to make multiple-line string sprites, use the
strsp
command instead.
The
NEW
third format is for creating single-color rectangle
sprites:
"[:(trans-mode)[/(animation)];]
>(width),(height),(color)
[(color)...]"
The
(trans-mode)
and
(animation)
have the same syntax as
used in the first tag format. The
(width)
and
(height)
provide the width and height of the resulting rectangle.
Note that there must be at least one color value provided; if multiple
(color)
values are provided, it creates a rectangle sprite with multiple cells -
one cell for each different color.
lsp 2,"thing1.bmp",0,0
lsp 2,":mmask1.bmp;thing1.bmp",0,0
lsp 0,":l/3,160,2;cursor0.bmp",0,0
lsp 0,":l/3,<160,1000,400>,2;cursor0.bmp",0,0
lsp 0,":c;>100,50,#FFFFFF#888888",200,200
Loads an extended sprite. Extended sprites add
rotation about center and horizontal/vertical scaling to the existing
sprite elements of position and opacity; it's also possible to flip
images with the use of negative scale factors.
Like
lsp
,
lsp2
loads images using the set display
transparency mode.
The scaling factors are percentages; also note that providing a negative
scaling factor will reverse the direction of the image.
lsp2 0,":c;test.bmp",320,240,100,200,36
Loads an extended sprite using additive composition.
lsp2add
uses additive blending for display, but otherwise it
works the same as
lsp2
.
lsp2add 0,":c;test.bmp",320,240,100,200,36
Loads an extended sprite using subtractive
composition.
lsp2sub
uses subtractive blending for display, but otherwise it
works the same as
lsp2
.
lsp2sub 0,":c;test.bmp",320,240,100,200,36
Loads a sprite in a hidden state.
The only difference between
lsp
and
lsph
is the beginning
condition of the sprite -
lsp
displays the sprite, while
lsph
keeps the sprite hidden (which may later be displayed with
vsp
).
Loads an extended sprite in a hidden state.
The only difference between
lsp2
and
lsph2
is the
beginning condition of the extended sprite -
lsp2
displays the
sprite, while
lsph2
keeps the sprite hidden (which may later be
displayed with
vsp2
).
Loads an extended sprite using additive composition,
in a hidden starting state.
The only difference between
lsp2add
and
lsph2add
is the
beginning condition of the extended sprite -
lsp2add
displays the
sprite, while
lsph2add
keeps the sprite hidden (which may later
be displayed with
vsp2
).
Loads an extended sprite using subtractive
composition, in a hidden starting state.
The only difference between
lsp2sub
and
lsph2sub
is the
beginning condition of the extended sprite -
lsp2sub
displays the
sprite, while
lsph2sub
keeps the sprite hidden (which may later
be displayed with
vsp2
).
Many default NScripter system functions can now be
replaced with Lua callbacks.
A Lua function could be created to handle text display using sprites,
for example, as well as other sorts of system customization.
The specified character string need not be enclosed by double-quotes,
and is case-insensitive.
The applicable Lua-side function must be named NSCALL_(sysfunc-name) and
use the defined function argument structure for that particular call.
luacall text
Defines a new command with the given name and ties
it to a Lua function NSCOM_(cmd-name).
Any time the command is executed within the script, that Lua function
will be called.
A Lua function registered with
luasub
must be void - no arguments
or return values.
luasub func
Sets the maximum number of pages that may be stored for Log Mode.
maxkaisoupage 10
Enters default text display (not single-page) mode; see menu_click_page .
Enters single-page text display mode, as provided via the 表示形式(Display Format) menubar item.
This command sets the colors of the right-click menu when the right-click menu functionality is enabled. In order, the colors are the mouseover color, the mouseout color, and the "no savefile exists" color.
Designates the WAV files that are played for menu
choices, and other system sounds.
From left to right, the strings are: menu open, menu cancel, menu item
mouseover, on click, forbidden operation, "yes" confirmation, "no"
confirmation.
If any of these are set to "", no sound plays.
By default, all of these sounds are set to "".
Creates a menu dialog
window.
This window displays above all other items in the screen when active.
From left to right, the arguments are: character font size x, character
font size y, kerning x, kerning y, boldface (1 - yes; 0 - no), drop
shadow (1 - yes; 0 - no); the final #rrggbb parameter is the window
color.
Shows a message box.
The first string is the contents of the box, the second string is the
title of said box.
Extracts a substring from the given character string.
mid $0,$1,%0,%1
mid $0,$1,0,5
Finds the remainder after the variable is divided by the number (same as the x % y command in C).
This
is a command developed especially for the commercial software
"Gin'iro". When you use this command, you can enter Auto Mode from the
menu. It is similar in concept to the "skip to next choice" option, but
displays characters much more slowly (with a delay defined by
automode_time). This makes it almost like a mode in which the computer
reads the text to you.
You can adjust sound playback volume from the NScr menus while Auto Mode
is progressing (MP3(BGM), voice(DWAVE 0), and SE(DWAVE 1+) are all
active and adjustable).
There are future plans to add more functionality to this command, and to
make things conform to predefined syntaxes.
A
command mode written especially for the doujin game, "Saya ~Labyrinth
of Immorality~". Once you specify this command, you enter: the legendary
Saya Mode!
In Saya mode, when the text window disappears:
* Sprites 0-9 also disappear, regardless of
whether they're flagged to be visible or not.
* Bars and numbers indicating status
underneath the text window also disappear.
You would use this, for instance, when you had a parameter status window
that you wanted to hide when the text window disappeared.
Usually WAV files are not played during "skip to next choice" mode, but specifying this command will have them be played.
Enables 320x240 screen mode. This command must be the first line in the script - even above *define .
;mode320 *define
Enables 400x300 screen mode. This command must be the first line in the script - even above *define .
;mode400 *define
Enables 800x600 screen mode (yes, the ';' in the beginning is necessary!). This command must be the first line in the script - even above *define .
;mode800 *define
Fades the screen to monochrome, using the given
color as a base.
The text window and cursor will not follow suit.
Use "off" as the parameter to make the colors return to normal.
Loads a Windows mouse cursor definition file (.cur) and utilizes it.
Assigns a variable with a new value.
mov %3,24
mov $0,"myfile.jpg"
This command fills 10 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.
mov3 %3,2,4,6,8,10,12,14,16,18,20 ;is equivalent to ;mov %3,2 ;mov %4,4 ;mov %5,6 ;mov %6,8 ;mov %7,10 ;mov %8,12 ;mov %9,14 ;mov %10,16 ;mov %11,18 ;mov %12,20
This command fills 3 numeric variables - starting
from the one specified and incrementing upward - with the specified
numbers.
mov4
,
mov5
,
mov6
,
mov7
,
mov8
,
mov9
,
and
mov10
all follow suit from this.
mov3 %3,2,4,6 ;is equivalent to ;mov %3,2 ;mov %4,4 ;mov %5,6
This command fills 4 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.
mov3 %3,2,4,6,8 ;is equivalent to ;mov %3,2 ;mov %4,4 ;mov %5,6 ;mov %6,8
This command fills 5 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.
mov3 %3,2,4,6,8,10 ;is equivalent to ;mov %3,2 ;mov %4,4 ;mov %5,6 ;mov %6,8 ;mov %7,10
This command fills 6 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.
mov3 %3,2,4,6,8,10,12 ;is equivalent to ;mov %3,2 ;mov %4,4 ;mov %5,6 ;mov %6,8 ;mov %7,10 ;mov %8,12
This command fills 7 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.
mov3 %3,2,4,6,8,10,12,14 ;is equivalent to ;mov %3,2 ;mov %4,4 ;mov %5,6 ;mov %6,8 ;mov %7,10 ;mov %8,12 ;mov %9,14
This command fills 8 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.
mov3 %3,2,4,6,8,10,12,14,16 ;is equivalent to ;mov %3,2 ;mov %4,4 ;mov %5,6 ;mov %6,8 ;mov %7,10 ;mov %8,12 ;mov %9,14 ;mov %10,16
This command fills 9 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.
mov3 %3,2,4,6,8,10,12,14,16,18 ;is equivalent to ;mov %3,2 ;mov %4,4 ;mov %5,6 ;mov %6,8 ;mov %7,10 ;mov %8,12 ;mov %9,14 ;mov %10,16 ;mov %11,18
Moves the mouse cursor to an arbitrary position on the screen.
movemousecursor 100,10
This movie playback command
is intended to replace
mpegplay
.
The following options may be combined:
movie "filename"
;Plays until
completion, can't be interrupted
movie "filename",pos,10,20,320,240
;Positions the movie within a 320x240 window with top-left at (10,20)
movie "filename",click
;Movie
playback is click-interruptible (not valid in
async
mode)
movie "filename",loop
;Plays the
movie repeatedly (must be combined with either
click
or
async
,
otherwise it can't be stopped!)
movie "filename",async
;Asynchronous
playback. The script returns to command interpretation while playback
continues. The movie will always be the top layer on-screen, even atop
text.
movie stop
;Use this to stop
async
movie playback
movie "test.mpg",pos,10,20,320,240,async,loop wait 30*1000 movie stop
movie "test.mpg",click print 10,1000
Enters numbers into an array all at once.
dim ?10[4] movl ?10,0,1,2,3,4
dim ?20[2][3] movl ?20[0],0,1,2,3 movl ?20[1],0,2,4,6 movl ?20[2],0,3,6,9
If mp3dec.dll is used (this functionality is built into ONScripter), you can use this to play an mp3 file. mp3 plays the file only once, while mp3loop loops the file. You may issue wave commands while mp3's are playing with no ill effects.
Sets MP3 (BGM) fadeout time in milliseconds. Same as bgmfadeout (added in Ver2.21).
If mp3dec.dll is used (this functionality is built into ONScripter), you can use this to play an mp3 file. mp3 plays the file only once, while mp3loop loops the file. You may issue wave commands while mp3's are playing with no ill effects.
Just like the mp3 command, this plays back an mp3 only once; however, if the player saves during playback, the mp3 will start playing upon reload.
Changes the volume of the BGM. This applies to both bgm and mp3 commands.
mp3vol 100
Plays an MPEG video file. The second parameter can be 0 or 1, and determines whether the player must watch the whole movie (0) or can skip the movie by clicking (1).
mpegplay "test.mpeg",1
Moves the sprite of the designated number, adjusting
the position and opacity relative to their current values.
Like the
tal
command, and other sprite system commands, The
results of
msp
will not show up immediately on screen (this is
for ease and speed of batch processing).
So before you call any text or image display commands after an
msp
,
please call a
print
command to update the screen before
continuing.
Moves the extended sprite of the designated number, adjusting its position, scale, rotation and opacity relative to their current values.
msp2 0,10,20,-10,10,5
This is a shorthand command
for playing mp3 voice files.
It is equivalent to
mp3 "voice\(num).mp3"
.
mv0001:「これが0001番のせりふだよー」
If flag is 1 or 2, it causes a
negative of the current image.
Use 1 to apply (any)
monocro
on top of the
nega
, 2 to
apply
nega
atop the
monocro
(i.e. 1 applies
nega
first, 2 applies
monocro first
).
If 0, the image flips back to positive.
Neither
monocro
nor
nega
update the screen themselves, so
please call
print
afterwards.
This ends a for block. Please refer to the documentation of for for more details.
Returns 1 if the next command is csel , 0 otherwise. This may be useful in displaying choices without erasing text.
The program won't fail with an error if a sound or image load command, such as ld or bgm , fails to load a file.
Standing images will not be erased when the text window is removed.
The commands following the
if statement are executed if the conditional statement(s) evaluate
false; if you want branch control in which a command executes if a
conditional statement is true, use
if
.
The conditions compare numerical values, else you can employ
fchk
.
&
and
&&
are logical 'ands', and are
equivalent to each another.
Conditions:
(numerical variable)
{>,<,=,>=,<=,==,!=,<>} (numeric variable)
- or -
fchk
(character string)
notif %0=1 quakex 2,500
Allows
for NSA archive mode. In this mode, resources such as BMPs may be read
from nsa*.arc, located in the same directory as the executable itself.
The nsa*.arc files themselves are generated by nsaarc.exe, which can be
found in the NScr SDK.
Please note that you may consecutively name files as arc.nsa, arc1.nsa,
arc2.nsa ... arc9.nsa, and for the purposes of the interpreter, they
will all be considered as part of the same namespace - like one big
archive. You may use this to quickly unpackage and repackage archives
for testing.
Sets the folder search path for nsa archives. By default, this is the same directory where the executable resides.
Creates a name that serves as an alias for a numeric value.
numalias ef_lshutter,2 ;Now the following 2 lines are equivalent. bg "test.bmp",ef_lshutter bg "test.bmp",2
numalias akari_love,0 ;Now the following 2 lines are equivalent. add %akari_love,10 add %0,10
Copies
things drawn using a
blt
command to the offscreen buffer.
Explanation:
Once you have blitted an image onto the
screen, and want to use an effect on it, you would use this command to
copy it to the offscreen buffer.
The offscreen buffer saved by this command
may be used in effects, just like any other screen buffer.
The image and the effect will display, but
they will not be remembered via load/save.
By using
blt
and
ofscpy
together, you can create engine
cutscenes and such (like those found in AIR).
btndef "~" ;read animation images bg ~ ld c,~ ;all commands up until this point have been standard image commands, so they will show fine. resettimer blt ~ waittimer 100 blt ~ waittimer 100 ;in this fashion we display images one after the other for an engine cutscene. ;now that we've blitted a bunch of stuff, to use effects on the image, we need to copy it to the offscreen buffer. ofscpy bg ~ ;and now you can do anything you want to either the onscreen or the offscreen buffer. bg ~ ld c,~
Shows a Windows OK/Cancel dialog box and retrieves user input.
okcancelbox %0,"セーブします。","セーブ確認"
A pretextgosub -enabled script will only check for [] pretext tags at the start of a page, not at the start of every line (or text command).
Specifies a set of characters that allow linebreaks;
if necessary for word-wrapping, ponscripter will make a new line right
after one of these characters.
Giving an empty string will clear all linebreak characters (including
space!)
Using the
basic
keyword will set the following characters as
breaking:
' '
U+0020 (space - default)
-
U+202d (hyphen-minus)
–
U+2013 (en dash)
-
U+2014 (em dash)
pbreakstr ^ ,-^
Sets the default text
styling. This command is equivalent to inserting a
~d
STR
~
formatting tag at the start of every subsequent text command (though it
has no effect on sprites).
Only font style tags are may be used; size and position tags are not
supported.
pfontstyle "si" ^Here is a page of italic text.\ ^And it's still italic!\ pfontstyle ^d^ ;back to regular style
Specifies a set of characters where, if one appears
as the first character of a page, it will set an indent; this is
equivalent to following the character with a
~n~
formatting tag.
Giving an empty string will clear all indent characters.
Using the
basic
keyword will cause indenting on the following
characters:
(
U+0028 (left paren)
-
U+2014 (em dash)
‘
U+2018 (left single curly quote)
“
U+201c (left double curly quote)
「
U+300c (left corner bracket)
『
U+300e (left white corner bracket)
(
U+ff08 (fullwidth left paren)
~
U+ff5e (fullwidth tilde)
「
U+ff62 (halfwidth left corner
bracket)
pindentstr ^"'‘“^
Plays a MIDI file or CD audio track.
If you specify a file name, then the corresponding MIDI file will be
played, but if you specify "*(number)", then the appropriate CD track
will play.
play
will loop the MIDI file/CD audio; if you want a file/track
to play once, use the
playonce
command.
Plays a MIDI file or CD audio track.
If you specify a file name, then the corresponding MIDI file will be
played, but if you specify "*(number)", then the appropriate CD track
will play.
Use
play
to loop the MIDI file/CD audio instead of playing just
once.
Adds or removes shortcut sequences. This commands
lets you define a sequence of ASCII (or Unicode) characters to be
replaced with a single Unicode character within text, for use as
shortcuts or mappings to ligatures.
The Unicode result for a particular shortcut may be given either as the
numeric value of a Unicode codepoint, or as a string whose first
(Unicode) character will be used as the result. Use the bareword
remove
to remove the shortcut with the defined sequence.
In its single-argument form, this command enables the specified preset
shortcuts. Valid arguments are:
none
- will
remove all
defined
shortcuts, even defaults
all
- adds all of the following
preset shortcuts
default
- enables
basic
and
specials
presets (default)
f_ligatures
- adds ligatures for
"ff", "fi", "fl", "ffi", and "ffl"
specials
- adds the hash escape
sequences for the special characters
@
,
/
,
\
,
_
,
^
,
`
,
!
,
#
basic
- adds the following sequences
for quotes:
"`"
‘
(left single quotation mark)
"``"
“
(left double quotation mark)
"'"
’
(right single quotation mark)
"''"
”
(right double quotation mark)
punctuation
- adds shortcuts for
these punctuation symbols:
"%-"
‑
(non-breaking hyphen)
"%_"
U+00A0 (non-breaking space)
"%."
U+2009 (thin space)
"..."
…
(horizontal ellipsis)
"--"
–
(en dash)
"---"
—
(em dash)
"(c)"
©
(copyright sign)
"(r)"
®
(registered sign)
"(tm)"
™
(trademark sign)
"++"
†
(dagger)
"+++"
‡
(double dagger)
"**"
•
(bullet)
To display a shortcut sequence as-is within text, insert a Unicode
zero-width non-joiner (ZWNJ) or its builtin shortcut
|
within the
sequence to prevent it from matching the shortcut. (The ZWNJ will not
be displayed).
If the Unicode character for a shortcut/ligature is not present in the
current font, that shortcut sequence will not be replaced in text.
Please note that this command, and ligature/shortcut processing in
general, are not available in onscripter compatibility mode.
pligate basic ;presets for curly quotes pligate "-->",0x2192 ;rightwards arrow pligate "'",remove ;don't replace single apostrophe with curly quote ^``Check it out --> it's my funky-cool shortcut example.''\ ;assuming a font that contains all those glyphs, the previous text should display as: ;“Check it out → it's my funky-cool shortcut example.”
Maps a font file to the given font slot.
For TrueType and OpenType fonts, the font file should be of type ".ttf"
or ".otf"; for Type 1 fonts, the font file should be of type ".pfa" or
".pfb", with the metrics option providing the corresponding ".afm" file.
Filenames are relative to the game's data path. If a file is not found
there, it is then sought within a "fonts" subdirectory of the data path,
then in the game's archive, and then in the game binary itself (in case
the font has been embedded).
As a last resort, and for compatibility, Ponscripter checks for a file
named "default.ttf" in the game's data path.
The eight font slots are intended to represent two typefaces (a text
face and a display face), each with regular, italic, bold, and
bold-italic styles, as follows:
slot
0
- text face, regular font
slot
1
- text face, italics font
slot
2
- text face, bold font
slot
3
- text face, bold-italic font
slot
4
- display face, regular font
slot
5
- display face, italics font
slot
6
- display face, bold font
slot
7
- display face, bold-italic
font
You can, of course, assign fonts however you like, but following this
convention permits straightforward use of mnemonic formatting tags.
Note that mapping fonts in this way is optional - a slot that has not
had a font assigned to it via
pmapfont
will use the default
filename "face
N
.ttf", where
N
is the slot number.
pmapfont 0,"myprettyfont.ttf"
Configures the Freetype text rendering mode.
Hinting can be one of the following:
none
- no hinting (default)
full
- Freetype hinting
light
- Light hinting
The optimum settings depend on the fonts in use. In general, Freetype
hinting makes TrueType fonts look hideous, but it does sometimes help
with Type 1 fonts.
Use the bareword
integer
for positioning - although
float
is available and uses subpixel positioning, which would in theory give
better spacing, it has never worked properly and tends to look awful.
The optional parameter can be used to override the Freetype rendering
mode. It should be one of the barewords
light
or
normal
.
By default, light rendering is used with light hinting, and normal
rendering otherwise.
Sets a subroutine to jump to immediately before a
display text command.
If this command is used, a script can use a "tag", or data enclosed
within square brackets
[]
, immediately before any line of text.
For example, in the following code, the
[太郎/0001.wav]
is a tag:
[太郎/0001.wav]テスト用の文章です。
pretextgosub *pretext_lb
pretextgosub *pretext_lb *pretext_lb dwavestop 0 gettag $0,$1 ;assuming first item is person name, second is voice dialog file if $0="" indent 0:goto *next_tag mov $2,$0 add $2,"/" puttext $2 ;this displays "(Name)" right before the actual text ;the "/" is to keep puttext from adding a newline indent 3 ;indents text for character dialog *next_tag if $1="" return dwave 0,$1 ;play the voice file return
Draws to the screen
utilizing the designated effect.
You may set the effect to use in one of two ways:
1) By effect tag
0: draws only to
memory, not to screen
1: instantaneous
display
>1: the tag
of an effect defined by the
effect
command
2) Direct designation
2-18: Use the
same parameters as used for the
effect
command
99
: Use
for plugin-based effects. You must provide a plugin specification string
of format: "plugin-name/plugin-parameters".
The following display commands, like
print
, take effect specs:
bg
ld
cl
All other display-related commands must be followed by
print
or
one of the above commands in order to update the screen display.
bg "test.jpg",0 ld c,"testman.jpg",1 cl c,3
bg "test.jpg",10,1000 ld "testman.jpg",15,2000,"mask.bmp"
bg "test.jpg",99,1000,"clockwip.dll/l"
Creates a numeric value
label, and then blits its current value in the given position at the
given size and color.
A label can take 3 columns, so they can range from 0 to 999 in value.
You need to call a print command or something like it to actually
display this onscreen.
bar
and
prnum
were specifically created for
mode_saya
,
which was in-turn specifically created for the doujin game "Saya
~Labyrinth of Immorality~".
There are plans to replace these commands with something a little bit
more generalized and powerful.
Displays the given character
string onscreen. This command is most often used within if statements
to display some short indicator; otherwise its efficacy is limited.
When using
puttext
, you may not use any of the variable
designation/value functions (e.g.
%
or
$
) with it.
Causes an onscreen random quake effect of the given amplitude and duration. Can be slow on older graphics cards.
quake 8,1000
Works just like quake , except it only shakes the screen from side-to-side (horizontally).
Works just like quake , except it only shakes the screen up-and-down (vertically).
After this command, a
right-click will cause a jump to the specified label.
This trap mode deactivates itself immediately thereafter, or you can
deactivate it manually (before the jump happens) by using
r_trap off
.
It behaves the same as
trap
and
lr_trap
, except that it
only activates on right-clicks.
Reads the contents of the given file into the given string variable.
readfile $0,"file.txt"
Repaints the screen. Call this command if you start getting strange artifacting and such onscreen.
Declares creation of a custom menubar. Add menu items after this command using insertmenu .
Used at the end of a routine called by gosub to return to the next command after the gosub call itself.
This sets a routine to call at right-clicks.
The given label will be called using a
gosub
, so that a
return
will go back to the waiting point where the right-click was detected.
Defines a system menu to show upon right-click.
The character string is menu item text, and the function is picked from
the list defined below.
SYSTEM MENU FUNCTION NAMES:
skip
- same as "skip to next choice"
reset
- reset program
resetdlg
- same as
reset
?
save
- go to save menu
load
- go to load menu
lookback
- go to log mode
windowerase
- remove text window
end
- exit the program
rmenu "セーブ",save,"ロード",load,"回想",lookback
Generates a random number and sticks it in the numerical variable, ranging from 0 to (number - 1).
rnd %5,100
Generates a random number ranging from number 1 to number 2.
rnd2 %3,10,20
Turns on ruby mode.
rubyon
rubyon 10,8
rubyon 14,12,"MS ゴシック"
This changes to ruby mode, but only when ruby appears in the current line. (Assumed to be used for quick-display modes; will also allow ruby text in strsp commands.)
This specifies a folder to use for storing save data.
savedir "savedata"
Saves the game under the given save number. This does not ask for confirmation, so be careful.
Stores a particular character string with each save file; otherwise, it works the same as savegame .
savegame2 12,"8月5日 ヒロインAルート"
savegame2 12,`Aug. 5 -Heroine A route-`
Designates the display
strings for savefiles.
From left to right, the strings are: title for the save menu, title for
the load menu, and then the name of the save itself.
By default, these are "<セーブ>","<ロード>","しおり" -- note that these are all
double-byte character strings.
Change the limit on the
number of save files. At most, this can be 20, and the default is 9.
If you are not careful to make sure that the save menu does not overflow
the bottom of the screen (using
menusetwindow
), this command
could cause the interpreter to hard crash.
Turns
Save Mode off.
This does not mean that you cannot save; it means that when you load,
the position at which the player starts will be at the last place where
saveon
was set.
Why would you ever want to turn save mode off? When save mode is on, it
records every sprite ever loaded into a log -- causing moderate to
massive amounts of slowdown when you are attempting to do a fast
animation. In these cases, you should definitely call
saveoff
before you start the animation, then call
saveon
once you've
finished.
Updates
the save point.
Use this when the
autosaveoff
command is used in the define
block.
Timing issues may slow down returns from data updates, for example when
updating a save point after drawing over the entire screen, so please
use common sense.
Saves a screenshot collected
via
getscreenshot
.
This also deletes the screenshot image from memory; use
savescreenshot2
instead if you need to reuse the screenshot image.
savescreenshot "thumb01.bmp"
Saves a screenshot collected
via
getscreenshot
as the given filename.
This does not delete the screenshot image from memory, so please use
deletescreenshot
to remove it from memory when finished.
Gets the month, day, hour of the day, and minutes of
the hour in which a particular save was recorded.
If the save file does not exist, then the %month parameter is set to 0.
savetime 3,%0,%1,%2,%3 if %0=0 goto *non ;save found セーブ3番は%0月%1日%2時%3分@ end *non ;save not found セーブ3番は存在しない。@ end
Displays a selection of
choices, and then jumps to the label associated with the selected
choice.
If the character string is set to "", then that choice will not be
displayed.
(This works the same way as
selnum
and
selgosub
.)
But be careful, as this command will cause the interpreter to hang if
you do not specify even a single choice as a parameter.
Waits for a click during a *customsel routine.
selectbtnwait %0
Designate WAV files to play in the choice dialog. From left to right: upon entry into choice dialog, upon mouseover of choice text, and finally upon clicking on a choice text.
Works the same as select , except this command jumps to a subroutine, not a generalized label.
Works somewhat like select and selgosub , except that there are no jumps - instead, depending on which character string is clicked, a number (starting at 0, then incrementing by 1 for each string) is loaded into the given numeric variable.
Loads and displays a cursor
definition file for use during click wait states.
The numbers comprise an (x,y) coordinate positioned relative to the
upper left pixel of the next text display character.
The default settings are:
setcursor 0,":l/3,160,2;cursor0.bmp",0,0
setcursor 1,":l/3,160,2;cursor1.bmp",0,0
Much as English has linebreak rules, Japanese
defines certain characters as "kinsoku" - forbidden from either starting
or ending a line of text (e.g. end/start quotes, parentheses, and other
punctuation).
This command specifies which (fullwidth) text characters will be treated
as "kinsoku" for the purposes of text display: the first string
contains characters forbidden at the start of a line, while the second
string contains characters to be forbidden at the end of a line.
The default kinsoku characters for NScripter are "」』)]}、。,.・?!ヽヾゝゞ々ー"
(start) and "「『([{" (end).
This registers a layer
number for a particular plugin DLL.
Messages may be sent to the plugin via
layermessage
.
Sets up the text window.
The first form is used when the backdrop for the text window is an
alpha-layered solid color.
The second form is used when the backdrop for the text window is a
graphic file.
By default, the text window takes up the full screen and is somewhat
translucent, the font is 26x26 pixels, the spacing is 0,2, the top left
coordinate is 8,16, there are 23 2-byte columns and 16 lines, boldface
and drop shadow enabled, 20 speed, and a translucent color of #999999.
setwindow 8,16,20,23,26,26,0,2,20,1,1,#999999,0,0,639,479
setwindow 8,16,20,23,26,26,0,2,20,1,1,"bg1.bmp",0,0
This modifies the appearance
of the text window without deleting either it or the text backlog.
This command can only modify the color or image file that was first
specified in setwindow, and none of the other parameters.
setwindow2 ":c;twindow2.bmp"
This behaves the same as setwindow but without clearing the Log mode buffer.
setwindow3 8,16,20,23,26,26,0,2,20,1,1,#999999,0,0,639,479
setwindow3 8,16,20,23,26,26,0,2,20,1,1,"bg1.bmp",0,0
Changes the sound volume.
sevol 100
Sets the text shadow position.
shadedistance 2,3
Executes the given file via Explorer, using the
ShellExecute API.
Note that shell execution is asynchronous with the game engine.
ONScripter-EN supports the
shell
command in Windows builds, and
has basic support in Mac and Linux for using it to open a URL in the
default web browser.
Acquires the trigonometric sine of the given angle, and returns the value multiplied by 1000.
sin %0,90 ;%0=1000, since sin(90)=1
Exits both "skip to next choice" mode and "auto mode".
skipoff
Using this, you can designate a dll file with which to decode other kinds of compressed sound files that are not mp3s. The character string format is "plugin-name|3-char-file-extension".
soundpressplgin "nbzplgin.dll|nbz"
Just like the
btn
command, except it sets up
an image button using a sprite. It uses cell 0 as the graphic for the
nonclicked state and cell 1 for the clicked state.
When the button is pressed during a
btnwait
, it returns the given
button number as a value.
Use
this between
btndef
and
btnwait
commands.
This will cause a wait command to give the same return value on a
pressed Spacebar as for a left-click in the same situation.
This sets the font to use for string sprites, e.g.
":s;名".
spfont clear
reverts to using the font settings from
setwindow
.
It's also possible to omit all but the first argument:
spfont
(font-name)
Doing so will have string sprites use the given font face but all other
settings will come from
setwindow
.
spfont "MS ゴシック",16,16,0,0,1,1
spfont clear
Allows for utilization of image compression plugin dll's - image filetypes that are not supported in standard NScripter. The character string format is "plugin-dll-name|file-extension".
spi "jpgplgin.dll|jpg" spi "iflf2.spi|lf2"
Splits the given string at
each occurrence of the given delimiter, and assigns the resulting
portions to the given variables.
Use this command to process the results returned by
readfile
.
mov $0,"あいうえお/かきくけこ/15/25/さしすせそ" split $0,"/",$1,$2,%0,%1,$3 $1=$1 ; あいうえお $2=$2 ; かきくけこ %0=%0 ; 15 %1=%1 ; 25 $3=$3 ; さしすせそ \
You can use this command to
manually control sprites using the control string format of the
exbtn
command.
Just like with
csp
,
lsp
and
vsp
, you need to call
print
afterwards to have anything show up on screen.
spstr "C11P10,2P9"
Waits for the animation of the given sprite number to be either finished or cut short by the user.
spwait 0
Stop playback of all sound.
Makes an alias for the given character string as then given name - in other words, after this declaration, you can refer to that character string using that NAME in all cases.
stralias man_a0,":a/10,20,2;man_alpha.bmp" ;Now the following 2 lines are equivalent. ld c,man_a0,1 ld c,":a/10,20,2;man_alpha.bmp",1
This creates a multi-line
string sprite, using the font face specified by
spfont
.
Use "\" to move to the next line. Note that text will run to the end of
the available columns and continue onto the next line, without using
linebreak or kinsoku conventions, so the "\" are necessary for proper
string display.
If optional colors are provided, then the sprite will have a cell for
each given color, with the text in that color.
Works the same as strsp , except that the sprite starts out hidden.
Subtract a number from a numeric variable.
sub %0,6 sub %0,%2
Works identically to the
system menu functions.
The available function names are similar to the ones used by
rmenu
:
SYSTEMCALL MENU FUNCTION NAMES:
skip
- same as "skip to next choice"
reset
- reset program
resetdlg
- same as
reset
?
save
- go to save menu
load
- go to load menu
lookback
- go to log mode
windowerase
- remove text window
automode
- automatically advance text at each clickwait (delay
time set by
automode_time
)
rmenu
- opens the right-click menu
If you use
systemcall
in routines like
select
/
selgosub
,
then you'll end up with something not very different from the title
menu.
(In that case, it would probably be better to temporarily toggle off
right-click menu functionality through
rmode
.)
Calling
systemcall rmenu
has the same effect as calling the
right-click menu itself.
You'd use this when you wanted right-click menu functionality during a
button wait state. Once you exit this right-click menu, the interpreter
continues its execution at the command after
systemcall
.
(This can leave the screen and the interpreter stack in an inconsistent
state, so be careful when using this command.)
Creates a jump table.
If the variable is set to 0, it jumps to the first label; if 1, the
second label; and so forth.
tablegoto %0,*label0,*label1,*label2,*label3
Changes the opacity of the specified standing picture to the given value: 0 is fully transparent, 255 is fully opaque.
Acquires the trigonometric tangent of the given angle, and returns the value multiplied by 1000.
tan %2,45 ;%2=1000, since tan(45)=1
Toggles vertical text display mode. See sample for details.
tateyoko 1
Does text removal for a page-wait (within a textgosub routine). Also does line-feeds after regular clickwaits as applicable.
Similar to
texec
,
except that it does not remove text immediately - only once the
following line is displayed.
(This is used to prevent erasing text at choices.)
Textbuttons
are usually active during a
btnwait
.
Using
textbtnoff
between
btndef
and
btnwait
commands will turn off text buttons during the wait.
This can be useful if, for example, textbuttons need to be off while
other buttons are processed.
btndef clear textbtnoff textbtnwait %0
Specifies the starting number for unnumbered textbuttons; 1 is the default value.
textbtnstart 3
Waits for a click during a custom wait routine, as defined by textgosub .
textbtnwait %0
Changes the color of the
text, using HTML hexadecimal color codes (e.g. #000000 for black,
#ffffff for white, and #ffffaa for pale yellow).
Please note that it only changes the color of text displayed after this
command, and not any of the text that came before.
*define english game *start textcolor #0000ff >blue font@ end
Adds complex behavior to a textbutton, in much the same manner as exbtn .
This creates a text input
window on the screen (not a dialog box) and waits for input.
The prior contents of the given string variable will be used as the
default text.
Input is returned by hitting the Escape, Tab or Enter keys, or by
left-clicking on-screen outside the textfield area.
To see if the Tab key was pressed, use
getret %0
If %0 is 0, then Tab was not pressed, but if %0 is 1 then the Tab key
was pressed to return input.
textfield $0,100,50,320,70,10,20,1
Defines a label to jump to at click waits for system customization. The routine named by this label must handle all system menus, cursors, buttons, and user input during these wait states.
textgosub *text_lb
Hides the textwindow text,
while leaving the window itself in place.
This is important for customized Log Mode display.
Changes the text display speed.
This has the same functionality as
!s
, except that you can
specify a variable here.
Sets
text display speed to the default.
Same as
!sd
, this command is especially meant for use in
english
mode.
This
will prevent transparent areas of a button image from activating the
button.
Please use this command after a
btndef
but before the
btnwait
command.
Change the default
transparency mode.
leftup
is the default setting.
This essentially makes any image-definition string without a
transparency setting use "l" for leftup, "c" for copy, or "a" for alpha;
see
lsp
for more details.
After this command, a
left-click will cause a jump to the specified label.
This trap mode deactivates itself immediately thereafter, or you can
deactivate it manually (before the jump happens) by using
trap off
.
This is the same as trap , except it is the one that should be used when "skip to next choice" mode is active.
Specifies the ground line for standing pictures. The default value is 479.
Sets
btnwait
commands to detect when the Esc key or Spacebar is
pressed.
The wait command will return -10 on Esc, -11 on Space.
Sets
btnwait
commands to detect mouse wheel movement.
The wait command will return -2 on wheel up, -3 on wheel down.
Please note that, when
usewheel
is in effect, a button wait
timeout (set by
btntime
) will return -5 instead of the usual -2.
This is a shorthand command
for playing voice files.
It is equivalent to
wave "voice\(num).wav"
.
v0001:「これが0001番のせりふだよー」
If a script file has ";value500" as the first line,
then this will set the starting number for global variables to 500.
To also change the window size mode, say to 800x600, use
";mode800,value500" as the first line of the script.
;value500 *define
Designates version strings to display in the "about" dialog. The first string is the first line, the second string is the second line.
Changes the sound volume for voices.
voicevol 100
Toggles display of specified extended sprite. 0 is off, 1 is on.
Causes a delay of specified time (in milliseconds)
that may not be escaped out of by clicking.
This works the same as the special text command '!w', but here you can
supply a variable as the argument.
Waits until the internal timer has passed the
specified time before proceeding.
This command is the single most accurate timing measure in all of
NScripter.
The timing intervals of things like image effect runtimes are not nearly
this accurate, so be careful when you mix and match timing methods.
Plays the specified WAV
file.
wave
plays it once, while
waveloop
loops it.
Plays the specified WAV
file.
wave
plays it once, while
waveloop
loops it.
Inserts the text window at the same level as standing pictures. Can be used for a 'positional subtitle' effect.
Attaches the given sprite to the text window, so it displays and disappears when the window does.
windowchip 2
Sets an effect to use when the text window is hidden or unhidden. The parameters are identical to effect , except that there's no effect number parameter here.
windoweffect 10,1000
Executes the given external
program using the WinExec API.
If NScr is in full-screen mode, the call to WinExec will use display
option SW_MAXIMIZE, while in windowed mode, it will use SW_SHOWNORMAL.
For any sync-flag value other than 0, the external program will run
synchronously with NScr.
The executed program will send WM_USER+10 to the NScripter window if it
restarted, and WM_USER+20 if the program ended.
This command is used to launch a demo program in "Dolls Antique".
Shows a Windows Yes/No dialog box and retrieves user input.
yesnobox %0,"ロードしますか?","ロード確認"
Enables use of 【】 (fullwidth black lenticular brackets) for pretext tag specifications, in addition to the standard [] brackets.
*define pretextgosub *pretextproc zenkakko game *start 【名前/音声】「せりふ」 click end *pretextproc gettag $0,$1 mesbox $0,$1 ; 題名が"音声"、本文が"名前"のダイアログを表示 return