美文网首页
【汉化】YEP.162 – Advanced Switches

【汉化】YEP.162 – Advanced Switches

作者: 沧笙 | 来源:发表于2018-03-04 01:08 被阅读1259次

    Introduction

    For the advanced users out there with JavaScript experience, you can set certain switches and variables to return data about the game through pieces of code on the get go. This can be used for event page conditions, enemy AI conditions, troop page conditions, and more!

    对于那些具有JavaScript经验的用户,您可以设置某些开关和变量,通过代码随时返回游戏的数据。包括事件条件,敌方AI条件,敌群条件等。

    Instructions

    To use this plugin, name the switches or variables that you want to utilize code effects with the following format:
    要使用此插件,请使用以下格式命名要使用代码效果的开关或变量

    Eval: code
    

    This will make the switch or variable run the piece of code after the ‘Eval:’ marker. The code is used for a switch, it ought to return a ‘true’ or ‘false’ boolean. If the code is used for a variable, it ought to return a numeric value for comparison.

    这将在Eval之后运行一段代码。如果代码用于开关,它应该返回一个'true'或'false'布尔值。如果代码用于变量,它应该返回一个数值进行比较。

    For example, a switch named ‘Eval: $gameActors.actor(1).isLearnedSkill(5)’, then it will return true if Actor 1 has skill 5 learned or not. This can be used for things like making a skill with ‘True Sight’ and making certain things appear visible on the map if the actor has that skill.

    例如,一个名为Eval:$ gameActors.actor(1).isLearnedSkill(5)的开关,如果Actor 1有技能5学习,它将返回true。这可以用于像'真实之眼'这样的技能,如果演员拥有该技能,则可以在地图上显示某些东西。

    While variables can insert their own JavaScript code easily thanks to the help of the ‘Script’ option in the Control Variables event, you can save yourself the extra step by just naming a variable ‘Eval: $gameParty.gold()’. This will automatically make it calculate the amount of gold the party has and reference it with the variable.

    虽然变量可以通过Control Variables事件中Script选项的帮助轻松插入自己的JavaScript代码,但你也可以通过命名变量Eval:$ gameParty.gold()来简化步骤。这将自动计算队伍金币数量并将其与变量进行比较。

    !! WARNING !!

    If you are using this as an event’s page condition, keep in mind that any changes made from events on the map will not reflect the changes made to reference those switches immediately. For that, you will have to refresh the map, which can be done using the plugin command below:

    如果您将此作为事件页面的条件使用,请记住,由地图上的事件所做的任何更改都不会立即引用这些开关所做的更改。所以,您必须刷新地图使其生效,这可以使用下面的插件命令完成:

    Plugin Commands

    These plugin commands can be used to immediately refresh a map or troop troop event to ensure that switch/variable data gets noticed and triggered or updated upon your call.

    这些插件命令可用于立即刷新地图或队伍事件,以确保在切换开关或变量数据时可以触发或更新。

    Plugin Command:

    RefreshMap
    

    – This will refresh all of the map’s events. This will update any page conditions with Advanced Switches or Variables that may have changed values prior to using this plugin command. This can only be used outside of battle!
    -这将刷新所有地图的事件。这将更新所使用的所有页面条件。这只能在战斗之外使用!

    RefreshTroop
    

    – This will refresh the current event interpreter in battle. This will update any page condition within the current troop that utilizes Advanced Switches or Variables that may have changed values prior to using this plugin command.

    • 这将刷新战斗中的事件。这将更新当前队伍中的任何页面状态的开关或变量。

    NOTE: If you are using the Battle Engine Core, using this won’t be necessary for the majority of the time.
    注意:如果您使用的是Battle Engine Core,那么在大多数情况下使用它并不是必需的。

    Examples

    Here are some examples that you can use Advanced Switches and Variables for!

    以下是一些示例,您可以使用这个插件做到的事情!

    Switches

    Eval: $gameActors.actor(1).isLearnedSkill(5)
    

    – This will make a check if Actor 1 (in the database) has learned skill 5 (in the database). This can be used for some skills like ‘True Sight’ to certain events appear differently on the map or certain events happen in battle (like seeing through an enemy’s disguise).

    • 这将检查角色1(在数据库中)是否学过了技能5(在数据库中)。这可以用于某些技能,如“真实之眼”,来发现在地图或战斗中某些事件。

      Eval: $gameActors.actor(3).isEquipped($dataWeapons[100])
      – This will make a check to see if Actor 3 (in the database) has Weapon 100 (in the database) equipped. If it does, then the switch will return true. Otherwise, it will return false.

    • 这将检查Actor 3(在数据库中)是否装备了Weapon 100(在数据库中)。如果是返回true。否则,它将返回false。

      Eval: $gameActors.actor(4).isEquipped($dataArmors[200])
      – This will make a check to see if Actor 4 (in the database) has Armor 200 (in the database) equipped. If it does, then the switch will return true. Otherwise, it will return false.

    • 这将检查Actor 4(在数据库中)是否装备了Armor 200(在数据库中)。如果是返回true。否则,它将返回false。

      Eval: $gameVariables.value(2) < 3
      – You know how map event page conditions can only make checks if a variable is only greater than or equal to a value? Well, now you can do the opposite and check if a variable is less than a certain value. The example used above will check if Variable 2 has a value less than 3 (but not equal to).

    • 你可以检查地图事件页面条件的一个变量是否小于某个值。上面使用的示例将检查变量2的值是否小于3。

      Eval: $gameSelfSwitches.value([10,20,’A’])
      – This will allow an event to use another event’s self switch case to determine its condition. The example above checks if Map 10, Event 20’s ‘A’ self switch is turned on.

    • 这将允许事件使用另一个事件的开关情况来确定其状态。上面的例子检查Map 10,Event 20的'A'自身开关是否打开。

    Variables

    Eval: $gameParty.leader().actorId()
    

    – This will return the party leader’s actor ID. This can be useful for certain events that may have different reactions depending on who your party leader is at the time.

    • 这将返回队伍领队的ID。。

      Eval: $gameParty.gold()
      – This will return the party’s exact amount of gold. This can also be used in some event’s pages to make bags of gold appear in the player’s HQ to show just how rich the player is.

    • 这将返回队伍的金币数量。

      Eval: $gameParty.steps()
      – This will return the amount of steps the player has walked. This can be used in ways where a trophy may appear in the player’s HQ depending on how many steps the player has walked.

    • 这将返回玩家走过的步数。

      Eval: $gameParty.aliveMembers().length
      – This will return the number of alive members in the current party. Best if used in battle when trying to make different things happen depending on the number of allies currently alive in battle.

    • 这将返回当前队伍中活着成员的数量。

      Eval: $gameParty.deadMembers().length
      – This will return the opposite: the number of dead members in the current party. Also best used in battle when trying to make different things happen depending on the number of allies that are dead in battle.

    • 这将返回相反的结果:当前队伍中死亡成员数量。

    Happy RPG Making!

    相关文章

      网友评论

          本文标题:【汉化】YEP.162 – Advanced Switches

          本文链接:https://www.haomeiwen.com/subject/knoxfftx.html