Important! Please read the announcement at http://myst.dustbird.net/uru-account.htm
Also! Please read the retirement announcement at http://myst.dustbird.net/uru-retirement.htm

Making Something Clickable

From UamWiki

Please note that this tutorial is quite old (one of my first, and started out simply as a note for myself). I will most likely be updating it in the near future. 1/8/2011


First you need to build your clickable object, texture it, and put it in your Age where it needs to go. Once you have done that, you need to do two more things:

Apply Scaling and Rotation Make it and actor with bounds set.

To apply the scaling and rotation, do the following. First select your object, then press the "N" key. A little box will pop up

Clicbuttut3.png

Look at the 3 little boxes that say ScaleX, ScaleY and ScaleZ. They should all say 1.0 If they don't, when you export your Age, your object will appear HUGE if you make it a clickable.

To apply the scaling and rotation, then press and hold the Cntl key, and then press the "A" key (Cntrl-A). A little box will pop up. Click on "Scale and Rotation to ObData"

Now look in the little box we called up with the "N" key. ScaleX, ScaleY and ScaleZ should now all say 1.0

Now go to the logic panel (purple smiley face). Make the object and Actor by clicking on that button, and set the bounds to Convex Hull

Clickbuttut1.png

Note: if your object is rather complex, and after following these steps your object is not clickable, you may need to change the bounds to Static Triangle Mesh.

Now that you've done that, you need to create a clickable region.

Change one of your windows to the Scripting Window (little green snake). Click on Script, then Add, the PyPRP:

Clickbuttut4.png

A new box will pop up. Click on Add a (Generic) Logic Region.

Clickbutt5.png

Now Blender has put a cube that is your region in Layer 2. You'll want to see both layer 1 and 2 at the same time. Do this by holding the shift key down, and clicking on Layer 2.

Now select the cube that is the logic region you just made.

And now rename it something meaningful and helpful, like Button1ClickRegion.

Clickbuttut2.png

Now scale and rotate the object so that it encompasses both the clickable object you made, AND where the avatar is suppose to stand to click on the object. If you don't do this, you won't be able to click on the object.

Apply the scale and rotation data by hitting Cntrl-A again.

Now go back to the logic panel, and make the region and actor, and set the bounds to Convex Hull

Note: we set the bounds on a region so that the game engine knows when the avatar is in the region.

That's it for this part. Now it's off to do scripting......


What does this do?

This is important, and will be hard to cover here, because we have so many different things that we can have the object (or the avatar for that mater) do when you click on something.

My Object Is a Journal or Linking Book:

Okay, in that case, you'll have to add the following to your ALCscript for the object:

NameMyObject:
    physical:
        pinned: true
    quickscript:
        simpleclick:
            pythonfile: MyPythonFileName
            region: MyClickRegionName

Where as "NameMyObject" is the name of your clickable object. "MyPythonFileName" will be the name of the python file you have to make for Journals and/or Linking Books. "MyClickRegionName" is the name of the clickable region we made.

The python file is normally the name of the python file that you used for the Dynamic Book Template.

Creating Linking Books And Journals

It's a button/lever/whatever and I want the avatar to animate, and something else to happen, and yadda yadda yadda yadda yadda yadda.....

Then at THIS point, I'll point you to my tutorial on using quickscripts for making animations.

Using Quickscripts for Animations Placeholder

I'm making a sit region, so the avatar will sit on the "whatever" when it's clicked on

Okay, then I will now point you to the GoW Wiki tutorial on how to make a sit region:

Sitting Regions Placeholder



Return To: Andy's Blender Tutorials