Minggu, 13 April 2008

MyHomeServer Tutorials - Streaming your ITunes Music Library over the Internet from your HP MediaSmart Server

Itunes Icon

Ever want to listen to your music collection while you are at work without having to carry it around with you? Our latest tutorial shows you how to use the HP MediaSmart along with the included Firefly media server to stream your Itunes music collection over the Internet! It requires a small zipped download of 3 files and a few configuration steps and you are ready to roll. Stream your music from anywhere with Internet access and a browser.

Please Note: This tutorial assumes you have copied your music collection to the MUSIC share on the mediasmart server. See your HP MediaSmart manual on moving your music over to the MediaSmart. You should also know your router password and understand port forwarding, etc. If you are having trouble grasping the port forwarding techniques, check out some of the tutorials at TZO.COM or you can review info at PortForward.com.

STEP 1 - Download the latest Fireplay files - Download the FirePlay files here and save on a local PC or desktop PC on the same network as the MediaSmart.

STEP 2 - Open the Fireplay.zip and Copy the 3 files to the clipboard - Double click on the Fireplay.Zip file as shown below and extract the 3 files from the compressed file. You should then highlight the 3 files you extracted with your mouse, right-click and hit COPY to copy these files to the clipboard
Fireplay Zip Files

STEP 3 - Start a remote desktop session - Start a remote desktop session using a laptop/desktop that resides on the same network as the MediaSmart server. Click Start, Program files, Accessories, Communications and select REMOTE DESKTOP CONNECTION and you will see a screenshot similar to the ones shown in step 4.

STEP 4 - Connecting to the MediaSmart server using Remote Desktop - Connect to the internal LAN IP address of the MediaSmart server, or the server name such as HPServer, or in our case, we called it MyMediaSmart. Using either the LAN IP or the server name, enter that into the remote desktop connection dialog as shown in one of the two screenshots below:

Remote Desktop Connection
Using the internal IP to connect to the MediaSmart with Remote Desktop

Remote Desktop Connection
Using the server name to connect to the MediaSmart with Remote Desktop

STEP 5 - Logging into the Server using Remote Desktop - You should be see the login for the MediaSmart server using remote desktop as shown in the screenshot below. Use the administrator account and password for the MediaSmart server and it will log you into the desktop of the MediaSmart

Remote Desktop Login
Logging into the HP MediaSmart server with Remote Desktop using the administrator account

STEP 6 - Copying the files into the Firefly folder - Click on the Start menu, then Run, In the “Run” window, next to Open: type in the backslash \ (as shown in the example below) and hit ENTER or the OK button

Opening a DOS Prompt Window
Opening My Computer via the Run dialog box

STEP 7 - Open C:\Program Files\Firefly Media Server\admin-root - Now you should see the contents of the admin-root directory in the Firefly Media Server. Right click your mouse over the directory window and select PASTE and you’ll see the 3 files appear in the window as shown below.

Pasting the fireplay files into the Firefly directory
Pasting the Fireplay files into the admin-root folder of FireFly

Step 8 - Changing the Windows Firewall - You now want to use the Control Panel to get to the Windows Firewall settings. Click Start, Control Panel, Windows Firewall and you will see the main Windows Firewall screen as shown below. Click the EXCEPTIONS tab as shown.

Windows Firewall Settings
Accessing the Windows Firewall on the MediaSmart server to add port 9999

Step 9 - Adding a Port to Windows Firewall - You now want to click the ADD PORT and then enter in the information as shown in the screenshot below. We call the new port firefly “firefly” and enter in 9999 under the port number. Click OK to save.

Windows Firewall - adding port 9999
Accessing the Windows Firewall on the MediaSmart server to add port 9999


Step 10 - Checking the port was added to Windows Firewall - Check that you have added the port properly in the Windows firewall. You will see the port listed as shown in the screenshot below. Once you confirm that the port was added properly, click OK to save and close the Windows Firewall settings to get back to the desktop. You can now shut down the remote desktop session to the MediaSmart server.

Windows Firewall - checking the port was entered properly
Checking that we added the port 9999 properly to the Windows Firewall


Step 11 - Internal Testing -
You now want test the server itself to make sure that the port was properly added to the MediaSmart firewall. Using the laptop or desktop you were using in the prior steps, open up a web browser and try to get to the INTERNAL IP ADDRESS of the MediaSmart. In the example below, our MediaSmart is at 192.168.1.103. Keep in mind that your MediaSmart internal IP may be different. Try your Internal IP:9999 in your browser like our example, we used http://192.168.1.103:9999

http://INTERNALIP:9999/index.html
(Admin interface used to change the Password and other config)

and try

http://INTERNALIP:9999/fireplay.html
(Play interface used to stream audio, select playlists, etc)

This should bring up a password dialog asking for a username and password. Once you enter the username and password as shown below, the Firefly Admin or Play interface will pop up depending on the URL you choose. The default username and password are below. When prompted, enter the username and password. We suggest you change the password under the CONFIGURATION TAB. Please see the Firefly documentation for Client passwords and configuration.

Username: admin
Password: firefly

If your browser did NOT show the interfaces described above, please re-check your setting. Once everything works properly and you have changed the admin password, you are ready to wrap up the installation.

Step 12 - Configure your router to open port 9999 - Log into your router using your browser and forward port 9999 TCP to the HP MediaSmart Server IP. This is the same IP you used to connect via remote desktop in step 3/4. f you have trouble with your router, please see some of the tutorials on port forwarding at PortForward.com or you can review info at TZO.COM

Step 13 - Remote Testing - You now want test that everything is setup properly, but this requires you to leave the location/network where the MediaSmart server is and try the connection from a different ISP or Network. This means that is your MediaSmart server is at home, try to access the server from work, or ask a friend to try it from their browser. It’s best not to ask your neighbor since they may have the same ISP, and doesn’t prove that the ISP is blocking it. You can also use a cellular modem to test.

You now want to use your domain name that you setup with the MediaSmart, in this example we use an HP Personal Domain Name by TZO. Our example domain name is YourName.HPShare.net, and we use the WWW subdomain since this is the only subdomain that bypasses the TZO Relay setup to forward to HTTPS.

http://www.YourName.HPShare.net:9999/fireplay.html
(Play interface used to stream audio, select playlists, etc)

Enter the username and password and the FirePlay interface will pop up as shown below. You can select your LIBRARY playlist on the far left and start browsing. Depending on how well you have tagged your music depends on your sorting and browsing experience. Below we have Jack Johnson streaming over the web to our laptop in our hotel room over a wireless Verizon EVDO network. Ahhhh, the Joys of a home server. Happy Streaming!

Fireplay Streaming Interface
Thanks to the thread on the http://MediaSmartServer.net for tipping me off on this and to the Firefly and Fireplay guys for putting this together.

MyHomeServer Tutorials - Printing over the Internet using your HP MediaSmart Server

HP MediaSmart ServerBrother Printer
Many HP MediaSmart users don’t realize that you can use the server to share a printer, and it’s actually very simple and easy to do. Sharing a printer on the local network is great, but with Internet Printing you can send print jobs to home from anywhere in the world! For example: Surfing the web at work and come across a recipe that looks good? Send the print job to the home printer so when you get in the recipe is there waiting for you! Ever work on your resume at work and try to print your updated resume on the company printer and FORGET it was there??? Send the resume to print at home instead of at work! Following our tutorial below you can setup Internet Printing quickly and easily and start sending print jobs over the Internet in no time! The best part is that no other TCP ports are needed since the Internet Printing encapsulates the IPP (Internet Printing Protocol) data into HTTP or HTTPS packets.

Important Note: You MUST have remote access enabled and working properly to print over the Internet. You must also make sure that port 80 or port 443 is open in order to print properly using this tutorial. You must also have a DOMAIN NAME selected for your Home Server such as an HP Personal or Custom Domain name powered by TZO.COM. If you do not have remote access setup and working with a domain name, please complete that part first before continuing. Please also keep in mind that some multifunction printers will not be fully functional in this scenario. They will print, but you may not be able to use scanning software, etc. Before you begin, you should first have the printer connected to the MediaSmart server and shared on the network as shown in our previous printer sharing tutorial. Please also be aware that you could screw up your server if you don’t follow this tutorial or set permissions properly. Again, we are not responsible if you screw up your server or have problems with sharing, permissions or security!


STEP 1 - Using Remote Desktop to login to your MediaSmart Server
- Login to the server with Remote Desktop. In order to login, you need to start a remote desktop session. Using the same laptop/desktop you used in previous steps, click Start, Program files, Accessories, Communications and select REMOTE DESKTOP CONNECTION and you will see a screenshot similar to the one shown below:

Remote Desktop Connection
Using the internal IP address to connect to the MediaSmart with Remote Desktop

STEP 2 - Connecting to the Server using Remote Desktop - You now need to know either the internal LAN IP address of the MediaSmart server, or the server name such as HPServer, or in our case, we called it MyMediaSmart. Using either the LAN IP or the server name, enter that into the remote desktop connection dialog as shown in one of the two screenshots below:

Remote Desktop Connection
Using the internal IP to connect to the MediaSmart with Remote Desktop

Remote Desktop Connection
Using the server name to connect to the MediaSmart with Remote Desktop


STEP 3 - Logging into the Server using Remote Desktop
- You should be see the login for the MediaSmart server using remote desktop as shown in the screenshot below. Use the administrator account and password for the MediaSmart server and it will log you into the desktop of the MediaSmart

Remote Desktop Login
Logging into the HP MediaSmart server with Remote Desktop using the administrator account

STEP 4 – Using Add/Remove Programs to add IIS components - By default, the Internet printing component is not installed. In order to install the IIS Internet Printing option, you need to click on Start, Control Panel and select ADD/REMOVE Programs. Once you open the ADD/REMOVE programs dialog, click on the ADD/REMOVE Windows Components as shown circled in the screenshot shown below

Add-Remove Programs dialog
Using Add-Remove Programs to add additional Windows Components

Step 5 -Adding the Internet Printing Component - Now that the Windows components dialog is showing, Select Application Server and click details in the lower right as shown in the screenshot shown below.

Adding Windows Components
Adding additional Windows Components under Application server on WHS

Step 6 -Adding the Internet Printing Component - Now that the Application Server components dialog is showing, Select Internet Information Services and click details in the lower right as shown in the screenshot shown below.

Adding Windows Components
Adding additional Windows Components under Internet Information Services on WHS

Step 7 -Adding the Internet Printing Component - Now that the Internet Information Services components dialog is showing, Select Internet Printing and make sure that it is checked ON as shown below. Click OK and this will install the Internet Printing module on the Windows Home Server. A dialog will pop up and tell you that you have installed installing the Windows component. Click Finish and then click OK to make sure all dialog boxes are closed.

Adding the Internet Printing component on WHS
Adding the Internet Printing component under the IIS services on WHS

Step 8 -Adding the Internet Printing Component - Now that the Internet Information Services components dialog is showing, Select Internet Printing and make sure that it is checked ON as shown below. Click OK and then the NEXT button and this will install the Internet Printing module on the Windows Home Server. Click OK to make sure all dialog boxes are closed after installing the Internet Printing component.

Adding the Internet Printing component on WHS
Adding the Internet Printing component under the IIS services on WHS

Step 9 -Enabling Internet Printing in IIS Manager - Now that the Internet printing component is installed on your MediaSmart server, you need to make sure the service is allowed and then set permissions. Click the Start button, Administrative tools, Internet Information Services Manager. You will then see the screenshot similar to the one shown below. If you do not see the folders, click the “+” to expand the services under the hostname.

Getting to the IIS Manager
Getting to the Internet Information Services Manager to setup Internet Printing on WHS


Step 10 -Enabling Internet Printing Services - Click on WEB SERVICE EXTENSIONS on the left hand menu and you will see a screen similar to the one shown below. Make sure that the INTERNET PRINTING extension exists and that the service is “allowed” under the status area for this service.

Checking that Internet Printing is allowed
Checking that the Internet Printing service is set to “allowed” on the Windows Home Server

Step 11 -Enabling Internet Printing Services - We now want to set the permissions for access to the printer. Expand the WEB SITES folder by clicking on the “+” and you will see the DEFAULT WEB SITE. Click the “+” to expand the default web site and you will see the PRINTERS folder as shown below. Highlight this folder and then RIGHT-CLICK and select PROPERTIES.

Expanding the Default site to show the printers
Setting the Printer permissions when using Internet Printing on WHS

Step 12 -Setting Properties of the Internet Printing Services - Once you select properties, the properties dialog will show up. Click the Directory Security tab, and then click Edit under authentication and access control as shown in the screenshot below.

Setting the Directory Security on the shared printer
Getting to the Internet Information Services Manager to setup Internet Printing on WHS

Step 13 -Setting authentication methods for Internet Printing Services - Once you click the edit button you will see the Authentication methods dialog as shown below. Here is where you can select the type of authentication. We selected to use basic authentication as we had trouble with permissions printing using any of the other settings - including anonymous. As shown below, select BASIC AUTHENTICATION and then click OK.

Setting the Directory Security on the shared printer
Getting to the Internet Information Services Manager to setup Internet Printing on WHS

Internet Printing is now enabled and ready to be tested! In order to test the Internet Printing, you first need to add the printer settings to a laptop or remote desktop PC that you wish to print on the home printer from a remote location. We used a laptop that travels away from the home.

Step 14 - Setting up client PC’s with Internet Printing -
The printer is now shared on the LOCAL network and on the Internet with the proper username(s) and passwords of registered users on the MediaSmart. On each system that you wish to print remotely over the Internet, do the following:

  • Click Start, Control Panel and find Printers and Faxes
  • Under Printers and Faxes, click ADD PRINTER
  • Select “A Network Printer, Or a Printer attached to another Computer”
  • Select “Connect to a Printer on the Internet….” as shown in the screenshot below and enter in the following URL, noting the changes below:http://DOMAINNAME/printers/PRINTERNAME/.printer(Where the DOMAINNAME and PRINTERNAME are the names of YOUR DOMAIN and YOUR PRINTER) - In this case, our domain name of our server is YourName.HPShare.net but due to the TZO forwarding, we must use the domain name of www.YourName.HPShare.net. Your Domain name will be different.

    Our printer was simply named “PRINTER”. Depending on what you named your shared printer, your URL may be slighly different. Note: You can also use HTTPS if you wish to print via SSL port 443 if your port 80 is blocked.

Sharing your installed printer
Using the HP MediaSmart Domain Name to install the shared printer onto the client system over the Internet

Step 15 - Finalizing the Printer install for Internet Printing from a client PC - Once you enter the URL in properly and click NEXT, a dialog box will appear asking for your authentication as shown below. Enter in a username and password of a user on the MediaSmart server. It’s best NOT to use the administrator account. Click OK and the printer should then be installed. If you get an error, try again making sure the username and password is set properly. You will then be asked if you want to make this the default printer. Click YES or NO and that’s it!

Installing the printer to be shared over the Internet
Adding the username and password to install a shared printer on the MediaSmart server



Step 16 - Check that the Internet Printer was installed properly on the client - Once you setup the printer properly, you should then be able to see the printer listed in the PRINTERS area as shown below. Once the printer appears below, this means you have properly installed the printer for Internet Printing. Do this on each system that you wish to have remote printing capabilities. When testing, some routers may not be able to print using the domain name from the SAME location as the MediaSmart server. If your router has this issue (most do), you should test AWAY from the location. You can right-click on the printer in the list below, click PROPERTIES and then click PRINT TEST PAGE. Your printer should then print a test page over the Internet to the printer attached to your MediaSmart server!

Checking that the Internet printer was installed properly
Adding the username and password to install a shared printer on the MediaSmart server

MyHomeServer Tutorials - Changing the web server port on your HP Media Vault Server

Remote access IconNetwork Icon Some ISP’s block port 80, and in very few cases, both port 80 and 443. This can be extremely frustrating to some users that require remote access and bought the server simply for this purpose. The problem is, unless you are technical enough to change the ports in your server, your server will not work for using HTTP or HTTPS for remote access to files and photos. This tutorial is designed for the folks who can’t get remote access to work with their HP Media Vault Server, and have tried everything to get this working.

Try this first! - Review the TROUBLESHOOTING TUTORIAL before you change the port on your Media Vault server. This step is a MUST so you can find out what ports are open before you start.

This tutorial makes a few assumptions. First off, we assume you have a basic understanding of networking and you know your router and network layout. You should also know your router password and understand port forwarding, and have found an open port on your network other than port 80. If you are having trouble grasping the port forwarding techniques, check out some of the tutorials at TZO.COM or you can review info at PortForward.com. To recap - If you DO NOT have a good working knowledge of Home IP networking, STOP AND DON’T DO THIS. If you don’t do this properly or make a mistake, you can lock yourself out of your server. Again, we are not responsible!

Secondly, we assume you have tried to solve your remote access issues using our Troubleshooting guide and nothing has worked. It also assumes that you have simplified your network by removing/changing/setting any VOIP Adapters such as Vonage routers properly. It also assumes that if you have a DSL or Cable modem that includes a NAT, you have used bridge mode, set DMZ or disabled the NAT completely. If you have any of these issues as discussed in the troubleshooting guide and have not taken care of this first, this tutorial may not work for you. When it comes to port blocking issues, simplifying the network is the most important thing and will make your troubleshooting much faster.

Important Note: This tutorial applies only for the second generation HP Media Vault Home Servers, model #’s MV2120, MV5140 and MV5150. We only show you how to change the standard port, not the SSL port 443. You CAN edit the SSL port, but this breaks some of the URL’s when launching from the console, so we leave this out of the tutorial. If you wish to change the SSL port, see the note at the end of the tutorial. You must have root access to the server and be able to login to the HP Media Vault server BEFORE you begin, see Setting up your root password and logging into the Media Vault using SSH

IMPORTANT BAIL OUT COMMAND! If something goes wrong or you type the wrong command and start to panic, type: Hit ESC ESC :q! (that’s ESC ESC COLON q EXCLAMATION) to quit without saving the file

Step 1 - Login as root into your Media Vault Server

Step 2 - Once logged in you need to change to the etc directory. Type cd etc and hit enter

Step 3 - You will now be in the etc directory. Type ls and hit enter to get a directory listing. You should see a list of files as shown in the screenshot below

Directory Listing

Step 4 - Once you verify that you are in the proper directory and see the httpd.conf file, you should make a backup of this file BEFORE editing. At the prompt type cp httpd.conf httpdconf.bak and hit enter

Step 5 - You now want to edit the httpd.conf file to add our new port and change one other line. To edit the file, type vi httpd.conf and hit enter and you will see a screen similar to the one shown in the screenshot below:

Directory Listing

Step 6 - Use your down arrow key to scroll down and place your cursor at the Listen 80 line as shown below and then hit the i key to insert into vi and then scroll to the end of the line that says Listen 80 and hit the enter key - this will create a blank line.

Step 7 - Type Listen XXXXX (where XXXXX is the port #) and then use your down arrow key to continue to scroll down until you reach the line that says

Step 8 - Using your right arrow key, scroll to the right to the end of the then hit the backspace key 3 times to delete the 80> and then type *> so the line reads

Step 9 - You are now ready to write and save the file. Hit ESC ESC and then :wq (that’s colon w q) and then hit enter and you will be back to the command prompt.

Step 10 - Type cd inc and hit enter, this will put you in the /etc/inc directory

Step 11 - You will now be in the /etc/inc directory. Type ls and hit enter to get a directory listing. You should see a file called func_httpd.inc in this directory as well as many other .inc files

Step 12 - Make a backup of this file, type cp func_httpd.inc funchttpd.bak

Step 13 - You now want to edit the func_httpd.inc file and make the same changes as we did in the httpd.conf file. To edit the file, type vi func_httpd.inc and hit enter

Step 14 - Use your down arrow key to scroll down and place your cursor at the Listen 80 line as shown below and then hit the i key to insert into vi and then scroll to the end of the line that says Listen 80 and hit the enter key - this will create a blank line.

Step 15 - Type Listen XXXXX (where XXXXX is the port #) and then use your down arrow key to continue to scroll down until you reach the line that says

Step 16 - Using your right arrow key, scroll to the right to the end of the then hit the backspace key 3 times to delete the 80> and then type *> so the line reads

Step 17 - You are now ready to write and save the file. Hit ESC ESC and then :wq (that’s colon w q) and then hit enter and you will be back to the command prompt.

Step 18 - Type killall –HUP httpd and hit enter. This will tell the httpd (web server) to restart and reload the config file. Your server will now be listening on port 80 and the new port you entered! Type exit at prompt to exit out, quit putty and you are all set! Happy Home Serving!

If you get an error, please try this command again. If you continue to get an error, you should exit putty (see below) and use the power button in the back of the unit to restart the server.

Simply forward your new port to the server and you should now be able to reach your server by going to http://xxxx:port (Where xxxx is your domain name that you selected for the server) If you have HTTPS enabled, your server will force the HTTPS connection on the standard port 443

Need to change the SSL port as well? - If you wish to change the SSL port, be aware that this change breaks some of the URLs when launching from the console. If you wish to change the SSL port, enable SSL first in the Network settings, then edit the /etc/ssl.conf file and the 2 files above - changing anywhere it mentions port 443 to the new port. Once finished, perform step 18 and then use https://xxxxx:port to reach your server.

Jumat, 11 April 2008

Setting up a simple gravity volume.


Drag out a brush that defines the extents of your volume. Right click on the created brush and choose volume_gravity from the popup menu.

Image:Gravity1.jpg
Fig.1: Right click menu

Select the newly created volume_gravity entity and enter a key named 'gravity' to define the direction of the gravity field within the volume. This is a vector key defining gravity strength in X, Y and Z. Standard game gravity is '0 0 -1066'; that is, a force of 1066 in the negative Z direction. The figure below shows a normal gravity volume setup, download and open the grav1.map test map to see an example.

Image:Gravity2.jpg
Fig.2: A standard gravity_volume with inverted gravity.


Changing the state of a gravity volume.

The state of a gravity volume can be altered in two ways. A target_enable and target_disable entity can be used to turn the effect of a volume on and off. Additionally more precise control is available within the level script.

For our example here we will just toggle the state of the volume. In the example map we use a console_projection_eye to allow us to alter the volume, but any standard triggering method will work. Download and examine grav2.map to see how it is set up.

Image:Gravity3.jpg
Fig.3: Using consoles to enable and disable a gravity volume.

Note: There's an undocumented key available on gravity volumes. The key 'enabled' can be set to 0 to prevent a volume being active at map load. More advanced control is available in the form of the script call $entityname.setGravity( vector );


Shoot switches.

Using shoot switches (entity name 'trigger_gravityswitch') to change the state of a gravity volume is very easy. Place a trigger_gravityswitch with an orientation that reflects the direction you wish your new gravity to assume. Have the switch target your gravity_volume and the details are taken care of by the game. In the example map (grav3.map) four switches are placed in four sides of the gravity volume, all the map maker needs do in this case is have each switch target the volume.

Image:Gravity4.jpg
Fig.4: Shoot switches targeting a gravity volume.

It is possible to override this behavior by setting the 'vector' key on the switch. This was not done in Prey as it was felt important to have the switches behave consistently.


Radial gravity.

For planetoids we use a different entity, a 'volume_gravityinward'. The illustration below (taken from grav4.map) shows a simple planetoid using a default volume_gravityinward. No other keys are required in order to set this up, although fine tuning of the behavior is possible using the keys documented in the appendix below.

Image:Gravity5.jpg
Fig.5: Side view of a basic radial gravity volume allowing the player to walk on a planetoid.


Outward gravity.

Although not used in the single player portion of Prey it is possible to use a negative factor with a radial gravity volume. In example map grav5.map the following key was used to allow the player to walk on the inside of a spherical space.

Image:Gravity6.jpg
Fig.6: Using a negative factor to allow the player to walk in the inside of a sphere.

Image:Gravity7.jpg
Fig.7: Top down editor view of an outward gravity volume.


Performance considerations.

Things to bear in mind when designing a gravity rich area.

Use broad strokes to define your gravity volumes. Each additional volume placed in the map adds to the computational overhead. Avoid using many small volumes to fit the layout of your area and blanket large parts with a single volume if at all possible.

“isSimpleBox” is an important key. It defaults true because a non simple volume adds considerable overhead when calculating the behavior required. You will undoubtedly need to set this false on occasion but try to design around it if at all possible.

Don't underestimate the use of smoke and mirrors. Clever use of a portal or a wall walk surface can trick the player into believing they are in an altered gravity area. It's always cheaper to invert the geometry and use standard gravity than to use a gravity_volume.

AI creatures will respond better to a standard gravity orientation so again, think of ways to trick the player if you plan combat in an area of gravity madness.


Appendix.

volume_gravity
A variable sized gravity zone. Changes the gravity of all physics objects that enter.

gravity vector New gravity vector (x y z). Default (0 0 -1066)
interpTime float Time in seconds to interpolate gravity changes. Default (1.0)
reorient boolean Reorient the player to the gravity direction. Default (1)
showVector boolean Draw debug line in game. Default (0)
killmonsters boolean Kill monsters when affected by gravity. Default (1)
zeroGravOnChange boolean
isSimpleBox boolean Simple boxes are cheaper. Default (1)
snd_gravity_loop string Sound played while gravity is non-default.


trigger_gravityswitch
Target at volume_gravity entities. Use angle to specify direction of gravity.

strength float Gravity factor. Default (1.0)
vector vector Forced gravity vector. Overrides strength and angle.
Enabled boolean Initially enabled. Default (1)


volume_gravityinward
A variable sized gravity zone. Gravitates all entering objects towards origin of volume. To make an outward gravity zone use a negative factor.

factor float Percentage of normal gravity magnitude. Default (0.5)
interpTime float Time in seconds to interpolate gravity changes. Default (1.0)
override_origin vector Origin defaults to model origin. Use this to override it.
monster_trace_gravity boolean Monsters trace down to find gravity normal rather than using inward vector. Default (0)
reorient boolean Reorient the player to the gravity direction. Default (1)
showVector boolean Draw debug line in game. Default (0)
killmonsters boolean Kill monsters when affected by gravity. Default (1)
isSimpleBox boolean Simple boxes are cheaper. Default (1)


volume_gravitysink
Variable sized gravity sink zone. Gravitates all entering objects towards origin with force proportional to inverse squared distance.

factor float Gravity factor. Default (60000)
interpTime float Time in seconds to interpolate gravity changes. Default (1.0)
showVector boolean Draw debug line in game. Default (0)
killmonsters boolean Kill monsters when affected by gravity. Default (1)
isSimpleBox boolean Simple boxes are cheaper. Default (1)

Senin, 07 April 2008

tutorial effect



Setting up the Movie



Open up Flash and set up your document properties. Set the dimensions to the exact dimensions of the image you are going to use and use a frame rate of around 20-30 fps. I find that a higher number of frames over a higher frame rate results in smoother animations.

Timeline Setup



Create 2 layers "image" and "fx" in your timeline. Import your image into the "image" layer. Set the image position to x: 0, y: 0, that is aligned to the top left corner. Lock the layer so it will not get in the way later.

* Note: Do not resize or do anything in Flash to the imported image as that will distort the image. Do any editing in Photoshop or any other external editor. Go to the Library (F11) and double-click the image/bitmap symbol and uncheck the "Allow smoothing" option. This disables any extra and unnecessary anti-aliasing in Flash which will slow down the movie and possibly distort the image.


Drawing the Mask



Using Flash's drawing tools, create outlines of shapes around areas of highlight (brighter colors). Example: metallic parts, shiny surfaces, cables and tubes. I have used just the Line and Oval tool. Fill in the outlines and you will end up with the correct shapes (see below).



Select the Eraser tool and set the Eraser Options to "Erase Lines". Erase the lines from the shapes so that you are left with only the fills.

Select everything on the "fx" layer but clicking the layer in the timeline. Group (CTRL+G) the shapes and convert the grouped shapes into a Movieclip symbol (F8) as shown below. Name it "mc_fx" and set the registration point to top-left.



Making the Effect

Double-click the "mc_fx" instance on the stage to go into Symbol Editing Mode. You should see a layer called "Layer 1" containing the shapes you have created. Rename the layer to "mask" and create another layer below it and name it "light".



While you are still on the "light" layer, create a strokeless reactangle which is 135pixels by 120pixels in dimension. Select the fill and turn it into a Liner Gradient using the Color Mixer (Shift + F9) with the following settings. Both ends have an alpha value of 0% and for the middle 100%. Use the Fill Transform tool to rotate the fill so it looks like the picture below.



Group the gradient and turn it into a Graphic symbol (F8). Name it "g_light". Now set the position of "g_light" to x: 0, y: 265. Create a keyframe (F6) on "light" layer at frame 50 and on that keyframe, set the position of "g_light" to x: 0, y: -120. Insert frames (F5) at frame 50 for "mask" layer. See below.



Right-click the first keyframe on "light" layer and Create Motion Tween. Select frame 25, the middle frame and convert it into a keyframe by pressing F6. Set the Easing value of frame 1 to -100 and frame 25 to 100.



Select the "mask" layer, right-click on it and select "Mask" from the context menu to convert it into a layer mask.

Test Movie (CTRL + Enter) to see the completed effect.
Name:*

Email Address:*

Feedback: