Mapdev:SMD: Difference between revisions
mNo edit summary |
added note about CMapInfi |
||
| Line 289: | Line 289: | ||
|} | |} | ||
== Source == | |||
The SMD file tag reading in Spring is located in the CMapInfo class. This class reads all (well, almost: it doesn't read SM3 tags) map tags, and hence it is the leading document on which tags are available and what their default values are. | |||
https://spring.clan-sy.com/svn/spring/trunk/rts/Map/MapInfo.h<br> | |||
https://spring.clan-sy.com/svn/spring/trunk/rts/Map/MapInfo.cpp | |||
Some C++ knowledge may be practical when examining these files, but extracting information like tag names and default values should be possible for anyone. | |||
[[Category:Development]] | [[Category:Development]] | ||
Revision as of 14:28, 24 April 2008
Maelstrom's SMD Creator
Maelstrom has made a handy little SMD creating utility, which can be found in this forum thread: http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2420
SMD Syntax
The SMD, to work correctly, must be set out correctly. The following are a few of these requirements that you have to follow:
- All lines must end in a ';'. This is just like any C derived programming language
- Sections begin with a keyword wrapped in [Square brackets], and are wrapped in {Curly Brackets}
- Each different tag must be placed on a different line (?)
The following are some recomendations to help other people read your SMD.
- Blank lines are allowed, and can be placed to help distinguish between different sections
- You may place comments in the SMD, and again like C programming languages, these are preceded by a '//'. Anything following a comment marker is ignored by the parser.
- You can tabulate your SMD to help the overall readability, and to show where sections begin and end.
Example SMD
[MAP]
{
Description=Lot of metal in middle but look out for kbot walking over the mountains;
TidalStrength=20;
Gravity=130;
MaxMetal=0.03;
ExtractorRadius=400;
MapHardness=100;
DetailTex=mydetailtex.bmp;
AutoShowMetal=1;
[ATMOSPHERE]
{
Skybox=space.dds;
FogColor=0.7 0.7 0.8;
FogStart=0.2;
CloudColor=0.9 0.9 0.9;
SkyColor=0.1 0.15 0.7;
SunColor=1.0 1.0 1.0;
CloudDensity=0.55;
MinWind=5;
MaxWind=20;
}
[WATER]
{
WaterTexture=mywatertexture.jpg;
WaterSurfaceColor=0.4 0.6 0.8;
WaterPlaneColor=0.4 0.6 0.8;
WaterBaseColor=0.4 0.6 0.8;
WaterAbsorb=0.004 0.004 0.002;
WaterMinColor=0.1 0.1 0.3;
WaterDamage=20;
}
[LIGHT]
{
SunDir=0 1 2;
GroundAmbientColor=0.4 0.4 0.4;
GroundSunColor=0.7 0.7 0.7;
GroundShadowDensity=0.8;
UnitAmbientColor=0.3 0.3 0.3;
UnitSunColor=0.8 0.8 0.8;
UnitShadowDensity=0.8;
SpecularSunColor=0.3 0.3 0.3;
}
[TEAM0]
{
StartPosX=600;
StartPosZ=600;
}
[TEAM1]
{
StartPosX=3600;
StartPosZ=3600;
}
[TEAM2]
{
StartPosX=3600;
StartPosZ=600;
}
[TEAM3]
{
StartPosX=600;
StartPosZ=3600;
}
[TEAM4]
{
StartPosX=2000;
StartPosZ=600;
}
[TEAM5]
{
StartPosX=2000;
StartPosZ=3600;
}
//Up to [TEAM9]
[TERRAINTYPE0]
{
name=default;
hardness=1;
tankmovespeed=1;
kbotmovespeed=1;
hovermovespeed=1;
shipmovespeed=1;
}
}
SMD Tags List
Source
The SMD file tag reading in Spring is located in the CMapInfo class. This class reads all (well, almost: it doesn't read SM3 tags) map tags, and hence it is the leading document on which tags are available and what their default values are.
https://spring.clan-sy.com/svn/spring/trunk/rts/Map/MapInfo.h
https://spring.clan-sy.com/svn/spring/trunk/rts/Map/MapInfo.cpp
Some C++ knowledge may be practical when examining these files, but extracting information like tag names and default values should be possible for anyone.
