Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Making a skybox from a map

Page: 1 of 1
 Mercenary
12-02-2004, 10:48 AM
#1
This is my way of making a skybox from a map. You can probably get the same result by using console commands but this way works just fine.

This is very useful when you don't have expensive software and you need a skybox with buildings for a Coruscant level or a natural scene made of models and effects and just about anything you can create in Radiant. Unlike a skyportal this won’t hurt your game performance, so think of this as a substitute of some sorts.

Requirements

-skybox making experience. If you don’t have any, find a tutorial before you attempt this.

-no scripting experience is necessary but you should have BehavED setup properly and know how to use it.

-last but not least, you should know how to map and use entities.

Put your GtkRadiant settings to single player.

In Radiant, make your scene (map) and place a ref_tag where you want your camera to be. This may take some practice to get it in the right place for your particular scene. With the ref_tag selected, hit the “n” key to bring up the entity window and enter the following:

Key: targetname
Value: cam1

Place a target_scriptrunner in your map and make your info_player_start target it. With the target_scriptrunner selected, hit the “n” key to bring up the entity window and enter the following:

Example: Key: usescript
Value: test/skybox (do not enter it this way: scripts/test/skybox.IBI)

Compile your map.

Copy the following script and paste it into notepad and save it as a .txt in your scripts folder. Make sure the path matches the one you specified in your target_scriptrunner.

//Generated by BehavEd

rem ( "SKYBOX SHOTS" );
camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 );
rem ( "===========================" );
rem ( "sky_rt" );
camera ( /*@CAMERA_COMMANDS*/ PAN, < 0.000 0.000 0.000 >, < 0.000 0.000 0.000 >, 0 );

affect ( "player", /*@AFFECT_TYPE*/ FLUSH )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/r2d2/misc/r2d2talk03.mp3" );
}

wait ( 4000.000 );
rem ( "===========================" );
rem ( "sky_bk" );
camera ( /*@CAMERA_COMMANDS*/ PAN, < 0.000 90.000 0.000 >, < 0.000 0.000 0.000 >, 0 );

affect ( "player", /*@AFFECT_TYPE*/ FLUSH )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/r2d2/misc/r2d2talk03.mp3" );
}

wait ( 4000.000 );
rem ( "===========================" );
rem ( "sky_lf" );
camera ( /*@CAMERA_COMMANDS*/ PAN, < 0.000 180.000 0.000 >, < 0.000 0.000 0.000 >, 0 );

affect ( "player", /*@AFFECT_TYPE*/ FLUSH )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/r2d2/misc/r2d2talk03.mp3" );
}

wait ( 4000.000 );
rem ( "===========================" );
rem ( "sky_ft" );
camera ( /*@CAMERA_COMMANDS*/ PAN, < 0.000 270.000 0.000 >, < 0.000 0.000 0.000 >, 0 );

affect ( "player", /*@AFFECT_TYPE*/ FLUSH )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/r2d2/misc/r2d2talk03.mp3" );
}

wait ( 4000.000 );
rem ( "===========================" );
rem ( "sky_dn" );
camera ( /*@CAMERA_COMMANDS*/ PAN, < 90.000 0.000 0.000 >, < 0.000 0.000 0.000 >, 0 );

affect ( "player", /*@AFFECT_TYPE*/ FLUSH )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/r2d2/misc/r2d2talk03.mp3" );
}

wait ( 4000.000 );
rem ( "===========================" );
rem ( "sky_up" );
camera ( /*@CAMERA_COMMANDS*/ PAN, < -90.000 0.000 0.000 >, < 0.000 0.000 0.000 >, 0 );

affect ( "player", /*@AFFECT_TYPE*/ FLUSH )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/r2d2/misc/r2d2talk03.mp3" );
}

wait ( 4000.000 );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );

Open the script in BehavED and compile it.

The way this script works is that the camera will face all 6 directions in succession and you’ll take a screenshot for each one. An r2d2 noise will notify you of a direction change, this is in case your scene is so similar that you don’t notice the change.

Crank up your video card settings and your JA video settings to get the best picture quality possible but don’t bother with the resolution because you’re going to force it to 1024 x 1024 anyways.

Start up a JA single player. In the opening menu bring down the console and enter the following:

cg_draw2d 0
bind x screenshot (you can bind another key if you want)
r_mode -1
r_customheight 1024
r_customwidth 1024

Restart JA single player. If you did the console commands correctly the game should occupy a square space on your desktop the next time you start up the game. Load up your map and get ready for the first screenshot because the script will run right from the start. Use the key you bound to take the screenshots. You have 4 seconds in between shots and be careful not to take the screenshot when there’s text in the top left corner of the screen "Wrote screenshots/shot0000.jpg".

When you’re done, bring down the console and reset your original resolution and exit the game.

Example
r_customheight 600
r_customewidth 800

Go to your base folder and open up the screenshots folder. Cut and paste your screenshots to a folder, in the textures folder. Rename the screenshots based on the order they were taken. If you look at the script it indicates what to name your 6 sides, starting with; sky_rt, sky_bk, sky_lf, sky_ft, sky_dn, sky_up.

Make your sky shader and don't forget to add your shader file to the shaderlist.txt in the shader folder. Make a new map and test out your new skybox.
Page: 1 of 1