Avatars & Bots

Gestures and animations

How to trigger avatar gestures

How to apply any animation as a full body gesture

How to decide whether they are sitting/standing (2.6+)

Child & Teenage Avatars

Non binary avatars

Voices and Text to Speech

Changing voices and voice gender

How can I adjust voices so they sound different using rate and pitch?

Localization

Using Multiple Languages for One Actor in ChatMapper

Can I make my player character switch languages?

Switching localization through dialogue

Picture-in-picture

Is there an option to add a picture-in-picture to allow this other character to jump in and help for a minute?

How do I execute a script before a node is displayed?

How to use a One-Line-Of-Text Bot for the default template bots

FAQ

I’m using a actorID to control a bot from ChatMapper but the bot doesn’t follow instructions

Gestures and animations

How to trigger avatar gestures

See Scenario Gestures.

In short, you can include the following in a ChatMapper dialogue node:

Hey[gesture=wave] I’m over here!

How to apply any animation as a full body gesture

For the player

LB.avatarController.triggerAnimation(player(),"dance","auto","FULL");

For a bot (see Scenario Finding Items doc for full details)

LB.avatarController.triggerAnimation(LB.avatarController.findAvatar({externalId:"botadfb40bc02bf47c25e936978c"}),"dance","auto","FULL");

For a full list of available gestures see the spreadsheet.

How to decide whether they are sitting/standing (2.6+)

In version 2.6+, a hotspot’s settings will include a field called posture. This can be set to stand or chair (for seated posture).

The field can be edited by entering edit mode, then clicking on the “cog” icon of a hotspot.

In the dialog that opens, find the posture field, and set the desired value. Afterwards, click the green Save item button (at the bottom right of the dialog).

From version 2.9 onwards, the following postures are supported

  • stand (this is the default posture)
  • chair
  • sleep_back
  • zen_sit
  • wall_sit
  • wall_stand
  • stool
  • rail
  • floor_sit

Child & Teenage Avatars

Depending on your target audience or scenario you may require younger avatars or bots. This is not a feature currently supported, however there is a script call you can make to achieve this.

To make the player character an avatar, you can execute this:

Var playerAvatar = player();

playerAvatar.skeletons[0].skeleton.bones[0].scale.copy(new THREE.Vector3(0.84,0.84,0.84));
playerAvatar.skeletons[
1].skeleton.bones[0].scale.copy(new THREE.Vector3(0.9,0.9,0.9));
playerAvatar.skeletons[
2].skeleton.bones[0].scale.copy(new THREE.Vector3(1.2,1.2,1.2));

For any other bot, you can do something similar. You will need to substitute MY_ACTOR_ID for the actorID of your target avatar.

var botAvatar = LB.Actions.getTargetAvatar({actorId:"MY_ACTOR_ID"});
botAvatar.skeletons[
0].skeleton.bones[0].scale.copy(new THREE.Vector3(0.84,0.84,0.84));
botAvatar.skeletons[
1].skeleton.bones[0].scale.copy(new THREE.Vector3(0.9,0.9,0.9));
botAvatar.skeletons[
2].skeleton.bones[0].scale.copy(new THREE.Vector3(1.2,1.2,1.2));

Non binary avatars

Avatars with non-binary gender are supported from versions 2.16 onwards. In earlier versions, they might be displayed incorrectly.

Voices and Text to Speech

Changing voices and voice gender

See Scenario Audio – Speech, SFX, Ambient 

How can I adjust voices so they sound different using rate and pitch?

See How to Make Actors using the Same Voice Sound Different in See Scenario Audio – Speech, SFX, Ambient

Localization

Using Multiple Languages for One Actor in ChatMapper

See Scenario Audio – Speech, SFX, Ambient 

Can I make my player character switch languages?

Yes. You will want to create a CAF for Dialog Nodes called “second_language” of type Boolean.

Check it in all the nodes in which the player has to change language.

 

In the first node of the first conversation, add this in the script editor of that node:

var malePrimaryVoice = '';
var femalePrimaryVoice = '';
var maleSecondaryVoice = '';
var femaleSecondaryVoice = '';

window.setInterval(function(){
   
if(LB.cmPlayer.ds.currentNode.Fields.second_language == 'True') {
     
if(player().gender == 'm') {
       LB.cmPlayer.ds.actors.Player.Voice = maleSecondaryVoice;
     }
else {
       LB.cmPlayer.ds.actors.Player.Voice = femaleSecondaryVoice;
     }
   }
else {
     
if(player().gender == 'm') {
       LB.cmPlayer.ds.actors.Player.Voice = malePrimaryVoice;
     }
else {
       LB.cmPlayer.ds.actors.Player.Voice = femalePrimaryVoice;
     }
   }
},
1);

You should change the first four lines to include the voices you want. For instance, if you wanted the player avatar to switch between UK English and Italian, you would have

var malePrimaryVoice = 'UK English Male';
var femalePrimaryVoice = 'UK English Female';
var maleSecondaryVoice = 'Latin Female'; // Because of a bug, "Italian Male" is currently called "Latin Female" 
var femaleSecondaryVoice = 'Italian Female';

Switching localization through dialogue

Assuming your localizations are called “spanish” and “en_EN”, you can switch by using this script in any node:

LB.cmPlayer.ds.activeLocalizationField = 'en_EN';

LB.cmPlayer.ds.activeLocalizationField = 'spanish';

Picture-in-picture

Is there an option to add a picture-in-picture to allow this other character to jump in and help for a minute?

Version 2.12+

Since version 2.12 PiP can appear and disappear automatically, only requiring one CAF to set up for Actors (Project -> Project Settings -> Custom Asset Fields -> Actors):

  • Title: isPIP
  • Type: Boolean
  • Default value: False

By checking this field on the avatar you want to appear in PiP mode, the avatar will be shown automatically when that actor is talking, and will disappear as soon as a dialogue node with a different actor starts.

Functionality that was available before 2.12 (showPipAvatar and hidePipAvatar functions – the pipConfig field has been deprecated since version 2.12).

Before version 2.12

To enable an avatar to appear as a PiP, a CAF is required for Actors (Project -> Project Settings -> Custom Asset Fields -> Actors) with:

  • Title: pipConfig
  • Type: String
  • Default value: (leave empty)

This field should be filled with the following values for the actor that should appear as PiP:

{left:0.75,bottom:0,width:0.25,height:0.4}

The PiP will also need to be shown and hidden manually, by calling one of two functions:

  • showPipAvatar(actorID)
  • hidePipAvatar(actorID)

showPipAvatar must go in the script of the node that shows the PiP (usually the same one in which they speak). actorID is the ID of the PiP actor, so if avatar X was the first created, the function will be showPipAvatar(1). To then hide the PiP, the opposite should be called, hidePipAvatar(1), As scripts in the Script Editor pane are executed as soon as a node starts, it’s best to call the “hide” function in the node right after the one in which the PiP actor stops speaking.

In the example image above, the first node would have the showPipAvatar function, in the one afterwards the hidePipAvatar.

How do I execute a script before a node is displayed?

In the script editor there is another tab called conditions

Scripts written in the conditions tab will be executed before a node is displayed, which can be helpful if you don’t want to display the node for some reason

How to use a One-Line-Of-Text Bot for the default template bots

Edit the bot’s hotspot for Actor 2, 3, 4 or 5

In the field

avatar_onclick

Put the following, replace the actorId with the actor of the hotspot you are editing

{"action":"playCustomNode","text":"Pillow, plonk pillow![gesture=surprised]","actorId":"4","getIntoCMMode":true}

Click Save Item button

FAQ

I’m using a actorID to control a bot from ChatMapper but the bot doesn’t follow instructions

ActorID is generally the order in which an avatar has been created, starting at 1. So normally you'd have a list like this:

However:

  1. The ID for bots (i.e. avatar imported directly in the 3D environment from the Bots app) is their bot ID, e.g. "bot3c8e76329495e910c1e1784da"
  2. Actors in ChatMapper store their ID at time of creation, so if you had 5 actors and then deleted the fourth, actor #5 would still have ID=5.

© 2020 LearnBrite – Commercial In Confidence

Trademarks & Copyrights are property of their respective owners. Pictures are indicative only & may not reflect final production.

How useful was this article?

Click on a star to rate it!

We are sorry that this article was not useful for you!

Let us improve this article!

Tell us how we can improve this article?