Custom Unit Icons: Difference between revisions

From Spring
Jump to navigationJump to search
Line 1: Line 1:
When you zoom out in Spring, units will get replaced with icons. The default icon is the radar blip, but mod developers have the ability to assign different icons to units. The custom icon information is stored in gamedata/icontypes.tdf.
When you zoom out in Spring, units will get replaced with icons. The default icon is the radar blip, but mod developers have the ability to assign different icons to units. The custom icon information is stored in gamedata/icontypes.tdf.


== Custom Unit Icons ==
===How to specify different types of icons===


When you zoom out in Spring, units will get replaced with icons. The default icon is the radar blip, but mod developers have the ability to assign different icons to units. The custom icon information is stored in gamedata/icontypes.tdf.
The custom icons specification, gamedata/icontypes.tdf, should look like this:
 
[icontypes]
{
[default]
{
// Spring replaces missing or incorrect bitmaps by the radar dot.
size=1;
radiusadjust=1;
distance=1;
}
[type1]
{
bitmap=icons/type1.bmp;
size=2;
radiusadjust=0;
distance=3;
}
[type2]
{
bitmap=icons/type2.bmp;
size=2;
radiusadjust=0;
distance=0.5;
}
// other type definitions may follow
}
 
'''bitmap''' is the location of the custom icon bitmap. If it is missing or incorrect, Spring replaces it with the standard radar dot. The transparent color for the bitmap is black (0,0,0). The bitmap will get blended with the team color, so there is no special team color channel.
 
'''size''' is a number that acts as multiplier for the icon size. The bigger the number, the bigger the icon will be. Default is 1.
 
'''radiusadjust''' is a boolean (0 or 1) that tells Spring whether or not the icon should scale with the unit radius. Default is 0 (false).
 
'''distance''' is a number that acts as a multiplier for the distance at which the unit will show up as an icon. The bigger the number, the further away the camera has to be from the unit for it to turn into an icon. Default is 1.
 
The "default" icon type is a bit special; every unit that misses an 'iconType' tag (see below) or has one that doesn't match a type specified in gamedate/icontypes.tdf gets assigned to the "default" type. If the "default" type is not specified, Spring will create it with the default values.
 
Furthermore, enemy units that are within radar range, but not in your Line Of Sight, will be shown as the default icon. Thus if there is a bitmap specified for the "default" icon type it will override the standard radar blip.


== How to assign icon types to units ==
== How to assign icon types to units ==

Revision as of 17:17, 1 July 2006

When you zoom out in Spring, units will get replaced with icons. The default icon is the radar blip, but mod developers have the ability to assign different icons to units. The custom icon information is stored in gamedata/icontypes.tdf.

How to specify different types of icons

The custom icons specification, gamedata/icontypes.tdf, should look like this:

[icontypes]
{
	[default]
	{
		// Spring replaces missing or incorrect bitmaps by the radar dot. 
		size=1;
		radiusadjust=1;
		distance=1;
	}
	[type1]
	{
		bitmap=icons/type1.bmp;
		size=2;
		radiusadjust=0;
		distance=3;
	}
	[type2]
	{
		bitmap=icons/type2.bmp;
		size=2;
		radiusadjust=0;
		distance=0.5;
	}
	// other type definitions may follow 
}

bitmap is the location of the custom icon bitmap. If it is missing or incorrect, Spring replaces it with the standard radar dot. The transparent color for the bitmap is black (0,0,0). The bitmap will get blended with the team color, so there is no special team color channel.

size is a number that acts as multiplier for the icon size. The bigger the number, the bigger the icon will be. Default is 1.

radiusadjust is a boolean (0 or 1) that tells Spring whether or not the icon should scale with the unit radius. Default is 0 (false).

distance is a number that acts as a multiplier for the distance at which the unit will show up as an icon. The bigger the number, the further away the camera has to be from the unit for it to turn into an icon. Default is 1.

The "default" icon type is a bit special; every unit that misses an 'iconType' tag (see below) or has one that doesn't match a type specified in gamedate/icontypes.tdf gets assigned to the "default" type. If the "default" type is not specified, Spring will create it with the default values.

Furthermore, enemy units that are within radar range, but not in your Line Of Sight, will be shown as the default icon. Thus if there is a bitmap specified for the "default" icon type it will override the standard radar blip.

How to assign icon types to units

To assign units to a specific icon type, add the following line to their FBI file:

iconType=type1;

You can replace "type1" with icontypes defined in gamedata/icontypes.tdf. If the tag "iconType" is missing, Spring sets it to the icontype "default".