Avatars & Bots

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

How to trigger avatar gestures

Using Multiple Languages for One Actor in ChatMapper

Voices and Gender

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

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?

Can I make my player character switch languages?

Switching localization through dialogue

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

How to apply any animation as a full body gesture

Child & Teenage Avatars

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

  • Version 2.6+ in the space settings you will have the option when editing a hotspot called posture, you may provide a value of stand or chair
  • Version 2.9 (experimental beta) supports the following postures
  • stand (default)
  • chair
  • sleep_back
  • zen_sit
  • wall_sit
  • wall_stand
  • stool
  • rail
  • floor_sit

How to trigger avatar gestures

See Scenario Gestures

TL;DR ChatMapper dialogue node:

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

Using Multiple Languages for One Actor in ChatMapper

See Scenario Audio – Speech, SFX, Ambient 

Voices and 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

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

So first you want to add a CAF to Actors (`Project -> Project Settings -> Custom Asset Fields -> Actors`) with

– Title: `pipConfig`

– Type: `String`

The rest can be empty. You then need to tell scenario when to display and when to hide the pip, and you can do so with two functions

`showPipAvatar` must go in the script of the node that shows the pip (usually the same one in which they speak). So if avatar X is the first you created, you'll have to write `showPipAvatar(1)`

to hide it you do the same but call `hidePipAvatar(1)` instead, and you would do it in the node right afterward the one in which the pip actor stops speaking

in the first node you would have the "showPip" function, in the one afterwards the "hidePip"

and one last thing: after you add the `pipConfig` CAF, you will need to set it for the avatar you want to pop up. If you click on that avatar you can write in this in that field: `{left:0.75,bottom:0,width:0.25,height:0.4}`

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

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';

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

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.

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.

player().skeletons[0].scale.copy(new THREE.Vector3(0.84,0.84,0.6));
player().skeletons[1].scale.copy(new THREE.Vector3(1,0.9,0.9));
player().skeletons[2].scale.copy(new THREE.Vector3(1.4,1.2,1.2));

© 2019 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!