PDA

View Full Version : Sandbox Themes: How To!! v1.0



PSmonkey
August 21st, 2006, 21:08
Ok

I will try doing an explination of how to make themes for sandbox.

Sorry if its not very well writen.
Music Files
Music files are AT3 format. The best way to generate an at3 file is either via Goldwave or download the codemasters tool for Race drive 2006 and renamed the converted file from .toc to .at3

http://www.codemasters.com/downloads/?downloadid=22511

Art Files
Art files are TGA format (24bit or 32bit suported). Best way is to get an art program like photoshop or jasc paintshop pro to make acceptable files.

Theme Files
Park theme.ini taken from sandbox v1.0

SANDBOX

// Sandbox Theme File
// Note First line is a Tag to validate this ini file
// All Commands must have a Space between the following items '=', ',' & ';'
GAMEMODE_DEMOLISION

ROOM_DESCRIPTION = Destroying a Statue ;
ROOM_AUDIO = ParkTheme.at3 ;
ROOM_SIZE = 80 , 40 , 80 ;

// Room Textures, Note ROOM_TEXT_WALL 2nd option is for texture mode
// Texture Modes 0: Single Texture Repeated, 1: Single Texture Streached, 2: Individual Textures
ROOM_TEXT_WALL = ParkWall , 2 ;
ROOM_TEXT_ROOF = ParkRoof ;
ROOM_TEXT_FLOOR = ParkFloor ;

// BLock Main Info
BLOCK_TYPE_MAX = 3 ;
BLOCK_COUNT_MAX = 50 ;
BLOCK_PREBLOCK_MAX = 7 ;

// Block Commands
// BLOCK_TEXT_# - Block Texture, Text Mode (0: Repeat, 1: Wrap)
// BLOCK_TYPE_# - Type 0: Box; 1: Circle; 2: Cylinder
// BLOCK_INFO_# - Box: Width, Height, Depth; Circle: Radius; Cylinder: Radius, Height
// BLOCK_USER_# - User Allowed to use (0: False/No, 1: True/Yes)

BLOCK_TEXT_1 = TNTblock , 0 ;
BLOCK_TYPE_1 = 0 ;
BLOCK_INFO_1 = 5.0 , 5.0 , 5.0 ;
BLOCK_USER_1 = 1 ;

BLOCK_TEXT_2 = ParkBlock , 0 ;
BLOCK_TYPE_2 = 0 ;
BLOCK_INFO_2 = 4.0 , 4.0 , 4.0 ;
BLOCK_USER_2 = 1 ;

BLOCK_TEXT_3 = ParkBlock , 0 ;
BLOCK_TYPE_3 = 0 ;
BLOCK_INFO_3 = 12.0 , 4.0 , 4.0 ;
BLOCK_USER_3 = 1 ;

// Preset Blocks
// PREBLOCK_TYPE_# - Block Type (whick of the defined blocks above to use)
// PREBLOCK_CPOS_# - Center Position (position based on center of object)
// PREBLOCK_CROT_# - Center Rotation (Axis rotation based on center of object)
// PREBLOCK_ACTV_# - Block is Active (0: False/Static, 1: True/ODE Active)

PREBLOCK_TYPE_1 = 2 ;
PREBLOCK_CPOS_1 = -4.0 , 2.0 , 0.0 ;
PREBLOCK_CROT_1 = 0.0 , 0.0 , 0.0 ;
PREBLOCK_ACTV_1 = 1 ;

PREBLOCK_TYPE_2 = 2 ;
PREBLOCK_CPOS_2 = 4.0 , 2.0 , 0.0 ;
PREBLOCK_CROT_2 = 0.0 , 0.0 , 0.0 ;
PREBLOCK_ACTV_2 = 1 ;

PREBLOCK_TYPE_3 = 2 ;
PREBLOCK_CPOS_3 = -2.0 , 6.0 , 0.0 ;
PREBLOCK_CROT_3 = 0.0 , 0.0 , 0.0 ;
PREBLOCK_ACTV_3 = 1 ;

PREBLOCK_TYPE_4 = 2 ;
PREBLOCK_CPOS_4 = 2.0 , 6.0 , 0.0 ;
PREBLOCK_CROT_4 = 0.0 , 0.0 , 0.0 ;
PREBLOCK_ACTV_4 = 1 ;

PREBLOCK_TYPE_5 = 2 ;
PREBLOCK_CPOS_5 = 0.0 , 10.0 , 0.0 ;
PREBLOCK_CROT_5 = 0.0 , 0.0 , 0.0 ;
PREBLOCK_ACTV_5 = 1 ;

PREBLOCK_TYPE_6 = 3 ;
PREBLOCK_CPOS_6 = 0.0 , 14.0 , 0.0 ;
PREBLOCK_CROT_6 = 0.0 , 0.0 , 0.0 ;
PREBLOCK_ACTV_6 = 1 ;

PREBLOCK_TYPE_7 = 2 ;
PREBLOCK_CPOS_7 = 0.0 , 18.0 , 0.0 ;
PREBLOCK_CROT_7 = 0.0 , 0.0 , 0.0 ;
PREBLOCK_ACTV_7 = 1 ;


Ok lets break this down a bit & explain.


SANDBOX

// Sandbox Theme File
// Note First line is a Tag to validate this ini file


As clearly stated. The first line is a tag. When themes are loaded it checks if the first line is "SANDBOX" to make sure it's a valid theme. So do not modify this line or it will reject your theme.


GAMEMODE_DEMOLISION

This TAG tells Sandbox which game mode to run. At the current time the following tags are suported.

GAMEMODE_SANDBOX - Straight up sandbox mode. Do as you please setup.
GAMEMODE_DEMOLISION - Demolision mode (set a bomb and watch things fly)
GAMEMODE_BATTLE - A mode for battle (kind of not finished atm).
GAMEMODE_BOWLING - Simply just bowling.


ROOM_DESCRIPTION = Destroying a Statue ;
ROOM_AUDIO = ParkTheme.at3 ;
ROOM_SIZE = 80 , 40 , 80 ;

Simple enough. Room Description (not fully suported in sandbox yet but soo will) is a basic description of your theme. Eventualy this will apear in a message box when someone selects to play.

Room Audio is specifying what audio file to load in the theme folder. Sandbox only suports AT3 playback since its not done by the CPU. This frees the cpu to handle the complex task of physics & keeps music from studdering because the cpu is busy.

Room size sets the dimentions of the room in units. The form is Width, Height, Depth.


ROOM_TEXT_WALL = ParkWall , 2 ;
ROOM_TEXT_ROOF = ParkRoof ;
ROOM_TEXT_FLOOR = ParkFloor ;

The following commands setup the room textures. The second parameter of TEXT_WALL is not implemented yet. Make sure your textures for the wall are properly numberd 1-4. So even tho the define is "ParkWall" the texture should be "ParkWall1.tga"

Roof & Floor are single textures only. So just provide the name for them.


BLOCK_TYPE_MAX = 3 ;
BLOCK_COUNT_MAX = 50 ;
BLOCK_PREBLOCK_MAX = 7 ;


The next bits setup the block information. The first command tells how many uniq block types will be setup in this ini file.

The second command tells the physics engine what is the maximum amount of blocks that can be active in the theme.

The third command tells tells the game how many pre set blocks are defiend in the ini file.


BLOCK_TEXT_1 = TNTblock , 0 ;
BLOCK_TYPE_1 = 0 ;
BLOCK_INFO_1 = 5.0 , 5.0 , 5.0 ;
BLOCK_USER_1 = 1 ;

This block of code defines the setup for a object type. The first line is simply just what texture to use. The second parameter is currently not suported.

The second option (block type) sets what type of geometrical shape will this object use. Currently suported are box & sphears (note atm sphear geometry is not implemented so a block will be rendered in its place). Eventualy there will be suport for Piramids and other objects.

The third command setups the object size.
If the shape is a box, The 3 commands represent Width, Height & Depth.
If the shape is a sphear, the first command is the sphear's radius. The 2nd & 3rd command will be ignored (but please do not remove, just repeat the sphears radius on the 2nd & 3rd command).

The fourth command tells the engine if a user can use this object. What it means is that if you wish to define objects to use on the pre-set commands but don't wish the user to be able to place thies objects, you would set the value to 0 (false).


PREBLOCK_TYPE_1 = 2 ;
PREBLOCK_CPOS_1 = -4.0 , 2.0 , 0.0 ;
PREBLOCK_CROT_1 = 0.0 , 0.0 , 0.0 ;
PREBLOCK_ACTV_1 = 1 ;

The last part is about pre defined blocks. What thies are, are blocks you wish the ini file to create and set in the scene.

The first command tells what type of object to use from the previous defined list (BLOCK_TYPE_#, # is the number you would use here).

The second command is the Position command. It is where you wish for the object to be set. The parameters are X, Y & Z. note that the value is floating point.
Do note that all objects positions are based on the center of the object. So if say you have a 32x32x32 box you wish to sit on the floor. You must set the hight to 16.

The third command sets the objects rotation value. This is buggy at the moment and does not properly work. The values are for rotating the x, y & z axis.

The forth command is the active command. What this does is tell the engine if the object is to run as a dynamic physics object or if it is static geometry. The difference between the two is an active dynamic object will fall by gravity and bounce when it colides with other objects. A static object will just sit in its location. It will not react to active objects but active objects will react and bounce off it.


So that is it for now. Sorry if the explination is not very well. If you have issues please ask. I will help out where I can.

BrooksyX
August 22nd, 2006, 00:32
This is nice, the mod I just did I had to edit one of the theme.ini to get my to work and I didnt know what half of it meant. Thanks.

V3N0M
August 22nd, 2006, 00:41
Good guide, PSmonkey.

PsychoSync
August 23rd, 2006, 13:17
Maybe in the future, an editor could be great...