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

Dustin's UamVar Tutorial

From UamWiki

Welcome! This tutorial will look at how to use UamVars, a (relatively) simple alternative to so much Python and SDL.

This assumes that you've had some experience with making Ages with 3dsmax. If not, you'll probably want to check out some of the other tutorials first: Creating Ages

Getting Setup

You should already have 3dsmax setup and Cyan's plugin setup with it. I'll assume you've got the output folder set to C:\PlasmaTest\, but if you don't, just use your path in place of what I use within this tutorial.

You'll also need the python files for 3dsmax. Don't worry though, you don't need to edit them! This page has links to the downloads of the various versions. Grab the newest one and save it in C:\PlasmaTest\. Unzip it there, so that it creates a folder called "C:\PlasmaTest\python\" and places a bunch of .py files in it. Test if it worked as follows:

  • Start 3dsmax
  • Create a dummy
  • Use the component manager to create a Logic->PythonFileMod and attach it to the dummy
  • Use the component util and it should have a "Python" box for this component, and within it there should be a "Python File" drop-down box with a ton of Python files listed, including "UamVar_Button".

Creating a Linking Book

  • Use your regular modeling skills to create the rudiments of the Age, and model a book for the player to click on.
  • Select your book model, and use the ComponentManager to add a Detector->Clickable to it.
  • In the ComponentUtil, there are some options, which are fine except for the "Required Region" Either:
    • a) check "Ignore" and the book will be clickable from anywhere in the Age, or
    • b) Create a Box (that you want the avatar to have to be in) around it and attach a Detector->RegionSensor to it.
      • Then go back to your Clickable component and click the "Must be in this region" box and select your RegionSensor box.
  • Now comes the UamVars part:
    • Create a dummy and name it something that makes sense, like UamVarsGalamayBook.
    • Attach a Logic->PythonFileMod to it, and set the PythonFile to UamVars_Button
      • Then the "UamVars_Button" box comes up, with options for "The clickable thing" and "Uamvar to set when clicked"
      • Set "The clickable thing" to your Clickable from above.
      • Set the "Uamvar to set when clicked" to something meaningful, like "galamay_book_clicked". By choosing a lowercase first letter, we tell it that this is a local Uamvar, so other players won't know when it's clicked. (Which is what we want, because otherwise everyone would have the Galamay book pop up when someone clicks it!)
    • Attach another Logic->PythonFileMod to it, and set the PythonFile to UamVars_LinkingBook
      • Set the "Uamvar to trigger book" to "galamay_book_clicked", because we want it to listen to the Uamvar that the Clickable is setting.
      • Set the "Age name" to "Galamay" and the "Spawn point" to "LinkInPointDefault" (LinkInPointDefault is always a fine choice, unless you have a particular place within the Age in mind!)
  • That should work! You should now be able to click on the book and it should pop up and let you link there. (Provided of course that you have the Age installed.)