document

initial stage


Misaka is distributed as a nar archive along with template ghost. Although the template ghost is completely inorganic/functional, it functions as a complete ghost (structurally), and by actually operating it and referencing the data file at the same time, Misaka's structure can be understood relatively easily. can. The following text is intended to be read while referring to the text file misaka.txt (Misaka dictionary database file) owned by Template Ghost.


The template ghost attached to the Misaka file set reacts correctly to all events, except that the reactions are extremely systematic and nonsensical. Therefore, a ghost master can create a valid ghost simply by rewriting the necessary parts of the template with the intended string. For example, in $OnBoot, change the part that says "Start." to something that works as a line, such as "Start." The initial stage of creating a ghost, "implementing a set of events", is completed with just this task.

Random talk, which is Ghost's main behavior, is defined in the template with the internal event symbol $_OnTalk. The sample defines six lines of meaningless strings, which are uttered randomly at random intervals. In Misaka, the process of returning multiple responses to the same situation can be achieved by simply increasing the number of lines like this. This applies to all events, not just $_OnTalk. For example, if you don't want $OnBoot to have multiple reactions, you can just add more lines in the same way.

At the end of the string defined as the $_OnTalk symbol is a string such as {$ms}, which when spoken will pick up the string from the $ms symbol and replace it appropriately. The symbol $ms is located in the first half of the file (although it can be located anywhere), and it contains a set of words that represent people's names. In other words, if you want to perform the action of "picking up random words" at the so-called "anywhere" level, you can define a symbol and word list with an arbitrary name in an arbitrary place in the file, and use it as {$name}. . Misaka's word dictionary is created in this way, realizing templates like "{$ms} laughed."

In the template word dictionary, the definitions of $mbou and $msmvo clearly express the characteristics of Misaka's variable evaluation system. Variables can be nested an infinite number of times in any situation. By making full use of this structure, variable definitions become smarter and less wasteful.

next stage


If you want Ghost to go beyond the initial stage, you will need to understand the overall structure and operate it, rather than just rewriting strings. In other words, you have to refer to Misaka's specifications, understand exactly what Template Ghost is doing, and then create the syntax by thinking about it yourself.


Misaka language specification


Once you have a clear idea of what the template ghost was doing, this stage is over.

Final stage


Misaka has a development concept of "avoiding dialects as much as possible'', and uses almost all system symbols as they are defined in SHIORI/2.2, and also uses no unnecessary processing for the reference header strings. I just throw it as is. Therefore Misaka is unable to perform to his 100% potential as it is ignorant about SHIORI/2.2. You need to read the SHIORI/2.2 specification to understand what events occur under what circumstances, and what reference arguments are set under what circumstances. This also leads to mastering the \![raise] command.


SHIORI/2.2 specifications


Once you understand the structure of SHIORI/2.2, you will have nothing to fear about using SHIORI.

Anti-Ghost Communicate


Anti-ghost communication is performed based on the following logic.


First, if you want to talk to someone yourself, call $_OnGhostCommunicateSend. The adoption judgment expression for these handlers in the template is written as a logical expression such as {$if ({$isghostexists(Hana-chan)})}, and this conditional judgment realizes the action of "searching for existing ghosts and talking to them.'' doing. When you find someone you can talk to, just set the other person's name in the $to variable and then return the lines as normal.

If you are being talked to, $_OnGhostCommunicateReceive will be called. The expression for determining the adoption of these handlers in the template is as follows: {$if (({$sender}==Hana-chan) && ({$inlastsentence(fish)}))}, and this condition determines whether the other party If Hana-chan's dialogue contains the character string "fish", it will respond in this way". This allows you to respond appropriately depending on the other person and their lines.


That's the basic structure. In order to increase the number of people to react to and the content of reactions, all you have to do is increase the number of these conditional expressions.

Back