Difference between revisions of "Emuera/flow"

From Era Wiki
Jump to: navigation, search
(Created page with "Hi, everybody! My name is Gavin. <br>It is a little about myself: I live in United States, my city of Metairie. <br>It's called often Northern or cultural capital of LA. I've...")
 
(Page created, half of it translated)
Line 1: Line 1:
Hi, everybody! My name is Gavin. <br>It is a little about myself: I live in United States, my city of Metairie. <br>It's called often Northern or cultural capital of LA. I've married 1 years ago.<br>I have 2 children - a son (Manuel) and the daughter (Doretha). We all like Skiing.<br><br>my web site :: [https://www.smashwords.com/profile/view/clamvinyl0 ketogenic diet one week]
+
=== Flowchart ===
 +
The flowchart was created using [http://logicnet.dk/DiagramDesigner/ DiagramDesigner].<BR>
 +
The data file is [https://osdn.net/projects/emuera/wiki/flow/attach/flow1821.ddd here].
 +
 
 +
Unless otherwise indicated in the following description, the subject of the sentence is Emuera.exe.
 +
 
 +
==== TITLE ====
 +
After starting up and reading the ERB, and after running BEGIN TITLE.
 +
[[File:Emuera-flow-title.png|center|thumb|Flowchart]]
 +
If @SYSTEM_TITLE is defined, call it and do nothing else.<BR>
 +
If BEGIN or LOADDATA instruction is not executed in @SYSTEM_TITLE and RETURN is executed, the next process is not executed and the operation ends in an error.
 +
 
 +
If @SYSTEM_TITLE is not defined, the standard title processing is done.<BR>
 +
Characters such as "![0] Start from the beginning" on the standard title screen can be changed.<BR>
 +
See [[replace|_replace.csv]] for details.
 +
 
 +
If "![0] Start from the beginning" is selected, the first step is to initialize the data.<BR>
 +
More specifically, the initial values of STR and PRINTLV (the same as the RESETDATA instruction), ADDCHARA 0, etc.<BR>
 +
Next, BEGIN FIRST is executed to transition to FIRST.
 +
 
 +
If @TITLE_LOADGAME is defined, it is called when "![1] Load and start" is selected.<BR>
 +
If not defined, the standard load screen is displayed.<BR>
 +
It is slightly different from the screen called from LOADGAME.
 +
 
 +
==== FIRST ====
 +
When "![0] Start from the beginning" is selected in the title screen and after BEGIN FIRST is executed.<BR>
 +
If the BEGIN instruction is not executed in @EVENTFIRST, the next process is not executed and the operation ends in an error.<BR>
 +
[[File:Emuera-flow-first.png|center|thumb|Flowchart]]
 +
 
 +
==== SHOP ====
 +
After loading and running the BEGIN SHOP.<BR>
 +
If it is loaded, @EVENTSHOP is not processed.<BR>
 +
[[File:Emuera-flow-shop.png|center|thumb|Flowchart]]
 +
 
 +
Request input after the @SHOW_SHOP call.<BR>
 +
If a value between 0 and 99 is received, the purchase process is performed, and if any other value is entered, @USERSHOP is called.<BR>
 +
This range can be changed by _replace.csv. See [replace _replace.csv] for more information.<BR>
 +
The range of items displayed by the PRINT_ITEMSHOP instruction is limited to the number of ITEMNAME or ITEMSALES elements, whichever is smaller (the standard is 1000).
 +
 
 +
When the purchase process is called, it judges whether the corresponding ITEMSALES is non-zero or whether MONEY is greater than ITEMPRICE.<BR>
 +
If the purchase decision fails, it is requested to enter it again.<BR>
 +
In eramaker, if the purchase failed, It would start over from @SHOW_SHOP.
 +
 
 +
If the purchase decision is successful, assign the ITEM number to the BOUGHT variable, increase ITEM:BOUGHT by 1, and reduce MONEY by ITEMPRICE:BOUGHT.<BR>
 +
Call @EVENTBUY and return to @SHOW_SHOP.
 +
 
 +
Unless a BEGIN instruction is issued somewhere, it will never leave the SHOP.
 +
 
 +
==== TRAIN ====
 +
After BEGIN TRAIN is executed.
 +
[[File:Emuera-flow-train.png|center|thumb|Flowchart]]
 +
 
 +
First, some of the variables are initialized.<BR>
 +
Specifically, assign 0 to ASSIPLAY:0, 0 to PREVCOM:0, and -1 to NEXTCOM:0.<BR>
 +
In addition, all TFLAGs are set to 0 and all characters' GOTJUEL, TEQUIP, EX, PALAM, and SOURCE are set to 0.<BR>
 +
Finally, assign 2 to STAIN:2, 1 to STAIN:3, 8 to STAIN:4, and 0 to all others.
 +
 
 +
These values will remain in the save data when you save with SHOP, because they are not initialized when you exit TRAIN.<BR>
 +
You can save space in your save data by assigning 0 to your character's GOTJUEL, TEQUIP, EX, PALAM, etc. in @SAVEINFO.<BR>
 +
 
 +
The behavior when a non-negative value is assigned to NEXTCOM is not explained here because it is a serious problem.<BR>
 +
Emuera's NEXTCOM was implemented to reproduce the behavior of the old code including the aforementioned defects, and no new use is expected.<BR>
 +
For the CALLTRAIN instruction, see the [excom extension instructions].
 +
 
 +
Display executable TRAIN commands after a @SHOW_STATUS call.<BR>
 +
Look up @COM_ABLExx for which TRAINNAME are defined.<BR>
 +
The search range (MAX_TRAIN in the figure) is up to the range of TRAINNAME specified in VariableSize.csv in Emuera, and up to 2147483647 in eramaker.<BR>
 +
@If COM_ABLExx is not defined or returns a non-zero value, TRAINNAME is displayed because it is executable.<BR>
 +
If @COM_ABLExx returns 0, TRAINNAME is not displayed because it cannot be executed.<BR>
 +
It remembers which commands are executable or not at this time. (It doesn't call @COM_ABLExx again at runtime.)
 +
 
 +
When TRAINNAME is displayed, call @SHOW_USERCOM.<BR>
 +
After @SHOW_USERCOM, initialize "UP", "DOWN" and "LOSEBASE" before inputting.<BR>
 +
It then asks for input.
 +
 
 +
The input result is checked against the result of @COM_ABLExx, and if it is an executable command, the corresponding @COMxx is called.<BR>
 +
First, assign the TRAIN command number to the SELECTCOM variable and set all NOWEX of all characters to 0.<BR>
 +
Next, call @EVENTCOM, followed by the corresponding @COM.<BR>
 +
If @COM returns a non-zero value, call @SOURCE_CHECK and @EVENTCOMEND and return to @SHOW_STATUS.<BR>
 +
After @SOURCE_CHECK ends, set all SOURCE elements of all characters to 0 before calling @EVENTCOMEND.<BR>
 +
After @SOURCE_CHECK ends, if @EVENTCOMEND does not exist or no WAIT instruction is performed in @EVENTCOMEND, WAIT is generated just before @SHOW_STATUS.<BR>
 +
If @COM returns 0, it returns to @SHOW_STATUS.<BR>
 +
When the UPCHECK instruction is executed, the UP and DOWN values are added and subtracted to the TARGET's PALAM, and all of the UP and DOWN values are assigned to 0.<BR>
 +
 
 +
If the input result is not an executable command, it calls @USERCOM and returns to @SHOW_STATUS.
 +
 
 +
Unless a BEGIN instruction is issued somewhere, it will never leave TRAIN.
 +
 
 +
==== ABLUP ====
 +
BEGIN ABLUP実行後。
 +
 
 +
[[File:Emuera-flow-ablup.png|center|thumb|Flowchart]]
 +
 
 +
@SHOW_JUEL、@SHOW_ABLUP_SELECTを呼び出し、入力を要求する。
 +
 
 +
入力が0~99の範囲内である場合、対応する@ABLUPを探す。<BR>
 +
対応する@ABLUPが定義されていれば@ABLUPを呼び出し、@SHOW_JUELに戻る。<BR>
 +
定義されていない場合、再度入力を要求する。<BR>
 +
eramakerでは定義されていない場合は@SHOW_JUELからやり直していた。
 +
 
 +
入力が0~99の範囲外である場合、@USERABLUPを呼び出し、@SHOW_JUELに戻る。<BR>
 +
Emuera1.705現在ではこの範囲を変える方法はない。
 +
 
 +
どこかでBEGIN命令が行われない限り、ABLUPから出ることはない。
 +
 
 +
==== AFTERTRAIN ====
 +
BEGIN AFTERTRAIN実行後。<BR>
 +
@EVENTEND内でBEGIN命令が行われなかった場合、次に実行する処理がなくなりエラー終了する。
 +
[[File:Emuera-flow-aftertrain.png|center|thumb|Flowchart]]
 +
 
 +
==== TURNEND ====
 +
BEGIN TURNEND実行後。<BR>
 +
@EVENTTURNEND内でBEGIN命令が行われなかった場合、次に実行する処理がなくなりエラー終了する。
 +
[[File:Emuera-flow-turnend.png|center|thumb|Flowchart]]
 +
 
 +
==== LOADGAME ====
 +
LOADGAME命令の実行時。<BR>
 +
BEGIN命令はRETURN命令を内包しBEGIN以下の文は決して実行されないが、LOADDATAとSAVEDATA命令はCALL命令と同様に元の場所に帰ってくる。<BR>
 +
ただし、LOADが実行された場合はもとの位置を忘れてLOADDATAENDへ遷移する。
 +
[[File:Emuera-flow-loadgame.png|center|thumb|Flowchart]]
 +
 
 +
==== SAVEGAME ====
 +
SAVEGAME命令の実行時。<BR>
 +
@SAVEINFOを呼び出すタイミングは実際に書き込みが行われる直前である。
 +
[[File:Emuera-flow-savegame.png|center|thumb|Flowchart]]
 +
 
 +
==== LOADDATAEND ====
 +
LOADGAMEでLOADが実行された後、およびLOADDATA命令の実行後。<BR>
 +
LOADが行われた時点で呼び出し中の関数などこれまでの状態は全て消去される。
 +
[[File:Emuera-flow-loaddataend1821.png|center|thumb|Flowchart]]
 +
 
 +
eramakerだとここでは何もせず、@SHOW_SHOPに遷移する。<BR>
 +
Emueraでは、@SYSTEM_LOADENDが定義されていれば@SYSTEM_LOADENDを実行する。<BR>
 +
@SYSTEM_LOADEND終了までにBEGIN命令が行われれば、そちらへ遷移する。<BR>
 +
でなければ@EVENTLOADが定義されていれば@EVENTLOADを実行する。
 +
 
 +
@EVENTLOAD終了までにBEGIN命令が行われれば、そちらへ遷移する。<BR>
 +
BEGIN命令が行われなければ通常通り@SHOW_SHOPに遷移する。

Revision as of 16:49, 13 April 2020

Flowchart

The flowchart was created using DiagramDesigner.
The data file is here.

Unless otherwise indicated in the following description, the subject of the sentence is Emuera.exe.

TITLE

After starting up and reading the ERB, and after running BEGIN TITLE.

Flowchart

If @SYSTEM_TITLE is defined, call it and do nothing else.
If BEGIN or LOADDATA instruction is not executed in @SYSTEM_TITLE and RETURN is executed, the next process is not executed and the operation ends in an error.

If @SYSTEM_TITLE is not defined, the standard title processing is done.
Characters such as "![0] Start from the beginning" on the standard title screen can be changed.
See _replace.csv for details.

If "![0] Start from the beginning" is selected, the first step is to initialize the data.
More specifically, the initial values of STR and PRINTLV (the same as the RESETDATA instruction), ADDCHARA 0, etc.
Next, BEGIN FIRST is executed to transition to FIRST.

If @TITLE_LOADGAME is defined, it is called when "![1] Load and start" is selected.
If not defined, the standard load screen is displayed.
It is slightly different from the screen called from LOADGAME.

FIRST

When "![0] Start from the beginning" is selected in the title screen and after BEGIN FIRST is executed.
If the BEGIN instruction is not executed in @EVENTFIRST, the next process is not executed and the operation ends in an error.

Flowchart

SHOP

After loading and running the BEGIN SHOP.
If it is loaded, @EVENTSHOP is not processed.

Flowchart

Request input after the @SHOW_SHOP call.
If a value between 0 and 99 is received, the purchase process is performed, and if any other value is entered, @USERSHOP is called.
This range can be changed by _replace.csv. See [replace _replace.csv] for more information.
The range of items displayed by the PRINT_ITEMSHOP instruction is limited to the number of ITEMNAME or ITEMSALES elements, whichever is smaller (the standard is 1000).

When the purchase process is called, it judges whether the corresponding ITEMSALES is non-zero or whether MONEY is greater than ITEMPRICE.
If the purchase decision fails, it is requested to enter it again.
In eramaker, if the purchase failed, It would start over from @SHOW_SHOP.

If the purchase decision is successful, assign the ITEM number to the BOUGHT variable, increase ITEM:BOUGHT by 1, and reduce MONEY by ITEMPRICE:BOUGHT.
Call @EVENTBUY and return to @SHOW_SHOP.

Unless a BEGIN instruction is issued somewhere, it will never leave the SHOP.

TRAIN

After BEGIN TRAIN is executed.

Flowchart

First, some of the variables are initialized.
Specifically, assign 0 to ASSIPLAY:0, 0 to PREVCOM:0, and -1 to NEXTCOM:0.
In addition, all TFLAGs are set to 0 and all characters' GOTJUEL, TEQUIP, EX, PALAM, and SOURCE are set to 0.
Finally, assign 2 to STAIN:2, 1 to STAIN:3, 8 to STAIN:4, and 0 to all others.

These values will remain in the save data when you save with SHOP, because they are not initialized when you exit TRAIN.
You can save space in your save data by assigning 0 to your character's GOTJUEL, TEQUIP, EX, PALAM, etc. in @SAVEINFO.

The behavior when a non-negative value is assigned to NEXTCOM is not explained here because it is a serious problem.
Emuera's NEXTCOM was implemented to reproduce the behavior of the old code including the aforementioned defects, and no new use is expected.
For the CALLTRAIN instruction, see the [excom extension instructions].

Display executable TRAIN commands after a @SHOW_STATUS call.
Look up @COM_ABLExx for which TRAINNAME are defined.
The search range (MAX_TRAIN in the figure) is up to the range of TRAINNAME specified in VariableSize.csv in Emuera, and up to 2147483647 in eramaker.
@If COM_ABLExx is not defined or returns a non-zero value, TRAINNAME is displayed because it is executable.
If @COM_ABLExx returns 0, TRAINNAME is not displayed because it cannot be executed.
It remembers which commands are executable or not at this time. (It doesn't call @COM_ABLExx again at runtime.)

When TRAINNAME is displayed, call @SHOW_USERCOM.
After @SHOW_USERCOM, initialize "UP", "DOWN" and "LOSEBASE" before inputting.
It then asks for input.

The input result is checked against the result of @COM_ABLExx, and if it is an executable command, the corresponding @COMxx is called.
First, assign the TRAIN command number to the SELECTCOM variable and set all NOWEX of all characters to 0.
Next, call @EVENTCOM, followed by the corresponding @COM.
If @COM returns a non-zero value, call @SOURCE_CHECK and @EVENTCOMEND and return to @SHOW_STATUS.
After @SOURCE_CHECK ends, set all SOURCE elements of all characters to 0 before calling @EVENTCOMEND.
After @SOURCE_CHECK ends, if @EVENTCOMEND does not exist or no WAIT instruction is performed in @EVENTCOMEND, WAIT is generated just before @SHOW_STATUS.
If @COM returns 0, it returns to @SHOW_STATUS.
When the UPCHECK instruction is executed, the UP and DOWN values are added and subtracted to the TARGET's PALAM, and all of the UP and DOWN values are assigned to 0.

If the input result is not an executable command, it calls @USERCOM and returns to @SHOW_STATUS.

Unless a BEGIN instruction is issued somewhere, it will never leave TRAIN.

ABLUP

BEGIN ABLUP実行後。

Flowchart

@SHOW_JUEL、@SHOW_ABLUP_SELECTを呼び出し、入力を要求する。

入力が0~99の範囲内である場合、対応する@ABLUPを探す。
対応する@ABLUPが定義されていれば@ABLUPを呼び出し、@SHOW_JUELに戻る。
定義されていない場合、再度入力を要求する。
eramakerでは定義されていない場合は@SHOW_JUELからやり直していた。

入力が0~99の範囲外である場合、@USERABLUPを呼び出し、@SHOW_JUELに戻る。
Emuera1.705現在ではこの範囲を変える方法はない。

どこかでBEGIN命令が行われない限り、ABLUPから出ることはない。

AFTERTRAIN

BEGIN AFTERTRAIN実行後。
@EVENTEND内でBEGIN命令が行われなかった場合、次に実行する処理がなくなりエラー終了する。

Flowchart

TURNEND

BEGIN TURNEND実行後。
@EVENTTURNEND内でBEGIN命令が行われなかった場合、次に実行する処理がなくなりエラー終了する。

Flowchart

LOADGAME

LOADGAME命令の実行時。
BEGIN命令はRETURN命令を内包しBEGIN以下の文は決して実行されないが、LOADDATAとSAVEDATA命令はCALL命令と同様に元の場所に帰ってくる。
ただし、LOADが実行された場合はもとの位置を忘れてLOADDATAENDへ遷移する。

Flowchart

SAVEGAME

SAVEGAME命令の実行時。
@SAVEINFOを呼び出すタイミングは実際に書き込みが行われる直前である。

Flowchart

LOADDATAEND

LOADGAMEでLOADが実行された後、およびLOADDATA命令の実行後。
LOADが行われた時点で呼び出し中の関数などこれまでの状態は全て消去される。

Flowchart

eramakerだとここでは何もせず、@SHOW_SHOPに遷移する。
Emueraでは、@SYSTEM_LOADENDが定義されていれば@SYSTEM_LOADENDを実行する。
@SYSTEM_LOADEND終了までにBEGIN命令が行われれば、そちらへ遷移する。
でなければ@EVENTLOADが定義されていれば@EVENTLOADを実行する。

@EVENTLOAD終了までにBEGIN命令が行われれば、そちらへ遷移する。
BEGIN命令が行われなければ通常通り@SHOW_SHOPに遷移する。