Dialogue System for Unity文档中英对照版(简雨原创翻译)第五篇(第三方插件拓展)

37 篇文章 1 订阅

接续上面,很遗憾这里开始讲一些第三方插件的使用了,但是我们手头没有这些收费的东东,只可以去官网看下在线的运行效果(国内谁买个全套的,分享下呀)

官网地址在这里


To set up and play the example:

1.Create a new project.

2.Import plyGame.

3.Import the Dialogue System for Unity.

4.Import Assets/Dialogue System/Third Party Support/plyGameSupport.unitypackage.

5.Import Assets/Dialogue System/Third PartySupport/plyGame/Example/plyGame Example plyData.unitypackage. This will unpackthe plyGame data, built specifically for the example, into Assets/plyData.

6.Addthe scene Assets/Dialogue System/Third Party Support/plyGame/Example/plyGameExample to the build settings.

7.Openthis scene.

8.Onthe plyGame toolbar, click the plyGame Refresh Button (2nd button).

9.Openthe plyGame Main Editor (Tools > PL Young > Toolbar > Main Editor).

10.Onthe Project tab, add the 'plyGame Example' scene.

11.Onthe Input Definitions tab, click 'Setup Input Manager'.

12.Clickon all of the other tabs to make sure plyGame updates its settings.

13.Makesure plyData/System/00-bootstrap is in the project's Build Settings.

14.Pressthe Unity Play Button. (The sample scene should be open from a previous step.)

15.Runup to Private Hart (NPC), press E and chat with him. Run up to Sergeant Graves(NPC) and press E to cause him to bark. You can also do the same with the DeadGuard and Terminal.

16.TheF1 key saves the game, and F2 loads a previously-saved game. This demonstrateshow the Dialogue System is tied into plyGame's Load/Save System.

建立和活动为例:

1创建一个新项目。

2进口plygame。

3进口的对话系统的统一。

4。进口资产/对话系统/第三方支持/ plygamesupport.unitypackage。

5。进口资产/对话系统/第三方支持/ plygame/例子/ plygame例plydata.unitypackage。这将解压plygame数据,专门为例建立,为资产/plydata。

6。添加场景资产/对话系统/第三方支持/ plygame/例子/ plygame实例生成设置。

7打开这个场景。

8。在plygame”工具栏上,单击plygame刷新按钮(第二个按钮)。

9。打开主的plygame编辑器(工具>>工具栏> PL年轻主要编辑)。

10。在“项目”选项卡,添加“plygame示例场景。

11。在输入定义”选项卡上,单击“设置输入经理。

12。点击所有其他的标签,以确保plygame更新设置。

13。确保plydata /系统/ 00的引导是项目的构建设置。

14按下播放按钮的统一。(样本的场景应该从以前的步骤。打开)

15。运行到私人哈特(NPC),按E和他聊天。跑到军士格雷夫斯(NPC)按E使他树皮。你也可以用死守卫和终端做同样的事。

16。按F1键保存游戏,和F2加载以前保存的游戏。这证明了对话系统捆绑到plygame的加载/保存系统。

 

 

TheSaveGame and LoadGame buttons are in an Input Group named SaveLoad. This makesthe full names of the buttons "SaveLoad/SaveGame" and"SaveLoad/LoadGame". These are used in the plyBlox on the Game Objectnamed "Feature Demo":

该savegame和loadgame按钮在一个名为saveload输入组。这使得姓名的按钮”saveload/存档”和“saveload / loadgame”。这些都是用在plyblox在游戏对象命名为“功能演示”:


Whenthe block above receives a "SaveLoad/SaveGame" keypress, it tellsplyGame to save to slot 0. The Dialogue Manager object has a PersistableDialogue Manager script, which ties the Dialogue System into plyGame'ssave/load system. So when plyGame saves the game, it also pulls in the DialogueSystem data. The "SaveLoad/LoadGame" keypress works similarly.

当块上收到一个“saveload /存档”按键,它告诉plygame存槽0。对话管理器对象有一个持久的对话管理脚本,这关系到plygame对话系统的保存/加载系统。所以当plygame保存游戏,它也拉在对话系统数据。“saveload / loadgame”按键的工作类似。

plyGame-SpecificSupport

plyGameBridge

Attachthe plyGame Bridge component (via Window > Dialogue System > Components> Integration > plyGame > plyGame Data Bridge) to any Actors for whomyou want to synchronize data between plyGame and the Dialogue System's Luaenvironment.

Thefollowing data are synchronized:

plygame桥

 

将plygame桥梁构件(通过窗口> > > >对话系统组件集成plygame> plygame数据桥)的任何演员谁要同步plygame和对话系统的Lua环境之间的数据。

 

下面的数据是同步的:


The identvalues are used in Lua.

 

Themethods in plyGameBridge are virtual so you can create a subclass if you wantto synchronize additional information.

识别值用Lua。

 

在plygamebridge方法是虚拟的,如果你愿意你可以同步附加信息创建一个类。

ConversationController

Attachthe Conversation Controller component (via Window > Dialogue System >Components > Integration > plyGame > Conversation Controller) to anyActors that will engage in conversations. This component disables cameracontrollers and character controllers during conversations. You can specifyadditional components to disable in the Also Disable During Conversations list.

会话控制器

 

将会话控制器组件(通过对话窗口>系统> > > >组件集成plygame会话控制器)的任何演员将参加谈话。此组件禁用相机控制器和角色控制器在谈话。您可以指定要禁用在谈话中也禁用列表附加组件。

Loading& Saving

Attachthe Persistable Dialogue Manager component (via Window > Dialogue System> Components > Integration > plyGame > Persistable DialogueManager) to the Dialogue Manager object to add the Dialogue System to plyGame'sLoading & Saving System.

 

If youuse Persistent Destructible or Increment On Destroy components, make sure tocall the Level Will Be Unloaded block before loading a new level. This tellsthe components to ignore their destruction due to the level change.

加载和保存

 

附加的持久的对话管理器组件(通过对话窗口>系统> > > >组件集成plygame持久对话经理)的对话管理器对象添加对话系统plygame加载和保存系统。

 

如果您使用的持续性破坏或摧毁成分增加,确保调用水平将卸下挡在加载一个新的水平。这告诉成分忽视他们的破坏水平的变化。

plyBloxSupport

TheDialogue System introduces the following plyBlocks:

plyblox支持

 

对话系统介绍以下plyblocks:

Conversations

•Start Conversation: Starts a conversation.

•Stop Conversation: Stops the activeconversation.

•Is Conversation Active?: Checks whether aconversation is currently active.

•Does Conversation Have Valid Entries?: Checkswhether a conversation has any entries linked from the START entry whoseconditions are true.

•Update Responses: Updates the responses forthe current state of the active conversation. If the response menu entries'conditions have changed while the response menu is being shown, use this toupdate the response menu.

 

对话

 

?开始谈话:启动一个会话。

?停止:停止谈话活跃的对话。

?对话活动?:检查是否是目前活跃的谈话。

?是否有有效的条目的谈话?:检查是否有任何条目与谈话从一开始进入的条件为真。

?更新对策:更新的活动会话的当前状态的反应。如果响应菜单项的条件,而响应菜单被显示的改变,使用此更新响应菜单。

Barks

•Bark: Plays a one-liner bark.

树皮

 

?树皮:具有一一套皮。

CutsceneSequences

•Start Sequence: Starts a sequence.

•Is Sequence Playing?: Checks whether asequence is playing or finished.

•Stop Sequence: Stops a sequence.

•Send Message to Sequencer: Sends a message tothe sequencer. (Used with WaitForMessage() as described in Sequencer Example 2:Waiting for Messages)

动画序列

 

?启动顺序:启动顺序。

?是顺序播放?:检查是否一个序列是打或完成的。

?停止:停止序列序列。

?发送消息到音序器:发送一个消息给音序器。(用于waitformessage()在音序器示例2:描述等信息)

Quests

•Add Quest: Adds a quest to the active game.

•Delete Quest: Deletes a quest from the activegame.

•Get QuestState: Gets the current state of aquest.

•Set QuestState: Sets the current state of aquest.

•Get Quest Description: Gets the description ofa quest.

•Set Quest Description: Sets the description ofa quest.

•Get Quest Entry Count: Gets the number ofentries (sub-tasks) in a quest. (optional)

•Add Quest Entry: Adds a quest entry.

•Get Quest Entry State: Sets the state of aquest entry.

•Set Quest Entry State: Gets the state of aquest entry.

•Is Quest Abandonable?: Checks whether a questis configured as abandonable.

•Is Quest Tracking Enabled?: Checks whether aquest is configured as trackable.

•Set Quest Tracking: Enables or disables questtracking.

•Get Quest Abandon Sequence: Gets the quest'sAbandon Sequence (if defined).

任务

 

?添加任务:添加一个任务激活的游戏。

?删除:删除任务从活跃的游戏任务。

?得到queststate:获取任务的当前状态。

?集queststate:设置一个任务的当前状态。

?把任务描述:获取任务描述。

?设置任务描述:设置任务的描述。

?把任务进入计数:获取参赛人数(子任务)在一个任务。(可选)

?添加任务条目:添加一个任务条目。

?把任务进入状态:设置一个任务进入状态。

?设置任务进入状态:获取任务进入状态。

?是追求放弃?:检查是否一个任务配置为放弃。

?是追求跟踪启用?:检查是否一个任务配置为跟踪。

?设置任务跟踪:启用或禁用任务跟踪。

?把任务放弃序列:获取任务放弃序列(如果定义)。

Relationships& Status

•Get Status: Gets the status value that hasbeen assigned between two actors.

•Set Status: Sets the status value between twoactors.

•Get Relationship: Gets the relationship valuethat has been assigned between two actors.

•Set Relationship: Sets the relationship valuebetween two actors.

•Decrement Relationship: Reduces therelationship value between two actors.

•Increment Relationship: Increases therelationship value between two actors.

关系与地位

 

?获取状态:获取状态值,被分配在两个演员。

?设置状态:设置两个演员间的状态值。

?得到的关系:获得了关系价值已被分配在两个演员。

?集集之间的关系:两个演员的关系价值。

?递减的关系:降低价值之间关系的两个演员。

?增量的关系:增加两个演员间的关系价值。

DialogueDatabase Management

•Add Dialogue Database: Adds a dialoguedatabase to the master database in memory.

•Preload Master Database: Preloads the masterdatabase. Use to control when loading occurs, to better time any pause whenloading large databases.

•Remove Dialogue Database: Removes a dialoguedatabase from the master database.

•Reset Dialogue Database: Resets the masterdatabase.

•Set Default Dialogue Database: Sets thedefault database that the master database starts with when it's reset.

•Set Portrait: Similar to the SetPortrait()sequencer command, this block overrides an actor's portrait image.

对话的数据库管理

 

?添加:添加一个对话对话数据库的数据库内存中的主数据库。

?预紧力的主数据库:数据库。用以控制加载时发生,更好的时间暂停任何大型数据库时加载。

?删除数据库中删除对话:从主数据库数据库对话。

?重置:重置对话数据库master数据库。

?设置默认的对话数据库:设置默认的数据库,主数据库启动时的复位。

?设定肖像:类似于setportrait()音序器的命令,这一块覆盖一个演员的肖像图像。

UserInterface

•Show Alert Message: Shows a message using thealert UI.

•Preload Dialogue UI: Preloads the dialogue UI.Use to control when loading occurs, to better time any pause when loading largeUIs.

用户界面

 

?显示警告信息:显示一个信息使用报警界面。

?预紧力的UI UI对话:对话。用以控制加载时发生,更好的时间暂停任何大的UI加载时。

Lua& Data Access

•Run Lua Code: Runs arbitrary Lua code in theDialogue System's Lua environment.

•Get Variable: Gets the value of an element inthe Variable[] table.

•Set Variable: Sets the value of an element inthe Variable[] table.

•Get Lua Field: Gets the value of an field inthe Actor[], Item[], or Location[] table.

•Set Lua Field: Gets the value of an field inthe Actor[], Item[], or Location[] table.

•Level Will Be Unloaded: Tells persistent datacomponents that listen for OnDestroy() to ignore it due to level change

Lua和数据访问

 

?运行lua代码:在对话系统的环境下运行任意Lua Lua代码。

?获取变量:获取在变量[ ]表中的一个元素的值。

?设置变量:套在变量[ ]表中的一个元素的值。

?得到Lua领域:得到的字段的值在演员[ ],[ ]项,或位置[ ]表。

?集Lua领域:获取的字段的值在演员[ ],[ ]项,或位置[ ]表。

?水平将卸载:告诉数据持久性组件,听ondestroy()忽略它由于水平的变化

Events

TheDialogue System introduces the following plyEvents:

 

•On Bark Start: Occurs when a bark starts. Sentto the barker and target.

•On Bark End: Occurs when a bark ends. Sent tothe barker and target.

•On Conversation Start: Occurs when aconversation starts. Sent to the participants and Dialogue Manager.

•On Conversation End: Occurs when aconversation ends. Sent to the participants and Dialogue Manager.

•On Conversation Cancelled: Occurs when theplayer cancels the active conversation. Sent to the Dialogue Manager.

•On Conversation Line: Occurs when a line in aconversation is displayed. Sent to the participants and Dialogue Manager.

•On Conversation Line Cancelled: Occurs whenthe player cancelled/skipped the display of a line in a conversation. Sent tothe Dialogue Manager.

•On Conversation Timeout: Occurs when the timeron the active conversation's response menu has timed out. Sent to the DialogueManager.

•On Sequence Start: Occurs when a sequence hasstarted. Sent to the participants.

•On Sequence End: Occurs when a sequence hasended. Sent to the participants.

When anevent is received, the specific event is recorded in the temporary variabledialogueEvent as "OnConversationStart","OnConversationEnd", etc.

 

Forevents that have an actor (the start and end of barks, conversations, andsequences), the actor's GameObject is recorded in the temporary variableactor.gameObject.

事件

 

对话系统介绍以下plyevents:

?树皮树皮开始时开始。发送到巴克和目标。

?树皮树皮结束时结束。发送到巴克和目标。

?在谈话开始时发生的对话开始。发送给参加者和对话管理器。

?在会话结束时发生的会话结束。发送给参加者和对话管理器。

?在谈话中取消了:发生时,玩家取消活跃的对话。发送到对话经理。

?谈话:发生在会话中的一行显示。发送给参加者和对话管理器。

?在会话行取消:发生时,玩家取消/跳过对话一行显示。发送到对话经理。

?在会话超时发生时,在活动会话的响应菜单定时器超时。发送到对话经理。

?在序列开始:发生在一个序列的开始。发送给参与者。

?在序列结束:发生在一个序列已经结束了。发送给参与者。

当接收到事件时,特定的事件是在临时变量dialogueevent记录为“onconversationstart”,“onconversationend”,等等。

有一个演员的事件(开始和结束的树皮,对话,和序列),演员的游戏对象被记录在临时变量actor.gameobject。

Behavior Designer Support

Thispage describes integration support for Opsive's Behavior Designer. The DialogueSystem's support package provides methods to control Behaviour Designer fromwithin conversations and sequences. Behavior Designer itself has acorresponding support package that allows you to monitor and control theDialogue System from within behavior trees.

本页描述了opsive的行为设计的集成支持。对话系统的支持软件包提供了从内在对话和序列控制行为的设计方法。行为的设计师本身具有相应的支持计划,允许您监视和控制的行为树的对话系统。

BehaviorTree Lua Bridge

TheBehavior Tree Lua Bridge component synchronizes a behavior tree's sharedvariables with the Dialogue System's Lua environment. Attach it to theGameObject that contains the behavior tree. To do this, select the GameObjectand then menu item Window > Dialogue System > Components > Integration> Behavior Designer > Behavior Tree Lua Bridge.

 

Synchronizationoccurs automatically at the beginning and end of conversations. You can alsosynchronize manually by calling SyncToLua() or SyncFromLua(). Only bools,floats, ints, and strings are synchronized.

 

The Luavariables will have the name gameObjectName_variableName. All blank spaces andhyphens will be converted to underscores.

 

Forexample, say an NPC named Private Hart has a behavior tree with a sharedvariable named Angry. The Lua variable will beVariable["Private_Hart_Angry"].

 

You cancheck the value of Variable["Private_Hart_Angry"] in a dialogueentry's Conditions fields and set the value a User Script field.

行为树Lua桥

 

行为树Lua桥梁构件的同步行为树的共享变量与对话系统的Lua环境。附加到游戏物体包含行为树。为此,选择对象,然后菜单窗口> > > >对话系统组件的整合行为设计师>行为树Lua桥。

 

自动同步发生的开始和结束时的谈话。您也可以手动同步调用synctolua()或syncfromlua()。只有书,花车,整型和字符串是同步的。

 

Lua变量都有名字gameobjectname_variablename。所有的空格,字符将被转换为下划线。

 

例如,说一个NPC叫私人哈特与共享变量名为愤怒的行为树。Lua变量,将变量[“private_hart_angry”]。

 

你可以检查变量[“private_hart_angry”]在对话输入的域值条件和值设置一个用户脚本领域。

BehaviorDesigner Sequencer Commands

Thesupport package adds these two new sequencer commands:

 

•Behavior() : Start, stop, pause, and resumebehavior trees.

•BehaviorVariable() : Set the values of abehavior tree's shared variables.

You canuse these commands within conversations, barks, and other sequences to controlbehavior trees.

设计师的音序器命令的行为

 

支持包中添加这两种新的音序器的命令:

?behavior():启动,停止,暂停,恢复行为树。

?behaviorvariable():设置一个行为树的共享变量的值。

你可以在谈话中,使用这些命令的树皮,和其他序列来控制行为树。

Localization

TheDialogue System supports localization out-of-the-box and provides generalpurpose Localization Tables. You can localize the following fields in dialogueentries:

 

•Dialogue Text

•Menu Text

•Sequence

You canalso localize the text for quests in the Quest Log System.

对话系统支持本地化的盒和提供通用的定位表。你可以定位在以下领域对话作品:

?对话文本

?菜单文本

?序列

你也可以定位在日志系统任务的文本。

LanguageCodes

Foreach localized language, you will use a language code. We recommend using theCulture Names defined inhttp://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo%28v=vs.80%29.ASPXbecause this is what the Dialogue System’s Localization class uses. It's alsoused by the Chat Mapper tutorial on localization. Example language codes are:

•"es" for Spanish

•"fr-CA" for French - Canadian

Foreach language "<em>LN</em>", the names of the dialogueentry fields will be:

•Dialogue Text:"<em>LN</em>"

•Menu Text: "Menu Text<em>LN</em>"

•Sequence: "Sequence<em>LN</em>"

You canset the current language in the DialogueManager's Display Settings.

If adialogue entry does not define a localized version for the current language, itwill use the default version.

语言代码

每个本地化的语言,你会使用一种语言的代码。我们建议使用HTTP定义文化的名字:/ / MSDN。微软。COM /en-US /图书馆/系统。全球化的CultureInfo 80 %。% 28V = 29.aspx因为这是对话系统的本地化类有什么用。它也通过定位聊天制图教程使用。语言代码:

?”西班牙ES”

?”fr CA”法国-加拿大

每种语言的“< em> LN < / EM >”的对话,进入战场的名称将是:

?对话的文字:“< em> LN < / EM >”

?菜单文字:“菜单文本< EM >在< / EM >”

?序列:序列<em>在</ EM >”

你可以在dialoguemanager的显示设置设置当前的语言。

 

如果一个对话进入未定义一个本地化版本为当前的语言,它将使用默认的版本。

How toLocalize in the Dialogue Editor

Theeasiest way to localize using the built-in Dialogue Editor is to addlocalization fields to the template on the Dialogue Editor's Templates Foldout.This way, they will automatically be added to assets as you add them.

 

If youadd fields to the template after creating assets, you can add missing fields tothe existing assets by clicking the asset's Template button.

如何定位在对话编辑

 

本地化使用内置的对话编辑的最简单的方法是将定位域在对话编辑模板折页模板。这样,他们将自动被添加到资产为你添加。

 

如果你加入域的模板创建资产后,您可以添加缺少的领域的现有资产按资产的模板按钮。

How toLocalize in Chat Mapper

ChatMapper make localization easy. The Chat Mapper Converter automatically importsall All Chat Mapper localization settings. To set up localization in ChatMapper, follow these steps:

 

1.SelectProject > Project Settings and click on the Custom Asset Fields tab.

2.Clickon the Dialogue Nodes field.

3.Add acustom field for each language:

◦Title:The language code (e.g., "es" for Spanish, "fr-CA" forFrench - Canadian). Use just the language code; do not put "DialogueText" in front of it.

◦Type:Localization.

4.Ifyou want to localize Menu Text or Sequences, add a custom field for eachlanguage "ln":

◦Title:"Menu Text ln" or "Sequence ln" (e.g., "Sequencefr-FR"). There should be exactly one blank space between the default titlename and the language code.

◦Type:Text. Note: Make sure the type is Text. Only the Dialogue Text localizationfields should have the type set to Localization.

5.ClickOK.

如何定位在聊天器

 

聊天器使定位容易。聊天器转换器自动导入所有聊天映射本地化设置。在聊天映射设置定位,遵循这些步骤:

 

1。选择项目>项目设置,点击自定义资产领域的标签。

2。在对话节点域中点击。

3。每个语言添加一个自定义字段:

?标题:语言代码(例如,“es”西班牙,“fr CA”法国-加拿大)。只使用语言代码;不要把“对话文本”在它的前面。

?类型:定位。

4。如果你想本地化菜单文本或序列,添加一个自定义字段的每种语言的“LN”:

?标题:“菜单文本LN”或“序列LN”(例如,“序列fr-FR”)。应该有一个空白的默认名称和代码之间的语言。

?类型:文本。注意:确保类型文本。只有对话文本定位领域应该设置为定位的类型。

5单击“确定”。


ChatMapper's tree view show the dialogue text of the active localization. To changethe active localization, select a choice from the Active Localization drop-downon the main window.

 

Whenediting dialogue entries, if you leave a localized version of a field blank,the Dialogue System will use the default version.

 

Notethat Chat Mapper only localizes Dialogue Text. The Dialogue System for Unityalso localizes Menu Text and Sequence. You won't see this in Chat Mapper'ssimulator, but it will take effect in Unity.

 

聊天映射的树视图中显示的有源定位对话文本。将有源定位,选择从下拉主动定位在主窗口。

 

编辑对话项时,如果你离开一个本地化版本的一个领域的空白,对话系统将使用默认的版本。

 

请注意,只有定位对话文本聊天器。团结的对话系统也本地化菜单文本和序列。你不会看到这个聊天中映射的模拟器,但它将在统一中起作用。

How toLocalize in the Built-in Dialogue Editor

Localizationsetup is similar to the procedure used for Chat Mapper.

如何定位在建立对话编辑

 

本地化设置是类似于用于聊天的制图程序。

这个地方是多语言减少了移植的麻烦

1.Openthe Templates > Dialogue Entry template foldout.

2.Add afield of type Localization for each language code (e.g., "fr-CA" forFrench - Canadian). This field will be used for localized Dialogue Text in thatlanguage.

3.Ifyou want to localize other fields, such as Menu Text or Sequence, add Textfields (not Localization) named with the default field's name and the languagecode separated by a blank space (e.g., Menu Text fr-CA").

1。打开模板>对话输入模板的折页。

 

2。添加一个字段,为每个类型的本地化语言代码(例如,“fr CA”法国-加拿大)。此字段将用于本地化的对话文本语言。

 

3。如果你需要将其他领域,如菜单文本或序列,添加文本域(不定位)为默认的字段的名称和语言代码由一个空格分开(例如,菜单文本fr CA”)。

LocalizationTables

TheDialogue System also provides a general-purpose localization system. You cancreate a table of localized text strings using menu item Window > DialogueSystem > Assets > Create > Localized Text Table or by right-clickingin the Project view and selecting Dialogue System > Create > LocalizedText Table.

 

Editthe table in the inspector. You can add languages in the top section, andfields in the bottom section. Every field will have a field name and values foreach language.

 

You canassign localized text tables to Unity GUI Controls and toUnityGUIQuestLogWindows (see Quest Log System).

 

To usea localization text table in a script, useLocalizedTextTable["fieldname"], where fieldname is the name of thefield. This will return the current value of the field based on the currentlanguage. (See PixelCrushers.DialogueSystem.LocalizedTextField for moreinformation.)

定位表

 

对话系统还提供了一个通用的定位系统。你可以创建一个表的本地化的文本字符串使用菜单项窗口> > > >对话系统资产创建本地化的文本表或通过点击在项目视图中选择正确的和对话系统>创建>本地化的文本表。

 

在检视面板编辑表。你可以在顶部添加语言,并在底部域。每一场都将为每种语言的字段的名称和值。

 

您可以指定本地化的文本表统一的GUI控件和unityguiquestlogwindows(见日志系统)。

 

在脚本中使用本地化的文本表,使用localizedtexttable [ ],在“字段名”字段是字段的名称。本文将基于当前语言领域的当前值。(更多信息请看pixelcrushers.dialoguesystem.localizedtextfield。)

Gameplay Integration

Thispage contains a discussion of how to integrate "conversation mode"with your project's regular "gameplay mode," including specifics forvarious gameplay platforms such as Adventure Creator and UFPS.

此页包含一个讨论如何将“对话模式”与您的项目的规则”的游戏模式,包括各种游戏平台如冒险的创造者和UFPs的细节。

AboutGameplay Integration

Whensetting up your project infrastructure, integrating PC-NPC dialogue withgameplay is one of the more complicated tasks, because you need to transitionplayer control from gameplay mode (looking around, moving, etc.) toconversation mode. Generally, you need to temporarily disable gameplay controlsand NPC AI, and get the NPC to act the way you want in conversation mode. To dothis, you can use triggers such as Set Enabled On Dialogue Event (see Triggers)and/or sequencer commands such as SetEnabled() (see Sequencer CommandReference).

 

Thegeneral approach is:

 

1.Identifythe control, camera, and AI components that are active during gameplay.

2.Whenthe conversation starts, disable these components and enable any necessaryconversation mode components. For example, if you use a Mecanim Animator tocontrol your character in gameplay but a legacy Animation component to controlyour character in dialogue cutscene sequences, you'll want to disable theAnimator and enable the Animation component. (Note: If you've assigned aSequencer Camera in the Dialogue Manager's display settings, the DialogueSystem will automatically disable the gameplay camera and enable the sequencercamera.

◦Youmay also want to use the Set Animator State On Dialogue Event or Set AnimationOn Dialogue Event components to force characters into states at the beginningand end of conversations, or Start Sequence On Dialogue Event if you need to domore, such as setting certain Animator parameters.

3.Whenthe conversation ends, disable any conversation-only components and re-enablethe gameplay components.

Inaddition, you may need to share data between the Dialogue System and yourgameplay framework (for example, the player's inventory or health). One goodapproach is to use the Dialogue System's Lua environment and theOnConversationStart/OnConversationEnd messages:

 

•OnConversationStart: Record your gameplay datainto the Lua environment so your conversation can access and/or manipulate it.

•OnConversationEnd: Apply any changes from theLua environment into your gameplay data.

TheFPSyncLuaPlayerOnConversation.cs script demonstrates how this is done in theUltimate FPS integration. It uses the Lua.Run() method to store and retrieveUFPS data.

关于游戏积分

 

当设置您的项目的基础设施,pc-npc对话的游戏将是一个更复杂的任务,因为你需要从游戏模式过渡球员控制(看看周围,运动,等)的对话模式。一般来说,你需要暂时禁用的游戏控制和NPC的AI,并获得全国人大法案要谈话的方式。要做到这一点,你可以使用如设置对话触发事件启用(见触发器)和/或音序器命令如setenabled()(见音序器命令参考)。

 

一般的方法是:

 

1。确定控制,摄像机,和AI的活动组件的游戏中。

 

2。当开始交谈,禁用这些组件,使任何必要的对话模式组件。例如,如果你使用一个mecanim动画师来控制你的角色在游戏,但传统的动画组件来控制你的对话动画序列的特征,你会想禁用动画,使动画组件。(注:如果你在对话管理器的显示设置,指定一个音序器相机的对话系统将自动禁用游戏摄像机和相机使音序器。

 

?你也可以使用设置动画状态的对话事件或设置动画的对话活动部件的受力特点为国家在开始和结束的对话,在对话或启动序列的事件如果你需要做更多的工作,如设置一定的动画参数。

 

3。当会话结束,禁用任何谈话只有组件并重新使游戏组件。

 

此外,你可能需要共享的对话系统与你的游戏框架之间的数据(例如,球员的库存或健康)。一个好的方法是使用对话系统的Lua环境和onconversationstart /onconversationend消息:

 

?onconversationstart:记录你的游戏数据到Lua环境,你的谈话可以访问和/或操作。

 

?onconversationend:适用于从lua环境的任何变化到你的游戏数据。

 

该fpsyncluaplayeronconversation.cs脚本演示了如何这样做是在最终的FPS一体化。它使用Lua。run()方法来存储和检索数据的超微粒子。

GameplayIntegration in the Feature Demo

TheFeature Demo can give you an overview of how to integrate the Dialogue Systemwith your own gameplay components.

 

In theFeature Demo example scene, the Player object has a Set Enabled On DialogueEvent component that disables these gameplay components on conversation start:

 

•SimpleController

•Selector

•SmoothCameraWithBumper

Thesame component also re-enables them on conversation end.

 

Inaddition, the first dialogue entry in Private Hart's conversation uses theLookAt() sequence command to make the player and Hart look at each other.

在特征演示的游戏积分

 

功能演示,可以给你一个如何与你自己的游戏组件的对话系统集成。

 

在特征演示的例子场景,玩家对象都有一组对话事件组件禁用这些游戏组件在会话开始启用:

 

?simplecontroller

?选择器

?smoothcamerawithbumper

该组件还重新使他们在谈话结束。

此外,在私人哈特的谈话一对话输入使用lookat()序列命令让球员和哈特看对方。


Thissection describes how to set up the Dialogue System with Cinopt Studios' 2DAction RPG Starter Kit and how to use them together. (2D Action RPG Starter Kitis required.)

本节描述如何用cinopt工作室的2D动作RPG入门套件建立对话机制以及如何把它们结合在一起使用。(2D动作RPG初学者工具包是必需的。)

2DAction RPG Starter Kit Setup

Followthese steps to set up the Dialogue System in the 2D Action RPG Starter Kit.These steps are already set up in the included example, so instead of thesesteps you can just import the example scene package located in Third PartySupport/2D Action RPG Starter Kit/Example/Example Scenes.

 

1.Importthe package Third Party Support/2D Action RPG Starter Kit Support. This willunpack files into the folder Third Party Support/2D Action RPG Starter Kit.

2.Ifyou didn't import Example Scenes, import the package Third Party Support/2DAction RPG Starter Kit/Script Modifications. This will update2dactionrpg/Scripts/playercurrency.js and playerhealth.js with versions thatcontain an extra function necessary to synchronize data with the DialogueSystem. If you've already imported the Example Scenes package, you can skipthis step (and in fact you can skip all of the steps below).

3.Loadthe scene 2dactionrpg/Scenes/loader.

4.Add aDialogue Manager (Window > Dialogue System > GameObject > Create >Dialogue Manager) or use the Dialogue Manager wizard (Window > DialogueSystem > Tools > Wizards).

5.(Optional)Move the Dialogue Manager so it's a child of permanentobjects. This is just fororganization to remind you that Dialogue Manager is a permanent object.

6.Selectthe Dialogue Manager object.

◦SetInitial Database to your dialogue database. If you haven't created one yet,remember to assign this once you've created it.

◦SetDisplay Settings > Dialogue UI to your UI prefab. The example uses the JRPGprefab in Dialogue System/Prefabs/Unity Dialogue UIs/JRPG, but you can use anyof the others or create your own. (See dialogueUI for more details.)

◦IMPORTANT:Set Display Settings > Camera Settings > Default Sequence toDelay({{end}}). This is important because the initial value of Default Sequencewill try to do closeups of the 3D transforms of the actors. Since this is a 2Dgame, you don't want to control the camera this way.

◦Moreinfo at: Set up the Dialogue Manager GameObject

7.Selectthe permanentobjects/Player object.

◦Addthese components:

■Window > Dialogue System > Component> Triggers > Show Cursor On Conversation

■Window > Dialogue System > Component> Supplemental > Proximity Selector

■Window > Dialogue System > Component> Integration > 2D Action RPG Starter Kit > 2D Action RPG Bridge

◦Selectthe player's ActionRPG2DBridge component.

■Assign permanentobjects/GUI/inventory to theInventory property.

■If you've added or modified items, expand theVariables list and update the item IDs. By default, they start with"sword", "bow", etc.

■If you want to prevent the player from walkingaway during conversations, tick Freeze Player During Conversations.

■If you want to include information on whethereach line of dialogue has been offered or spoken (which makes saved gamesbigger), tick Include Sim Status.

◦Selectthe Proximity Selector.

■Set Default Use Message to (E to interact) orsomething similar.

■Change the Use Key to E, since the kit alreadyuses Space to attack.

8.Toadd a conversation to an NPC or interactive object:

◦Expandthe NPC's hierarchy and select the talktrigger object.

◦Setthe tag to npc.

◦Removethe Npctalk component.

◦Addthese components:

■Window > Dialogue System > Component> Triggers > Conversation Trigger (or Bark Trigger to bark instead)

■Window > Dialogue System > Component> Triggers > Stop Conversation If Too Far (if the player can move duringconversations)

■Window > Dialogue System > Component> Supplemental > Usable

■If the NPC barks, add a bark UI: Component> UI > Unity GUI > Bark > Bark UI

■For mobile, consider ticking Cache Bark Lines(see About Caching Bark Lines)

◦On theConversation Trigger:

■Set Conversation to the title of theconversation in the dialogue database.

■Set Conversant to the main NPC GameObject.

◦On theUsable component:

■Set Override Name if you don't want to use thename of the main NPC GameObject for

2D动作RPG入门套件安装

 

遵循这些步骤在2D动作RPG入门套件建立对话系统。这些步骤已经在包括树立的榜样,而不是这些步骤,你可以导入示例场景包位于第三方支持/ 2D动作RPG初学者工具包/例子/示例场景。

 

1。进口包第三方支持/ 2D动作RPG入门套件支持。这将解压文件到文件夹第三方支持/ 2D动作RPG入门套件。

 

2。如果你不输入样例场景,导入包第三方支持/ 2D动作RPG初学者工具包/脚本的修改。这将更新2dactionrpg /脚本/playercurrency.js和包含一个额外的功能,必须与对话系统同步数据的版本playerhealth.js。如果你已经输入的示例场景包,你可以跳过这一步(事实上,你可以跳过以下步骤)。

 

3。负荷现场2dactionrpg/场景/装载机。

 

4。添加一个对话管理器(窗口>> > >游戏对象创建对话系统的对话管理器)或使用对话管理器向导(窗口>对话系统>工具>奇才)。

 

5。(可选)将对话的经理是一个孩子的permanentobjects。这是组织提醒你,对话管理器是一个永久的对象。

 

6选择对话管理器对象。

 

?你的对话设置初始数据库数据库。如果你还没有创建一个呢,记得要将本一旦你创造了它。

 

?设置显示设置>对话UI UI预制。该示例使用JRPG预制在对话系统/预设/团结/ JRPG对话界面,但您可以使用任何其他人或创建自己的。(更多细节见。dialogueui)

 

?重要:设置显示设置>相机设置>默认序列的延迟({ { } }结束)。这很重要,因为默认序列的初始值将尝试做的3D特写的角色转换。由于这是一个2D游戏,你不想这样控制摄像机。

 

?更多信息:建立对话管理器对象

 

7。选择permanentobjects/播放器对象。

 

?添加这些成分:

 

■对话窗口>系统>组件>触发>显示光标在谈话

 

■对话窗口>系统>组件>附加>邻近选择器

 

■窗口> > > >对话系统组件集成2D动作RPG入门套件> 2D动作RPG桥

 

?选择球员的actionrpg2dbridge组件。

 

■分配permanentobjects /图形/库存存量资产。

 

■如果你添加或修改的项目,扩大和更新项目ID变量列表。默认情况下,他们开始用“剑”,“弓”,等等。

 

■如果你想防止玩家离开的谈话中,蜱冷冻的球员在谈话。

 

■如果你想包括在每行是否已提供的对话或语音信息(这使得游戏更大),蜱包括SIM卡状态。

 

?选择接近选择器。

 

■设置默认使用消息(E交互)或类似的东西。

 

■改变使用钥匙,因为工具已经使用的攻击空间。

 

8。加入对话的NPC或交互对象:

 

?扩大全国人大的层次和选择talktrigger对象。

 

?设置标签的NPC。

 

?拆下npctalk组件。

 

?添加这些成分:

 

■对话窗口>系统>组件> >对话触发触发器(或树皮树皮而触发)

 

■对话窗口>系统>组件>触发>停止谈话如果太远(如果玩家可以移动时的谈话)

 

■对话窗口>系统>组件>附加>可用

 

■如果NPC的树皮,树皮:添加一个UI组件>界面GUI >树皮>树皮>统一用户界面

 

■移动,考虑在高速缓存线(见有关缓存树皮树皮线)

 

?在对话触发:

 

■设置对话在对话数据库会话的标题。

 

■集熟悉主要的NPC游戏对象。

 

?在可用的组件:

 

■集覆盖的名字,如果你不想使用的主要NPC游戏对象的名称

Accessing2D RPG Kit Data in the Dialogue System

When aconversation starts, the bridge script sets the following Lua variables:

 

•Variable["playerHealth"]: Theplayer's health.

•Variable["money"]: The player's gemcount.

•Variable["slotSet"]: The slot number(1 to 16) of the currently-equipped item.

•Variable["sword"]: 1 if the playerhas a sword, 0 if not.

•Variable["bow"]: 1 if the player hasa bow, 0 if not.

•Variable["wand"]: 1 if the playerhas a wand, 0 if not.

•Variable["potion"]: The number ofpotions the player has.

•The variables "sword","bow", etc., will be different if you've changed the list ofvariables on the player's ActionRPG2DBridge component.

You cancheck these values in dialogue entry conditions and set them in dialogue entryuser scripts. If you set a value during a conversation, at the end of theconversation it will be reflected back into the 2D RPG Kit.

在对话系统的二维RPG套件的数据访问

 

当开始交谈,桥下面的Lua脚本设置变量:

?变量[“playerhealth”]:球员的健康。

?变量[“钱”]:玩家的宝石计数。

?变量[“slotset”]:槽数(1至16)目前装备物品。

?变量[“剑”]:1如果玩家有一把剑,如果没有0。

?变量[“弓”]:1如果玩家有一个弓,0如果不。

?变量[“魔杖”]:1如果玩家有一根魔杖,0如果不。

?变量[“药水”]:药剂的玩家数量。

?变量“剑”,“弓”,等,将不同,如果你改变了对球员的actionrpg2dbridge成分变量列表。

 

你可以检查这些值在对话的准入条件,使他们进入用户脚本的对话。如果你设定一个值时的谈话,在谈话结束时它会被反射回的二维RPG试剂盒。

ExampleScenes

Theexample for this integration package uses modified versions of the scenes in2dactionrpg/Scenes. It provides a menu for saving games, loading games, andviewing the quest log window. The Escape key opens and closes the menu.

 

To playthe example, first import the Example Scenes package. Then play the scene named"loader".

 

Thefollowing scenes have been modified for the example:

 

•loader:

◦AddedDialogue Manager, including a Quest Tracker.

◦AddedDialogue System components to Player.

◦Addedan Example Menu (under Dialogue Manager) to demonstrate quest windows, saving,and loading.

•menu:

◦DisabledMenuGUI, since there's a new main menu in loader.

•playerhouse:

◦Addedinteractive barks to bed and table.

◦Addeda conversation to bookshelf.

◦Addeda usable component to housedoor just to give it a label when you approach it.

•town:

◦Addeda bark on idle to oldwomannpc (note: Cache Bark Lines is ticked).

◦Addeda bark trigger to oldmannpc (the walking one).

◦Addeda conversation to oldmannpc (the stationary one).

◦Addeda conversation and quest to girlnpc (bottom center of map).

•otherhouse:

◦AddedIncrement On Destroy to each blob for quest tracking.

 

示例场景

 

本示例使用集成封装在2dactionrpg /幕后的修改版本。它提供了一个菜单保存游戏,加载游戏,查看日志窗口。Escape键打开和关闭菜单。

 

玩的例子,首先导入示例场景包。然后,活动现场命名为“机”。

 

下面的场景已被修改为例:

 

?装载机:

?经理加入对话,包括任务追踪。

?说对话系统组件的球员。

?添加一个菜单例子(在对话管理器)来证明任务窗口,保存,加载。

?菜单:

?残疾人menugui,因为有装载机新的主菜单。

?playerhouse:

?床和表添加交互式树皮。

?增加了一个谈话的书架。

?添加一个可用的组件宅门只是给它一个标签时,你的做法。

?镇:

?加上闲置的树皮oldwomannpc(注:缓存树皮线勾选)。

?增加了一个叫触发oldmannpc(行走的人)。

?增加了一个会话oldmannpc(固定)。

?加入谈话,寻求girlnpc(地图底部中心)。

?otherhouse:

?在每一个增量破坏任务跟踪。

下面这个插件应该是很眼熟吧,


剧情系统开始的时候我提到的不用编程的剧情制作工具,其实它是一个对Dialogue System for Unity的拓展与封装

但说实话,不一定比Dialogue System for Unity更方便使用,不过好在这个是可以在国内免费下载到的,有兴趣可以自己用用看

Integrationsupport files for Icebox Studios' Adventure Creator are located in Third PartySupport/Adventure Creator Support. (Adventure Creator is required.)

 

IMPORTANT:Please read the Adventure Creator Setup section for specific steps required toset up support.

 

Theintegration package adds these features:

 

•New Adventure Creator actions to start DialogueSystem conversations and barks.

•A bridge that synchronizes Adventure Creator'sglobal variables and inventory with the Dialogue System's Lua environment.

•An AC() sequencer command to run AdventureCreator action lists from inside Dialogue System conversations.

•Integration with Adventure Creator's SaveSystem.

冰箱影城冒险编辑器集成支持文件位于第三方支持/冒险编辑器支持。(冒险的创造者是必需的。)

 

重要:请阅读冒险编辑器设置节的具体步骤需要建立支持。

 

集成包添加这些特性:

 

?新的冒险者行动开始对话系统的对话和树皮。

 

?一座桥,同步冒险造物主的全局变量与对话系统的Lua环境库存。

 

?一个ac()音序器命令运行的冒险行动清单内的创造者从对话系统的对话。

 

?冒险的创造者的保存系统集成。

AdventureCreator Setup

Importthe package Third Party Support/Adventure Creator Support. This will unpackfiles into the folder Third Party Support/Adventure Creator.

 

It willalso import these files into AdventureCreator/Scripts/Actions:

 

1.ActionDialogueSystemBark.cs

2.ActionDialogueSystemConversation.cs

3.ActionDialogueSystemLua.cs

AdventureCreator requires that these files are in its Actions folder. If you have movedAdventure Creator from its default installation location, you must move thesefiles into the new location, too.

 

To makethe new actions available in Adventure Creator, you must open the Game Editor(Adventure Creator > Editors > Game Editor) and, on the Actions tab,click Refresh list.

冒险编辑器设置

 

导入包第三方支持/冒险编辑器支持。这将解压文件到文件夹第三方支持/冒险的创造者。

 

它还将这些文件导入到adventurecreator /脚本/行动:

 

1.actiondialoguesystembark.cs

 

2.actiondialoguesystemconversation.cs

 

3.actiondialoguesystemlua.cs

 

冒险者要求这些文件在文件夹的行动。如果你已经冒险者从默认的安装位置,你必须将这些文件移到新的位置,太。

 

为了使新动作冒险的创造者,你必须打开游戏编辑器(冒险编辑器>编辑>游戏编辑器),在操作”选项卡上,单击“刷新列表。

ExampleScene

Theexample scene is a modified version of Adventure Creator's Demo scene thatreplaces the AC conversation "IntroConv" with a Dialogue Systemequivalent.

 

It usesthe AC() sequencer command to start IntroConv2 at the end of the conversationin "nowait" mode, which immediately releases control back to AC.

 

It alsoincludes a simple quest example: "Find a Sword". This quest startsactive. When the player picks up the sword by triggering the Sword_Useinteraction, it runs a Lua action to update the quest state and refresh thequest tracker HUD. You can also use the quest log window system (not shown inthis example scene), but you need to implement the menus to open and close it.

 

Thereis also a simple interactive object, a Trash Can containing an obsolete modelrobot, Copper Pot. Copper Pot demonstrates barks (one-off lines of dialogueduring gameplay) and a conversation that uses the sequencer commandAC(TrashCanShake,nowait).

 

There'salso a small utility script on Dialogue Manager that shows the current AC gamestate.

 

示例场景

 

示例场景是一个修改的冒险的创造者的场景演示版本替换交流对话”与对话系统的等效introconv”。

 

它使用ac()音序器命令启动introconv2会谈结束时在“立即”模式,并立即释放控制回交流电。

 

它还包括一个简单的任务,例如:“找剑”。这个任务开始活跃。当玩家拿起剑触发sword_use互动,它运行一个Lua动作来更新任务的状态和刷新任务追踪平视显示器。你也可以使用日志窗口系统(没有在这个示例中显示的场景),但你需要执行的菜单来打开和关闭它。

 

也有一个简单的交互式对象,一个垃圾桶含有一个过时的机器人模型,铜锅。铜锅演示树皮(在游戏中的对话一次性线)和会话使用音序器命令交流(trashcanshake,NOWAIT)。

 

还有在对话管理器显示当前交流游戏状态的实用小脚本。

 

DialogueSystem Actions

Whenyou complete the step above, these new actions will be available in AdventureCreator:

 

•Third-Party: Dialogue System conversation:Starts a Dialogue System conversation. The scene must have a Dialogue Managerobject (see: Set up the Dialogue Manager GameObject).

◦ConversationTitle: The title of a conversation defined in the Dialogue Manager's dialoguedatabase.

◦Actor:The main actor in the conversation, usually the player.

◦Conversant:The other actor in the conversation, usually an NPC.

◦Notethat conversations can have multiple actors. The Actor and Conversant simplydefine the two primary actors.

•Third-Party: Dialogue System bark: Starts aDialogue System bark (a one-off line of dialogue). The scene must have aDialogue Manager object (see: Set up the Dialogue Manager GameObject).

◦BarkConversation Title: The title of a conversation defined in the DialogueManager's dialogue database. See Bark System for an explanation of how barklines are stored in conversations.

◦Actor:The actor speaking the bark.

◦Conversant:(Optional) The actor being barked at.

◦SyncData: If ticked, Adventure Creator data is synchronized to the Dialogue Systembefore barking and back to Adventure Creator after barking. Since this couldhave a small impact on performance if many barks occur at the same time, youhave the option to leave it unticked if your barks don't need to access ACdata.

•Third-Party: Dialogue System Lua: Runs Luacode in the Dialogue System's Lua environment. This is often used to update thestate of a quest, as demonstrated in the Sword_Use interaction in the examplescene. The scene must have a Dialogue Manager object (see: Set up the DialogueManager GameObject).

◦LuaCode: The Lua code to run.

◦SyncData: If ticked, Adventure Creator data is synchronized to the Dialogue Systembefore and after running the Lua code.

◦UpdateQuest Tracker: Updates the quest tracker HUD, if one exists on the DialogueManager object.

对话系统的行为

 

当你完成以上的步骤,这些新措施将在冒险的创造者是可用的:

 

?第三方:对话系统的对话:开始一个对话系统的对话。现场必须有一个对话管理器对象(见:建立对话管理器对象)。

 

?标题:对话的对话中,经理的对话数据库会话定义标题。

 

?演员:会话中的主要演员,通常玩家。

 

?熟悉:会话中的其他演员,通常是一个NPC。

 

?注意对话中可以有多个演员。演员和熟悉的简单定义了两个主要演员。

 

?第三方:对话系统的对话系统:从树皮树皮(一种对话一次性线)。现场必须有一个对话管理器对象(见:建立对话管理器对象)。

 

?标题:树皮对话的对话中经理的对话数据库会话定义标题。看看如何皮行存储在会话解释皮系统。

 

?演员:演员说话树皮。

 

?熟悉:(可选)演员对着。

 

?数据同步:如果勾,冒险者的数据同步到对话系统前狂吠,回到造物主脱皮后的冒险。因为这可能如果树皮发生在同一时间对性能影响小,你可以把它unticked如果你的皮不需要访问交流数据。

 

?第三方:对话系统:在对话系统的Lua Lua环境运行lua代码。这通常是用来更新任务的状态,如在示例场景的交互显示sword_use。现场必须有一个对话管理器对象(见:建立对话管理器对象)。

 

?Lua代码:Lua代码运行。

 

?数据同步:如果勾,冒险者的数据同步到对话系统之前和运行lua代码后。

 

?更新:更新任务追踪任务追踪HUD,如果存在的对话管理器对象。

DialogueSystem - Adventure Creator Bridge

TheAdventure Creator Bridge synchronizes Adventure Creator data with DialogueSystem data. Add it to your Dialogue Manager object by selecting the object andthen menu item Window > Dialogue System > Component > Integration >Adventure Creator > AC Bridge. The inspector has these options:

 

•Use Dialog State: Specifies what game state toput AC in during conversations. Set it to:

◦Never:To never change AC's game state.

◦IfPlayer Is Involved: To change to GameState.DialogOptions only if the player isinvolved in the conversation.

◦Always:To change to GameState.DialogOptions during every conversation.

•Include Sim Status: Includes SimStatus in savedata. See Saving and Loading below.

When aconversation starts, the bridge will either set the game state to the statespecified in Conversation State or, if Turn Off Adventure Creator is ticked,turn off Adventure Creator entirely. Then it will copy Adventure Creator'sinventory and global variables to the Dialogue System's Lua environment. Whenthe conversation ends, it restore the Adventure Creator state and copy theDialogue System's Lua environment back to AC's inventory and global variables.

 

In theDialogue System's Lua environment:

 

•Every AC variable has a corresponding entry inthe Lua Variable[] table. You can check the value in dialogue entries'Condition fields, and set the value in their User Script fields.

◦Example:Variable["Tipped_barrel"]

•Every AC item has a corresponding entry in theLua Item[] table. The entry has fields for the AC ID number (AC_ID) and theitem count (Count). To remove an item, set its Count to 0.

◦Example:Item["Prop_sword"].Count = 0

You canmanually synchronize data and/or freeze Adventure Creator by calling:

对话系统的冒险者的桥梁

 

冒险编辑器同步数据桥冒险编辑器对话系统数据。添加到您的对话管理器对象的选择对象然后菜单窗口> > > >对话系统组件集成冒险编辑器>交流电桥。检查员有这些选项:

 

?使用会话状态:指定要放在什么游戏状态的对话交流。将它设置为:

?没有永远不变的AC的比赛状态。

?如果玩家参与:只有当玩家参与谈话改变gamestate.dialogoptions。

?总:改变gamestate.dialogoptions每次谈话。

?包括SIM卡状态:包括simstatus在保存数据。看下面的保存和加载。

 

当开始交谈,大桥将设置游戏状态的会话中所指定的状态的状态或,如果关掉创造者是在冒险,冒险者完全关闭。然后将复制的冒险的创造者的库存和全局变量的对话系统的Lua环境。当谈话结束,恢复冒险编辑器状态和复制的对话系统的Lua环境回到AC的库存和全局变量。

 

在对话系统的Lua环境:

?每一个交流变量在Lua变量[ ]表对应的条目。你可以检查值在对话内容的条件的领域,和值设置在他们的用户脚本领域。

?例如:“tipped_barrel变量[”]

?每一个交流项目已在Lua项目[ ]表对应的条目。输入为交流的身份证号码域(ac_id)和项目数(数)。要删除一个项目,将其数到0。

?例如:“prop_sword项目[”]数= 0。

您可以手动同步数据和/或冻结的冒险者通过调用:


SequencerCommand

EveryDialogue System dialogue entry can have a cutscene sequence defined in itsSequence field. You can start an Adventure Creator action list or cutscene byusing the AC() sequencer command.

 

Example:Sequence: AC(BarrelTip)

音序器命令

 

每个对话系统的对话条目可以在其序列字段定义动画序列。你可以通过使用ac()音序器命令开始冒险行动清单或动画创作者。

 

例如:序列:交流(barreltip)

Savingand Loading

AdventureCreator doesn't provide hooks for saving and loading third-party global data.The Dialogue System integration package provides two static functions inAdventureCreatorBridge that you must call manually to save the DialogueSystem's state into an Adventure Creator global variable and retrieve it againwhen loading a game. These methods will automatically create the globalvariable if it doesn't already exist.

 

Therecommendation from Icebox Studios is to insert code into the followingAdventure Creator files:

Scripts/Menu/MenuSystem.cs:

At theend of the OnMenuEnable method, add this code:

保存和加载

 

冒险者不保存和加载第三方的全局数据提供钩。对话系统集成软件包提供了两个静态函数adventurecreatorbridge,必须调用手动保存对话系统的状态变成了一次冒险的创造者的全局变量和检索一次加载游戏时。这些方法将自动创建全局变量,如果它不存在。

 

从冰箱工作室的建议是为以下的冒险者的文件插入代码:

 

脚本/菜单/ menusystem.cs:

 

在onmenuenable方法结束时,添加此代码:


Scripts/Savesystem/SaveSystem.cs:

 

At theend of the OnLevelWasLoaded method, add this code:

脚本/保存系统/ savesystem.cs:

 

在onlevelwasloaded方法结束时,添加此代码:


IfInclude Sim Status is ticked on the Adventure Creator Bridge, the status of alldialogue entries will be included in the save data. This records whether anentry was offered in a response menu and/or whether it has been spoken by anactor. If you have a lot of dialogue entries, this can make the save datalarge, so it's unticked by default since many games don't even need to recordthis information.

 

Pausingthe Game

AdventureCreator pauses the game during player menus by setting Time.timeScale = 0. Bydefault, the Dialogue System ignores Time.timeScale. This allows you to pausegameplay but still continue to run a conversation. If you the Dialogue Systemto pause when Time.timeScale is zero, set

如果包括SIM卡状态勾选上冒险的创造者桥,所有对话作品的地位将包括在保存数据。这项记录是否是一个响应菜单和/或是否已由一个演员说了。如果你有很多对话的条目,这可以使保存数据大,所以它的默认unticked由于许多游戏甚至不需要记录这个信息。

 

暂停游戏

 

冒险者暂停游戏玩家通过在菜单设置time.timescale = 0。默认情况下,对话系统忽略time.timescale。这允许你暂停游戏,但仍继续运行的谈话。如果你的对话系统暂停时,time.timescale是零,集


Integrationsupport files for Dark Tonic's Core GameKit (formerly Killer Waves) are locatedin Third Party Support/Core GameKit Support. (Core GameKit is required.) Theintegration scripts add these features:

 

•Lua access (e.g., in conversations) to KillerWaves World Variables (read/write) and current level/wave values (read-only).

•World variable listeners that can synchronizeLua variables and World Variables on the fly.

•Sequencer commands to control waves, spawningand despawning, and spawned object attributes.

Thescripts are available through the menu item Window > Dialogue System >Integration > Killer Waves.

暗补品的核心GameKit集成支持文件(原杀手波)位于第三方支持/核心GameKit支持。(核心GameKit是必需的。)集成脚本添加这些功能:

 

?Lua访问(例如,在谈话中)杀手波世界变量(读/写)和电流水平/波值(只读)。

 

?世界变的听众,可以同步Lua变量和世界变量对飞。

 

?音序器命令来控制波,产卵和despawning,催生了对象属性。

 

脚本可以通过菜单窗口> > >杀手波对话系统集成。

ExampleScene

Theexample scene contains an NPC that you can converse with to control KillerWaves inside a conversation. The scene starts in Wave 1, which is an empty wavethat doesn't spawn anything. In the conversation, you can end the wave andprogess to Wave 2 (select the responses "Wave Control", then"End Wave"), which will spawn enemy soldiers. You can also manuallyspawn and despawn enemies and change their hit points and attack points duringthe conversation.

示例场景

 

示例场景包含一个NPC,你可以同控制杀手波在谈话。现场1浪的开始,这是一个空的波不产生任何东西。在交谈中,你可以结束2波的波和过程(选择反应”,那么“波”控制端波”),这将产生的敌军士兵。您也可以手动产生和消失的敌人,在谈话的过程中改变他们的生命值和攻击点。

KillerWaves Lua Bridge & Listeners

TheKiller Waves Lua Bridge component synchronizes Killer Waves' level settings andworld variables with the Dialogue System's Lua environment. It automaticallysynchronizes before and after conversations, and you can synchronize manuallyusing SyncKillerWavesToLua() and SyncLuaToKillerWaves().

 

Forevery Killer Waves world variable, there will be a corresponding entry in theLua environment's Variable[] table. Spaces in variable names will be replacedwith underscores. For example:

 

•Killer Waves world variable: Experience Points

•Lua: Variable["Experience_Points"]

The Luavariables below will also be set as read-only. They won't be synchronized backto Killer Waves.

 

•Variable["Current_Level"]: Currentlevel number.

•Variable["Current_Wave"]: Currentwave number in the current level.

•Variable["Current_Wave_Length"]:Length of the current wave in seconds.

•Variable["Current_Wave_Time_Remaining"]:Seconds remaining in the current wave.

TheWorld Variable To Lua and Lua To World Variable listeners can be used to keepLua and Killer Waves' world variables synchronized.

 

•World Variable To Lua listens for changes toworld variables. When they change, the listener updates the corresponding Luavariable.

•Lua To World Variable listens for changes toLua variables. When they change, the listener updates the corresponding worldvariable.

 

杀手波Lua桥梁与听众

杀手波Lua桥梁构件同步杀人波”级别的设置和世界变量与对话系统的Lua环境。它会自动同步之前和之后的谈话中,你可以使用synckillerwavestolua()和syncluatokillerwaves()手动同步。

每一个杀手波世界变量,将有在Lua环境变量[ ]表对应的条目。变量名称空间将用下划线代替。例如:

?世界杀手波变量:经验值

?Lua:变量[“experience_points”]

在Lua变量也将被设置为只读。他们不会被同步回杀手波。

?变量[“current_level”]:当前级别。

?变量[“current_wave”]:在电流的波数。

 

?变量[“current_wave_length”]:在几秒钟内电流波长度。

?变量[“current_wave_time_remaining”]:剩余电流波秒。

世界变到Lua和LUA世界变的听众可以用来保持Lua和杀手的波变量同步的世界。

?世界变的lua听世界变量的变化。当他们改变,听者更新相应的Lua变量。

?Lua世界变侦听到Lua变量的变化。当他们改变,听者更新相应的世界变。

SequencerCommands

The integrationpackage adds the following sequencer commands. You can use them in any cutscenesequence.

 

•KillerWavesPauseWave(): Pauses the currrentwave.

•KillerWavesUnpauseWave(): Unpauses thecurrrent wave.

•KillerWavesEndWave(): Ends the currrent wave.

•KillerWavesGameOver(): Ends all waves.

•KillerWavesSynchroSpawn(spawner): Tells aspawner to spawn a single object. Provide the name of the spawner.

•KillerWavesDespawn(object): Despawns a spawnedobject. Provide the name of the spawned object. Spawned objects usually have"(Clone)" appended to the end of their names. You can omit"(Clone)" in this command.

•KillerWavesDespawnKillable(killable): Despawnsa killable object. You can omit "(Clone)".

•KillerWavesDestroyKillable(killable[,scenarioName]): Destroys a killable object. You can omit "(Clone)".

•KillerWavesAddAttackPoints(killable,pointsToAdd): Adds attack points to a killable. You can omit"(Clone)".

•KillerWavesAddHitPoints(killable,pointsToAdd)(): Adds hit points to a killable. You can omit "(Clone)".

•KillerWavesTakeDamage(killable, damagePoints):Does damage to a killable. You can omit "(Clone)".

音序器的命令

集成包中添加下列顺序的命令。你可以使用它们的任何动画序列。

?killerwavespausewave():暂停电流波。

?killerwavesunpausewave():unpauses的电流波。

?killerwavesendwave():两端的电流波。

?killerwavesgameover():结束所有波。

?killerwavessynchrospawn(产卵):讲述一个产卵产卵单一对象。提供的产卵鱼的名字。

?killerwavesdespawn(对象):despawns衍生对象。提供了对象的名称。产生的对象通常有“(克隆)”添加到他们的名字的结尾。你可以省略”(克隆)”这个命令。

?killerwavesdespawnkillable(杀死):despawns一杀的对象。你可以省略”(克隆)”。

?killerwavesdestroykillable(杀scenarioname[,]):摧毁一个杀的对象。你可以省略”(克隆)”。

?killerwavesaddattackpoints(杀死,pointstoadd):增加攻击指向一个被杀死。你可以省略”(克隆)”。

?killerwavesaddhitpoints(杀死,pointstoadd)():增加命中点的一个被杀死。你可以省略”(克隆)”。

?killerwavestakedamage(杀死,damagepoints):一个杀的伤害。你可以省略”(克隆)”。


Realistic FPS Prefab 1.21(这个版本在国内交流论坛里是可以下载到的,国内网友们还是很有爱的!!)

Integrationsupport files for Azuline Studios' Realistic FPS Prefab system are located inThird Party Support/Realistic FPS Prefab Support. (Azuline Studios' RealisticFPS Prefab is required.) This includes menu items to add support components tothe FPS Player, NPCs, and pickups. The menu is located in Window > DialogueSystem > Component > Integration > Realistic FPS Prefab.

 

DisablingNPC Gameplay During Conversations

In theexample scene, there is a dialogue NPC named "Sad Robot". Examine hisAI script properties. The attack range property is set to 0. This forces theNPC to just sit there and never attack. To do the same thing at run-time,you'll need to write a short script to set the properties. It can respond tothe OnConversationStart() and OnConversationEnd() messages sent by the DialogueSystem.

 

A moregeneral option is to use the Set Enabled On Dialogue Event component to disablethe AI script during conversations, and then use the sequencer commandAnimation() to play the Idle animation (or whatever animation is appropriateduring the conversation).

 

You cando this all in a sequence, in fact, without having to add any components to theNPC. For example, you could use a sequence like this on the NPC's firstdialogue entry:

 

SetEnabled(AI,false); LookAt(listener); Animation(idle); Delay(2)

 

Thissequence:

 

1.Disablesthe AI component,

2.Rotatesthe NPC to look at the listener, and

3.Playsthe NPC's idle animation.

4.Thenit delays for 2 seconds to give the player time to read the NPC's first line.

At theend of the conversation you'll need to re-enable the AI script. You can do thiswith a sequencer command or, probably easier, using Set Enabled On DialogueEvent, triggered On Conversation.

在伊比工作室的现实的FPS预制系统集成支持文件位于第三方支持/现实的FPS预制的支持。(伊比工作室的现实的FPS预制是必需的。)这包括菜单项添加到FPS玩家,支持组件的NPC,和皮卡。菜单位于窗口> > > >对话系统组件集成的现实FPS预制。

 

在游戏过程中禁用NPC对话

 

在示例场景中,有一个对话的NPC命名为“悲伤的机器人”。检查他的AI脚本性能。攻击范围属性设置为0。这迫使NPC只是坐在那里,从不攻击。在运行时做同样的事情,你需要写一个简短的脚本来设置的属性。它可以应对onconversationstart()和onconversationend()对话系统发送的消息。

 

一个更一般的方法是利用设置对话事件组件在对话过程中禁用脚本启用,然后用音序器命令animation()发挥闲置动画(或其他适当的动画是在谈话中)。

 

你可以做这一切在一个序列中,事实上,不必对NPC添加任何成分。例如,你可以使用一个像这样的序列在NPC的对话的第一个条目:

 

setenabled(AI,false);查看(听众);动画(空闲);延迟(2)

 

这个序列:

 

1禁用智能组件,

 

2。旋转NPC看听众,和

 

3发挥人大的闲置动画。

 

4。然后延迟2秒给球员时间读人大的第一行。

 

谈话结束时你需要重新使AI脚本。你可以做一个音序器的命令或,可能更容易,利用设置对话事件启用,触发的谈话。

Lua OnPick Up Item

TheLuaOnPickUpItem.cs script can be attached to any Pickup object. When the playerpicks up the object, this script will run a Lua command. In the example scene,the Shotgun Pickup uses this script to display a gameplay alert message.

 

Lua OnDestroy

TheLuaOnDestroy.cs script can be attached to any object. When the object isdestroyed, the script will run Lua code. You can add this to an enemy to updatethe kill count when the enemy is destroyed.

 

LuaBridge

On theFPS player, the Set Active On Dialogue Event and Set Enabled On Dialogue Eventcomponents deactivate and reactivate FPS components during conversations. Youcan automatically set this up using the menu item Window > Dialogue System> Component > Integration > Realistic FPS Prefab > Disable PlayerOn Conversation.

 

LuaBridge

TheFPSLuaBridge.cs script synchronizes data between the Realistic FPS Prefabplayer and the Dialogue System's Lua environment. It automatically synchronizesbefore and after conversations, and you can synchronize manually usingSyncFPSToLua() and SyncLuaToFPS().

 

It usesthe following values in the Lua environment:

 

•Actor["Player"].hitPoints: Currenthit points.

•Actor["Player"].maximumHitPoints:Maximum hit points.

•Actor["Player"].hungerPoints:Current hunger points.

•Actor["Player"].thirstPoints:Current thirst points.

◦Note:Player Actor Name defaults to "Player", but you can change it if thename of your player actor is different in your dialogue database.

•Variable["</c><em>(weapon-name)</em><c>"](for each weapon): A Boolean (true or false) indicating whether the player hasthe named weapon.

◦Example:Variable["Shotgun"] == true is true when the player has the shotgun.

◦Example:Variable["Shotgun"] = false takes the shotgun away from the player.

•Variable["</c><em>(weapon-name)</em><c>_Ammo"](for each weapon): An integer indicating how much ammo the player has for theweapon.

•If the player name or any weapon names havespaces, those spaces will be replaced with underscores (_) in Lua.

Thisscript also hides the HUD during conversations if you tick Hide Hud InConversations.

 

Theexample scene's "Sad Robot" conversation checks whetherVariable["Shotgun"] == true. If it's true, it offers the player theoption of giving the shotgun to the sad robot. If the player gives the shotgunto the sad robot, the conversation runs the scriptVariable["Shotgun"] = false to remove the shotgun from the player'sinventory.

 

The"Happy Robot" conversation tests giving and taking weapons and ammo,and reporting health.

 

If youenter the back of the house, you'll trigger the "Kill 4 Zombies"quest. This uses the Quest Trigger component to start the quest and Lua OnDestroy on each house zombie to increment the kill counter. Another QuestTrigger outside each door of the house checks the status of the quest.

 

You maynotice two quirks:

 

1.Thezombie kill count sometimes increases on its own. This is just due to thedesign of the example scene taken from the Realistic FPS Prefab samples. Forsome reason it kills zombies on its own at times.

2.Whenyou reload a level, all zombies in the old level are destroyed, triggeringtheir Lua On Destroy events that increment the kill count. To prevent this inyour own project, call PersistentDataManager.LevelWillBeUnloaded() beforeloading or reloading a level. This tells components such as Lua On Destroy toignore the OnDestroy message that's generated when an old level is unloaded.

 

Lua对接项目

 

该luaonpickupitem.cs脚本可以连接到任何拾取对象。当玩家拿起对象,该脚本将运行一个Lua命令。在示例场景,猎枪拾取使用此脚本显示游戏警报消息。

 

Lua对破坏

 

该luaondestroy.cs脚本可以连接到任何对象。当对象被销毁,脚本将运行lua代码。你可以添加到敌人杀死计数更新时,消灭敌人。

 

Lua桥

对FPS玩家,设定积极的对话,在对话事件组件的事件停用并重新激活FPS组件在谈话中启用。你可以自动设置使用菜单项窗口> > > >对话系统组件集成的现实FPS预置>禁止球员在谈话。

Lua桥

该fpsluabridge.cs脚本同步现实的FPS预制的球员和对话系统的Lua环境之间的数据。它会自动同步之前和之后的谈话中,你可以使用syncfpstolua()和syncluatofps()手动同步。

使用下列值在Lua环境:

?演员[“玩家”]。当前生命值的生命。

?演员[“玩家”]。maximumhitpoints:生命值。

?演员[“玩家”]。hungerpoints:电流饥饿点。

?演员[“玩家”]。thirstpoints:渴点电流。

?注:玩家的演员名字缺省为“玩家”,但你如果你的球员的演员的名字是你在对话中数据库的不同改变它。

?变量[“</C><em>(武器名称)< / EM><C >”](每个武器):一个布尔值(true或false)指示是否这个球员有命名的武器。

?例如:变量[“猎枪”] = =真是真的当球员有枪。

?例如:变量[“猎枪”] = false以猎枪远离球员。

?变量[“</C><em>(武器名称)< / EM><C > _ammo”](每个武器):一个整数,球员有多少弹药的武器。

?如果球员的名字或任何武器的名字空间,这些空间将被替换下划线(_)Lua中。

此脚本也隐藏HUD的谈话中,如果你勾选隐藏HUD交谈。

示例场景的“悲伤的机器人“会话检查是否变[“猎枪”] = =真。如果这是真的,它提供给玩家的猎枪伤心的机器人的选项。如果玩家给猎枪到悲伤的机器人,会话运行脚本变量[“猎枪”] = false从球员的库存将霰弹枪。

“快乐的机器人“谈话试验的给予和接受的武器和弹药,和报告的健康。

如果你进入房子的后面,你会触发“杀4个僵尸”的任务。使用任务触发组件开始追寻和Lua对每一家僵尸增加杀反破坏。另一个在门口检查任务触发任务的状态。

你可能会注意到两个怪癖:

1。僵尸杀死数有时会增加自己的。这是由于来自现实的FPS预制样品的示例场景设计。由于某种原因,它杀死僵尸在自己的时代。

2。当你加载一个水平,在旧的水平,所有的僵尸被破坏,破坏,触发Lua增量杀死计数的事件。为了防止这种在你自己的项目,叫persistentdatamanager。之前的水平levelwillbeunloaded()或重新加载。这告诉部件如Lua对摧毁无视onDestroy消息生成的一个老水平时,卸下。


Integrationsupport files for VisionPunk's Ultimate FPS (FPS) are located in Third PartySupport/UFPS Support. (VisionPunk's UFPS is required.) Two levels ofintegration are provided: Shallow and Deep.

 

SimpleIntegration Example

TheShallow example uses Dialogue System features such as Set Enabled On DialogueEvent to switch between UFPS gameplay mode and dialogue mode.

 

DeeperIntegration Example / Script Documentation

TheDeep example uses UFPS features to suspend UFPS gameplay and interact with anNPC to start a conversation, synchronizing UFPS data between UFPS and theDialogue System. This includes menu items to add support components to the FPSPlayer, NPCs, and pickups. The menu is located in Window > Dialogue System> Component > Integration > UFPS.

 

On theDeep example's AdvancedPlayer, these scripts were added via menu items:

为visionpunk的终极FPS集成支持文件(FPS)位于第三方支持/ UFPs的支持。(是必需的。visionpunk的超微粒子)提供了两个层次的整合:浅及深。

 

简单的集成的例子

 

浅的例子使用对话系统的特点,如设置对话事件使开关之间的超微粒子的游戏模式、对话模式。

 

更深层次的整合的例子/脚本文件

 

深的例子使用了超微粒子功能暂停UFPs的游戏和NPC开始一个对话的互动和对话,超微粒子系统之间的混沌同步数据。这包括菜单项添加到FPS玩家,支持组件的NPC,和皮卡。菜单位于窗口> > > >对话系统组件集成的超微粒子。

 

在深的例子的advancedplayer,这些脚本,通过添加菜单项:

On theDeep example's AdvancedPlayer, these scripts were added via menu items:

 

•FPFreeze Player: Freezes gameplay and showsthe cursor during conversations. The Freeze() and Unfreeze() methods are alsoused by the example scene's main menu.

◦HideHUD: Tick to hide the UFPS HUD during conversations. (Default is ticked.)

◦FreezeDuring Conversations: Tick to freeze the UFPS player during conversations.(Default is ticked.)

•FPPersistent Player Data: Records the player'sposition, health, and inventory. When loading a game, this component uses UFPSmethods to restore the position.

◦OverrideActor Name: (Optional, defaults to "Player") If not set, thecomponent uses the game object's name as the name of the actor in the LuaActor[] table. If your actor is named differently in the Lua Actor[] table(e.g., the actor has a different name in Chat Mapper or the DialogueDatabase),then set this property to the Lua name.

◦RecordPosition: Tick this checkbox to record the player's position when savingpersistent data.

◦ForceWield: Tick to force the player to wield the current weapon after loading agame. Some custom weapons won't aim properly unless they go through the wieldanimation.

◦DontApply Lua Next Load Level: Tick this to skip applying the player's saved infofrom Lua on the next level load. Normally you want to apply the saved info sothe player's health, inventory, etc., persist across levels. However, if you'rerestarting the level with a fresh instance of the player (e.g., if the playerdied), set this true or the player will receive his old stats, such as zerohealth.

•FPSync Lua Player On Conversation:Synchronizes the player's health and inventory in UFPS with the inventory inthe Dialogue System's Lua environment so conversations can check and manipulateit. This script uses FPPlayerLuaBridge.cs, which does the actualsynchronization. You can use FPPlayerLuaBridge.cs separately from FPSync LuaPlayer On Conversation in your own scripts, too. It synchronizes:

◦Actor["Player"].Health:The player's current health.

◦Actor["Player"].TotalSpace:The total capacity of the player's inventory. (read-only)

◦Actor["Player"].UsedSpace:The current used space in the player's inventory. (read-only)

◦Actor["Player"].RemainingSpace:The current remaining space in the player's inventory. (read-only)

◦Actor["Player"].CurrentWeaponIndex:The index of the player's currently-equipped weapon.

◦Variable["Pistol"],Variable["Revolver"], etc. for all weapons defined in the player'svp_Inventory. If the value is 0 or nonexistent, the player does not have theitem. If the value is 1 or higher, the player has the item, and the numberindicates the amount of ammo. If you set a value during a conversation, thechange will be reflected in the UFPS player at the end of the conversation.

◦Variable["Pistol_Units"],Variable["Revolver_Units"], etc.: The amount of ammo loaded into eachweapon.

◦Variable["Bullet"],Variable["MachinegunBullet"], etc.: The amount of ammo held by theplayer (outside of weapons).

◦NOTE1: The inventory system changed in UFPS v1.4.7. The variables above representthe values as used in UFPS 1.4.7+ using the new vp_Inventory system. Toaccommodate these changes, FPPlayerLuaBridge was changed to a MonoBehaviour.You must assign the valid inventory item types to the bridge component (seebelow).

◦NOTE2: FPPlayerLuaBridge assumes that the scene has a Dialogue Manager object. Theeasiest way to ensure this is to tick Dont Destroy On Load and Allow Only OneInstance on the Dialogue Manager object to enable it to persist across scenechanges. If there is no Dialogue Manager object, FPPlayerLuaBridge will set theplayer's health to 0. This will make the player unkillable because UFPS onlychecks for death if the player takes damage that changes his health from apositive number to 0 or less. Since his health is already 0, the deathcondition is never met.

在深的例子的advancedplayer,这些脚本,通过添加菜单项:

 

?fpfreeze球员:冻结的游戏和显示光标在谈话。该freeze()和unfreeze()方法也由示例场景的主菜单使用。

 

?隐藏HUD:蜱隐藏UFPs的HUD在谈话。(默认是勾。)

 

?冻结在对话:蜱冻结UFPs的球员交谈。(默认是勾。)

 

?fppersistent玩家数据:记录的球员的位置,健康,和库存。当加载游戏时,该组件使用的超微粒子的方法恢复的位置。

 

?替代演员的名字:(可选的,缺省为“玩家”)如果没有设置,使用组件的游戏对象的名称在Lua演员表[ ]的演员的名字。如果你的男演员在Lua演员[ ]表不同的命名(例如,演员在聊天或dialoguedatabase映射名称不同),然后将此属性设置为Lua的名字。

 

?记录的位置:勾选这个复选框来记录玩家的位置在保存数据持久性。

 

?力的运用:蜱迫使玩家使用当前武器后加载游戏。一些自定义的武器不会目的适当除非他们通过使用动画。

 

?再应用Lua下负荷水平:请跳过应用玩家保存的信息从Lua对下一级荷载。通常你想要应用保存的信息让球员的健康,库存,等,坚持在水平。然而,如果你的球员的一个新实例的水平重新启动(例如,如果玩家死亡),设置为true或玩家会收到他的旧数据,如零健康。

 

?fpsync Lua球员谈话:同步球员的健康,在对话系统的Lua环境UFPs的库存,库存的谈话可以检查和操作。这个脚本使用fpplayerluabridge.cs,并实际同步。你可以从fpsyncLua球员在自己的脚本fpplayerluabridge.cs单独谈话,太。它同步:

 

?演员[“玩家”]。健康:玩家当前的健康。

 

?演员[“玩家”]。totalspace:玩家的库存总容量。(只读)

 

?演员[“玩家”]。usedspace:目前使用的空间在玩家的库存。(只读)

 

?演员[“玩家”]。remainingspace:目前剩余空间在玩家的库存。(只读)

 

?演员[“玩家”]。currentweaponindex:玩家的当前装备的武器的指数。

 

?变量[变量“手枪”],[“左轮手枪”],等在玩家的vp_inventory定义的所有武器。如果该值为0或不存在,玩家没有项目。如果该值为1或更高,玩家有项目,和数字表示的弹药量。如果你设定一个值时的谈话,变化会在谈话最后反映在超微粒子的球员。

 

?变量[“pistol_units”],[”变revolver_units”],等:加载到每个武器弹药的数量。

 

?变量[变量“子弹”],[“machinegunbullet”],等:弹药的玩家持有量(外武器)。

 

?注1:在超微粒子v1.4.7改变库存系统。上述变量的代表值采用新的vp_inventory UFPs 1.4.7 +系统。为了适应这些变化,fpplayerluabridge改为MonoBehaviour。您必须指定有效的库存项目类型的桥组件(见下文)。

 

?注2:fpplayerluabridge假定现场有一个对话管理器对象。确保这是蜱不要破坏载荷和允许在对话管理器对象只有一个实例,使其持续整个场景变化的最简单的方法。如果没有对话管理器对象,fpplayerluabridge将玩家0的健康。这将使玩家杀不死的因为UFPs只检查死亡如果玩家要损害他的健康,改变从正到0或更少。由于他的健康已经是0,死亡的情况是前所未有的。

 

•FPPlayer Lua Bridge: (Automatically added byFPSync Lua Player On Conversation and FP Persistent Player Data.) This classsynchronizes data between UFPS and the Dialogue System's Lua environment.Methods are virtual so you can override them if you want to create a subclassthat does additional processing. You must add all UFPS item types that will besynchronized with Lua to this component's Usable Items Types list.

On theNPC, Private Hart, a child object named "AI" contains these components:

 

•FPInteractable Dialogue: Derived fromvp_Interactable, this component makes the NPC interactable within the UFPSframework. When the player interacts with the NPC, this component sends anOnUse message to the NPC. If the NPC has a Conversation Trigger configured tolisten for OnUse, it will start a conversation.

•Conversation Trigger: Starts the conversationwhen FPIteractable Dialogue sends an OnUse message to the NPC.

•Set Enabled On Dialogue Event: Disables theFPInteractable Dialogue component during conversations.

•Persistent Position Data: Records the NPC'sposition.

On theDialogue Manager object (which is marked to persist between level changes),this component was added:

 

•FPSync Lua Player On Load Level: Syncs theplayer's saved Lua data to the UFPS player components after a level has loaded.This component should usually be added to the Dialogue Manager object, not theplayer object. This is because it needs to persist across level loads. Theplayer's position is not applied from Lua, but the inventory and other statsare.

?fpplayer Lua桥:(由fpsync Lua球员谈话和FP持续的玩家数据。自动添加)这类同步超微粒子和对话系统的Lua环境之间的数据。方法是虚拟的所以你可以绕过它们,如果你想创建一个类,做额外的处理。你必须把所有的超微粒子的项目类型,将与lua到此组件的可用物品类型列表同步。

 

在全国人大,私人哈特,子对象命名为“艾”包含这些组件:

 

?fpinteractable对话:来自vp_interactable,这个组件使得人大在超微粒子框架交互。玩家和NPC的相互作用时,该组件发送一个消息给onuse人大。如果NPC对话触发配置为侦听onuse,它将启动一个对话。

 

?对话触发:开始谈话时,fpiteractable对话发送一个消息给onuse人大。

 

?设置对话事件启用:禁用fpinteractable对话部件在谈话。

 

?持续数据记录位置:人大的位置。

 

在对话管理器对象(这是显着的持续变化,此组件之间)加入:

 

?fpsync Lua球员对负荷水平:同步玩家的保存Lua数据UFPs的球员组成一级加载后。这个组件应该通常被添加到对话管理器对象,不是玩家对象。这是因为它需要在水平荷载作用下的坚持。球员的位置不应用Lua,而库存和其他属性。

SharingAdditional Data

SharingAdditional Data

You maywant to share additional data between UFPS and the Dialogue System. One way todo this is to put that information in the Dialogue System's Lua environmentusing the Lua.Run() method. If you set a user variable usingPixelCrushers.DialogueSystem.Lua.Run(), then dialogue entries can check and/orchange the value.

 

Forexample, NPC conversations can branch based on whom the player has killed, orwhat UFPS items the player has in his inventory (seeFPSyncLuaPlayerOnConversation.cs).

分享更多的数据

 

分享更多的数据

 

你可能想分享的超微粒子和对话系统之间的附加数据。这样做的一个方法是把这些信息在对话系统使用Lua Lua环境run()方法。如果你设定一个用户变量使用pixelcrushers。dialoguesystem。lua。run()对话,然后条目可以检查和/或改变值。

 

例如,NPC对话可以分基于谁也杀了,或者是超微粒子的球员在他的库存物品(见fpsyncluaplayeronconversation。CS)。

Savingand Loading

See theexample menu script (ExampleMainMenu.cs) for a simple example of how to saveand load. In brief, call PersistentDataManager.GetSaveData() to get the savedgame data (including UFPS data). Call PersistentDataManager.ApplySaveData() toload a game by feeding previously-saved game data back into the Dialogue Systemand UFPS state.

 

If theplayer can switch between levels in your game, you may also want to use theLevelManager script as shown in the example menu script.

保存和加载

 

看到菜单例子脚本(examplemainmenu。CS)为一个简单的例子,如何保存和加载。总之,叫persistentdatamanager。getsavedata()得到保存游戏数据(包括超微粒子数据)。呼叫persistentdatamanager。applysavedata()加载游戏以前保存的游戏数据送回到对话系统和超微粒子的状态。

 

如果玩家能在游戏之间的电平转换,你也可以使用levelmanager脚本作为例子中显示的菜单脚本。

Pre-GameLevel Selection Scenes

If thefirst scene of your game does not have a UFPS player object and a DialogueManager object, you'll have to take an extra step. Here's the background:

 

Whenevera new level is loaded, the FPPlayerLuaBridge applies the Lua data to UFPS data.

 

•[New Level Loaded]

◦Lua–> UFPS

Whenswitching between gameplay levels, the FPPlayerLuaBridge in the old level savesthe UFPS data to Lua. Then the new level applies the Lua data to UFPS.

 

•[Old Level]

◦UFPS–> Lua

•[New Level Loaded]

◦Lua–> UFPS

比赛前的水平选择的场景

 

如果你的游戏的第一个场景没有UFPs的玩家对象和对话管理器对象,你必须采取额外的步骤。这里的背景:

 

当加载新的关卡,这fpplayerluabridge应用Lua数据UFPs的数据。

 

?【新水平加载]

 

?Lua–>超微粒子

 

游戏级别之间切换时,在旧的水平fpplayerluabridge节省UFPs的数据到Lua。那么新的水平将lua数据超微粒子。

 

?[水平]老

 

?超微粒子–> Lua

 

?【新水平加载]

 

?Lua–>超微粒子

If yourlevel selection scene does not have an FPPlayerLuaBridge, it will not saveUFPS–>Lua.

 

Toaddress this, you'll need to add some starting values to the dialogue database.These Lua environment will be initialized with these values.

 

On theActors tab, add a field named "Health" to the Player. Change its Typeto Number. Set the Value to the player's starting health. In the example below,the player starts with 42% health.

 

To setthe player's current weapon, add a field named "CurrentWeaponIndex".Change its Type to Number. Set it to the weapon index (e.g., 1=Pistol,2=Revolver, etc.). In the example below, the player's current weapon is 1(Pistol).

如果你的水平选择场景并没有一个fpplayerluabridge,它不会保存的超微粒子–>Lua。

 

为了解决这个问题,您需要添加一些初始值的对话数据库。这些Lua环境将这些值初始化。

 

在演员表,添加一个字段名为“健康”的球员。更改其类型数。将该值设置为玩家的起始健康。在下面的例子中,玩家从42%健康。

 

设定玩家当前的武器,加入一场名为“currentweaponindex”。更改其类型数。它设置为武器的指标(例如,1 = 2 =手枪,左轮手枪,等)。在下面的例子中,玩家的武器是1(手枪)。

To setthe player's inventory, add variables on the Variables tab. In the examplebelow, the player has a Pistol with 11 units loaded, and 38 extra bullets.

设置游戏者的库存,在变量标签添加变量。在下面的例子中,玩家有一把手枪与11个单位负载,和38个额外的子弹。


Thenames of the variables are defined above in the Deeper Integration Example /Script Documentation section.

变量的名称被定义在更深层次的整合的例子/脚本文件。

UFPSMobile-Addon

Supportfor the UFPS Mobile-Addon is in the package UFPS Mobile Addon Support. When youimport this package, it will add a Scripts folder and an example foldercontaining a two-level mobile demo.

 

To beable to switch between levels, you must add 'Mobile Level 1' and 'Mobile Level2' to the build settings. For the example main menu's Restart Game button towork, you must make 'Mobile Level 1' the first scene in the build settings.

 

Theexample uses Unity GUI for the example menu and dialogue UI, but you couldimplement a dialogue UI using UFPS Mobile's vp_UI. An implementation that usesvp_UI is planned for a future release of this support package.

 

Theexample menu is accessed through the mobile demo's menu. The Dialogue SystemMenu object (which contains the example menu script) is a child of the DialogueManager object.

超微粒子的移动插件

 

的UFPs移动插件支持包中的超微粒子的移动插件支持。当你引入这个包,它会添加一个脚本文件夹和含有两个移动演示一个例子文件夹。

可以切换之间的水平,你必须添加“移动1级和2级的移动的生成设置。例如,主菜单的重新开始游戏按钮的工作,你必须移动1级在建造设置第一现场。

该示例使用Unity GUI例如菜单和对话界面,但你可以利用超微粒子移动的vp_ui实施对话界面。一种实现使用vp_ui计划在将来发布此支持包。

例菜单是通过移动演示的菜单访问。对话系统”菜单中的“对象”(包含菜单例子脚本)是一个孩子的对话管理器对象。

Followthese steps to set up up the Dialogue System with the UFPS Mobile Addon:

1.Addan AdvancedPlayerMobile and RootUI to each scene. These objects don't seem tosurvive across scene loads very well.

2.Connectthe AdvancedPlayerMobile's vp_SimpleHUDMobile fields to the RootUI as shownhere:

遵循这些步骤,建立了超微粒子的对话系统移动插件:

1。添加一个advancedplayermobile和rootui到每个场景。这些对象没有生存在现场负载很好。

2。连接advancedplayermobile的vp_simplehudmobile领域的rootui如下所示:


3.Addthese components to AdvancedPlayerMobile:

◦FPFreezePlayer

◦FPPlayerLuaBridge

■Add all usable item types to the Usable ItemTypes list.

◦FPSyncLuaPlayerOnConversation

◦FPPersistentPlayerData(if you want to save the player's position)

4.Addthese components to the Dialogue Manager:

◦FPSyncPlayerOnLoadLevelMobile(a mobile-friendly version of FPSyncPlayerOnLoadLevel)

TheFPPersistentPlayerData and FPSyncPlayerOnLoadLevelMobile components are only necessaryif your player will be switching levels or saving and loading games.

3到advancedplayermobile添加这些成分:

 

?fpfreezeplayer

 

?fpplayerluabridge

 

■添加所有可用的项目类型,使用的项目类型的列表。

 

?fpsyncluaplayeronconversation

 

?fppersistentplayerdata(如果你想节省玩家的位置)

 

4。在对话管理器中添加这些成分:

 

?fpsyncplayeronloadlevelmobile(移动版fpsyncplayeronloadlevel)

 

如果你的球员将切换水平或保存和加载游戏fppersistentplayerdata和fpsyncplayeronloadlevelmobile组件是必需的。

UFPSAI-Addon

NOTE:The UFPS AI-Addon support package is still provided but is no longer underdevelopment.

 

Thisseparate package contains UFPS AI-Addon integration files. The sub-folders are:

 

•Scripts: Interactable script for dialogue withAI-Addon controlled NPCs. Add this script to your AI-controlled NPCs instead ofFPInteractable Dialobue.

•Example: A variation on the UFPS Support scenein which Private Hart is controlled by AI-Addon.

UFPSand UFPS AI-Addon must be installed in your project. You must import both UFPSsupport packages.

超微粒子的AI插件

 

注:UFPs的AI仍然提供插件支持封装,但不再是在发展。

 

这个单独的包中包含了超微粒子的AI插件集成文件。子文件夹:

 

?脚本:脚本插件交互AI控制的NPC对话。将此脚本添加到您的AI控制的NPC不是fpinteractable dialobue。

 

?例如:一个变化对超微粒子的支持的场景,私人哈特艾插件控制。

 

超微粒子和超微粒子的AI插件必须安装在您的项目。你必须进口超微粒子的支持包。

Glossary

Actor:A participant in a conversation. Also called a conversant.

 

Alert:A gameplay message. See: Alerts

 

articy:draft:articy:draft by Nevigo is a game project organization and writing tool.

 

articy:draftConverter: A Dialogue System tool that converts articy:draft projects intodialogue databases. See: articy:draft Converter

 

Bark: Asingle line of dialogue spoken outside of an interactive conversation. See:Bark System

 

BarkUI: The user interface component (attached to the character speaking the bark)that displays the bark. See: Bark System

 

ChatMapper: Chat Mapper by Urban Brain Studios is an industry-standard tool forwriting and testing nonlinear dialogue.

 

ChatMapper Converter: A Dialogue System tool that converts Chat Mapper projectsinto dialogue databases. See: Chat Mapper Converter

 

Condition:A Lua statement that evaluates to true or false. Links can have conditions. Ifthe condition is false, then the link cannot be followed at the current time.

 

Conversation:A collection of linked dialogue entries.

 

DialogueDatabase: An asset file containing all of the data required to runconversations, including actors, items, locations, variables, andconversations. See: Dialogue Creation

 

DialogueEntry: A line spoken by an actor. May consist of text and/or a sequence.

 

DialogueManager: The Dialogue System "engine," a game object in your scenethat runs conversations.

 

DialogueUI: The user interface component that displays alerts and conversations. See:Dialogue UI

 

Link: Aconnection (possibly conditional) from one dialogue entry to another.

 

Localization:The process of adapting a project to a particular language. See: Localization

 

Lua: Asimple scripting language available in Chat Mapper and the Dialogue System toprovide extensive control of conversations. See: Lua

 

Quest:A goal or subgoal in a game. See Quest Log System.

 

QuestEntry: A subgoal within a quest. Quest entries are optional, but may be usefulto break down a quest into smaller steps for the player. See Quest Log System.

 

Sequence:A series of commands that perform typically visual/audio actions, such asmoving the camera and playing animations and audio. Every dialogue entry canplay a sequence when the character delivers a line. See: Sequencer

 

Trigger:A component that performs an action under a specified condition. Triggers canstart conversations, barks, or sequences when triggered. Or they can performother actions when conversations, barks, or sequences start or end. See:Triggers

 

演员:会话中的参与者。也被称为一个熟悉的。

 

警告:一个游戏的消息。参见:警报

 

articy:汇票:汇票articy:nevigo是一个游戏项目的组织和写作工具。

 

articy:草案转换器:对话系统的工具转换为articy:起草项目对话数据库。看:articy:草案转换器

 

树皮:一个单一的口语对话的交互式会话的外边线。参见:皮系统

 

树皮的用户界面:用户界面组件(附性格来讲树皮)显示树皮。参见:皮系统

 

聊天聊天的映射:映射城市脑工作室是一个行业标准的编写和测试工具的非线性对话。

 

聊天器转换器:对话系统工具转换映射为数据库项目对话聊天。参见:聊天映射变换器

 

条件:一个Lua语句返回true或false。链接可以有条件。如果条件为假,则链接不能在当前的时间之后。

 

对话:集合与对话的条目。

 

对话:数据库包含所有所需的数据运行的对话,包括演员,项目,地点,变量的一个资源文件,和对话。参见:对话创造

 

对话录:线由一个演员说。可以包含文本和/或一个序列。

 

对话管理器:对话系统”引擎,”一个游戏对象在场景中运行的谈话。

 

对话的界面:用户界面组件显示通知和对话。参见:对话界面

 

链路:连接(可能是有条件的)从一个对话进入到另一个。

 

定位:适应项目特定语言的过程。参见:定位

 

一个简单的脚本语言Lua:聊天制图和对话系统的对话提供了广泛的控制。参见:Lua

 

任务:在游戏中的目标或子目标。看到任务日志系统。

 

任务:在追求的一个目标进入。探索项目是可选的,但可以被分解成较小的步骤,寻找有用的球员。看到任务日志系统。

 

序列:一系列执行视觉/音频行动的命令,如移动摄像机和播放动画和音频。每个对话进入可以扮演一个序列的性质时,传输线。参见:音序器

 

触发:一个组件执行一个动作在特定条件下。触发器可以开始交谈,树皮,或序列时,触发。或者他们也可以执行其他动作时的对话,树皮,或序列的开始或结束。参见:触发器

Recipes

Thispage contains an assortment of solutions developed for and by other DialogueSystem users.

此网页包含解决方案开发和其他用户的对话系统分类。

------------------------------------------------------------------------------------------------------------------------------------------

这一篇先到这,刚刚截图工具又罢工了,我人还没到下呢,它先倒下了,这篇先到这,重启电脑,之后进入下一篇。


The powerful, top-rated dialogue system used in Disco Elysium, Crossing Souls, Jenny LeClue, Last Epoch, The Last Door, and many many more, the Dialogue System for Unity makes it easy to add interactive dialogue and quests to your game. It’s a complete, robust solution including a visual node-based editor, dialogue UIs, cutscenes, quest logs, save/load, and more. The core is a lean, efficient conversation system. A large collection of included, optional add-ons make it quick and easy to drop conversations into your project and integrate them with other assets. No scripting required. Complete C# source included. Demo | Docs | Tutorials | Forum Free Extras | Free Trial Cinemachine & Timeline Integration! Editor: Visual, node-based dialogue editor Importers for Chat Mapper, articy:draft 1/2/3, Twine, Ink, Neverwinter Nights, Talkit, and CSV Export screenplay format, voiceover asset list, CSV, Chat Mapper, and more I2 Localization support Engine: Dynamic, branching conversation trees Barks and alerts Cutscenes (audio, animation, etc.) Quick Time Events (QTEs) Quest system NPC status & relationship system Easy language localization Save/load without scripting Optional Lua scripting and variable system Comprehensive documentation and tutorials Runtime UIs: GUI-independent; works with all GUI systems, including Unity UI & NGUI Built-in support for Unity UI, NGUI, TextMesh Pro, legacy Unity GUI, & more Input system-independent; works with Unity Input, Rewired, New Input System, etc Modular interfaces: swap in your own UI or cutscene system Several beautiful, fully-customizable UI skins Detailed sci-fi environment & animated model Works in 2D and 3D Works in VR (Oculus Rift, Vive, GVR, etc.) Integration: Components for drop-in integration into existing frameworks Cinemachine & Timeline Action-RPG Starter Kit Adventure Creator Animator Timeline Editor articy:draft Behavior Designer Bolt Visual Scripting
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值