Adding Behaviors to Objects
Using the Activeworlds Virtual Worlds System

Right-clicking on an object opens that object's property box. It is possible to type action commands into the property box so that they will be carried out when the object first comes into the world, and also so that they wil be carried out when the object is clicked on or bumped into. Many actions may be put in place there, separated by commas.

For actions to happen as soon as an object comes into the world, those actions are listed after the word, 'create'. For actions to happen when an object is clicked on, those actions are listed after the world 'activate'.

For example,

create color green, rotate 4 0 0;activate move 2 0 0 loop time=8 wait=10

will cause the object to come into the world green and rotating, and make it so when the object is clicked on it will move. Notice that while actions are separated by commas, the activate section is separated from the create section with a semicolon. Details of how these actions are specified are described below.

 

Color

Examples: "create color blue", "create color 0000FF", "create color 012345" They cause an object to be a particular color.

To see a list of color names that can be used, click here. (http://www.activeworlds.com/help/aw36/colors.html) Besides the more common color names like red, orange, yellow, green, blue, and violet, other color names can be used, like forestgreen, lightgrey, salmon, orchid, magenta, maroon, and pink.

Notice that on the list of color names that can be used, each color name has a six-character code next to it. These codes can be used instead of the color names. The reason that knowing how to work with the codes is useful is that with them it is possible to create many more colors than the colors on the name list. The way the codes work is simple, but it takes some getting used to. The best way to get used to them is to try out different combinations while keeping this in mind:

The first two characters in the code stand for the amount of red in the color, the second two for the amount green, and the third two for the amount of blue. (RRGGBB) So, for example:

  • a code 000000 means that there is no red, green, or blue in the color - it is black.
  • a color with zeros in the first two sets of pairs, and other characters in one or both of the last pair, for instance 000070, mean the color is a blue. The higher the number in that pair, the brighter the blue.

The most unusual part of this code is that the letters A - F can be used as well as the numbers 0 - 9. A stand for 10, B for 11, C for 12, up to F for 16. So the brightest blue would be 0000FF. FF00FF is a color with the brightest red and the brightest blue, mixing them. The shade of pink given on the color chart is FF6EC7, but knowing how this system works, it is possible to adjust the colors to get other shades of pink.

When an equal number is put in place in each pair, the color is a shade of grey, somewhere from white to black.

  • FFFFFF is white,
  • C0C0C0, for instance, is a light shade of grey, and
  • 505050 is a dark shade of Gary.

Again, 000000 is black. If you begin to increase the value in one of these pairs, you should begin to see a subtle shade of red, green, or blue.

For more information on the color action, look here. (http://www.activeworlds.com/help/aw36/color_command.html)

 

Rotate

"create rotate 0 4 0" will cause an object to rotate around its y axis, that is, will make it, generally, spin like a top.

"create rotate 4 0 0" will cause an object to rotate around its x axis, and "create rotate 0 0 4" will make it rotate around its z axis.

The numbers designate the number of rotations per minute, so a 4 will mean a rotation every 15 seconds. A six would mean a rotation every 10 seconds.

For more information on rotate, go here. (http://www.activeworlds.com/help/aw36/rotate_command.html)

 

Move

"create move -1 0 0 loop time=5 wait=3"

Move causes an object to move a certain distance (specifiec by the first three numbers) over a certain amount of time, then wait, and move back.

For more information on move, look here. (http://www.activeworlds.com/help/aw36/move_command.html)

 


The full help guide for actions can be found by scrolling down to Building, and then Assigning Actions to Objects, here. (http://www.activeworlds.com/help)