Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Text cleanup (<tt> is deprecated and also unsupported and also ugly)

...

After creating a new example and saving the .plist file, to make it load automatically every time the NPCEditor is started from the Virtual Human Toolkit launcher is sufficient to modify the NPCEditor launching script that is found in svn_vhtoolkit/trunk/tools/launch-scripts/run-toolkit-npceditor.bat and then re-compile vhtoolkit.sln.  If you want to make this change without having to re-compile, edit the file bin/launcher-scripts/run-toolkit-npceditor.bat.
In that script change the pointer from the default plist file to your new plist file.

...

To modify the default behavior and move the tossing from the end of the utterance to the beginning of the utterance, move the two selected lines from the method <tt>npcBehavior_done</tt> to npcBehavior_done to the method <tt>npcBehavior_begin</tt> as npcBehavior_begin as displayed in the following image:

...

To debug the dialog manager script one can add logging instructions. To do that one has to add this import: <tt>import import com.leuski.af.Application;</tt> and  and use the following expression to log something: <tt>ApplicationApplication.getLogger().warning(a.toString());</tt> where <tt>a</tt> is  where a is the object we want to print in the log.

The log is saved in <tt>$HOME$HOME/AppData/Local/Temp/edu.usc.ict.npc.editor.EditorMain.0</tt>0

If you are unsure on the location of the log file, you can use tools like Process Explorer.

An additional way to debug it is by using the debugging capabilities of an IDE. With IntelliJ is easy to import the project directly from the source checked out of the svn repository. It figures out most of the dependencies (but not all). Just try to recompile all projects, and resolve one by one the errors the compile gets (that are unresolved symbol errors) by including in the dependencies of the project, the module that implements the symbols (classes) unresolved.

The <tt>main</tt> main method to run to get the NPCEditor is the one in the class <tt>trunktrunk\core\NPCEditor\editor\src\java\edu\usc\ict\npc\editor\EditorMain.java</tt>.java

IntelliJ can also debug Groovy together with Java (the dialog manager script is written in Groovy).

To recompile NPCEditor just run <tt>ant</tt> from ant from the directory <tt>trunktrunk\core\NPCEditor</tt>.NPCEditor

If you use this way to debug NPCEditor, you may want to disable the NPCEditor row in the launcher so that only the instance started from IntelliJ is present.

...

Another way to handle state changes is by keeping track of the state in the dialog manager script.
When the user says or types something, the classifier receives it and returns the list of most appropriate answers.
This list is what the expression <tt>List<Map<String List <Map<String,Object>> answers = engine.search(global.domainName, event);</tt>
returns (near the top of the method <tt>public public boolean vrSpeech_asr_complete(Event event)</tt>. Each answer is an object of form <tt>Map<StringMap<String,Object></tt>Object .

Within the script itself, one can keep a state variable, then the state can be changed based on the list returned by the classifier (i.e. <tt>answers</tt> answers) and a particular reply can be sent to the virtual agent.
To send a particular reply, we can change the value associated with the key 'ID' of the element in <tt>answers</tt> that answers that we want to send to the virtual agent for speach speech production and animation.
Each answer in the 'Utterances' tab in the NCPEditor has an 'External ID' column. So, to send the utterance we want, just get it's ID (that is the value of the 'External ID' column, this should have be manually stored in the state variable), then pick one of the objects in <tt>answers</tt> answers , change the value associated with the key 'ID' to the 'External ID' selected and send the modified object using the <tt>send</tt> method send method.