Difference between revisions of "Max:Clickables"

Line 1: Line 1:
{{Wikify}}
+
{{Tutorial|Clickables}}
 +
A Clickable is an in-game object that the player can click on when their circle is no longer empty, but filled with a dot in the center (giving it the appearance of a target). Clickables have numerous uses, from levers to pull to buttons to push to rocks to shove and so on. In most cases, you will also want to animate the avatar when he clicks something. The exceptions are what are called GUI Dialogs, which pop up on screen (static examples include journals, notes, Yeesha pages; there are also interactive GUI Dialogs, for which you might not want avatar animation but object animation). Many of these objects can become very complex and involved, so they will not be covered here.
  
I'm going to introduce you to "Clickables" in this tutorial. A "Clickable" is the object that the player clicks on in the game, because their cursor is hot (no longer a open circle, but looks like a target).
+
This tutorial will begin by teaching you how to turn an object into a Clickable using Max.
  
Clickables have a multitude of uses: A lever that you can pull, a button to push, a linking book to touch, the list goes on and on.
+
== Prerequisites ==
 +
You will need a sample Age to work on. You must of course be familiar with the workings of the Plasma plugin.
  
In most cases, you will want to have your Avatar animate when something is clicked. There are exceptions to this, like what we call GUI Dialogs. A GUI Dialog is when we click on something and it "pops up" for a closer view. Examples of this are:
+
=== Tutorials ===
 +
* [[Max:Getting Started]]
  
Journals, the various notes on the desk in the Baron's City Office, the notes and drawings on Sharper's desk in Teledahn.
+
== Getting Started ==
 +
This tutorial will produce a clickable that when clicked-on will link the player to another Age.
  
Those are all good examples of simple GUI Dialogs. You have interactive GUI Dialogs too, in which there is no avatar animation, but you may have object animation.
+
=== Setting the Stage ===
 +
[[File:ClickLink1.jpg|thumb|right|200px|The setup this tutorial will be using.]]You'll need to set up a few objects before you can begin making Clickables.
 +
# Create something that the avatar can click on (such as a [[Media:ClickLink1.jpg|flat plate]]). The position of this item will be extremely important if you plan on animating the avatar; for this tutorial, the box will be 3 feet high and the plate placed near the edge. Don't forget to add the object to your PageInfo. You'll probably want to rename your item to something more useful too; this tutorial will call it "LinkPlate".
 +
# Create a region for this clickable. They can be used to ensure that the avatar can not click on something from far away, for example, but are not mandatory. The region needs to be big enough to encompass the avatar (so no smaller than 3 by 3 by 6 feet). This tutorial uses a 5 x 5 x 7 box, since even though the avatar is 6 feet high, you'll want to [[Media:ClickLink2.jpg|dip the region]] just below the floor that the avatar is standing on. You can make the box transparent in Max by selecting and right-clicking it, then [[Media:ClickLink3.jpg|navigating to "Properties..."]]. In the pop-box, check the "[[Media:ClickLink4.jpg|See-Through]]" parameter under "Display Properties". You could use check "Display As Box" which will show only the lines. You might also want to rename it to something more useful; this tutorial will call it "LinkClkRegion".
  
Many of these things get very complex and rather involved, and I'm not going to cover here for now. But I will introduce you to the most important aspect of all of these: Making something "Clickable"
+
=== Adding a Region and a Clickable ===
 +
# Select your Region, then call up the Component Manager. Click on [[Media:ClickLink5.jpg|New->Detector->Region Sensor]] and attach it to your Region. Again, you might want to rename it to a better name.
 +
# Go to the Utils tab (as represented by a hammer icon) and click on the "Component Util" button. [[Media:ClickLink6.jpg|Select the Region sensor]] you've just added to your Region. This tutorial won't use more advanced parameters, and the defaults are fine, but you might be interested in this section should you wish to make something happen when your avatar enters that Region.
 +
# Select the object set on becoming a Clickable ("LinkPlate" in this tutorial) and call up the component Manager. Navigate to [[Media:ClickLink7.jpg|New->Detector->Clickable]] and attach it to your Clickable object (renaming it is advised).
 +
# While still in the Component Manager, click on [[Media:ClickLink8.jpg|New->Logic->Responder]] and attach it to your Clickable object (renaming it is advised).
 +
# Go to the Utils tab and click "Component Util". Select your Clickable component, then click on the button indicated by [[Media:ClickLink10.jpg|this arrow]]; your button should read "None". Then click on the Click Region you made in your 3D Scene. The button's label should change to reflect the name of your region. ''Alternative'': If you chose not to use a region, leave the button alone and put a check mark next to "Ignore".
 +
# Select your [[Media:ClickLink11.jpg|Responder Component]] in Component Util.
 +
# Click on the Add button under the Detectors box (as indicated by the arrow in the previous screenshot). This will open up [[Media:ClickLink12.jpg|a box]]. The Responder needs to be told what it is supposed to detect, whether it is when the avatar is in the region or when the player clicks on something.
 +
# Select your Clickable component in this box. We want the Responder to detect when the player clicks on this  object. Your Clickable component should now be in the [[Media:ClickLink13.jpg|Detectors box]].
  
----
+
=== Adding Actions ===
===Let's Get Started.....===
+
# Things can get quite complex from hereon, should you make more than one thing happen. A good example would be a lever that the avatar must pull: the responder would need to be told to animate the avatar, animate the lever, make a sound, and ''then'' activate whatever is supposed to happen afterwards, such as a rising platform, an opening door, etc. For this tutorial, no linking animation will be done and the link sequence will happen immediately.
 +
# Click on the Add button pointed to by the arrow in the preceding picture; a [[Media:ClickLink14.jpg|small box will pop up]]. You'll notice there is a plethora of options available to you; for this tutorial, click on Link. You'll notice that [[Media:ClickLink15.jpg|a lot more of information]] will have been added to the Responder component.
 +
# The game now needs to be told where your avatar will be linking too. Before doing so, however, you'll need an actual Age the avatar can link to. As such, you'll need to copy the <code>.age</code> file of that Age into the Max Output folder specified in the <code>PlasmaMAX2.ini</code> file; any Age will do for this tutorial, but remember well its name (e.g. Gahreesen's file name is actually "Garrison").
 +
# Go back to your Responder component. You need to set the linking settings now. The "Linking Rule" parameter can be left to its default setting, but you need to select your copied Age from the dropdown list under "Age Filename" (if it isn't showing up, then you didn't copy the file to the appropriate folder).
 +
# The next four boxes can be ignored; by default the avatar's Spawn Point will be the Start Point. The last box describes the animation the avatar will play once he has linked to that Age; the default option can be left.
 +
# Select once more the name of the Age the avatar will be linking too under "[[Media:ClickLink18.jpg|Parent Age Filename]]".
 +
Your Age is now ready to be exported and tested.
  
Okay, the example I'm using in this tutorial is a clickable that when the player clicks on it, he or she links out to another Age. So you will need to make something that the avatar can click on. I just threw together a large brick box, and a flat plate that is kind of like the Bahro Stones:
+
== Troubleshooting ==
 
+
If something is incorrectly done, it's quite likely nothing will work at all. There are a few common problems:
[[File:ClickLink1.jpg]]
+
* '''Your cursor is not going hot:''' something is probably wrong with the Clickable or the Region.
 
+
* '''Your cursor is going hot but nothing happens when the Clickable is clicked on:''' the Responder on the Clickable is most likely the problem, or your action (e.g. an animation, a link, a GUI Dialog, etc.) has a problem getting done.
Now, if we were going to animate the avatar for touching the plate, the positions of these things would be very important. For now I'm not too worried about it. I made the box 3 feet high and placed my metal plate on next to one edge.
+
 
+
Once you've made your stuff and textured them, do not forget to add them to your PageInfo (if you don't know how to do that, you need to go back to one of my first tutorials on getting started on building Ages in Max).
+
 
+
Now I'll be using a region for this clickable. You do not have to use a region to have a clickable work. However you can use them to ensure the player can not click on something from far away, or needs to be close to a seek point of your avatar is going to animate.
+
 
+
You'll want your Avatar completely in the box, so make sure you make it big enough to encompass the Avatar (no smaller than 3 x 3 x 6 feet). I made mine 5 feet x 5 feet wide and deep and 7 feet wide. Even though the avatar is 6 feet high, you'll want to dip the region just below the floor that the avatar is standing on:
+
 
+
[[File:ClickLink2.jpg]]
+
 
+
Now, if you're wondering how I got my region box to be nice and see through like that, here's a Max tip: When you first create your objects in Max, they'll be solid. If you need them to be see through, simply select what you've made, and right click with your mouse. You'll have a box show up like this:
+
 
+
[[File:ClickLink3.jpg]]
+
 
+
Left click where it says "Properties". A new box will pop up showing you the objects properties in Max:
+
 
+
[[File:ClickLink4.jpg]]
+
 
+
Notice where I circled. I put a check mark in See Through, and now my box looks that way. If you want it to looks like a box with just lines (regardless of the amount of mesh facings) click where it says "Display As Box" instead.
+
Making your regions look either See Through or Display As Box is a very good idea, as you know it's not something that will be rendered by Plasma.
+
 
+
Okay, now that we have our Object we are going to click on, and our Region, make sure you've named them something Useful. Leaving them as Box01, Box02, Box03, will get confusing in a hurry. I've named my clickable object "LinkPlate" and the region has been named LinkClkRegion.
+
 
+
Select your Region first. Then call up the Component Manager. As I said, Plasma uses regions to detect where the Avatar is, so click on New > Detector > Region Sensor
+
 
+
[[File:ClickLink5.jpg]]
+
 
+
And attach it to your region.
+
 
+
Also, RENAME THE REGION SENSOR you just attached. Your Plasma Components will get cluttered and confusing in a heart beat if you keep using the default names. Simply right click on the component you just attached and select "Rename" and name it something useful.
+
 
+
Now go over to the Utils Tab (the little hammer) and click on the Component Utils button. Select our region sensor you just attached to the region. You should see this:
+
 
+
[[File:ClickLink6.jpg]]
+
 
+
These are the default settings and we're going to leave them at that. We are using the region to simply detect the Avatar, not perform a function because it does detect the Avatar.
+
 
+
Now go and select your object that is your clickable. In my case it is the LinkPlate I made. Now call up the Component Manager. Click on New > Detector > Clickable
+
 
+
[[File:ClickLink7.jpg]]
+
 
+
And attach it to your clickable object. AND rename it to something useful.
+
 
+
While still in the Component Manager, click on New > Logic > Responder
+
 
+
[[File:ClickLink8.jpg]]
+
 
+
Attach it to your clickable object, and rename it something useful.
+
 
+
Now go back over to the Utils Tab (little hammer) and you Component Utils.
+
 
+
[[File:ClickLink10.jpg]]
+
 
+
As you can see from my picture, I've renamed my components to something that helps me ID them. "LinkClick" is my "Clickable" component, and "RespLink" is my Responder component. Select your Clickable component.
+
I my picture, where my arrow is pointing, your button will say "none", click on this button, and then click on your Click Region you made in your 3D Scene. Your button's name should change to the name of your region.
+
 
+
That's all we're going to do here. We've told our Clickable component that the avatar MUST be inside our region in order for the object to become a clickable.
+
 
+
If you decided to not use a region, simply leave the button that says "none" alone and put a check mark where it says "Ignore"
+
 
+
Now things are going to start getting a bit more interesting. Select your Responder Component in the Component Utils. It will look like this:
+
 
+
[[File:ClickLink11.jpg]]
+
 
+
Under the Detect box, click on the Add button (where I have my purple arrow drawn). We're going to tell the Responder what it must detect in order to respond.
+
When you click on the "Add" button, a new box will pop up:
+
 
+
[[File:ClickLink12.jpg]]
+
 
+
Now you can see why it's important to start naming your Plasma Components and not just the Objects and Materials in your Age. Our Responder is asking us to pick what it is suppose to detect: When the avatar is in the region? Or When the player clicks on something?
+
Select your Clickable component here. We want the Responder to detect when the player clicks on our object.
+
 
+
Now you should have your Clickable component in the Detect box. Go down now to the State box. We're going to tell the Responder what it is we want to happen when the player clicks on this object:
+
 
+
[[File:ClickLink13.jpg]]
+
 
+
This is where things will start getting VERY complex for you, if you are going to have more than one thing happen. A good example of that would be the avatar pulling on a lever. We would have to tell the responder to animate the avatar, animate the lever, and make a sound....THEN have whatever is going to happen after that (a door opening, a platform rising, whatever).
+
 
+
I'm going easy on you here, normally we'd have the avatar animate and reach out to the linking plate, but instead, I'm just going to have the link out sequence happen immediately.
+
 
+
Click on the Add button where my purple arrow is pointing in the pic above. You'll have a small box pop up:
+
 
+
[[File:ClickLink14.jpg]]
+
 
+
As you can see, LOTS of goodies to pick from here. Go down and click on Link. When you do, you'll have more added to the responder component:
+
 
+
[[File:ClickLink15.jpg]]
+
 
+
Now we're going to tell the game, WHERE your avatar is going to link to. But before we do you need to do something first. You need to have an Age that the Avatar is going to link to. Specifically, you need to make a copy of the .age file of that Age, and place it in your Max Output folder you specified in the PlasmaMAX2.ini file. Mine is "C:\PlasmaTest\dat"
+
I've got another test Age I'm using here in this tutorial, but you can copy and past any Uru age you want here. When you do, it's important to remember the name of the file (IE: The Maintainer Age of Gahreesen's file name is actually "Garrison", the garden Age of Eder Kemo is actually called "Garden", etc).
+
 
+
Once you have a copy of the .age file pasted, go back to your responder component. In the top box about Linking Rule, leave it set to the default for now.
+
Instead, go down to the drop box for Age Filename and select the Age you want to link too. (if nothing is showing up, it's because you didn't put the .age file in the right place).
+
 
+
The next 4 boxes, you can leave alone. Unless you know what the names of different spawn points are in an Age, it won't do you any good to change this. Right now they are set up to link the Player into the Age at it's Star Point (In Teledahn it's in the hut, in Gahreesen it's in the atrium of the small building, you get the idea).
+
 
+
[[File:ClickLink17.jpg]]
+
 
+
In that last box is the animation the Avatar will do once it has linked in to the other Age. You can leave it where it's set for now.
+
 
+
In the last box, simply select the name of your Age in the drop down box:
+
 
+
[[File:ClickLink18.jpg]]
+
 
+
And that's IT! You're done!
+
 
+
You can export, drizzle the Age, link in and walk over to your object. Your cursor should go hot, when you click, you should immediately link out, and link into the Age you specified.
+
 
+
So a summery here:
+
 
+
For an object to be clickable, you must have; The Object and a Region near or around the object.
+
 
+
The Region must be set up to simply detect the Avatar.
+
The Object MUST have the following components: Clickable and Responder
+
 
+
Now, I can tell you from other things I've been working on, that your clickable will not work right if other things are not set right. You may end up with the cursor simply never going hot, or you'll have the cursor go hot, but nothing happens.
+
 
+
The key to troubleshooting your clickable, is to know where to look. If the cursor is not going hot, chances are you have something wrong with the clickable or region. If your cursor is going hot, but when you click nothing happens, chances are you have something wrong either with the Responder on the clickable, or the actions have a problem (IE the animation, the linking, the GUI Dialog, etc, what ever it is that is suppose to happen when you click).
+
 
+
----
+
Return To: [[3DS Max and Plasma Plugin tutorials.]]
+

Revision as of 13:25, 5 April 2012

Disambig gray.png

This is a tutorial page.Versions available: PyPRP; 3ds Max; Korman.
 

A Clickable is an in-game object that the player can click on when their circle is no longer empty, but filled with a dot in the center (giving it the appearance of a target). Clickables have numerous uses, from levers to pull to buttons to push to rocks to shove and so on. In most cases, you will also want to animate the avatar when he clicks something. The exceptions are what are called GUI Dialogs, which pop up on screen (static examples include journals, notes, Yeesha pages; there are also interactive GUI Dialogs, for which you might not want avatar animation but object animation). Many of these objects can become very complex and involved, so they will not be covered here.

This tutorial will begin by teaching you how to turn an object into a Clickable using Max.

Prerequisites

You will need a sample Age to work on. You must of course be familiar with the workings of the Plasma plugin.

Tutorials

Getting Started

This tutorial will produce a clickable that when clicked-on will link the player to another Age.

Setting the Stage

The setup this tutorial will be using.
You'll need to set up a few objects before you can begin making Clickables.
  1. Create something that the avatar can click on (such as a flat plate). The position of this item will be extremely important if you plan on animating the avatar; for this tutorial, the box will be 3 feet high and the plate placed near the edge. Don't forget to add the object to your PageInfo. You'll probably want to rename your item to something more useful too; this tutorial will call it "LinkPlate".
  2. Create a region for this clickable. They can be used to ensure that the avatar can not click on something from far away, for example, but are not mandatory. The region needs to be big enough to encompass the avatar (so no smaller than 3 by 3 by 6 feet). This tutorial uses a 5 x 5 x 7 box, since even though the avatar is 6 feet high, you'll want to dip the region just below the floor that the avatar is standing on. You can make the box transparent in Max by selecting and right-clicking it, then navigating to "Properties...". In the pop-box, check the "See-Through" parameter under "Display Properties". You could use check "Display As Box" which will show only the lines. You might also want to rename it to something more useful; this tutorial will call it "LinkClkRegion".

Adding a Region and a Clickable

  1. Select your Region, then call up the Component Manager. Click on New->Detector->Region Sensor and attach it to your Region. Again, you might want to rename it to a better name.
  2. Go to the Utils tab (as represented by a hammer icon) and click on the "Component Util" button. Select the Region sensor you've just added to your Region. This tutorial won't use more advanced parameters, and the defaults are fine, but you might be interested in this section should you wish to make something happen when your avatar enters that Region.
  3. Select the object set on becoming a Clickable ("LinkPlate" in this tutorial) and call up the component Manager. Navigate to New->Detector->Clickable and attach it to your Clickable object (renaming it is advised).
  4. While still in the Component Manager, click on New->Logic->Responder and attach it to your Clickable object (renaming it is advised).
  5. Go to the Utils tab and click "Component Util". Select your Clickable component, then click on the button indicated by this arrow; your button should read "None". Then click on the Click Region you made in your 3D Scene. The button's label should change to reflect the name of your region. Alternative: If you chose not to use a region, leave the button alone and put a check mark next to "Ignore".
  6. Select your Responder Component in Component Util.
  7. Click on the Add button under the Detectors box (as indicated by the arrow in the previous screenshot). This will open up a box. The Responder needs to be told what it is supposed to detect, whether it is when the avatar is in the region or when the player clicks on something.
  8. Select your Clickable component in this box. We want the Responder to detect when the player clicks on this object. Your Clickable component should now be in the Detectors box.

Adding Actions

  1. Things can get quite complex from hereon, should you make more than one thing happen. A good example would be a lever that the avatar must pull: the responder would need to be told to animate the avatar, animate the lever, make a sound, and then activate whatever is supposed to happen afterwards, such as a rising platform, an opening door, etc. For this tutorial, no linking animation will be done and the link sequence will happen immediately.
  2. Click on the Add button pointed to by the arrow in the preceding picture; a small box will pop up. You'll notice there is a plethora of options available to you; for this tutorial, click on Link. You'll notice that a lot more of information will have been added to the Responder component.
  3. The game now needs to be told where your avatar will be linking too. Before doing so, however, you'll need an actual Age the avatar can link to. As such, you'll need to copy the .age file of that Age into the Max Output folder specified in the PlasmaMAX2.ini file; any Age will do for this tutorial, but remember well its name (e.g. Gahreesen's file name is actually "Garrison").
  4. Go back to your Responder component. You need to set the linking settings now. The "Linking Rule" parameter can be left to its default setting, but you need to select your copied Age from the dropdown list under "Age Filename" (if it isn't showing up, then you didn't copy the file to the appropriate folder).
  5. The next four boxes can be ignored; by default the avatar's Spawn Point will be the Start Point. The last box describes the animation the avatar will play once he has linked to that Age; the default option can be left.
  6. Select once more the name of the Age the avatar will be linking too under "Parent Age Filename".

Your Age is now ready to be exported and tested.

Troubleshooting

If something is incorrectly done, it's quite likely nothing will work at all. There are a few common problems:

  • Your cursor is not going hot: something is probably wrong with the Clickable or the Region.
  • Your cursor is going hot but nothing happens when the Clickable is clicked on: the Responder on the Clickable is most likely the problem, or your action (e.g. an animation, a link, a GUI Dialog, etc.) has a problem getting done.