Load cnc TEMPERAT maps (other theatres need tileset.til fixes)

This commit is contained in:
Paul Chote
2010-03-02 21:47:16 +13:00
parent 3fd7af5532
commit e841bbd3d2
8 changed files with 2812 additions and 3946 deletions

View File

@@ -28,6 +28,7 @@ namespace OpenRA.FileFormats
{ {
public class Map public class Map
{ {
public readonly string BinaryPart;
public readonly string Title; public readonly string Title;
public readonly string Theater; public readonly string Theater;
@@ -59,7 +60,7 @@ namespace OpenRA.FileFormats
IniSection basic = file.GetSection("Basic"); IniSection basic = file.GetSection("Basic");
Title = basic.GetValue("Name", "(null)"); Title = basic.GetValue("Name", "(null)");
BinaryPart = basic.GetValue("BinaryPart", "scm01ea.bin");
IniSection map = file.GetSection("Map"); IniSection map = file.GetSection("Map");
Theater = Truncate(map.GetValue("Theater", "TEMPERATE"), 8); Theater = Truncate(map.GetValue("Theater", "TEMPERATE"), 8);
@@ -69,9 +70,13 @@ namespace OpenRA.FileFormats
Width = int.Parse(map.GetValue("Width", "0")); Width = int.Parse(map.GetValue("Width", "0"));
Height = int.Parse(map.GetValue("Height", "0")); Height = int.Parse(map.GetValue("Height", "0"));
UnpackTileData(ReadPackedSection(file.GetSection("MapPack")));
UnpackOverlayData(ReadPackedSection(file.GetSection("OverlayPack")));
ReadTrees(file); //UnpackTileData(ReadPackedSection(file.GetSection("MapPack")));
//UnpackOverlayData(ReadPackedSection(file.GetSection("OverlayPack")));
//ReadTrees(file);
UnpackCncTileData(FileSystem.Open(BinaryPart));
SpawnPoints = file.GetSection("Waypoints") SpawnPoints = file.GetSection("Waypoints")
.Select(kv => Pair.New(int.Parse(kv.Key), new int2(int.Parse(kv.Value) % 128, int.Parse(kv.Value) / 128))) .Select(kv => Pair.New(int.Parse(kv.Key), new int2(int.Parse(kv.Value) % 128, int.Parse(kv.Value) / 128)))
@@ -80,6 +85,17 @@ namespace OpenRA.FileFormats
.ToArray(); .ToArray();
} }
void UnpackCncTileData( Stream ms )
{
for( int i = 0 ; i < 64 ; i++ )
for( int j = 0 ; j < 64 ; j++ )
{
MapTiles[j, i].tile = (byte)ms.ReadByte();
MapTiles[j, i].image = (byte)ms.ReadByte();
Log.Write("Set tile to {0} {1}",MapTiles[j, i].tile,MapTiles[j, i].image);
}
}
static MemoryStream ReadPackedSection(IniSection mapPackSection) static MemoryStream ReadPackedSection(IniSection mapPackSection)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();

View File

@@ -1,4 +1,4 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford. * Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA. * This file is part of OpenRA.
@@ -47,7 +47,7 @@ namespace OpenRA.FileFormats
public class Global public class Global
{ {
public string Map = "scm12ea.ini"; public string Map = "scm01ea.ini";
public string[] Packages = {}; // filename:sha1 pairs. public string[] Packages = {}; // filename:sha1 pairs.
public string[] Mods = { "ra" }; // mod names public string[] Mods = { "ra" }; // mod names
public int OrderLatency = 3; public int OrderLatency = 3;

View File

@@ -106,7 +106,14 @@ namespace OpenRA.FileFormats
if (r.tile == 0xff || r.tile == 0xffff) if (r.tile == 0xff || r.tile == 0xffff)
r.image = 0; r.image = 0;
try {
return walk[r.tile].TerrainType[r.image]; return walk[r.tile].TerrainType[r.image];
} }
catch (KeyNotFoundException)
{
return 0; // Default zero (walkable)
}
}
} }
} }

View File

@@ -1,4 +1,4 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford. * Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA. * This file is part of OpenRA.
@@ -39,7 +39,7 @@ namespace OpenRA.GameRules
// External game settings // External game settings
public readonly string NetworkHost = ""; public readonly string NetworkHost = "";
public readonly int NetworkPort = 0; public readonly int NetworkPort = 0;
public readonly string Map = "scm12ea.ini"; public readonly string Map = "scm01ea.ini";
public readonly int Player = 1; public readonly int Player = 1;
public readonly string Replay = ""; public readonly string Replay = "";
public readonly string PlayerName = ""; public readonly string PlayerName = "";

View File

@@ -11,11 +11,13 @@ Packages:
mods/cnc/packages/cclocal.mix mods/cnc/packages/cclocal.mix
mods/cnc/packages/speech.mix mods/cnc/packages/speech.mix
mods/cnc/packages/conquer.mix mods/cnc/packages/conquer.mix
# mods/cnc/packages/general.mix mods/cnc/packages/general.mix
mods/cnc/packages/sounds.mix mods/cnc/packages/sounds.mix
mods/cnc/packages/tempicnh.mix mods/cnc/packages/tempicnh.mix
mods/cnc/packages/updatec.mix mods/cnc/packages/updatec.mix
mods/cnc/packages/temperat.mix mods/cnc/packages/temperat.mix
mods/cnc/packages/winter.mix
mods/cnc/packages/desert.mix
# Cannot qualify the RA names because they may live inside a mix # Cannot qualify the RA names because they may live inside a mix
~main.mix ~main.mix
redalert.mix redalert.mix
@@ -23,7 +25,7 @@ Packages:
temperat.mix temperat.mix
snow.mix snow.mix
interior.mix interior.mix
general.mix # general.mix
conquer.mix conquer.mix
sounds.mix sounds.mix

File diff suppressed because it is too large Load Diff

View File

@@ -10,11 +10,11 @@ TSI
ffff ffff
clear1 clear1
; sandy shorelines ; clear ground
TS- TSI
56 1
0003 0000
sh{0:00} clear1
; plain water ; plain water
TS- TS-
@@ -22,17 +22,136 @@ TS-
0001 0001
w{0} w{0}
; cliffs ; Coastline
TS-
5
0003
sh{0}
TS-
1
0008
sh11
TS-
1
0009
sh12
TS-
1
000A
sh13
TS-
1
000B
sh14
TS-
1
000C
sh15
; Cliffs
TS- TS-
38 38
0087 000D
s{0:00} s{0:00}
; rocky coast ; More Coast
TS- TS-
38 1
003b 0033
wc{0:00} sh32
TS-
1
0034
sh33
;;; TODO: Add desert only tiles
; Bones/Wall/Mud/UFO/Rock
TS-
4
0043
p{0:00}
;;; TODO: More desert only tiles
; Mud
TS-
4
0049
p07
TS-
4
004A
p08
; Ford WU
TS-
1
004B
sh16
; Water
TS-
1
004C
sh17
; Water
TS-
1
004D
sh18
; Destroyed house
TS-
1
004F
p13
; Walls
TS-
1
0050
p14
; Rocks
TS-
3
0052
b{0}
; More coast
TS-
1
0058
sh6
TS-
1
0059
sh7
TS-
1
005A
sh8
TS-
1
005B
sh9
TS-
1
005C
sh10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ROADS ; ROADS
@@ -40,311 +159,67 @@ wc{0:00}
; roads ; roads
TS- TS-
43 43
00ad 005d
d{0:00} d{0:00}
; road
TS-
1
00e3
d44
; road
TS-
1
00e4
d45
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; RIVERS ; RIVERS
; river emerging from cliff
TS-
4
00e7
rc{0:00}
; rivers ; rivers
TS- TS-
13 13
0070 0088
rv{0:00} rv{0:00}
; river ; River Crossing
TS- TS-
1 2
00e5 00A1
rv14 ford{0}
; river ; Waterfalls
TS- TS-
1 2
00e6 00A3
rv15 falls{0}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; BRIDGES ; BRIDGES
; long bridge (north end)
TS-
1
00eb
br1a
; long bridge (north end, damaged)
TS-
1
00ec
br1b
; long bridge (north end, broken)
TS-
1
00ed
br1c
; long bridge (south end)
TS-
1
00ee
br2a
; long bridge (south end, damaged)
TS-
1
00ef
br2b
; long bridge (south end, broken)
TS-
1
00f0
br2c
; long bridge (middle)
TS-
1
00f1
br3a
; long bridge (middle, damaged)
TS-
1
00f2
br3b
; long bridge (middle, broken)
TS-
1
00f3
br3c
; long bridge (middle, broken, south end missing)
TS-
1
00f4
br3d
; long bridge (middle, broken, north end missing)
TS-
1
00f5
br3e
; long bridge (water / totally broken)
TS-
1
00f6
br3f
; long bridge (north surround)
TS-
1
017c
br1x
; long bridge (south surround)
TS-
1
017d
br2x
; short bridge "/" ; short bridge "/"
TS- TS-
1 1
0083 00A5
bridge1 bridge1
; short bridge "/" (destroyed) ; short bridge "/" (destroyed)
TS- TS-
1 1
0084 00A6
bridge1d bridge1d
; short bridge "/" (damaged)
TS-
1
017a
bridge1h
; short bridge "/" (surround)
TS-
1
017e
bridge1x
; short bridge "\" ; short bridge "\"
TS- TS-
1 1
0085 00A7
bridge2 bridge2
; short bridge "\" (destroyed) ; short bridge "\" (destroyed)
TS- TS-
1 1
0086 00A8
bridge2d bridge2d
; short bridge "\" (damaged) ; More coast
TS- TS-
1 1
017b 00BA
bridge2h sh34
; short bridge "\" (surround)
TS- TS-
1 1
017f 00BB
bridge2x sh35
; fyords
TS-
6
00f7
f{0:00}
; short fyord
TS-
2
0081
ford{0}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WATERFALLS
; waterfall (E-W)
TS-
1
007d
falls1
; waterfall (E-W, into sea)
TS-
1
007e
falls1a
; waterfall (N-S)
TS-
1
007f
falls2
; waterfall (N-S, into sea)
TS-
1
0080
falls2a
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; DEBRIS / ROCKS
; random rock chunks (impassable)
TS-
3
0061
b{0}
; random rock chunks (passable)
TS-
11
00d8
rf{0:00}
; random debris
TS-
4
0067
p{0:00}
; random debris
TS-
1
006b
p07
; random debris
TS-
1
006c
p08
; random debris
TS-
1
006d
p13
; random debris
TS-
1
006e
p14
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; INTERIOR
; walls
--I
49
0149
wall{0:0000}
; black floor
--I
7
010c
flor{0:0000}
; walls with stuff, random tiles
--I
16
0180
xtra{0:0000}
; black/yellow stripe
--I
11
013e
strp{0:0000}
; red stripe
--I
15
00fd
arro{0:0000}
; white floor
--I
5
0113
gflr{0:0000}
; white floor with black/yellow stripe
--I
11
0118
gstr{0:0000}
; bogus ; bogus
TS- TS-

565
scm01ea.ini Normal file
View File

@@ -0,0 +1,565 @@
; Scenario 20 control for house GoodGuy.
[Basic]
BinaryPart=scm01ea.bin
CarryOverCap=-1
CarryOverMoney=100
Intro=x
BuildLevel=1
Theme=No theme
Percent=0
Player=Multi1
Action=LAND
Lose=GAMEOVER
Win=x
Brief=GDI1
Name=GREEN ACRES
[MAP]
Height=49
Width=58
Y=11
X=3
Theater=TEMPERATE
[Multi1]
FlagHome=1031
FlagLocation=5127
MaxBuilding=150
Allies=Multi1,Multi2,Multi3
MaxUnit=150
Edge=North
Credits=0
[Multi2]
FlagHome=952
FlagLocation=5048
MaxBuilding=150
Allies=Multi1,Multi2,Multi3,Multi4
MaxUnit=150
Edge=North
Credits=0
a
[Multi3]
FlagHome=3510
FlagLocation=7606
MaxBuilding=150
Allies=Multi1,Multi2,Multi3,Multi4
MaxUnit=150
Edge=North
Credits=0
[Multi4]
FlagHome=3466
FlagLocation=7562
MaxBuilding=150
Allies=Multi2,Multi3,Multi4
MaxUnit=150
Edge=North
Credits=0
[Base]
Count=0
[TERRAIN]
1004=TC04,None
1002=TC03,None
2274=TC03,None
2145=TC04,None
2741=TC04,None
2679=TC02,None
2521=T02,None
2588=T01,None
1677=SPLIT2,None
2900=SPLIT3,None
3498=SPLIT3,None
2269=SPLIT3,None
1462=SPLIT2,None
738=SPLIT3,None
1935=TC01,None
1997=T17,None
1732=TC05,None
2058=TC04,None
1170=TC04,None
2000=TC02,None
1874=T07,None
2397=T06,None
1828=T07,None
1443=T06,None
1570=T07,None
1770=T07,None
2847=T07,None
2977=T16,None
2910=T17,None
2911=TC02,None
1641=TC04,None
2665=TC04,None
2640=TC04,None
755=T02,None
780=T02,None
779=T03,None
2764=T16,None
3603=TC02,None
1124=T16,None
806=T17,None
870=TC01,None
814=TC02,None
3349=T07,None
3286=TC04,None
992=TC04,None
1247=TC02,None
981=TC01,None
1169=T01,None
2095=TC04,None
2031=TC01,None
2701=SPLIT2,None
1382=SPLIT2,None
2798=SPLIT3,None
3452=T01,None
1658=TC05,None
1720=TC04,None
1718=TC03,None
1716=TC02,None
1779=TC01,None
2289=TC02,None
2221=TC04,None
2351=TC03,None
[OVERLAY]
3819=TI1
3756=TI6
3755=TI10
3754=TI11
3692=TI4
3691=TI1
3690=TI8
3689=TI6
3628=TI11
3627=TI6
3626=TI8
3625=TI1
3624=TI1
3564=TI7
3563=TI7
3561=TI8
3560=TI6
3559=TI2
3558=TI6
3500=TI12
3499=TI7
3498=TI10
3497=TI3
3495=TI2
3494=TI6
3436=TI12
3435=TI6
3434=TI11
3433=TI4
3432=TI5
3431=TI12
3183=TI12
3159=TI10
3119=TI8
3118=TI5
3117=TI2
3116=TI11
3115=TI5
3114=TI9
3095=TI10
3093=TI3
3092=TI10
3057=TI5
3056=TI4
3055=TI7
3054=TI1
3053=TI7
3052=TI4
3051=TI2
3050=TI12
3049=TI6
3031=TI12
3030=TI2
3029=TI10
3028=TI5
3027=TI7
2992=TI9
2991=TI9
2990=TI3
2989=TI9
2988=TI12
2987=TI10
2986=TI11
2985=TI12
2984=TI3
2966=TI3
2965=TI3
2963=TI9
2962=TI11
2930=TI8
2929=TI6
2928=TI5
2927=TI7
2926=TI10
2925=TI5
2923=TI9
2922=TI10
2921=TI3
2920=TI2
2919=TI12
2901=TI4
2900=TI5
2899=TI1
2898=TI9
2897=TI3
2896=TI1
2894=TI9
2893=TI6
2892=TI5
2891=TI5
2890=TI8
2866=TI2
2865=TI5
2864=TI5
2861=TI1
2855=TI2
2854=TI10
2836=TI4
2835=TI4
2834=TI12
2833=TI1
2832=TI9
2831=TI9
2830=TI3
2829=TI3
2827=TI2
2826=TI4
2825=TI3
2803=TI5
2802=TI7
2801=TI12
2796=TI1
2769=TI11
2767=TI5
2766=TI6
2764=TI2
2763=TI9
2762=TI1
2761=TI5
2737=TI3
2736=TI10
2733=TI12
2732=TI4
2703=TI2
2702=TI12
2701=TI12
2700=TI12
2699=TI12
2698=TI7
2674=TI8
2673=TI7
2672=TI2
2671=TI6
2670=TI4
2669=TI12
2639=TI3
2609=TI6
2397=TI4
2396=TI7
2395=TI5
2394=TI5
2393=TI4
2336=TI12
2335=TI5
2334=TI2
2332=TI2
2331=TI5
2330=TI1
2329=TI3
2328=TI5
2327=TI7
2272=TI3
2270=TI10
2269=TI10
2268=TI1
2267=TI8
2266=TI8
2265=TI7
2264=TI11
2263=TI2
2208=TI8
2207=TI8
2206=TI1
2205=TI2
2204=TI3
2203=TI5
2202=TI12
2201=TI3
2200=TI12
2144=TI3
2143=TI10
2142=TI12
2141=TI6
2139=TI11
2080=TI11
2079=TI11
2078=TI4
2015=TI6
1998=TI3
1997=TI6
1996=TI3
1995=TI6
1994=TI8
1937=TI3
1936=TI8
1934=TI8
1933=TI9
1932=TI11
1931=TI9
1930=TI1
1929=TI5
1873=TI1
1872=TI2
1871=TI1
1870=TI9
1868=TI8
1867=TI5
1866=TI11
1865=TI10
1810=TI12
1809=TI8
1808=TI7
1806=TI8
1805=TI5
1804=TI12
1803=TI4
1768=TI5
1767=TI12
1764=TI10
1763=TI7
1747=TI3
1745=TI3
1744=TI3
1743=TI6
1740=TI11
1739=TI1
1715=TI8
1704=TI7
1702=TI12
1701=TI4
1699=TI5
1698=TI5
1681=TI10
1680=TI11
1679=TI4
1678=TI9
1676=TI5
1675=TI10
1651=TI6
1650=TI11
1640=TI5
1639=TI2
1637=TI1
1636=TI4
1633=TI11
1619=TI11
1618=TI2
1617=TI12
1616=TI5
1615=TI4
1614=TI11
1613=TI7
1612=TI7
1611=TI1
1610=TI2
1595=TI10
1594=TI3
1593=TI11
1592=TI2
1591=TI8
1590=TI12
1589=TI5
1588=TI4
1587=TI11
1577=TI4
1576=TI1
1575=TI12
1573=TI2
1572=TI4
1571=TI7
1570=TI7
1569=TI5
1553=TI5
1552=TI9
1551=TI3
1550=TI9
1549=TI5
1548=TI2
1547=TI6
1530=TI10
1529=TI9
1528=TI7
1527=TI8
1525=TI3
1524=TI5
1512=TI9
1511=TI1
1510=TI6
1509=TI4
1506=TI12
1505=TI9
1489=TI9
1468=TI12
1466=TI2
1465=TI9
1464=TI10
1463=TI10
1447=TI1
1445=TI9
1444=TI2
1443=TI8
1442=TI5
1441=TI2
1404=TI11
1403=TI12
1384=TI7
1383=TI12
1382=TI8
1381=TI5
1380=TI9
1379=TI5
1377=TI4
1320=TI8
1318=TI4
1317=TI8
1316=TI12
877=TI1
869=TI5
868=TI8
867=TI4
866=TI11
865=TI10
817=TI4
816=TI2
813=TI5
812=TI4
811=TI11
810=TI9
809=TI10
808=TI9
807=TI4
805=TI10
804=TI1
803=TI7
801=TI9
800=TI7
799=TI5
754=TI9
751=TI11
750=TI8
749=TI8
748=TI7
747=TI1
746=TI10
745=TI3
744=TI8
743=TI3
742=TI5
741=TI3
740=TI5
738=TI6
737=TI10
736=TI8
735=TI7
[SMUDGE]
[INFANTRY]
[UNITS]
[STRUCTURES]
[Waypoints]
31=-1
30=-1
29=-1
28=-1
27=2272
26=2272
25=-1
24=-1
23=-1
22=-1
21=-1
20=-1
19=-1
18=-1
17=-1
16=-1
15=-1
14=-1
13=-1
12=-1
11=-1
10=-1
9=-1
8=-1
7=3464
6=3573
5=2298
4=3745
3=2216
2=953
1=786
0=1221
[Neutral]
FlagHome=0
FlagLocation=0
Allies=Neutral
MaxBuilding=150
MaxUnit=150
Edge=North
Credits=0
[GoodGuy]
FlagHome=0
FlagLocation=0
Allies=GoodGuy,Neutral
MaxBuilding=150
MaxUnit=150
Edge=North
Credits=0
[BadGuy]
FlagHome=0
FlagLocation=0
Allies=BadGuy
MaxBuilding=150
MaxUnit=150
Edge=North
Credits=0
[Special]
FlagHome=0
FlagLocation=0
Allies=Special
MaxBuilding=150
MaxUnit=150
Edge=North
Credits=0
[Multi5]
Allies=Multi5
MaxBuilding=150
MaxUnit=150
Edge=North
Credits=0
[Multi6]
Allies=Multi6
MaxBuilding=150
MaxUnit=150
Edge=North
Credits=0