Page 1 of 2

Where to Find Item ID?

Posted: Mon Nov 07, 2016 4:16 pm
by chrish
Although there are functions to use item name instead of item ID, where would an author find an item id for use in javascript? Previously, I thought this was by hovering over a part of a trigger for that item in the right sidebar after selecting the trigger, but this is not it.

Re: Where to Find Item ID?

Posted: Tue Nov 08, 2016 11:54 am
by tnelson
Click on the item in a scene. Hover over the Trigger in the left column and the number will show up.

Re: Where to Find Item ID?

Posted: Tue Nov 08, 2016 4:33 pm
by chrish
I'm not quite following. Do you mean right column? If so, this is the number that seems to change with each trigger rather than being specific to the item.

Re: Where to Find Item ID?

Posted: Mon Nov 14, 2016 12:41 pm
by djgagnon
There are two ways to use an item in .js

By using the item_id directly.
First, you want to open the item from the left bar,
NOT the trigger in the scenes. Then hover the mouse right underneath the X to close the window. It will like like this if you know where to hover the mouse:

Screen Shot 2016-11-14 at 12.29.47 PM.png

By using the idForItemName function

Use this anywhere in your code, after defining the ARIS object.

Code: Select all

var item_id = ARIS.cache.idForItemName(item_name);

To see this in context, check out ... board.html

Re: Where to Find Item ID?

Posted: Mon Nov 14, 2016 2:29 pm
by chrish
Alright, yes! There it is.

Re: Where to Find Item ID?

Posted: Thu Feb 16, 2017 4:13 pm
by WaterGuerrilla
Does a scene have an ID # and if so where do we find it?

Trying to implement ARISjs for the set scene command and not clear on if the string title constitutes the ID and if it requires single quotations, etc. There does not appear to be a hover-over reveal option for scenes as there are for objects.



Re: Where to Find Item ID?

Posted: Thu Feb 16, 2017 4:17 pm
by WaterGuerrilla
I think I just found it. You have to hover over it when the scene is selected from the scenes tab. To the right of the title. Would be grand if these things weren't invisible by default!

Re: Where to Find Item ID?

Posted: Thu Feb 16, 2017 4:50 pm
by WaterGuerrilla
Same question re: Quests, however, and Tabs. I can't find item ID #s for these objects.

In a specific instance, I'd like to exit to the Map. Not the Tab of the Map. The Map itself. Not clear how to proceed. Seems like this ought to be relatively straightforward. In any case, I do not find item IDs for Tabs or Quests. That makes it difficult to use js to "exit" from or to the object if I don't know what to call it.

...Still looking for that all elusive clean screen free from pages being shoved aside. Suspect that has to do with objects being associated with or subordinated to the Tabbed Menu, and will post separately on that when I have more time to focus my commentary after more testing, but I believe this post is a relevant inquiry even absent that exploration...

I'm probably missing something, but others may be in the same boat at some point so am posting.

I did not find clarity on this in the ARISjs documentation.


Re: Where to Find Item ID?

Posted: Thu Feb 16, 2017 7:27 pm
by chrish
I'm not sure I quite follow what you're looking for but I'd like to try. What is the difference to you between the map and the tab of the map? I can only think of the tab.

As far as I remember, the tabs have literal names, not ID numbers, but that could have changed since I've looked. The js looks something like aris.exitToTab(map). With this same call, you should be able to go the the quests tab, but likely not a specific quest. Maybe part of the problem is some confusion over the term "object". In ARIS objects are not entirely general. Plaques, conversations, webpages, items, these are objects. But the map is not, nor are quests.

I can see the usefulness of taking a player directly to a specific quest description. What I would do as an author is likely create a plaque to point the player to that served the goal of communicating quest information. I don't know how well this would serve your particular purpose though.

Re: Where to Find Item ID?

Posted: Thu Feb 16, 2017 9:17 pm
by WaterGuerrilla
Thanks, Chris.

Some clarification and then a response with a follow-up question, better stated.

When I route them to Exit to Map, I'm sometimes getting the Map swished aside with a white screen where the Menu is and they have to swish the Map over to make it full screen and bring the menus back. I am interpreting this result as that the focus of the Exit target is on the Menu Tabs, of which the Map is one of the defaults, and that we get stuck on the Tabbed Menu at times rather than purely proceeding through to the actual page/object directed to. Sometimes they do go purely to the Map on a full screen (which is what is intuitive and comfortable for the user, since they already have the nice little button in the upper left as a way to get back to the Menu whenever they're on the Map). So that is what I meant to imply by not routing them to the Tab but to the Map itself. I haven't been able to fully ascertain what is different about the two instances in my cases, except that I am noticing stuff accessed through the Menu, rather than from the Map, tends to get stuck on the Menu with an inelegant side-swipe that confuses our users (and me!).

I am noticing that as I gain more familiarity with the guts of the Tabbed Menu that it is sort of this thing that plays by slightly different hierarchical rules than everything else when it comes to Exiting stuff that may be nested within a Conversation that appeared/s on the Tabbed Menu. In a way, this makes sense. In another way, this has become somewhat frustrating.

Right now I am actually in the process of repurposing the Quests tab as a more functional menu within the context of our game experience. This is partly because I have discovered the tile display feature and it offers the most visually appealing interface when in tile mode, and so we are trying to nest a lot of the functions of the game through this so that they can be easily tucked away without overloading the Menu with stuff that the user doesn't need within each site challenge but does need to navigate the entire game. I am partway there. We are then using the Tabbed Menu as a way for sub-challenge features to come up and be anchored there while the player is within one site or one trek, which are the two geographic scene-scale elements of our game; the Quests tab then becomes their interface to switch scenes and pursue other sites or treks (the subcategories of our scavenger hunt across the city).

I haven't been able to successfully deploy the Set Scene javascript yet from a Quest page in this context. My interest in doing so is to use this with one of the Quest tiles so that it becomes essentially a Main Map reset, setting the scene back to our Main Map. I may end up doing away with this at some point, but for now it's important because the Main Map is our starting ARIS scene and ultimately the user could start at any geographic point in our city. Right now, I am able to accomplish this function by javascript-linking to a Conversation that serves as this Map Reset toggle switch, but that's one extra step, in effect. If I could get the Set Scene to work right from the Quests description page using javascript, then with one less click the user can be transported to the Map scene and I'd also like to route their view to the Map itself so they can zoom out to the citywide view. So that ought to be the set scene js + the exit to map js.

Question re: javascript protocols--can you nest multiple commands within one "ready block"? Or do you need to insert multiple sets of tags to order multiple commands? For example, if I can get the Set Scene to work, can I immediately add the Exit to Map js in the same tag, or do I need to insert two separate tags? Does that even work?

(I would consider throwing this code into the Continue button function, but the problem doing this from Quests is that the button is stuck being called "Begin Quest" not "Continue" and I don't want to confuse our user. I know of no way to customize the text on the Continue or Begin Quest button, though I seem to recall another person posting about that some time ago but could not find the thread.)

Finally for now, this question is practical re: js, not structural: do you know with respect to the "Map" how we reference this Tab in javascript--is it 'Map', "Map", Map, or something else? I get the ID # references and have had success routing to plaques and conversations by number, now that I know enough to play with a little js (thanks to Charles!), but I haven't yet had success routing to the Map and am uncertain if I've had success routing to other Tabs because of the swipe-aside appearance result. It could be that I am not entering the proper text string. I haven't yet tried this often enough to have definitive results, but maybe you know? Probably other javascript neophytes will have the same question at some point and I saw one example where it was 'Map' in the documentation but again could not get it to play nice for me.