Page 1 of 1

Exit to tab from plaque

Posted: Mon Nov 28, 2016 9:29 am
by jwshin94
Hello,

I'm trying to use ARIS.exitToTab('Map') from plaque, but when I press the continue button, instead of going to tab, the text simply disappears from the plaque while still staying in the plaque mode. Is there a bug in ARISjs, or is there something else that I'm currently missing?

Thank you!

Re: Exit to tab from plaque

Posted: Thu Dec 01, 2016 4:45 pm
by chrish
There might be a problem in how it's being implemented. What does you plaque look like exactly, and are you choosing JS as the continue button function in the editor?

Re: Exit to tab from plaque—ARISJS and buttons

Posted: Tue Apr 18, 2017 1:48 pm
by chrish
I came back to this because I'm looking into the places where ARIS lets you take over a button already present in the interface via Javascript. I realize that this is what you were talking about but I didn't previously (I misread and thought you were talking about sending someone *to* a plaque *from* a conversation.

Let's see if we can unpack what your question was really about and maybe get somewhere. Running JS from many parts of ARIS seems to be possible and yet many of them are a mystery to me.

In plaques, you have three choices for the "continue" button. The default is that the button says continue and sends the player out of the plaque. Another option is to get rid of the button altogether. Watch out here as then the player has no way to exit the plaque without force quitting ARIS. The third option is javascript. I don't know what it does or how to use it. Maybe someone here does. My guess: with a bit of javascript, you can make a custom button that has custom text visible to the player and whose pressing might do any number of things. Where to put the javascript and what javascript you may or may not need to instantiate that particular button seems a mystery.

Another place in ARIS with something similar is in Quests. Again, for the button, you can choose javascript as an option, but it is unclear both where to put javascript and whether you need to bracket off or set up the particular bit that applies to just the button.

Finally, when you create an event, you have the option to "run JS". I guess that you would put javascript in the "what " box, but it's just a guess. And then the script would be run when the event is triggered, whether it is a standalone event or one that is attached to a plaque or some other object.

Re: Exit to tab from plaque

Posted: Mon Apr 24, 2017 4:17 pm
by chrish
I've got some good news!

My collaborator discovered a bit of help, waiting there all along. The thing that you'll need to make use of the JS buttons in quests and plaques is the ARIS.hook(). See the example below.

Code: Select all

<script type="text/javascript">
var ARIS = {};
ARIS.ready = function() {

ARIS.hook = function()
{
  ARIS.vibrate();
  ARIS.exitToTab('MAP');
}

}
</script>


Two other important things to note here:

1. When you want to exit to a tab, like the map, the correct usage is the name of the tab in all CAPS (e.g. "MAP"). There has been a lot of confusion over this in the past, and just today, I've fixed a couple places in the documentation that were incorrect.
2. It seems like there should be a way to retitle the buttons ("Continue" and "Begin Quest"), but I haven't been able to do this.