Introduction
This plugin requires YEP_MessageCore. Make sure this plugin is located under YEP_MessageCore in the plugin list.
这个插件需要YEP_MessageCore。确保此插件位于插件列表中的YEP_MessageCore下。
This is a small plugin that adds in a \evalText<<code>> text code for messages so that people can run JavaScript code and display it as text. This can be used to make calculations on the fly without needing to use Change Variable events prior to displaying the amount or to determine what kind of string would be displayed without making a plethora of Conditional Branch events.
这是一个小插件,它为消息添加了新的文本代码,以便人们可以运行JavaScript代码并将其显示为文本。
Text Code
\evalText<<code>>
– Replace ‘code’ with JavaScript code. It will run the code inside, then return whatever is the last line of the code that’s ran. Here are some examples of what you could do this with:
- 用JavaScript代码替换'code'。它将运行代码,然后返回运行代码的最后一行。以下是您可以执行此操作的一些示例:
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Examples:
\evalText<<$gameActors.actor(1).atk + $gameActors.actor(2).atk>>
– Displays the sum of actor 1’s ATK and actor 2’s ATK.
显示演员1的ATK和演员2的ATK的总和。
\evalText<<Math.min(1000, $gameParty.gold())>>
– Displays either ‘1000’ or the party’s gold count, depending on which one is currently smaller.
显示'1000'或方的金币计数,具体取决于当前哪一个较小。
\evalText<<[‘His’,’Her’,’Its’][\v[123]]>>
– Depending on the value of Variable 123, this will display ‘His’ if the Variable 123 value is equal to 0, ‘Her’ if the value is equal to 1, or ‘Its’ if the value is equal to 2.
根据变量123的值,显示1、2、3会显示他、它、她
\evalText<<[‘Abel’,’Brandon’,’Chris’][$gameVariables.value(456)]>>
– Depending on the value of Variable 456, this will display ‘Abel’ if the Variable 456 value is equal to 0, ‘Brandon’ if the value is equal to 1, or ‘Chris’ if the value is equal to 2.
根据变量456的值,根显示不同的名字
Happy RPG Making!