RICOCHET INFINITY

For all things Ricochet...
It is currently Tue Jun 18, 2013 6:12 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Sequence, Simultaneous, and Random Order Sequence Scripting
PostPosted: Tue Apr 01, 2008 9:22 pm 
Offline
Ghost Buster
Ghost Buster
User avatar

Joined: Thu Jan 12, 2006 11:58 pm
Posts: 22612
Location: Tennessee, USA
Sequence

When opening a brick’s properties, the plug-ins created are all considered to be simultaneous; that is, all scripting happens at the same time. When you want a brick to follow a series of plug-ins in a specific order, you must use a sequence. Using a sequence, the brick will perform the plug-ins in the order they are listed.

For example, Let’s say you have 3 markers (named A, B, and C) on the playing field, and you want a brick to move to each of these markers. After it completes these steps, you want the brick to start over again creating an endless cycle. To do this, open the bricks properties, click on <new simultaneous plugin slot>; use the dropdown menu it provides and select “Sequence” from the Script folder. Click on the Sequence button to open it, and using the <new step slot> button, put in the following plug-ins:

1. From the Move folder, select “Move to Point”. Using the dropdown menu, change the End Point Type to “Named Object”. Use the “Pick” function to select Marker B (or type in the marker name).
2. From the Move folder, select “Move to Point”. Using the dropdown menu, change the End Point Type to “Named Object”. Use the “Pick” function to select Marker C (or type in the marker name).
3. From the Move folder, select “Move to Point”. Using the dropdown menu, change the End Point Type to “Named Object”. Use the “Pick” function to select Marker A (or type in the marker name).

By default, a sequence is set to “Repeat” when done (look at the bottom of the Sequence box). If you change this to stop, the brick will stop moving once it finishes the last step of the sequence.

NOTE: When using a sequence, it is advisable to frequently test the level to ensure it is working the way you want. The most frequent scripting errors in working with sequences is making sure plug-ins like “Move Along Path”, “Orbit”, and “Move Between Points” are set to end after a certain number of loops.

Simultaneous

The simultaneous plug-in is used when you want more than one plug-in to work at the same time. For example, let’s say you want a brick to orbit a marker clockwise for one loop, then counterclockwise for one loop. While the brick is moving clockwise, you’d like to display the text “forward”. When going counterclockwise, you’d like to display the text “backward”. To do this, open up the brick’s properties and create a sequence (see Sequence above) that has the following plug-ins:

1. From the Script folder, select “Simultaneous”. Open Simultaneous, and from the <new simultaneous plugin slot> button add the following plug-ins:
a. From the Move folder, select “Orbit”. Using the dropdown menu, change the Center Type to “Named Object”. Use the “Pick” function to select the marker you want the brick to orbit around (or type in the marker name). Under Stop, click the checkbox for “After Rotation” and put a “1” in the box next to it. Click the “Back” button on the top of the Orbit box to return to the Simultaneous box.
b. From the Miscellaneous folder, select “Display Value”. Using the dropdown menu, change the Value to “Displayable Text” located in the test folder. Type the word “Forward” into the space provided after Value Text. To make “forward” appear below the brick, change the Y: coordinate to 20 for Display Offset. Click the “Back” button on the top of the Orbit box to return to the Simultaneous box, then hit the “Back” button again to return to the Sequence box.

2. From the Script folder, select “Simultaneous”. Open Simultaneous, and from the <new simultaneous plugin slot> button add the following plug-ins:
a. From the Move folder, select “Orbit”. Using the dropdown menu, change the Center Type to “Named Object”. Use the “Pick” function to select the marker you want the brick to orbit around (or type in the marker name). Under Stop, click the checkbox for “After Rotation” and put a “1” in the box next to it. Using the dropdown menu, change the Direction to “Counterclockwise”. Click the “Back” button on the top of the Orbit box to return to the Simultaneous box.
b. From the Miscellaneous folder, select “Display Value”. Using the dropdown menu, change the Value to “Displayable Text” located in the test folder. Type the word “Backward” into the space provided after Value Text. To make “backward” appear below the brick, change the Y: coordinate to 20 for Display Offset. Click the “Back” button on the top of the Orbit box to return to the Simultaneous box, then hit the “Back” button again to return to the Sequence box.

NOTE: You cannot combine movements using simultaneous, i.e., you cannot have a brick orbit AND follow a path at the same time.

Random Order Sequence

The random order sequence is the same as using a sequence with one exception. Instead of the brick following the plug-ins in order (i.e., Step 1, 2, 3, 4, etc.), it will randomy go through the plug-ins until all have been performed, (i.e. Step 4, 1, 3, 2, etc.).

For example, Let’s say you still have 3 markers (named A, B, and C) on the playing field, and you want a brick to move to each of these markers, but you want them to move randomly. After it completes these steps, you want the brick to start over again creating an endless cycle of seemingly random moving. To do this, open the bricks properties, click on <new simultaneous plugin slot>; use the dropdown menu it provides and select “Random Order Sequence” from the Script folder. Click on the Random Order Sequence button to open it, and using the <new step slot> button, put in the following plug-ins:

1. From the Move folder, select “Move to Point”. Using the dropdown menu, change the End Point Type to “Named Object”. Use the “Pick” function to select Marker B (or type in the marker name).
2. From the Move folder, select “Move to Point”. Using the dropdown menu, change the End Point Type to “Named Object”. Use the “Pick” function to select Marker C (or type in the marker name).
3. From the Move folder, select “Move to Point”. Using the dropdown menu, change the End Point Type to “Named Object”. Use the “Pick” function to select Marker A (or type in the marker name).

When you test the level (F6), you will see that the random selection changes with each cycle.

HELPFUL TIPS

Copy/Pasting objects can be easily done by pressing Ctrl C for copy and Ctrl V for paste. However, did you know this can be easily done on the properties of the object too? A real-world example of this would be to double-click on a brick to bring up its "property window". Then, click on to create an empty slot. Put in an action...it doesn't matter which one. THEN, go back to the brick "property window" and click on the "Simultaneous PlugIn 1" to the LEFT of the action you scripted. A darker line should appear over the whole line. Then, press Ctrl C to copy this action. It can now be pasted in any other property window on another brick or object.

Sequence, Simultaneous, and Random Order Sequence plug-ins can be used with each other in many combinations. In the Simultaneous example, there were 2 uses of Simultaneous inside 1 use of sequence. You could also have sequences inside random order sequences. There really is a lot of options using these three plug-ins.

When scripting, you may realize you used a Sequence plug-in when you meant to use a Simultaneous plug-in. OR, you may realize you need to put the Sequence you’ve just finished inside another Sequence. In this instance, YOU DO NOT HAVE TO REDO ALL YOUR SCRIPTING. On the brick’s properties, where you put the sequence (or simultaneous) plug-in, look to the right of that button. There is a dropdown arrow. Click on the dropdown arrow and notice that you have the option to convert the sequence to a simultaneous, OR you can convert to where the sequence is inside another sequence. Very cool!!!

Making a sequence video

Making a random order sequence video

_________________
Image
If I don't get my Infinity, I'm going back to bed!


Last edited by BigMama on Wed Apr 02, 2008 12:35 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Sequence, Simultaneous, and Random Order Sequence Scripting
PostPosted: Fri Nov 07, 2008 6:01 pm 
Offline
Ghost Buster
Ghost Buster
User avatar

Joined: Thu Jan 12, 2006 11:58 pm
Posts: 22612
Location: Tennessee, USA
This post is now fixed correctly after the website change. :lol:

_________________
Image
If I don't get my Infinity, I'm going back to bed!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group