trigger

Hi,

I wonder if anyone could help me. I want to trigger something in storyline when a variable changes, however, the variable change needs to be done through javascript using 'execute javascript' on another trigger. It works fine if the variable is changed by storyline but I can't seem to get it working when the variable change is done though javascript. Is this possible?

Any help would be much appreciated.

Thanks,

Will

5 Replies
Will Morris

Hi Dennis,

Thanks for your response. 

This is the code:

var player=GetPlayer();

player.SetVar("changingVar","true");

Basically the question I'm asking is, if I have a trigger set up to fire when a variable changes, and I then change that variable through javascript, will the trigger still fire as it would if I had changed the variable with a storyline 'adjust variable' action?

Thanks,

Will

Dennis Hall

Hi Will:

I see what you aer up to now. Thanks fo rthe sample.

You are looking to round-trip the var back to Storyline if I am correct.

Rather than explain this myself, here is an excelent link that will help you out. You will need to apply this solution to your requierment, however, I'm sure you will be able to since the solution demonstrated represents the this working in an area of storyline that supposts teh least possible Javascript abilities.

BTW: I have done this and it works and can be adapted easilly to other scenarios.

https://elearningenhanced.com/blog/2012/07/03/round-tripping-variables-storyline

Best Regards,

Dennis Hall