DSM Tea House    The DSM* Steampowered Tea Rooms and Pub. Coordinates: Yellow 1804.109S 1761.587E 0.05a 3.4              *Dark Satanic Mills

A review of some key scripting commands

In the last issue of the YG we talked about how you can use a series of scripting commands to completely alter an object, and we used a wall part w3pan_0200f.rwx. We will continue with more commands you can use on this object. We also offer some important tips relating to changes in how the AW engine works in version 5.2. And finally a few caveats we discussed before, but which are important to recall.

Manipulating a wall.

blank wall bit

Here is that wall part we worked on last time. The code used to make the wall look like this is create texture ap-pan2, scale 1 1.5 1, color tint red, opacity 0.6.

wall rotating

Now we want to do some more with it. We want to make it rotate around the Y axis. We do this adding another command to the existing string, separated by a comma as always: create texture ap-pan2, scale 1 1.5 1, color tint red, opacity 0.6, rotate 0 3 0. This command will make the wall rotate around its Y (up/down) axis at 3 revolutions per minute. You can make this rotate faster by increasing the number. Max is 50,000. (very fast indeed!) More information on the 'rotate' command may be found at http://www.activeworlds.com/help/aw51/index.html and click on the Rotate command link there.

Wall is moving

Oops. That isn't quite what I meant to do. I wanted it to move up and down. So I will need to delete the rotate command and instead use the move command, like this: move 0 3 0 loop. Like the rotate command used above, this will make the object move up and down (Y axis again) and because I put the loop flag there, it will continue to move up and down forever.

using activate trigger

Ah, but wait! I don't want the object to move like that; I would rather have it activated by someone before it moves. We can do that with the activate command. This is a trigger, which means that if a user clicks on the object, something will happen. In this case, the object will move. Now, be careful here when writing this command because triggers have to be separated by semicolons (;) and not by commas! So, our commands will now look like this: create texture ap-pan2, scale 1 1.5 1, color tint red, opacity 0.6;activate move 0 3 0 loop. Also note that when you place your pointer over an object with a trigger, the pointer turns into a hand (not shown).

opbox script

We're nearly done. I want to use our modified object as a window that users can open. So I don't want the moving up and down to go on forever, so I can use some flags to alter that. We will add to that activate command time=2 wait=5 global. This will open the window once it is clicked on. It will take 2 seconds to fully open and will close again after 5 seconds. There. That's ready to use now for my build. So now, the full script for the object will read: create texture ap-pan2, scale 1 1.5 1, color tint red, opacity 0.6;activate move 0 3 0 time=2 wait=5 global. The 'global' flag means that everyone in the vicinity can see the window opening and closing; without 'global' only the person clicking on the window will see it.

We will continue having fun with this wall in the next issue of the Gazette, with even more commands. Remember, you can do all these commands with most objects. And it's fun to play with the values; see what you can do! Do visit the AWschool, the AWHelp pages and the AW Wiki for technical details.

Some essential tips!

Using name posts
One of the techiques beloved by many of us in the past was using the command 'name' on an object, with a picture that would then be linked with that name to perhaps a hundred or so objects. The upside of this was that you didn't have to use the "create picture..." script for each object which takes up a lot of cell space. Instead, just the command 'create name [name]'. However, in AW version 5.2, this is not recommended because of the incredible lag this particular techniques causes. It can actually make some really good builds non-functional. So, if you have been using this technique in the past, you may have to go and put the 'create picture' command in all the objects and delete the 'create name' command. This takes up more characters, but will make your build load more efficiently with less lag to your visitors.

Do you have any questions on building?

Does anyone have any building questions they want answered or do you have some tips you want to share? Please telegram Ozman and also to give feedback on this article, particularly if there are any mistakes. He is doing this from experience. And as always, be sure to check the AW Help page and the related AW wiki pages for further help.

For new builders, be sure to visit AWNewbie, and AWSchool worlds for very good tutorials, on-line help from qualified teachers, and lots of very good objects.