Skip to content

Commit

Permalink
update: release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WDRshadow committed Mar 27, 2024
1 parent 9c23060 commit 71dd807
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 14 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
![GitHub license](https://img.shields.io/github/license/Team-Jackdaw/chat-with-NPC)
![test workflow](https://github.com/Team-Jackdaw/chat-with-NPC/actions/workflows/build.yml/badge.svg)

> The mod is still under development, and the current version is not stable. If you want to use the latest version,
> please compile
> the source code yourself, see [Build](#8-build). If you encounter any problems, please submit an issue.
> The mod is still in beta, please submit an issue if you find any problems. If you want to use the latest version,
> please compile the source code yourself, see [Build](#8-build).
[Chinese Version](docs/README_zh.md)

Expand Down Expand Up @@ -79,14 +78,14 @@ If you are administrator, see the [Installation](#5-installation) for more infor
- `/npchat setURL <url>` - Set the OpenAI API proxy URL
- `/npchat saveAll` - Save all the data to the disk
- `/npchat setChatBar <true/false>` - Set to display the conversation at the chat bat at the bottom left or not, `true` to display, `false` to hide.
- `//npchat setBubble <true/false>` - Set to display the bubble of the conversation above our lovely NPC or not, `true` to display, `false` to hide.
- `/npchat setBubble <true/false>` - Set to display the bubble of the conversation above our lovely NPC or not, `true` to display, `false` to hide.
- `/npchat setBubbleStyle Color <color preset>` - Set the preset colors for font and background.
- `/npchat setBubbleStyle timeLastingPerChar <time>` - Set the time lasting for a character in unit of second. For example, setting the time to 1.5 seconds means a sentence with 6 characters will have its bubble displayed for a total of 9 seconds.

## 7. To do list

- [X] Improve the chat bubble.
- [ ] NPCs chat with each other and communicate their opinion of events.
- [ ] NPCs chat with each other and communicate their opinion of events. (See [Advanced](docs/Advanced.md))
- [ ] NPCs have their opinion on every event in their `Group`.
- [X] NPCs performing actions based on the chat content. (See [Advanced](docs/Advanced.md))

Expand Down
12 changes: 11 additions & 1 deletion docs/Advanced.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Advanced Features

## 1. Function Calls
## 1. Function Calls (beta)

Function calls are an advanced feature of the OpenAI API that allows ChatGPT to call functions that may affect game
balance as an NPC at the appropriate time. The functions are defined by the server administrator, and the effects that
Expand Down Expand Up @@ -196,3 +196,13 @@ Don't forget to add this function to the NPC.

![open_door](images/open_door.png)
![close_door](images/close_door.png)

## 2. NPC Conversation (dev)

This feature allows NPCs to communicate with each other and convey their opinions on events. This feature can make your
server more vivid and interesting. This feature is still under development. We plan to put this part in
[NPConversation](https://github.com/Team-Jackdaw/NPConversation).

**_Effect Picture:_**

![npc_conversation](images/npConversation.jpg)
14 changes: 12 additions & 2 deletions docs/Advanced_zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 高级功能

## 1. 函数调用
## 1. 函数调用(beta)

函数调用是OpenAI
API的一个高级功能,它允许ChatGPT在适当的时候以NPC的身份调用这些可能影响游戏平衡的函数,函数由服务器管理员定义,它可以达到的效果由您来决定。详细关于该功能的介绍请参见[OpenAI API文档](https://beta.openai.com/docs/api-reference/function-calls/create-function-call)
Expand Down Expand Up @@ -176,4 +176,14 @@ execute run scoreboard players set @s npc_open_door_result 1
**_效果图:_**

![open_door](images/open_door.png)
![close_door](images/close_door.png)
![close_door](images/close_door.png)

## 2. NPC间的对话(dev)

该功能允许NPC之间交流并传递他们对事件的看法。这个功能可以让您的服务器更加生动有趣。目前这个功能仍在开发中。我们计划将这部分内容放在[NPConversation](https://github.com/Team-Jackdaw/NPConversation)
中。

**_效果图:_**

![npc_conversation](images/npConversation.jpg)

2 changes: 1 addition & 1 deletion docs/Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ settings are:
- `ConversationHandler` and `Group` are managed by the lifecycle manager, and the lifecycle manager provides methods to
activate, extract, and discard `ConversationHandler`, `NPCEntity` and `Group`.
- The lifecycle manager will automatically discard the `ConversationHandler`, `NPCEntity` and `Group` that have not been activated for
a 5 minutes period every 30 seconds after the plugin is loaded.
a **5 minutes** period every **30 seconds** after the plugin is loaded.
- All `ConversationHandlers`, `NPCEntity` and `Groups` can be unloaded asynchronously with the command `/npc saveAll`.
3 changes: 1 addition & 2 deletions docs/Config_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ NPCEntity管理器负责管理所有的NPCEntity,NPCEntity的主要设定有

生命周期管理器负责管理所有`ConversationHandler``NPCEntity``Group`的生命周期,它的主要设定有:

- 自插件被加载后,生命周期管理器将会被异步加载,**每30秒**检查一次所有的`ConversationHandler``NPCEntity``Group`,并且将会卸载那些*
*超过5分钟**没有被使用的实例。
- 自插件被加载后,生命周期管理器将会被异步加载,**每30秒**检查一次所有的`ConversationHandler``NPCEntity``Group`,并且将会卸载那些**超过5分钟**没有被使用的实例。
- 服务器关闭时,生命周期管理器会保存并关闭所有的`ConversationHandler``NPCEntity``Group`,并关闭生命周期管理器线程。
- 通过指令`/npc saveAll`可以异步保存并卸载所有的`ConversationHandler``NPCEntity``Group`,并且同步插件设定和函数文件夹。
5 changes: 3 additions & 2 deletions docs/README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
![GitHub license](https://img.shields.io/github/license/Team-Jackdaw/chat-with-NPC)
![test workflow](https://github.com/Team-Jackdaw/chat-with-NPC/actions/workflows/build.yml/badge.svg)

> 该mod仍在开发中,当前版本不稳定。如果您想使用mod,请自行编译源代码,参见[构建](#8-构建)。如果遇到任何问题,请提交问题。
> 该mod目前仍在测试阶段,请您发现任何问题及时提交issue。如果您想使用最新版本,请自行编译源代码,参见[构建](#8-构建)

[English Version](../README.md)

Expand Down Expand Up @@ -75,7 +76,7 @@ NPC的对话可以被所有人看到(在他们头顶的**聊天气泡**中)
## 7. 待做列表

- [X] 改进聊天气泡。
- [ ] NPC之间可以相互聊天,并交流观点。
- [ ] NPC之间可以相互聊天,并交流观点。 (请参阅[高级功能](Advanced_zh.md)
- [ ] NPC会对他们所属的`Group`中的事件有自己的看法。
- [X] NPC会对聊天内容作出动作反应。 (请参阅[高级功能](Advanced_zh.md))

Expand Down
1 change: 1 addition & 0 deletions docs/RegisterGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1. Basic Commands for Group

- `/npchat group` - View the information of all groups.
- `/npchat group <group>` - View the information of a group.
- `/npchat group <group> setParent <parent>` - Set the parent group for the group.
- `/npchat group <group> setInstructions <instructions>` - Set the instructions for the group.
Expand Down
1 change: 1 addition & 0 deletions docs/RegisterGroup_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1. 群组的基本命令

- `/npchat group` - 查看所有群组的信息。
- `/npchat group <group>` - 查看一个群组的信息。
- `/npchat group <group> setParent <parent>` - 设置群组的父级群组。
- `/npchat group <group> setInstructions <instructions>` - 设置群组的说明。
Expand Down
Binary file added docs/images/npConversation.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ org.gradle.parallel=true
loader_version=0.15.7

# Mod Properties
mod_version = 0.0.3+build.7
mod_version = 0.1.0
maven_group = com.jackdaw
archives_base_name = chat-with-npc

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/jackdaw/chatwithnpc/CommandSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ public static int help(@NotNull CommandContext<ServerCommandSource> context) {
.append("\n/npchat setModel <model> - Set AI model")
.append("\n/npchat setRange <range> - Set the range of the conversation")
.append("\n/npchat setLanguage <language> - Set the response language")
.append("\n/npchat setBubble <isBubble> - Set if npc reply to chat bubble")
.append("\n/npchat setBubbleStyle Color <color> - Set the chat bubble color")
.append("\n/npchat setBubbleStyle timeLastingPerChar <time lasting per character in second> - Set the chat bubble time lasting per character")
.append("\n/npchat setChatBar <isChatBar> - Set if NPC reply to chat bar.")
.append("\n/npchat setWordLimit <wordLimit> - Set the word limit of the response")
.append("\n/npchat setURL <url> - Set the AI Model URL")
.append("\n/npchat saveAll - Discard all instances, save all the data and reload the mod.")
Expand All @@ -187,6 +191,7 @@ public static int help(@NotNull CommandContext<ServerCommandSource> context) {
.append("\n/npchat npc deleteFunction <function> - Delete a function from the closest NPC.")
.append("\n/npchat npc clearMemory - Clear the memory for the closest NPC.")
.append("\n --------------------------------")
.append("\n/npchat group - All group status")
.append("\n/npchat group <group> - The group status")
.append("\n/npchat group <group> setParent <parent> - Set the parent group for the group.")
.append("\n/npchat group <group> setInstruction <instruction> - Set the instruction for the group.")
Expand Down

0 comments on commit 71dd807

Please sign in to comment.