Tutorial; MappingMapExtra - HWRM/KarosGraveyard GitHub Wiki

Go Back to MappingTutorial

10. Adding Map Info

Once you've set the size, you have gotten to the NonDetermChunk part of the map. This consists of: setting the background image, picking the music, choosing shadow color, deciding how far out and in you can zoom the sensors manager camera, and picking whether you want fog or a lens flare. Add this text:

setGlareIntensity(0); setLevelShadowColour(0, 0, 0, 1); loadBackground("X"); setSensorsManagerCameraDistances(MIN, MAX); setDefaultMusic("Data:sound/music/Y/Z");

Values for X can be any of the following:

m01, m02, m03, m04, m05, m06, m07, m08, m09, m10, m11, m12, m13, m14, m15, planet, quick, singlesun, stars, tanis, taniswstars, black, white
Note: using "stars" as your background will cause the game to crash.

Y is one of the music directories, either "ambient" or "battle". Z is the track name.

Tracks in the Ambient directory include:

amb_01, amb_02, amb_03, amb_04, amb_05, amb_06, amb_07, amb_08, amb_09, amb_10, amb_11, amb_12, amb_13, amb_14

Most of the ambient tracks are pretty boring, honestly, but if you want a relaxed atmosphere, they can work.

Tracks in the Battle directory include:

battle_01, battle_04, battle_04_alt, battle_06, battle_keeper, battle_movers, battle_planetkillers, battle_sajuuk, bentus_arrival

Planet_Killers is pretty dramatic. Battle_Keeper, Battle_Movers, Bentus_Arrival and Battle_Sajuuk are pretty cool Arabic-sounding tracks. Battle_01, Battle_04 and Battle_06 are your typical menacing orchestral tracks.

Min and Max are the minimum and maximum zooming distances.
Note: despite whatever values you set here, the HW2 graphics engine has a threshold beyond which nothing will be displayed. If you make a map that is larger than this threshold, everything will still function properly. You can move from place to place, and the enemy fleets will continue to build and harvest. You can even zoom far beyond this threshold. However, anything beyond that distance (from the camera) will simply not appear, and will be painted black. -Mikali

11. Adding Fog - blood_angel, Sp3ctre, Mikali

fogSetActive (C) fogSetStart (S) fogSetEnd (E) fogSetDensity (D) fogSetColour (R, G, B, A) fogSetType (T) fogAddInterpolator (buff, length, target)

The value for C is boolian. 1 enables fog for the level. 0 disables it.

S is the start plane of the fog.

E is the end plane of the fog.

D is the fog density.

R, G, B is the RGB code (0 to 255).

A is the alpha transparency (0 to 1).

The value for T is a string and must be contained within quotes. It can either be "linear", "exp", or "exp2". If "exp", then the fog will increase exponentially.

fogAddInterpolator adds an interpolator for fog. buff can be one of these string values: "fogStart", "fogEnd", "fogDensity", "fogR", "fogG", or "fogB". length is the duration of the event. target is the final value of the modified parameter.
Note: "Fog settings will act as a shadow effect on objects in a map. It does not produce any fog effect. This should be used when using a nebula on the whole map. The color setting should be the opposite color of the nebula surrounding the map. This would be true physics effects of colors and visual effects. An example is our sky color is light blue and the sun appears yellow orange. If the sky color were redish the sun would appear cyan in color. To show this in the color numbers using RGB, use {100,0,0} on the nebula and (0,100,100) on the fogSetColour command when FogSetActive(1)." -iron_man123

12. Level Thumbnails

To add a level screenshot (thumbnail): add an uncompressed 24 (or 32)-bit ".tga" image with the same name as your map, plus "_thumb" at the end, into the same directory that your map is in (e.g., if your map's name is "4p_spacious_place.level", then name your image "4p_spacious_place_thumb.tga"). The final image must be at least 128 by 128 pixels, or some multiple thereof (e.g., 256 by 256, 512 by 512, etc.) 128 by 128 will look blurry; 256 by 256 looks much better.

The game will only display the top-left portion of the image, so crop accordingly. If your final image is 512 by 512 pixels, only the top-left 360 by 270 pixels of the image will be displayed. The rest can just be blank space. Also, the game will not display the image if your map file has an extra period in it. For example, "Big_Map_2.0_thumb.tga" will not display, whereas "Big_Map_v2_thumb.tga" will. Name your ".level" file and ".tga" accordingly.

Many image editing applications do not have an option to explicitely save a ".tga" file as a 32-bit image. However, any 24-bit image can be converted into a 32-bit image by adding a mask (or alpha layer) to it. The mask happens to be 8 bits; so, the result will always be a 32-bit image (because the sum of 24 bits and 8 bits is 32 bits).

For further instructions on how to create ".tga" files for Homeworld 2, read the Badge Tutorial. Also, read UberJumper's Muliplayer Map Thumbnail Tutorial. It describes an alternate method of creating map thumbnails that you may find preferable.
Note: thumbnails will not transfer over GameSpy.
Suggestion: mark the map's starting positions on the thumbnail using the Homeworld font.
Tip: for additional file-size savings, you can convert the ".tga" file to ".dds" using a .DDS Converter (note: the ".tga" image must be 32-bits in this case). You can convert the ".dds" or ".tga" image to a ".rot" file using Spooky's ROT Tool.

13. Compiling Your Level

Once you've finished creating your level, you have the option of compiling your level using a program called LuaC. Compiling your level has two clear bonuses, and an additional effect that could be interpreted as a major drawback:

compiling your map decreases its size. This means that other players will spend less time downloading your map when you host it over GameSpy. (Oddly, in many cases if you compress the compiled file using WinZip or WinRAR, the file will actually be larger than if you had simply compressed the uncompiled file.)

the compiled file is in machine language. This results in a slight speed boost, as the computer does not have to waste time translating the Lua (text) file into its own native language.

decompiling the compiled file is either impossible, or results in messy code. This depends on the command-line options you use with LuaC, and could be considered a boon if you do not wish other people to view your code. Note: to decompile a file, use Age2un's Lua Decompiler.

Comments

Page Status

Updated Formatting? Initial
Updated for HWRM? Initial