Procedural Methods Overview 

• The Methods panel of the Alice 3 Code Editor contains the tiles used for the creation of the program code.

• The Methods panel has two tabbed sections, Procedures and Functions.

• Procedures can generally be described as methods that perform an action.

 

Procedural Methods and the Object Menu

• The Procedure tab will display the procedures available for the object selected in the Object Menu found at the top of the methods panel, which displays the objects that have been added to the scene. 

• It should be noted that the keyword this refers to the Scene object.

 

Procedural Methods and the Editor

• To add a procedure to your program all you need to do is drag it into the code editor panel in the empty space available.

• When a procedure is added to the code editor a series of sub-menus will appear depending on the arguments required to execute the instruction.  

 

Editing a Procedural Method

• Instructions may be modified by clicking on the yellow argument components that have a small arrow next to them.  Selecting these components will bring up a drop down menu showing the available options for substitution.

• An instruction may be deleted from the editor by right-clicking on the instruction and choosing delete from the menu, or by dragging the instruction tile to the methods panel.

• Right-clicking on a procedural instruction tile in the editor will provide options to 

o Delete the instruction tile

o Disable and enable the instruction tile.  Disabling code will omit it when running your programming.  This is a good way to disable parts of your code to focus on testing specific procedures when debugging your program.

o Copy the tile to the clipboard

 

Details options for Procedural Methods 

• Almost every Alice procedure has an optional details argument associated with it. These details modify the way the procedure behaves in some way. The most common details include 

o Duration specifies how long the animation will take, 

o Style specifies how the animation executes, 

o As seen by specifies the point-of-view the animation will use to execute.

• Some procedural methods will have other details options. For example, the say instruction will provide options for altering the text that appears in eth speech bubble

 

Categories of Procedural Methods

• Text Bubble Procedures – include say, think which generate text bubbles for the character or prop to say or think something

• Position Procedures – provide different forms of movement throughout the scene.

o It should be noted that the moveTo procedure will move the object so that it is in the same location as its target in the scene, aligning its pivot point with the pivot point of the target object.

• Orientation Procedures – provide different ways of changing the orientation of an object in the scene.

o It should be noted that the orientTo procedure will aligns the object so that it is facing the same direction as the target object, but remain in its current position

o moveAndOrientTo combines the moveTo and orientTo procedures so that an object moves to the same location as the target object, and will face the same way.

• Size Procedures – allow an object to be re-scaled along the different dimensions of the object.

o It should be noted that most re-sizing of Alice objects is proportional. 

• Appearance and Atmosphere Procedures – allow you to change the visual aspects of the object such as color or opacity

• Vehicle Procedures – allows you to attach an object to another object to mirror it’s movements.

• Audio Procedures – allow you to add sound to your world.  

• Timing Procedures –  allow you to do things related to when things happen.  Delays come in useful for helping synchronize when things should happen in the world.  

• Other Procedures – modify the various properties of an Alice object such as straightenOutTheJoints of an object which brings a character back to their starting pose after having been manipulated.

• Custom Procedures – The area found at the top of the Procedure tab will list custom procedures that you have created under the different class categories shared by the object.