Skip to content

Instantly share code, notes, and snippets.

@anthkris
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthkris/efec7f02b3da20d914a4 to your computer and use it in GitHub Desktop.
Save anthkris/efec7f02b3da20d914a4 to your computer and use it in GitHub Desktop.
//this goes in User.js in storyline output
//creates a way to access variables made in Storyline
var player = GetPlayer();
function getVar(x) {
return player.GetVar(x);
}
//function to set variable
function setVar(x,v) {
return player.SetVar(x,v);
}
/* this goes inside of Construct 2
embed construct 2 game as a webobject instide of Storyline
construct 2 requires double quotes around the JS
use browser object in Construct to to execute javascript
match variable name to variable created in Storyline
value can be text or number, match to value needed in Storyline */
“parent.setVar(‘variablename’, variablevalue);”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment