ReActions
ReActions 带来了一套自定义事件处理系统。它允许检查特定条件并执行相应操作。如果所需条件未满足,则会执行其他备选操作。
什么是 ReActions
ReActions 是一款允许你为物品、按钮以及……事件添加新功能的工具。你可以添加在点击按钮或打开箱子时触发的新动作。你可以改变拉杆的状态或将玩家传送至其他地点。你可以检测玩家是否处于某个区域,并在击杀 Boss 后给予附魔物品作为奖励。哦对了!你还可以生成 Boss 怪物…… ReActions 能够与第三方插件(Vault、Factions、Towny 等)进行交互,从而引入非标准的功能使用方式,或者为玩家提供更灵活且完全可自定义的设置。例如,你可以对进入领地、打开箱子或拉动拉杆收取费用。当玩家更换阵营时(由 Factions 插件提供)或强制玩家加入城镇时(由 Towny 插件提供),你也可以执行某些操作。
而且……你不需要学习脚本语言。只需花几分钟理解 ReActions 的原理,接下来的限制就只取决于你的想象力了。
说明文档
详细说明文档请参阅此处:reactions.fromgate.me
俄语说明文档(Инструкция на русском)位于此处:reactions.fromgate.ru
开发版本
最新的开发版本可在以下平台获取:
立即下载最新版本
术语表
为了便于理解后续描述,我们先澄清一下相关术语:
订阅(Subscription) - 将触发器绑定到任何游戏事件上(受到伤害、按下按钮、穿戴盔甲、手持特定物品右键点击等)。因此,如果触发器已订阅某事件,则在该事件发生时会被触发。
触发器(Activator) - “事件-条件-动作”的组合。即:触发器由特定事件(其已订阅的事件)引起,检查特定条件(标志位)并执行某些操作。
标志位(Flag) - 用于检查的条件。
动作(Action) - 触发器在检查完标志位后所执行的操作。动作分为两种类型:
- action - 在标志位验证成功后执行;
- reaction - 在标志位验证失败(至少有一个标志位返回 false)后执行。
占位符(Placeholders) - 用于确定动态计算的值。
功能特性
- 能够检查大量条件(标志位):权限(或权限组)、玩家余额或背包中定义的物品等。
- 执行各种动作:你可以给玩家施加药水效果、将玩家传送到指定位置、执行第三方插件的命令等。
- 将触发器订阅到各类事件:点击按钮或在踏板上行走、进入或离开 WorldGuard 区域。
- 内置调度器(计时器(Timers)),可以将触发器链接到服务器时间(可重复或单次)或游戏内时间。
- MySQL 支持(使用 ReActions 你可以访问你的 Web 服务器或任何应用程序及插件的数据)
- 创建库存菜单(GUI)并将触发器链接到虚拟库存的槽位。
使用 ReActions 可以创建什么?
以下是一些我在某些服务器上找到的 ReActions 使用示例:
- 传送系统,可以收取金钱或物品费用,并依赖于玩家权限和游戏内时间。例如:仅在白天进行传送,并以一个钻石块作为支付费用。
- 简单的管理员商店,出售物品。例如,你可以通过单击鼠标按钮出售一套完整的钻石护甲。
- 放射性区域——玩家在区域内会受伤,并且在离开该区域后一段时间内仍会继续受到伤害。
- 桥梁和闸门。
- 创建自定义命令(包括你的母语),无需安装第三方插件。
- 创建解决任务或迷宫的额外途径。例如,手持钻石剑的玩家会被传送到特殊地点,而没有钻石剑的玩家会被传送到另一个地方。
- 执行第三方插件的命令会带来很多乐趣。
- 我知道有一个服务器运行着一种策略游戏。玩家无法在该服务器建造,但存在一些区域,玩家可以在其中购买提供资源的建筑(建筑通过 ScLoad 插件命令创建,并使用 ReActions 执行)。
- 制作枪械和喷气背包。
视频示例
目前没有展示 ReActions 全部功能的视频。我会尽快制作一个。但有一些视频展示了 ReActions 的部分功能:
1. 如何使用物品右键飞行
2. 演示了两种类型的触发器:rgenter 和 rgleave,以及药水效果等功能:
视频教程
你可以在这里看到一些演示如何使用 ReActions 的教程。
为什么选择 ReActions?
有时我会收到一个问题:为什么我应该使用 ReActions 而不是在 BukkitDev 上找到的任何脚本插件。我可以对此说几句话。如果你已经学习了用于任何脚本插件的任何脚本语言,我不建议你更改它。大多数脚本插件允许你完成与 ReActions 相同的事情。但有一些特定的特点我想重点强调:
- ReActions 非常容易上手。创建第一个触发器后,你就会了解 ReActions 的工作原理。
- 我试图让 ReActions 更贴近用户,而不是开发者:Bukkit 内置的事件通常不会在 ReActions 中镜像反映。例如,ReActions 包含 REGION_ENTER 触发器,而不是 PlayerMoveEvent 的镜像,后者需要脚本编写者检查玩家周围的区域。
- 我试图让 ReActions 更贴近服务器所有者(再次),并计划支持最流行的插件。目前支持的有:WorldGuard、Vault、Craftconomy3、Factions、Towny、PlayEffect 和 RacesAndClasses。
- 你可以使用插件命令或手动编辑配置文件来创建触发器(手动编辑甚至更容易)。
- ReActions 不是一种脚本语言。用户为此感谢我,这也是我继续开发它的主要原因。
命令
<param> - 必需参数。
[param] – 可选参数。
[param:<value>] – 可选参数,如果使用,请确保指定一个值。
[v1 | v2 | v3] – 可选参数,将替换为这三个值之一。
插件的主命令是 "/react"。别名:/rea, /ra。
- /react help - 有人帮忙吗!..
- /react add <ActivatorType> <ActrName> [Param] - 创建一个订阅指定类型事件的新触发器。触发器类型列表。
- /react add loc <LocName> - 将当前位置保存为命名位置以便后续使用(例如传送到该位置)。
- /react add <ActrName> f <Flag> <Param> - 向触发器添加指定条件。标志列表。
- /react add <ActrName> a <Actn> <Param> - 向触发器添加操作(如果所有检查都返回 true 则执行)。所有操作按添加的顺序依次执行。操作列表。
- /react add <ActrName> r <Reaction> <Param> - 向触发器添加反应(如果至少一个检查返回 false 则执行)。所有反应按添加的顺序依次执行。反应列表。
- /react copy [flag | actions | reactions] <SrcActr> <DestActr> - 将 <SrcActr> 的标志、操作或反应复制到 <DestActr>。注意:如果省略可选参数 (flag|actions|reactions),它将复制所有内容。
- /react list [loc | group | type] [Page] - 显示位置、组或类型的列表。注意:如果省略可选参数,则将显示所有内容的列表。
- /react info <ActrName> [f | a | r] - 显示触发器的标志、操作或反应的信息。注意:如果省略可选参数,则将显示关于触发器的完整信息。
- /react group <ActrName> <GroupName> - 将触发器的组更改为指定的组。注意:如果指定的组不存在,则将被创建。
- /react remove <loc|activator> <ActrName|LocName> - 移除触发器或位置。
- /react remove <ActrName> <f | a | r> <num> - 从触发器中移除具有指定编号的标志、操作或反应。注意:你可以使用命令 /react info <ActrName> [f | a | r] 查看编号。
- /react clear <ActrName> <f | a | r> - 从触发器中移除所有标志、操作或反应。
- /react debug <true|false|off> - 切换调试模式。此处:true – 所有检查始终返回 true;false – 所有检查始终返回 false;off - 关闭调试模式。
- /react check [radius] - 显示指定范围内的所有已定位的触发器。注意:如果省略可选参数,则半径使用其默认值 – 8 米(方块)。
- /react reload - 重新加载插件(插件将重新读取其所有文本文件)。
权限
- reactions.config - 允许创建和设置触发器及位置。
- reactions.debug - 允许使用调试模式。
阅读有关命令和权限的更多信息 这里
与第三方插件的交互
ReActions 与一些其他插件兼容。您可以自由使用(或不使用)这些插件中的任何一个。
bStats 和更新检查器
ReActions 包含两个使用您服务器互联网连接的功能。第一个是 Metrics,用于收集 关于插件的信息(插件版本、Java 版本等),第二个是更新检查器,在插件启动后每半小时检查一次 ReActions 的新发布版本。此功能使用了 dev.bukkit.org 提供的 API。如果您不喜欢这些功能,可以轻松禁用它们。要禁用更新检查器,需要在 config.yml 中将参数 "version-check" 设置为 "false"。获取更多关于 bStats 的信息并了解如何关闭它,请阅读 这里。
喜欢这个插件吗?
您可以通过赞助来支持未来版本的发布!
ReActions
ReActions bringing custom event processing system. It allows to check certain conditions and perform certain actions. If required conditions are not met, other actions will be carried out.
What is ReActions
ReActions is a tool that allows you to add new features to items, buttons and... events. You can add new actions that occur when you click the button or open the chest. You can change the state of lever or teleport the player to another location. You can check whether the player in the region and give him an enchanted item as reward for killing a Boss. Oh yeah! You can spawn a Boss-mob too... ReActions can interact with third-party plugins (Vault, Factions, Towny, etc...) to introduce the possibility of non-standard use of their capabilities or give you more flexible and fully customizable settings of the player. For example, you may charge a fee for the entrance to the territory or for opening the chest or pulling the lever. You can perform some actions when player is changing faction (provided by Factions plugin) or force player to join town (Towny plugin).
And... you don't need to learn scripting language. It takes just a few minutes to understand the principle of ReActions to then be limited only with your imagination.
Instructions
Detailed instruction available here: reactions.fromgate.me
Russian instruction (Инструкция на русском) is here: reactions.fromgate.ru
Dev Builds
Latest dev builds available on
Download latest build now
Terminology
To understand further description let us clarify the terminology:
Subscription - the binding of the activator to any gaming event (getting damage, pressing a button, donning armor, clicking RMB with a specific item in hand). Thus, if the activator is subscribed to an event, it’s triggered when an event occurs.
Activator - set of "event-condition-action". I.e. the activator is caused by a specific event (which it is subscribed), checks for certain conditions (flags) and performs some actions.
Flag - condition to check.
Action - what makes activator after checking flags. Actions are of two types:
- action - is executed after successful verification flags;
- reaction - is executed after unsuccessful verification flags (at least one flag returns false).
Placeholders - use it to determine dynamically calculated values.
Features
- Ability to check lot of conditions (flags): permissions (or permisision groups), player balance or defined item in inventory, etc.
- Executing variuos actions: you can apply a potion effect to player, teleport player to specified locations, execute command of third-party plugin, etc.
- Subscribing activator to some kind of events: button clicking or walking on plate, entering or leaving WorldGuard regions.
- Built-in scheduler (Timers) that can link an activator to server time (could be repeated or single-time) or to in-game time.
- MySQL support (using ReActions you can access to data of your web-server or any application and plugins)
- Creating inventory-menu (GUI) and linking activators to the slots of virtual inventory.
What can I create using the ReActions?
Here are some examples of usage of ReActions that I find at some servers:
- Teleporting system that can charge money or items and depends on player permissions and in-game time. For example: teleporting only during daytime using one diamond block as payment.
- Simple admin-shop that sells items. For example you can sell a full set of diamond armor by single click of mouse button.
- Radioactive areas - player gets a damage inside the area and some time after leaving this region.
- Bridges and gates.
- Create custom commands (including your native language) without the need to install third-party plugins.
- Creating an additional ways to solve quest or labyrinths. For example, player with the diamond sword in hand will be teleported to a special location, but player without the diamond sword will be teleported for another place.
- Executing third-party plugins commands will bring you a lot of fun.
- I know a server with a kind of strategy game. Players can’t build there, but there are some regions where players can buy buildings that provide resources (buildings are created by ScLoad plugin command executed using ReActions).
- Creating guns and jetpacks.
Video examples
There's no video that shows full features of ReActions. I will create it as soon as I can. But there're some videos that demonstrate some features of ReActions:
1. How to fly using item right-click
2. demonstrates two types of activators: rgenter and rgleave, and such action as potion effects features:
Video tutorials
You can see some tutorials demonstrating how to use ReActions here.
Why ReActions?
Some times I receive a question: why I should use ReActions instead of any scripting plugins that could be found at BukkitDev. I can say some words about it. If you learned any scripting language for any scripting plugins I can not recommend you to change it. Most of scripting plugins allow you to do the same things as ReActions. But there are some particular qualities to which I would like to focus:
- ReActions is really easy to start. After creating your first activator you will know everything about how ReActions works.
- I'm trying to made ReActions closer to user, not to developer: bukkit's built-in events usually are not mirrored in ReActions. For example ReActions contains a REGION_ENTER activator instead of mirror of PlayerMoveEvent where script-writer must check regions around the player.
- I'm trying to made ReActions closer to server owner (again) and going to add support to most popular plugins. Now supported: WorldGuard, Vault, Craftconomy3, Factions, Towny, PlayEffect and RacesAndClasses.
- You can create activators using plugin's command or editing the config files manually (it's even much easier).
- ReActions is not scripting language. And users thank me for this fact, and this is main reason for me to continue working on it.
Commands
<param> - required parameter.
[param] – optional parameter.
[param:<value>] – optional parameter, in which, if used, be sure to specify a value.
[v1 | v2 | v3] – optional parameter, which is substituted one of these three values.
Main command of plugin is "/react". Aliases: /rea, /ra.
- /react help - Somebody help!..
- /react add <ActivatorType> <ActrName> [Param] - Creates a new activator that subscribed to an event of specified type. List of activator types.
- /react add loc <LocName> - Saves your current position as the named location for further use (for example for teleporting to).
- /react add <ActrName> f <Flag> <Param> - Adds a specified condition to the activator. List of flags.
- /react add <ActrName> a <Actn> <Param> - Adds an action to the activator (executes if all checks returned true). All actions are performed in the same sequence in which they were added. List of actions.
- /react add <ActrName> r <Reaction> <Param> - Adds an action to the activator (executes if at least one check returned false). All reactions are performed in the same sequence in which they were added. List of reactions.
- /react copy [flag | actions | reactions] <SrcActr> <DestActr> - Copies flags, actions or reactions of the <SrcActr> to the <DestActr>. Note: If you omit the optional parameter (flag|actions|reactions), it will copy all.
- /react list [loc | group | type] [Page] - Displays the list of locations, groups or types. Note: If you omit the optional parameter then will be displayed the list of all.
- /react info <ActrName> [f | a | r] - Displays information about flags, actions or reactions of the activator. Note: If you omit the optional parameter then will be displayed full information about activator.
- /react group <ActrName> <GroupName> - Changes the group of activator to the specified. Note: If the specified group doesn’t exist then it will be created.
- /react remove <loc|activator> <ActrName|LocName> - Removes the activator or the location.
- /react remove <ActrName> <f | a | r> <num> - Removes from the activator the flag, action or reaction, which have the specified number. Note: you can see the numbers by using command /react info <ActrName> [f | a | r].
- /react clear <ActrName> <f | a | r> - Removes all flags, actions or reactions from the activator.
- /react debug <true|false|off> - Toggles debug mode. Here: true – all checks always return true; false – all checks always return false; off - turn off debug mode.
- /react check [radius] - Displays all geolocated activators in the specified range. Note: If you omit the optional parameter then the radius has it’s default value – 8 meters (blocks).
- /react reload - Reloads plugin (the plugin will reread all of it’s text files).
Permissions
- reactions.config - allows to create and setup activators and locations.
- reactions.debug - allows to use debug mode.
Read more about commands and permissions here
Interaction with third-party plugins
ReActions is compatible with some other plugins. You can feel free to use (or not) any of this plugins.
- Vault — group management and economy.
- WorldGuard — required for using regions-activators.
- Towny — you can change/check the player’s town (Warning! Towny located at external web-site and it not approved by bukkit team. Use it on your own risk).
- Factions — you can catch faction relationship changes, change player’s faction.
- RacesAndClasses — you can change/check player’s class and race.
- PlayEffect — you can play particles effects.
- Craftconomy3 — advanced economy features, multiple currency support.
bStats and update checker
ReActions includes two features that use your server Internet connection. First one is Metrics that is used to collect information about the plugin (versions of plugin, of Java.. etc.) and the second one is update checker that checks new releases of ReActions after plugin startup and every half hour. This feature is using API provided by dev.bukkit.org. If you don't like this features you can easily disable it. To disable update checker you need to set parameter "version-check" to "false" in config.yml. Obtain more information about bStats and learn how to switch it off, you can read here.
Like this plugin?
You can support releasing future versions!
评论 0
登录后参与评分
还没有评论,来抢沙发吧