Javascript Nerds: Build out the transcription of a Branching Scenario

Just curious.

Has anyone come up with a solution to capture the transcript of a Sales or Customer Service branching scenario.

In my mind, you'd have a varTranscript variable then constantly appends to itself when the learner is making choices.

http://stackoverflow.com/questions/1288095/append-to-string-variable

Sounds doable.

However, I'm not getting much use from SL's text variables because of the type breaking ... so using them just for transcription building seems excessive.

Now, if my text variable was killing 2 or 3 birds with one stone (odd saying), this makes perfect sense; why not add transcription capture along the way...

I'm sure this has been done. If not. Food for thought.

4 Replies
Steve Flowers

Pretty easy I think... :) You'd want to setup a function to make this easy to call. You could even set it up to add to the transcript whenever the "choice variable" changed.

appTran=function(){
var player=GetPlayer();
//grab the current transcript first
var cTran=player.GetVar("varTranscript");
//grab the new item
var addIt=player.GetVar("varNewItem");
player.SetVar("varTranscript",cTran+"<br/>"+addIt);
}

Now you could call the function whenever varNewItem changed.

When variable changes varNewItem execute JavaScript:

appTran();

 

Steve Flowers

Another note. SL variables displayed within %references% can support limited HTML elements. <br/><b></b><i></i> should all work. This makes your transcript possibly even cooler. 

<b>Nice choice!:</b> DSFDSFSDFDSFS

<b>Pack your box and wait for your escort</b> SDF SDFD FSDF DSF DSFDS

<b>facepalm</b> DSFSD FSDFD SFSD FSFS