Difference between revisions of "Emuera/eramaerb"

From Era Wiki
Jump to: navigation, search
(page created)
(translated half of the page)
Line 1: Line 1:
<B>eramaker ERBファイル書式(暫定版)</B><BR>
+
<B>eramaker ERB file format (provisional)</B><BR>
<em><b>このファイルの説明を見るだけではイメージが沸きづらい</b></em>と思います。まずサンプルゲームをプレイし、その後でサンプルゲームのERBファイルをながめながら見ていくとわかりやすいです。<BR>
+
I think <em><b>it's hard to get a picture just by looking at this file.</b></em> It is easier to understand if you play the sample game first, and then look at the ERB files of the sample game while looking at it.<BR>
  
==基本情報==
+
==Basic Info==
===ERBファイルについて===
+
===About the ERB file===
* eramaker.exeの直下に、ERBという名前のフォルダをおき、そのなかにERBファイルを入れます。<BR>
+
* Put a folder named ERB directly under eramaker.exe, and put ERB file in it.<BR>
* 拡張子が.ERBとなっていればどんなファイル名でもかまいません。<BR>
+
* You can use any file name as long as the extension is .ERB<BR>
* メモ帳などのテキストエディタで編集してください。<BR>
+
* Please edit it with a text editor such as Notepad.<BR>
<BR>
 
  
===ERBファイルの書き方===
+
===How to write an ERB file===
====コメントとスペース====
+
====Comments & Spaces====
すべてのERBファイルにおいて、<BR>
+
In all ERB files,<BR>
 
<BR>
 
<BR>
* 1文字目が半角の;(セミコロン)だった場合、その行は無視されます。また、空行も無視されます。<BR>
+
* If the first character in the first column is a ; (semicolon), the line is ignored. Empty lines are also ignored.<BR>
* 行の終わりにセミコロンをつけたり、そのあとにコメントを書いたりしないでください。<BR>
+
* <del>Don't put a semicolon at the end of a line, or a comment after it.</del> Both ways can be done in Emuera.<BR>
* 行頭にある半角スペースやタブは何個つづいても無視されます。<BR>
+
* Any number of spaces or tabs at the beginning of a line will be ignored.<BR>
  
 
  <nowiki>
 
  <nowiki>
 
; CORRECT
 
; CORRECT
  
;お金の設定
+
;Setting up the money
 
MONEY = 500
 
MONEY = 500
  時刻の設定
+
;Setting the time
  DAY = 10
+
DAY = 10
  TIME = 1
+
TIME = 1
;ゲーム開始
+
;Game start
PRINT どうする?
+
PRINT What do we do now?
  
; MISTAKE
+
; Also CORRECT in Emuera
 +
; The ; at the end of MONEY = 500 is not needed
 +
; MISTAKE in eramaker
  
 
MONEY = 500;
 
MONEY = 500;
TIME = 5;(5日目からスタート)</nowiki>
+
TIME = 5; (Start on Day 5)</nowiki>
  
====半角での入力====
+
 
数値、命令、変数名、関数名などを入力するときは半角にしてください。<BR>
+
====Half-width input====
 +
Please use half-width characters when inputting numbers, instructions, variable names, function names, etc.<BR>
  
 
  <nowiki>
 
  <nowiki>
Line 40: Line 42:
  
 
MONEY = 500
 
MONEY = 500
PRINT ゲームをはじめます。
+
PRINT Let the game begin.
  
 
; MISTAKE
 
; MISTAKE
  
 
MONEY = 500
 
MONEY = 500
PRINT ゲームをはじめます。</nowiki>
+
PRINT Let the game begin.</nowiki>
  
====文字列の入力====
+
====Inputting a string====
文字列を""でくくるとCORRECT常に動作しません。
+
It doesn't work properly if you enclose a string with "".
  
 
  <nowiki>
 
  <nowiki>
 
; CORRECT
 
; CORRECT
  
PRINT 一日が終わった* * *
+
PRINT The day is over...
  
 
; MISTAKE
 
; MISTAKE
  
PRINT "一日が終わった* * * "</nowiki>
+
PRINT "The day is over..."</nowiki>
  
 
====1行で完結====
 
====1行で完結====
長い命令を書くときも、2行以上に分けないでください。<BR>
+
Even when writing long instructions, don't split them into more than two lines.<BR>
 
  <nowiki>
 
  <nowiki>
 
; CORRECT
 
; CORRECT
  
PRINT 名雪の身体は敏感だったし経験も豊富だったから、多少乱暴にしても悦ぶ。口では否定していても、名雪はどんどん乱れていく。だが、眠っているという特殊な状況が俺に大胆な動きをためらわせた。
+
PRINT Nayuki's body was sensitive and she had a lot of experience, so she was happy even if it was a little rough. Even though she denies it with her mouth, Nayuki is getting more and more promiscuous. But the peculiar circumstance of her being asleep made me hesitant to make a bolder move.
  
 
; MISTAKE
 
; MISTAKE
  
 
PRINT  
 
PRINT  
名雪の身体は敏感だったし経験も豊富だったから、多少乱暴にしても悦ぶ。口では否定していても、名雪はどんどん乱れていく。だが、眠っているという特殊な状況が俺に大胆な動きをためらわせた。</nowiki>
+
Nayuki's body was sensitive and she had a lot of experience, so she was happy even if it was a little rough. Even though she denies it with her mouth, Nayuki is getting more and more promiscuous. But the peculiar circumstance of her being asleep made me hesitant to make a bolder move.</nowiki>
  
  
==変数と命令==
+
==Variables and Instructions==
===変数について===
+
===About the variables===
  
調教SLGではパラメータの変化が命です。そのため、データを記憶し、足したり掛けたりといった計算ができる「変数」の使い方を覚えなくてはなりません。<BR>
+
In training SLG, the change of parameters is vital. Therefore, it is necessary to learn how to use "variables" that can store data and perform calculations such as adding and multiplying data.<BR>
 
<BR>
 
<BR>
====変数に数値を入れる====
+
====Putting a number in a variable====
=(イコール)を使います。半角で入力してください。=の前後は半角スペースかタブで区切ります。<BR>
+
Use = (equal). Please enter it in half-width characters. Before and after = is separated by a half-size space or a tab.<BR>
eramakerで使える数値は基本的に整数です。小数を入力しないでください。<BR>
+
The numbers that can be used in eramaker are basically integers. Do not enter a decimal point.<b>*</b><BR>
 
  <nowiki>
 
  <nowiki>
 
; CORRECT
 
; CORRECT
Line 91: Line 93:
 
MONEY = 3.14</nowiki>
 
MONEY = 3.14</nowiki>
  
====変数に計算した数値を入れる====
+
<b>*Adendum:</b> Emuera has since added more number literal types. Check [[Emuera/exvar#Constants_(Literals)|Constants (Literals)]] for more information.
同じく=を使います。*が掛け算、/が割り算、%があまりを求めるということに注意してください。<BR>
+
 
計算結果が小数になるときは端数切捨てです。<BR>
+
====Putting a calculated number into a variable====
 +
Use = in the same way. Note that * is for multiplication, / is for division, and % is for the rest of the division.<BR>
 +
Fractions are rounded down when the result is a decimal.<BR>
 
  <nowiki>
 
  <nowiki>
 
; CORRECT
 
; CORRECT
  
;MONEYを74にする
+
;set MONEY to 74
 
MONEY = 15+34+25
 
MONEY = 15+34+25
;MONEYを650にする
+
;set MONEY to 650
 
MONEY = 150+(100-50)*10
 
MONEY = 150+(100-50)*10
;MONEYを3にする
+
;set MONEY to 3
 
MONEY = 10/3
 
MONEY = 10/3
;MONEYをTIMEの10倍にする
+
;set MONEY to TIME multiplied by 10
 
MONEY = TIME*10
 
MONEY = TIME*10
;DAYが0,1,2...となるとMONEYが0,10,20...となって7を超えると0に戻る
+
;If DAY is 0,1,2... then MONEY becomes 0,10,20... and returns to 0 when it exceeds 7.
 
MONEY = DAY%7*10
 
MONEY = DAY%7*10
  
Line 112: Line 116:
 
MONEY = 500×10÷4</nowiki>
 
MONEY = 500×10÷4</nowiki>
  
====変数に数を足したり掛けたりする====
+
====Add or multiply variables====
+=,-=,*=,/=,%=を使います。<BR>
+
Use +=, -=, *=, /=, %=.<BR>
 
  <nowiki>
 
  <nowiki>
 
; EXAMPLE
 
; EXAMPLE
Line 119: Line 123:
 
MONEY = 100
 
MONEY = 100
 
TIME = 12
 
TIME = 12
;MONEYを150にする
+
;set MONEY to 150
 
MONEY += 50
 
MONEY += 50
;MONEYを750にする
+
;set MONEY to 750
 
MONEY *= 7-2
 
MONEY *= 7-2
;MONEYを80にする
+
;set MONEY to 80
 
MONEY -= 670
 
MONEY -= 670
;MONEYを8にする
+
;set MONEY to 8
 
MONEY %= TIME
 
MONEY %= TIME
;MONEYを1にする
+
;set MONEY to 1
 
MONEY /= TIME-4</nowiki>
 
MONEY /= TIME-4</nowiki>
  
====配列について====
+
====About Arrays====
* 変数は「配列」としてアクセスすることができます。「配列」は同じ名前の変数で複数のデータを管理するためのものです。<BR>
+
* The variables can be accessed as an "array". An "array" is for managing multiple data with the variable of the same name.<BR>
* 配列へのアクセスは:(コロン)を使います。半角で入力してください。間にスペースを入れないでください。<BR>
+
* To access the array, use : (colon). Please enter it in half-width characters. Don't put any spaces in between.<BR>
* 配列の後に入れられる数字は最低で0です。最大値は変数によって決まっています。詳しくはリストを参照してください。<BR>
+
* The number that can be put after the array is at least 0. The maximum value is determined by the variable. See the list for more information.<BR>
* 配列の後に数字ではなく変数を入れることもできます。ただし、配列の後に配列を持ってくることはできません。
+
* You can also put a variable instead of a number after the array. However, you can't put an array after an array.
  
 
  <nowiki>
 
  <nowiki>
Line 140: Line 144:
  
 
A = 35
 
A = 35
;FLAGに値を設定にする
+
;Set the FLAG to a value
 
FLAG:0 = 0
 
FLAG:0 = 0
 
FLAG:2 = 10
 
FLAG:2 = 10
 
FLAG:35 = 440
 
FLAG:35 = 440
;FLAGで計算する
+
;Calculate with FLAG
 
FLAG:A += 100/FLAG:2
 
FLAG:A += 100/FLAG:2
 
FLAG:2 *= FLAG:A
 
FLAG:2 *= FLAG:A
Line 155: Line 159:
 
FLAG:91881816 = 1</nowiki>
 
FLAG:91881816 = 1</nowiki>
  
====二重配列について====
+
====About the Double Sequence====
* 例外的にコロンを2つ使ってアクセスできる変数もあります。キャラのデータに絡む変数です。<BR>
+
* Exceptionally, some variables can be accessed using two colons. Usually variables related to your character's data.<BR>
* (変数名):(所持キャラ番号):(変数番号)という形でアクセスします。<BR>
+
* Use (variable name):(character number):(variable number) to access it.<BR>
  
 
  <nowiki>
 
  <nowiki>
Line 163: Line 167:
  
 
A = 2
 
A = 2
;5番目のキャラの0番目の能力をLV3にする
+
;Makes the 5th character's 0th ability LV3.
 
ABL:5:0 = 3
 
ABL:5:0 = 3
;A番目(2番目)のキャラの1番目の経験を+1する
+
;A (2nd) character's first experience is increased by 1.
EXP:A:1 += 2</nowiki>
+
EXP:A:1 += 1</nowiki>
  
  
====変数を画面に表示する====
+
====Display the variable on the screen====
* もっとも簡単なのはPRINTVとPRINTVLという命令を使うことです。命令については後で詳しく述べます。<BR>
+
* The easiest way to do this is to use the PRINTV and PRINTVL commands. We will discuss the instruction in more detail later.<BR>
 
  <nowiki>
 
  <nowiki>
 
; EXAMPLE
 
; EXAMPLE
Line 186: Line 190:
 
400</nowiki>
 
400</nowiki>
  
====文字列変数について====
+
====About String Variables====
* 普通の変数は整数しか扱えませんが、文字列を扱える文字列変数もあります。ただし機能は限定的です。<BR>
+
* Regular variables can only handle integers, but there are string variables that can handle strings. However, the features are limited.<BR>
* 文字列変数を画面に表示するにはPRINTSかPRINTSLという命令を使います。<BR>
+
* To display a string variable on the screen, use the PRINTS or PRINTSL instruction.<BR>
 
  <nowiki>
 
  <nowiki>
 
; CORRECT
 
; CORRECT
  
STR:0 = あいうえお
+
STR:0 = aiueo
 
PRINTSL STR:0
 
PRINTSL STR:0
  
 
; MISTAKE
 
; MISTAKE
  
;+=で付け加えたりはできない
+
;You can't add it with +=
STR:0 += うえお</nowiki>
+
STR:0 += ueo</nowiki>
 
<BR>
 
<BR>
  
====変数リスト====
+
====Variable List====
* [[Emuera/eramavar|こちら]]を参照してください。
+
* See [[Emuera/eramavar|here]].
  
===命令について(基本)===
+
===About Instructions (Basic)===
命令を使うことで、画面に文字を表示したり、条件判断をしたりすることができます。
+
Instructions can be used to display characters on the screen and to make conditional judgments.
====命令の書き方====
+
====How to write an instruction====
* (命令名) (命令内容)という書き方が基本です。(命令名)(命令内容)は半角スペースかタブで区切ってください。<BR>
+
* The basic writing style is (instruction name) (instruction content). Separate (instruction name) and (instruction content) with a half-size space or tab. <BR>
* (命令内容)がない命令の場合、そのまま改行してください。
+
* If there is no (instruction content), start a new line as it is.
  
 
  <nowiki>
 
  <nowiki>
 
; CORRECT
 
; CORRECT
  
PRINT これはテストです。
+
PRINT This is a test.
 
SIF 3 == 1+2
 
SIF 3 == 1+2
   PRINT 当たり前です。
+
   PRINT Obviously.
 
WAIT
 
WAIT
  
 
; MISTAKE
 
; MISTAKE
  
PRINTこれはテストです。
+
PRINTThis is a test.。
;入力待ち
+
;wait for input
 
WAIT 0</nowiki>
 
WAIT 0</nowiki>
  
====文字を表示する====
+
====Displaying Text====
* PRINTは文字を表示する命令です。PRINTLは文字を表示し、改行します。PRINTWは文字を表示し、入力待ちにします。<BR>
+
* PRINT is an instruction to display text; PRINTL displays text and starts a new line; PRINTW displays text and waits for input.<BR>
* PRINTVは変数の内容を表示する命令です。PRINTVLは変数の内容を表示し、改行します。PRINTVWは変数の内容を表示し、入力待ちにします。<BR>
+
* The PRINTV command displays the content of a variable, the PRINTVL command displays the content of the variable and makes a new line, the PRINTVW command displays the content of the variable and waits for input.<BR>
* PRINTSは文字列変数の内容を表示する命令です。PRINTSLは文字列変数の内容を表示し、改行します。PRINTSWは文字列変数の内容を表示し、入力待ちにします。<BR>
+
* PRINTS is an instruction that displays the contents of a string variable, PRINTSL displays the contents of the string variable and starts a new line, PRINTSW displays the contents of the string variable and waits for input, and PRINTSW displays the contents of the string variable and waits for input.<BR>
* PRINTFORMは文字、変数、文字列変数などが組み合わさったものを表示できます。PRINTFORMLは同様にした上で改行し、PRINTFORMWは同様にした上で入力待ちにします。<BR>
+
* PRINTFORM can display a combination of characters, variables, and string variables; PRINTFORML can do the same and break a new line; PRINTFORMW can do the same and wait for input.<BR>
* PRINTFORMSはPRINTFORMと同じように文字列変数の内容を変換して表示をします。PRINTFORMSLは同様にした上で改行し、PRINTFORMSWは同様にした上で入力待ちにします。<BR>
+
* PRINTFORMS is the same as PRINTFORM. PRINTFORMSL is the same as PRINTFORM, but with a new line, PRINTFORMSW is the same as PRINTFORM and waits for input.<BR>
(末尾にWがつく命令で入力待ちのときは、Enterを押すことで次に進むので、結局改行されます)<BR>
+
(If you are waiting for input with a W at the end of the command, press Enter to move on, and the line will eventually be broken.<BR>
  
 
  <nowiki>
 
  <nowiki>
Line 236: Line 240:
  
 
MONEY = 500
 
MONEY = 500
NAME:0 = 佐藤
+
NAME:0 = Sato
PRINT お金は
+
PRINT The money is
 
PRINTV MONEY
 
PRINTV MONEY
PRINTL 円です。
+
PRINTL yen.
PRINT 名前は
+
PRINT My name is
 
PRINTS NAME:0
 
PRINTS NAME:0
PRINTL です。
+
PRINTL .
PRINTFORML 繰り返すと、名前は%NAME:0%で、お金は{MONEY}円です。
+
PRINTFORML To repeat, the name is %NAME:0% and the money is {MONEY} yen.
PRINTFORMW 1000円もらって600円払うと、残りは{MONEY+1000-600}円です。
+
PRINTFORMW If you get 1000 yen and pay 600 yen, you're left with {MONEY+1000-600} yen.
STR:0 = そのお金を5倍にすると、{(MONEY+1000-600)*5}円です。
+
STR:0 = If you multiply that money by five, it's {(MONEY+1000-600)*5} yen.
 
PRINTFORMSW STR:0
 
PRINTFORMSW STR:0
 
  
 
; RESULTS
 
; RESULTS
  
お金は500円です。
+
The money is 500 yen.
名前は佐藤です。
+
My name is Sato.
繰り返すと、名前は佐藤で、お金は500円です。
+
To repeat, the name is Sato and the money is 500 yen.
1000円もらって600円払うと、残りは900円です。
+
If you get 1000 yen and pay 600 yen, you're left with 900 yen.
そのお金を5倍にすると、4500円です。</nowiki>
+
If you multiply that money by five, it's 4500 yen.</nowiki>
  
 
====条件判断する====
 
====条件判断する====

Revision as of 21:34, 8 April 2020

eramaker ERB file format (provisional)
I think it's hard to get a picture just by looking at this file. It is easier to understand if you play the sample game first, and then look at the ERB files of the sample game while looking at it.

Basic Info

About the ERB file

  • Put a folder named ERB directly under eramaker.exe, and put ERB file in it.
  • You can use any file name as long as the extension is .ERB
  • Please edit it with a text editor such as Notepad.

How to write an ERB file

Comments & Spaces

In all ERB files,

  • If the first character in the first column is a ; (semicolon), the line is ignored. Empty lines are also ignored.
  • Don't put a semicolon at the end of a line, or a comment after it. Both ways can be done in Emuera.
  • Any number of spaces or tabs at the beginning of a line will be ignored.
; CORRECT

;Setting up the money
MONEY = 500
;Setting the time
DAY = 10
TIME = 1
;Game start
PRINT What do we do now?

; Also CORRECT in Emuera
; The ; at the end of MONEY = 500 is not needed
; MISTAKE in eramaker

MONEY = 500;
TIME = 5; (Start on Day 5)


Half-width input

Please use half-width characters when inputting numbers, instructions, variable names, function names, etc.

; CORRECT

MONEY = 500
PRINT Let the game begin.

; MISTAKE

MONEY = 500
PRINT Let the game begin.

Inputting a string

It doesn't work properly if you enclose a string with "".

; CORRECT

PRINT The day is over...

; MISTAKE

PRINT "The day is over..."

1行で完結

Even when writing long instructions, don't split them into more than two lines.

; CORRECT

PRINT Nayuki's body was sensitive and she had a lot of experience, so she was happy even if it was a little rough. Even though she denies it with her mouth, Nayuki is getting more and more promiscuous. But the peculiar circumstance of her being asleep made me hesitant to make a bolder move.

; MISTAKE

PRINT 
Nayuki's body was sensitive and she had a lot of experience, so she was happy even if it was a little rough. Even though she denies it with her mouth, Nayuki is getting more and more promiscuous. But the peculiar circumstance of her being asleep made me hesitant to make a bolder move.


Variables and Instructions

About the variables

In training SLG, the change of parameters is vital. Therefore, it is necessary to learn how to use "variables" that can store data and perform calculations such as adding and multiplying data.

Putting a number in a variable

Use = (equal). Please enter it in half-width characters. Before and after = is separated by a half-size space or a tab.
The numbers that can be used in eramaker are basically integers. Do not enter a decimal point.*

; CORRECT

MONEY = 500

; MISTAKE

MONEY = 500
MONEY=500
MONEY = 3.14

*Adendum: Emuera has since added more number literal types. Check Constants (Literals) for more information.

Putting a calculated number into a variable

Use = in the same way. Note that * is for multiplication, / is for division, and % is for the rest of the division.
Fractions are rounded down when the result is a decimal.

; CORRECT

;set MONEY to 74
MONEY = 15+34+25
;set MONEY to 650
MONEY = 150+(100-50)*10
;set MONEY to 3
MONEY = 10/3
;set MONEY to TIME multiplied by 10
MONEY = TIME*10
;If DAY is 0,1,2... then MONEY becomes 0,10,20... and returns to 0 when it exceeds 7.
MONEY = DAY%7*10

; MISTAKE

MONEY = 500×10÷4

Add or multiply variables

Use +=, -=, *=, /=, %=.

; EXAMPLE

MONEY = 100
TIME = 12
;set MONEY to 150
MONEY += 50
;set MONEY to 750
MONEY *= 7-2
;set MONEY to 80
MONEY -= 670
;set MONEY to 8
MONEY %= TIME
;set MONEY to 1
MONEY /= TIME-4

About Arrays

  • The variables can be accessed as an "array". An "array" is for managing multiple data with the variable of the same name.
  • To access the array, use : (colon). Please enter it in half-width characters. Don't put any spaces in between.
  • The number that can be put after the array is at least 0. The maximum value is determined by the variable. See the list for more information.
  • You can also put a variable instead of a number after the array. However, you can't put an array after an array.
; CORRECT

A = 35
;Set the FLAG to a value
FLAG:0 = 0
FLAG:2 = 10
FLAG:35 = 440
;Calculate with FLAG
FLAG:A += 100/FLAG:2
FLAG:2 *= FLAG:A

; MISTAKE

FLAG:0 = 10
FLAG : 52 = 1000
FLAG:FLAG:20 = 10000
FLAG:91881816 = 1

About the Double Sequence

  • Exceptionally, some variables can be accessed using two colons. Usually variables related to your character's data.
  • Use (variable name):(character number):(variable number) to access it.
; EXAMPLE

A = 2
;Makes the 5th character's 0th ability LV3.
ABL:5:0 = 3
;A (2nd) character's first experience is increased by 1.
EXP:A:1 += 1


Display the variable on the screen

  • The easiest way to do this is to use the PRINTV and PRINTVL commands. We will discuss the instruction in more detail later.
; EXAMPLE

A = 2
PRINTV A
A = 30
PRINTVL A
B = 400
PRINTVL B

; RESULTS

230
400

About String Variables

  • Regular variables can only handle integers, but there are string variables that can handle strings. However, the features are limited.
  • To display a string variable on the screen, use the PRINTS or PRINTSL instruction.
; CORRECT

STR:0 = aiueo
PRINTSL STR:0

; MISTAKE

;You can't add it with +=
STR:0 += ueo


Variable List

About Instructions (Basic)

Instructions can be used to display characters on the screen and to make conditional judgments.

How to write an instruction

  • The basic writing style is (instruction name) (instruction content). Separate (instruction name) and (instruction content) with a half-size space or tab.
  • If there is no (instruction content), start a new line as it is.
; CORRECT

PRINT This is a test.
SIF 3 == 1+2
   PRINT Obviously.
WAIT

; MISTAKE

PRINTThis is a test.。
;wait for input
WAIT 0

Displaying Text

  • PRINT is an instruction to display text; PRINTL displays text and starts a new line; PRINTW displays text and waits for input.
  • The PRINTV command displays the content of a variable, the PRINTVL command displays the content of the variable and makes a new line, the PRINTVW command displays the content of the variable and waits for input.
  • PRINTS is an instruction that displays the contents of a string variable, PRINTSL displays the contents of the string variable and starts a new line, PRINTSW displays the contents of the string variable and waits for input, and PRINTSW displays the contents of the string variable and waits for input.
  • PRINTFORM can display a combination of characters, variables, and string variables; PRINTFORML can do the same and break a new line; PRINTFORMW can do the same and wait for input.
  • PRINTFORMS is the same as PRINTFORM. PRINTFORMSL is the same as PRINTFORM, but with a new line, PRINTFORMSW is the same as PRINTFORM and waits for input.

(If you are waiting for input with a W at the end of the command, press Enter to move on, and the line will eventually be broken.

; EXAMPLE

MONEY = 500
NAME:0 = Sato
PRINT The money is 
PRINTV MONEY
PRINTL  yen.
PRINT My name is 
PRINTS NAME:0
PRINTL .
PRINTFORML To repeat, the name is %NAME:0% and the money is {MONEY} yen.
PRINTFORMW If you get 1000 yen and pay 600 yen, you're left with {MONEY+1000-600} yen.
STR:0 = If you multiply that money by five, it's {(MONEY+1000-600)*5} yen.
PRINTFORMSW STR:0

; RESULTS

The money is 500 yen.
My name is Sato.
To repeat, the name is Sato and the money is 500 yen.
If you get 1000 yen and pay 600 yen, you're left with 900 yen.
If you multiply that money by five, it's 4500 yen.

条件判断する

  • 条件判断は; EXAMPLEを見ながら理解するのが早
  • SIFは条件式が0でなければ(成立した場合)次の行を実行します。0の場合(成立しない場合)、次の行をスキップします。
  • IFは条件式が0でなければ(成立した場合)、次の行からELSE、ELSEIF、ENDIFを迎えるまで実行していきます。0である場合(成立しない場合)、ELSE、ELSEIF、ENDIFを迎えるまでスキップします。(ELSEならその次の行からENDIFを迎えるまで実行します。ELSEIFで条件式が成立している場合、その次の行からELSEかELSEIFかENDIFを迎えるまで実行します。成立していなければELSEかELSEIFかENDIFを迎えるまでスキップし、同じことを繰り返します)
; EXAMPLE

A = 1
B = 2
C = 4

SIF A == 1
   PRINTL テスト1
SIF B != 1
   PRINTL テスト2
SIF C < 5
   PRINTL テスト3
IF A+B > 2
   IF C >= 6
      PRINTL テスト4
   ELSE
      PRINTL テスト5
   ENDIF
   IF A == 1 && B == 3
      PRINTL テスト6
   ELSEIF A == 1 || B == 3
      PRINTL テスト7
   ELSEIF A > 1 || (B > 2 && C > 2)
      PRINTL テスト8
   ENDIF
ELSEIF A+B == 2
   PRINTL テスト9
ELSE
   PRINTL テスト10
ENDIF

; RESULTS

テスト1
テスト2
テスト3
テスト5
テスト7
  • 「等しい」には==を、「等しくない」には!=を、「左が大きい」には>を、「左が右以上」には>=を、「右が大きい」には<を、「右が左以上」には<=を使います。すべて半角で入力してください。
  • 「かつ」には&&を、「または」には||を使います。すべて半角で入力してください。
  • カッコを使い、複雑な条件を記述することもできます。

入力と入力待ち

  • 文章を表示するなどして、入力を待つときにはWAITを使います。

(※普段はPRINTWなどを使うと、少ない行数で表現できるため見やすいです)

  • 整数をプレイヤーに入力させたいときはINPUTを使います。入力された結果はRESULTに格納されます。
  • 文字列をプレイヤーに入力させたいときはINPUTSを使います。入力された結果はRESULTSに格納されます。
; EXAMPLE

PRINT データ入力開始。
WAIT
PRINTL 年齢を入力してください。
INPUT
PRINTL 名前を入力してください。
INPUTS
PRINTFORML %RESULTS%さんは{RESULT}歳ですね。

繰り返しとGOTO

  • 同じ命令を繰り返したいときはREPEATを使います。RENDがあるまで繰り返されます。繰り返した回数はCOUNTに格納されます。
  • REPEATの中にREPEATは作れませんので注意してください。
  • REPEATからRENDまでの途中でCONTINUEを使うと、REPEATのあるところまで戻ります。BREAKを使うと、繰り返しをやめてRENDの次の行までスキップします。
  • 別のところに一気に移動したいときはGOTOを使います。GOTOを使うときは、$を使って「ラベル」を登録しておく必要があります。
; Example 1

REPEAT 10
   PRINT あいう
REND
;0文字をPRINTLで書くことで改行
PRINTL 
REPEAT 5
   PRINTFORML 点数:{COUNT*5}
REND

; Results Of Example 1

あいうあいうあいうあいうあいうあいうあいうあいうあいうあいう
点数:0
点数:5
点数:10
点数:15
点数:20

; Example 2

MONEY = 300
REPEAT 5
   SIF MONEY <= COUNT*100
      BREAK
   PRINTFORML {COUNT*100}円よりは金が多い。
REND
REPEAT 5
   SIF MONEY == COUNT*100
      CONTINUE
   PRINTFORML 所持金は{COUNT*100}円ではない。
REND

; Results Of Example 2

0円よりは金が多い。
100円よりは金が多い。
200円よりは金が多い。
所持金は0円ではない。
所持金は100円ではない。
所持金は200円ではない。
所持金は400円ではない。

; Example 3

$INPUT_LOOP
PRINTL 0から9までの数字を入力してください。
INPUT
SIF RESULT < 0 || RESULT > 9
   GOTO INPUT_LOOP
PRINTFORML {RESULT}が入力されました。

関数について

  • プログラムを最初から最後まで続けて書くとわかりづらいものです。
  • 部分部分に切り分けてわかりやすくするためには、「関数」を使います。
  • 関数は@を使って登録します。@の後に、アルファベットと_(アンダーバー)を使って関数名を書いてください。関数名は半角で入力してください。
  • ゲームの最初に呼ばれる関数は「EVENTFIRST」という名前にします(これについては後に詳述)。
  • 他の関数に移動するには、JUMPを使います。
  • 他の関数に移動し、その関数が終わったら再び元の位置から再開したいときはCALLを使います。
  • CALLで呼ばれた関数の中でRETURNを使うと、その関数を途中で終えることができます。そのとき、RESULTにRETURNで指定した数値が格納されます。RETURNを使わずに関数が終了した場合、RESULTには0が格納されます。
  • RESTARTを使うと、その関数の最初からやり直します。
; EXAMPLE

@EVENTFIRST
PRINTW ゲームスタート。

CALL OPENING
PRINTFORMW オープニングの結果は{RESULT}でした。
CALL GAME_MAIN
PRINTFORMW ゲームの結果は{RESULT}でした。
JUMP ENDING

PRINTL JUMPしたのでこの部分は表示されない。

@OPENING
PRINTW オープニングです。
RETURN 25

@GAME_MAIN
PRINTW ゲーム中です。
PRINTL RETURNなしで終わります。

@ENDING
PRINTW エンディングです。
RESTART

; RESULTS

ゲームスタート。
オープニングです。
オープニングの結果は25でした。
ゲーム中です。
RETURNなしで終わります。
ゲームの結果は0でした。
エンディングです。
エンディングです。
エンディングです。
エンディングです。
エンディングです。
.......(以下無限)

その他、基本的な命令

  • QUITを使うとゲームを終了します。
  • DRAWLINEを使うと画面の左端から右端まで----と線を引きます。
  • TIMESを使うと、小数を使った掛け算ができます。eramakerでは基本的に数値を整数で扱うので、小数を絡めたいときはこの命令を使ってください。TIMES (変数) , (小数値)という形で使います。
  • BARを使うと、[*****....]のようにグラフが表示できます。BARLの場合は改行されます。BAR (変数) , (最大値), (長さ)という形で使います。
; EXAMPLE

MONEY = 500
DRAWLINE
BARL MONEY , 1000 , 20
PRINTFORMW {MONEY}円持っていました。
DRAWLINE
TIMES MONEY , 1.25
BARL MONEY , 1000 , 20
PRINTFORMW {MONEY}円になりました。ゲームを終了します。
QUIT

; RESULTS

---------------------------------------------------------------------
[**********..........]
500円持っていました。
---------------------------------------------------------------------
[************........]
625円になりました。ゲームを終了します。


命令について(調教用)

  • eramakerには、調教のために使う特殊な命令がいくつかあります。

調教用データの表示

  • PRINT_ABLはキャラの能力を表示します。
  • PRINT_TALENTはキャラの素質を表示します。
  • PRINT_MARKはキャラの刻印を表示します。
  • PRINT_EXPはキャラの経験を表示します。
  • PRINT_PALAMはキャラの調教中パラメータを表示します。
  • 以上の命令を使うときには、どのキャラのデータを表示したいのかを指定してください。たとえばPRINT_ABL 0なら、大体の場合は主人公の能力を表示することになります。


  • PRINT_ITEMは所持しているアイテムを表示します。
  • PRINT_SHOPITEMはショップで売っているアイテムを表示します。


  • UPCHECKは調教コマンドによる調教中パラメータの変化を表示します。


キャラの管理

  • ADDCHARAはキャラを追加します。キャラ番号3のキャラを追加したいならADDCHARA 3のようにします。
  • ADDSPCHARAはSPキャラを追加します。キャラ番号3のSPキャラを追加したいならADDSPCHARA 3のようにします。

(SPキャラとは、キャラフラグの0番が1であるキャラのことを指します)

  • DELCHARAはADDCHARAなどで追加したキャラを削除します。
; EXAMPLE

;キャラ番号0のキャラの名前が浩之で主人公。
;キャラ番号3のキャラの名前が智子、5のキャラの名前がレミィ、6のキャラの名前が琴音だとする
PRINTFORML 今いるキャラは{CHARANUM}人です。

ADDCHARA 3
ADDCHARA 5
ADDCHARA 6
PRINTFORML 今いるキャラは{CHARANUM}人です。
REPEAT CHARANUM
   PRINTFORML {COUNT}番目に%NAME:COUNT%。
REND
DELCHARA 2
PRINTFORML 今いるキャラは{CHARANUM}人です。
REPEAT CHARANUM
   PRINTFORML {COUNT}番目に%NAME:COUNT%。
REND

; RESULTS

今いるキャラは1人です。
今いるキャラは4人です。
0番目に浩之。
1番目に智子。
2番目にレミィ。
3番目に琴音。
今いるキャラは3人です。
0番目に浩之。
1番目に智子。
2番目に琴音。

セーブ関係

  • SAVEGAMEはセーブ画面を、LOADGAMEはロード画面を呼びます。いずれもSHOPでないと呼び出せません。
  • PUTFORMは@SAVEINFOという特殊な関数でのみ使えます。PRINTFORMと同様の書式で書くことにより、セーブデータに概要をつけることができます。何日目か、キャラの能力はどれくらいか、どのキャラを調教しているかなどのデータを書き込むとよいでしょう。

BEGIN

  • BEGINはさまざまなシステム命令を呼び出すことにより、ゲームを進行させます。
  • BEGINを呼んだ時点で実行中の関数は終了します。CALLでどこからか呼ばれてきたとしても、元の関数に戻ることはありません。


  • BEGIN TRAINは調教を開始します。
  • BEGIN AFTERTRAINは調教を終了します。
  • BEGIN ABLUPは能力アップ画面を呼び出します。
  • BEGIN TURNENDはそのターンを終了します。
  • BEGIN SHOPはSHOPを呼び出します。


更新履歴

  • 06/05/05 暫定版公開。