18
 
  Object scripting
 

If we talka bout object scripting, then we talk about adding descriptions and actions to the objects you have built.

There is a huge range of actions and functions that can be used, consisting of triggers, commands, booleans,etc. , in any case you will have to learn them first, this is how you can start learning them :

When entering the world AWSchool you will find in the ground zero landing zone a teleport-sign "Tutorial Park" , which teleports you to location 35N 30E. Here you will find an overview of teleports signs, which will bring you to all kinds of tutorials in AWSchool : from beginner till advanced tutorials. There are also signs with url-links to the Activeworlds Wiki pages http://wiki.activeworlds.com/ . You can also find additional information on the help pages in the tabsheet menu (F9). Or you can continue reading the create-pages here in AWTimes.

 

Description field and action field

We choose the model floor50h.rwx,right-click and go to the object properties window. If you type nothing in the Description field, then you will see the grey text "none". But as soon as you type a text in this field, then you will see this text in the world, as soon as move with your mouse over this object. If you however typed a blank space, then you will also see a little yellow screen with a blank space when you do a mouse-over. If no text is needed , then you should see the grey text "none" , and delete the blank text by pressing the backspace key.

In the Action field, we will type the action command , and here you can type all kinds of commands which will modify the object or which will do "an action" upon the object. In this example , the model gets another texture.

This picture is the teleport-sign "tb_sign303.rwx" in the world AWSchool which will bring you to the Tutorial Park. The text in the description field is not onlyupon the object, but when doing a mouse-over, you will see this text upon a little yellow screen. : The text in the description fileld have been typed on seperate lines, which will make a nice aligned presentation of the words upon the sign-object.

In the Action Field, we can see that the command consists of several parts, each part starts with a "trigger" : the most common triggers are "create" and "activate".

Triggers

The trigger "create" executes a command as soon as the object will be viewed by the video card of your computer : this is when the object starts to load into the 3d environment e.g. receive another texture, another color, another size.

The trigger "activate" executes a command as soon as you click upon the object . When you make a mouse-over upon such an object , then your mouse cursor will change into a hand.

The trigger "bump" executes a command as soon as your avatar bumps against the object with the bump command.

The trigger "adone" executes a new command after an animate command has been completed. With the adone command you can make a sequence of action commands. (e.g make a domino game animation).

There are still other triggers : sdone, at , collide, enter zone , exit zone . See AWWiki :

http://wiki.activeworlds.com/index.php?title=Object_Scripting#Triggers

Using more triggers in 1 action command

When you have 2 or more action commands starting with the same trigger , then the 2 triggers commands are seperated by a komma , and the trigger name is not repeated the 2nd time. When you have 2 or more action commands but with other triggers, then those triggers will be seperated by a pointkomma :

"create scale 3" and "create color red" will be typed in the action field as :
"create scale 3 , color red"
"create scale 2" and "activate rotate 3" will be typed in the action field as :
"create scale 2 ; activate rotate 3"

In this example of the object tbpictglobe.rwx in AWSchool , you have this action-command using a mask upon a texture. This mask command is part of the texture command and in this case, we don't type a komma, because we only type a komma when a new command begins with the same trigger.

Booleans

In some command you can use the flag boolean : and you can choose between yes/true/on and no/false/off. Some examples :

create solid off
create visible no

Commands

There is a wide range of commands and each have their specific function:

Animation animate , astart, astop, frame , seq
Audio midi , noise, sound
Cosmetic alpharef, color, envi, matfx, opacity, picture, sign , shadow , texture
Interactivity examine, group, link, lock, name , say , tag, timer
Lighting corona, light
Physics addforce, addtorque, ballsocket, collider, colltag, hinge, reset, velocity
Transforms move, rotate , scale, shear, skew, solid, visible
User camera, teleport, teleportx , warp
Web media, url , web

See AWWiki about object scripting and see which commands can be used in combination with the flags"global " and "name".

http://wiki.activeworlds.com/index.php?title=Object_Scripting