Tutorials
-> AtmoScripter -> Help
How do i start?
Begin by downloading the ajscripter.zip or ajscripter.rar. Thus
far, AJScripter has been compiled to run on Windows only. If you
have another operating system and have a Java JDK version installed
on your machine, you can also run the application using the ajscripter.jar
file. Unzip to a particular folder and run the ajscripter.exe.
You ought to see the picture below:
To being creating a new javascript file, click on the File->New
Project menu button.
Lets run through a sample scenario to help you get started!
Scenario 1
Say you wish to add a new atmosphere Model.aer to your Atmosphere
world. With this Model, you wish to attach a message to it so that
anytime a user clicks on it, the message prints in the chat box.
Step 1 -- Define An Action!
The action in this instance is to "print messages in the chat
box". We set this up in AJScripter as follows:
1. Click the Add Object button. A window will popup. Specify the
type of object you wish to add (in this case, it is a "Model.aer")
and click "ok". The model we wish to add is named "box.aer".
2.
Select the newly added "box.aer". A new panel will open in the
center.
3. Select the kind of action we wish to undertake. In this
case, we click to enable the "Print message to chat window" check
box.
A new panel will open on the right hand side.
4. Enter in your message.
Eg "Hello world!".
5. Click "Save & Close" to save your action.
What have we done so far? We've simply specified an "Action".
There are two types of object interaction concepts with AJScripter
- "Actions" and "Triggers". Actions behave a particular way in
the world, and Triggers cause the action to execute. Next step,
specifying a "Trigger" for our Action.
Step 2 -- Define a Trigger!
6. Click to enable the "On click trigger" check box. A new panel
will open up on the right hand side.
7. Select "box.aer <model.aer>" option in the new panel. This will
present for you a list of available actions that you can specify
to be triggered. Note: only Actions with enabled checkboxes will
be listed.
8. Select the "Print messages in chat window" option from the action
listing
9. Click the arrow button to move the action into the list of actions
to be triggered.
10. Click "Save".
Done! You have now set your trigger up. What is left? Having AJScripter
auto-generate the javascript for us that you will use for your
Atmosphere world.
Step 3 -- Auto-Generate Script
11. From the menu bar, select Javascript->Generate. A new window
will pop up. Currently, it is empty.
12. Click "Regenerate" to auto-generate the javascript. You will
see it appear in the box. You may edit this script if you so feel.
13. "Save File" to whereever you wish. Eg "world.js". Import the
.js file inside your Adobe Atmosphere Builder and attach the script
to an anchor and we're done!
Actions and Triggers
In the sample Scenario 1, we saw how to add a simple action and
trigger to an object. So
trigger = box.aer (onclick)
action = box.aer
(print message to chat)
It is possible in AJScripter to assign different actions to different
triggers. For example,
trigger = sphere.mtx (proximity)
action = actor (move to position)
action = box.aer (
rotation continuosly)
And so forth. Play around with it and see what you can do!
Multi-User synchronisation
AJScripter allows multi-user synchronisation via Shared Objects
in Atmosphere. Basically, this mean that if "synchronisation" is
enabled, other users within the world will be able to see what
actions have been triggered from within your world (and vice versa).
To enable synchronisation, it is a quick 3 step process:
1. In the menu bar, click Objects->Enable Synchronisation. Make
sure the little dot next to the name is on - this means that object
synchronisation is ON.
2. For each trigger that you wish other users to be sent the actions
for, enable the checkbox "Enable Shared Objects Synchronisation". Only
triggers with this box enabled will have synchronisation.
3. Click "Save".
Now, auto-regenerate & save your code - instant synchronisation
via shared objects!
Please note: For multi-user synchronisation capability within
an Atmosphere world, you will need to have specified in your world
the "Adobe Community
Server". This might be typically something like "yacp://atmosphere.adobe.com".
Trouble?
If you are having any troubles with things not mentioned on this
page such as :
- Attaching a script to a world
- Adobe Community Server
There are a range of reading materials out there. I'd start with
http://www.roce.org/articles.html or
go to the Adobe
Forums and ask a question :)
|