Keep Informed

Entries in mice (1)

Thursday
Nov112010

Chat Session Nov. 15th 2010

[20:03] Antonius: Join me in 1hr (18:00SLT) for the MiceOnABeam User Group weekly chat! - Antonius
[20:04] Pilot McBride: Will be there......
[20:04] Pilot McBride: ISP kicked me off last week :(
[21:01] Antonius: Hello everyone!! Time for another MiceOnABeam User Group chat!
[21:01] Antonius: Welcome!
[21:01] Antonius: Who's joining us tonight? Pilot you there?
[21:02] Antonius: Brendan? Jorie? Lucy? Danuel?
[21:03] Lucy: Im here listining ^^
[21:03] Antonius: Hey Lucy!
[21:03] Lucy: Hello :D
[21:03] Antonius: I know there's a couple of others who said they'd be monitoring the chat.
[21:03] Danuel: i'm here
[21:04] Antonius: So I thought I'd try something a bit different this evening.
[21:04] Antonius: Hi Danuel. Welcome aboard.
[21:04] Antonius: I thought I'd go through a small model showing some of the main features of MiceOnABeam.
[21:05] Antonius: If you can start-up MiceOnABeam and run it along with your viewer or chat client that would be best.
[21:06] Antonius: If you can't, I've also prepared several images that you can look at on the web.
[21:06] Antonius: Interested?
[21:06] Lucy: Sure I can follow along let me start it up.
[21:07] Antonius: For those of you who are running MiceOnABeam here is the link to download the model: http://www.miceonabeam.com/storage/downloads/UsingShowMenu.dat
[21:07] Antonius: Download it to a convenient location and the open up the model in MiceOnABeam.
[21:08] Antonius: For those others, here are the set of links for the pictures:
[21:08] Lucy: downloading
[21:08] Antonius: ShowMenu1: http://screencast.com/t/nwRF86dSro
ShowMenu2: http://screencast.com/t/9G1SH4BSKf8
ShowMenu3: http://screencast.com/t/WlbVE25iBJ
[21:09] Lucy: lets see desktop is good place lol
[21:10] Antonius: Danuel: Are you going to try running MiceOnABeam? I know you're a brand-new user, but I'm here to answer questions as we go along.
[21:10] Antonius: Too bad Pilot's not here. He IM'd that he was going to join us but was having ISP problems.
[21:11] Lucy: okay got it open
[21:11] Antonius: Great. So the example we're looking at is how to use the ShowMenu model to well, show a menu and respond to it.
[21:12] Lucy: oh how you put that gray dot there thats say touch?
[21:12] Lucy: Why is it gray?
[21:12] Antonius: If you're following on the web, take a look at ShowMenu1
[21:13] Antonius: Lucy: That's called a Group Transition and it represents an event that can be taken from any of the substates within that level of the model.
[21:13] Antonius: So let's start from the beginning.
[21:14] Antonius: What I did first was drag the ShowMenu component from the Library Browser into my new model (UsingShowMenu).
[21:15] Antonius: You can drag any model that you want to use as a reusable snippet into another model. Just move your snippet or component model into your Library folder within your MiceOnABeam directory.
[21:15] Antonius: Once the ShowMenu component was in my new model then I started to connect things up with transitions.
[21:16] Antonius: First you'll notice a transition from the large black dot in the upper left corner connecting to the state ShowMenu.
[21:17] Antonius: That's called the Initial Transition and it tells the script model what state to start up in.
[21:18] Antonius: The ShowMenu component has one Entry Point and two Exit Points on it's border. That's one way you can define the component's interface, but it is not necessary in all cases.
[21:18] Lucy: Wait so how I create transition again? you put it into Handlemenu item?
[21:19] Antonius: To create a transition you first select the transition tool in the toolbar. The icon looks like a transition labeled "T"
[21:20] Lucy: right
[21:20] Lucy: but you don't add anything to it just make the line?
[21:20] Antonius: Then you click on the starting point for the transition, holding down the mouse and drag to the destination state.
[21:21] Lucy: yea
[21:21] Antonius: At first all you do is create the transition line identifying it's start and end.
[21:21] Lucy: no need to connect one going back? to the starting point?
[21:21] Antonius: So to connect up to ShowMenu the Initial Transition can just connect to the border.
[21:22] Antonius: But our other transitions are going to connect to the Entry & Exit Points.
[21:23] Antonius: Entry and Exit points can be used when the state is a Composite State, that is, it contains states within it. States within states.
[21:24] Antonius: Lucy: No, each transition is uni-directional. If you want to go back to the previous state, you have connect another transition going in the reverse direction.
[21:24] Antonius: ShowMenu is a Composite State that hides the details of creating and handling the menu within it.
[21:25] Antonius: If you're running the model, you can open up the ShowMenu state by right-clicking the state's menu and selecting Open State.
[21:26] Antonius: We can come back to discuss the inside of ShowMenu later if people are interested.
[21:26] Antonius: But that's what nice about the MiceOnABeam's ability to design using Composite States, you can hide script details when you need to.
[21:27] Antonius: At the highest level of the script, we see that we want to display a menu and do something different depending on which of the three menu items are selected.
[21:28] Antonius: Lucy/Danuel: Are you following ok? Any questions so far?
[21:29] Antonius: The IN Entry Point is how you start up the menu.
[21:30] Lucy: okay
[21:30] Antonius: As Lucy asked earlier, IN is connected to a grey transition point on the border of the state.
[21:31] Antonius: It's called a Group Transition, and it acts just as if you had connected a touch transition from each of the other states HandleMenuItemAAA, etc.
[21:33] Antonius: So what it means is that whenever you touch the prim that this script is running in, no matter what internal state it is in, the touch transition will be taken, (it's action code will be executed if any), and you will enter the ShowMenu state that will display the menu.
[21:33] Antonius: At this point a menu dialog will be displayed prompting the avatar to select one of the three menu items that have been configured for the menu.
[21:34] Antonius: So you may be (hopefully) asking, How do I set up the menu items?
[21:35] Antonius: Right now you do that by editing the properties of the ShowMenu state and assigning the required values to the variables that are described there.
[21:35] Antonius: In the next release it will be even easier as a convenient dialog will popup where you can fill in the information like on a form.
[21:36] Antonius: So to edit ShowMenu's properties, right-click and select Edit Properties.
[21:37] Antonius: The Entry Action has the instructions on the variables that need to be filled in such as MenuPrompt and MenuButtons.
[21:38] Antonius: You can see how the menu buttons AAA, BBB & CCC have been assigned, as well as the main dialog prompt.
[21:39] Antonius: There's a couple of other variables that you can set if need be, setting a timeout for the dialog for example.
[21:39] Antonius: So once you configure the ShowMenu state, you then have to connect it up to the rest of the model.
[21:40] Antonius: To do that I created a Choice Point, the diamond shaped element.
[21:41] Antonius: You use a Choice Point when you're leaving a state and you have to make a decision based on some boolean expression as to which state to go to next.
[21:42] Antonius: Note it does NOT replace all if statements in your code!
[21:42] Antonius: It's only really used when you can go to one of a number of states whenever you receive a particular event.
[21:43] Antonius: So natually after the avatar makes a menu selection you have to decide which state to go to, to handle the processing.
Join Group Chat Success!
[21:50] Antonius: Whoa- I was disconnected. Lucy, Danuel are you there?
[21:50] Antonius: I'll pick up where I left off.
[21:51] Antonius: We were at the point in the model where I was connecting up the Choice Point to decide which menu item had been selected.
[21:53] Antonius: We use the Choice Point to do this, in conjunction with outgoing transitions from the Choice Point to the specific states that we want to handle each of the selected menu items.
[21:53] Antonius: Each of the three transitions AAA, BBB, & CCC contain a Guard Condition which is a boolean expression used by the Choice Point to decide whether to take that transition.
[21:54] Antonius: The first outgoing transition whose Guard Condition evaluates to TRUE is then taken.
[21:55] Antonius: If you take a look at a Guard Condition by opening the properties for say the AAA transition, you can see that there's a test there to see if the AAA menu item was selected.
[21:56] Antonius: This is done via a State Variable, which is a variable that is global to the particular state. If you look back at the properties for the ShowMenu state, you'll see that as part of it's Exit Action, it sets the result of the menu dialog to a state variable named SelectedItem.
[21:57] Antonius: SelectedItem is then used in the Guard Conditions of the outgoing transitions from the Choice Point.
[21:57] Antonius: So at this point one of three states HandleMenuItemAAA, HandleMenuItemBBB & HandleMenuItemCCC will have been transitioned to.
[21:58] Antonius: Inside each of those states you would put the code to handle the respective menu item.
[22:01] Antonius: And now we're back where we started. The touch Group Transition is in force, and whenever the avatar next touches the prim, the model will transition back to the ShowMenu state to re-display the menu and we start again!!
[22:01] Antonius: Questions anyone?
[22:02] Antonius: I hope it wasn't too hard for some of you lurkers to follow along. :-)
[22:02] Antonius: I will post the whole transcript of the chat on the MiceOnABeam website in the MiceOnABeam User Group section, so you can review it at your leisure.
[22:03] Antonius: Again here's the link to download the model used in this mini-tutorial: http://www.miceonabeam.com/storage/downloads/UsingShowMenu.dat
[22:04] Antonius: If you have any follow-on questions, please don't hesitate to contact me.
[22:04] Antonius: Sorry for some of the communication difficulties.  Thanks for listening all!
[22:06] Antonius: Talk with you next week.