Game uses new format. Missing bridges/resources/smudges. Buggy map bounds, actor placement and tile images.
This commit is contained in:
@@ -38,7 +38,7 @@ namespace MapConverter
|
||||
|
||||
public readonly int Width;
|
||||
public readonly int Height;
|
||||
public NewMap Map = new NewMap();
|
||||
public Map Map = new Map();
|
||||
|
||||
static string Truncate( string s, int maxLength )
|
||||
{
|
||||
@@ -183,10 +183,10 @@ namespace MapConverter
|
||||
|
||||
void UnpackRATileData( MemoryStream ms )
|
||||
{
|
||||
Map.MapTiles = new NewTileReference<ushort, byte>[ MapSize, MapSize ];
|
||||
Map.MapTiles = new TileReference<ushort, byte>[ MapSize, MapSize ];
|
||||
for( int i = 0 ; i < MapSize ; i++ )
|
||||
for( int j = 0 ; j < MapSize ; j++ )
|
||||
Map.MapTiles[j, i] = new NewTileReference<ushort,byte>();
|
||||
Map.MapTiles[j, i] = new TileReference<ushort,byte>();
|
||||
|
||||
for( int i = 0 ; i < MapSize ; i++ )
|
||||
for( int j = 0 ; j < MapSize ; j++ )
|
||||
@@ -203,7 +203,7 @@ namespace MapConverter
|
||||
|
||||
void UnpackRAOverlayData( MemoryStream ms )
|
||||
{
|
||||
Map.MapResources = new NewTileReference<byte, byte>[ MapSize, MapSize ];
|
||||
Map.MapResources = new TileReference<byte, byte>[ MapSize, MapSize ];
|
||||
for( int i = 0 ; i < MapSize ; i++ )
|
||||
for( int j = 0 ; j < MapSize ; j++ )
|
||||
{
|
||||
@@ -213,7 +213,7 @@ namespace MapConverter
|
||||
if (o != 255 && resourceMapping.ContainsKey(raOverlayNames[o]))
|
||||
res = resourceMapping[raOverlayNames[o]];
|
||||
|
||||
Map.MapResources[j, i] = new NewTileReference<byte,byte>(res.First, res.Second);
|
||||
Map.MapResources[j, i] = new TileReference<byte,byte>(res.First, res.Second);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ using System.Text;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public class Map
|
||||
public class OldMap
|
||||
{
|
||||
public readonly string Title;
|
||||
public readonly string Theater;
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.FileFormats
|
||||
public readonly int Height;
|
||||
public int2 Size { get { return new int2(Width, Height); } }
|
||||
|
||||
public readonly TileReference[ , ] MapTiles;
|
||||
public readonly OldTileReference[ , ] MapTiles;
|
||||
public readonly List<ActorReference> Actors = new List<ActorReference>();
|
||||
|
||||
public readonly IEnumerable<int2> SpawnPoints;
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.FileFormats
|
||||
return s.Length <= maxLength ? s : s.Substring(0,maxLength );
|
||||
}
|
||||
|
||||
public Map(string filename)
|
||||
public OldMap(string filename)
|
||||
{
|
||||
IniFile file = new IniFile(FileSystem.Open(filename));
|
||||
|
||||
@@ -69,10 +69,10 @@ namespace OpenRA.FileFormats
|
||||
Height = int.Parse(map.GetValue("Height", "0"));
|
||||
MapSize = (INIFormat == 3) ? 128 : 64;
|
||||
|
||||
MapTiles = new TileReference[ MapSize, MapSize ];
|
||||
MapTiles = new OldTileReference[ MapSize, MapSize ];
|
||||
for (int j = 0; j < MapSize; j++)
|
||||
for (int i = 0; i < MapSize; i++)
|
||||
MapTiles[i, j] = new TileReference();
|
||||
MapTiles[i, j] = new OldTileReference();
|
||||
|
||||
|
||||
if (INIFormat == 3) // RA map
|
||||
|
||||
@@ -27,7 +27,7 @@ using System.Reflection;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public class NewMap
|
||||
public class Map
|
||||
{
|
||||
// Yaml map data
|
||||
public int MapFormat = 1;
|
||||
@@ -47,17 +47,30 @@ namespace OpenRA.FileFormats
|
||||
public string Tiledata;
|
||||
public byte TileFormat = 1;
|
||||
public int2 Size;
|
||||
public NewTileReference<ushort,byte>[ , ] MapTiles;
|
||||
public NewTileReference<byte, byte>[ , ] MapResources;
|
||||
public TileReference<ushort,byte>[ , ] MapTiles;
|
||||
public TileReference<byte, byte>[ , ] MapResources;
|
||||
|
||||
|
||||
// Temporary compat hacks
|
||||
public int MapSize {get {return Size.X;}}
|
||||
public int XOffset {get {return Bounds[0];}}
|
||||
public int YOffset {get {return Bounds[1];}}
|
||||
public int2 Offset { get { return new int2( Bounds[0], Bounds[1] ); } }
|
||||
public int Width {get {return Bounds[2];}}
|
||||
public int Height {get {return Bounds[3];}}
|
||||
public string Theater {get {return Tileset;}}
|
||||
public IEnumerable<int2> SpawnPoints {get {return Waypoints.Select(kv => kv.Value);}}
|
||||
|
||||
|
||||
|
||||
|
||||
List<string> SimpleFields = new List<string>() {
|
||||
"MapFormat", "Title", "Description", "Author", "PlayerCount", "Tileset", "Tiledata", "Preview", "Size", "Bounds"
|
||||
};
|
||||
|
||||
public NewMap() {}
|
||||
public Map() {}
|
||||
|
||||
public NewMap(string filename)
|
||||
public Map(string filename)
|
||||
{
|
||||
var yaml = MiniYaml.FromFile(filename);
|
||||
|
||||
@@ -140,18 +153,23 @@ namespace OpenRA.FileFormats
|
||||
Size.X = ReadWord(dataStream);
|
||||
Size.Y = ReadWord(dataStream);
|
||||
|
||||
MapTiles = new NewTileReference<ushort, byte>[ Size.X, Size.Y ];
|
||||
MapResources = new NewTileReference<byte, byte>[ Size.X, Size.Y ];
|
||||
|
||||
MapTiles = new TileReference<ushort, byte>[ Size.X, Size.Y ];
|
||||
MapResources = new TileReference<byte, byte>[ Size.X, Size.Y ];
|
||||
|
||||
// Load tile data
|
||||
for( int i = 0 ; i < Size.X ; i++ )
|
||||
for( int j = 0 ; j < Size.Y ; j++ )
|
||||
MapTiles[i, j] = new NewTileReference<ushort,byte>(ReadWord(dataStream),ReadByte(dataStream));
|
||||
{
|
||||
ushort tile = ReadWord(dataStream);
|
||||
byte index = ReadByte(dataStream);
|
||||
byte image = (index == byte.MaxValue) ? (byte)( i % 4 + ( j % 4 ) * 4 ) : index;
|
||||
MapTiles[i, j] = new TileReference<ushort,byte>(tile,index, image);
|
||||
}
|
||||
|
||||
// Load resource data
|
||||
for( int i = 0 ; i < Size.X ; i++ )
|
||||
for( int j = 0 ; j < Size.Y ; j++ )
|
||||
MapResources[i, j] = new NewTileReference<byte,byte>(ReadByte(dataStream),ReadByte(dataStream));
|
||||
MapResources[i, j] = new TileReference<byte,byte>(ReadByte(dataStream),ReadByte(dataStream));
|
||||
}
|
||||
|
||||
public void SaveBinaryData(string filepath)
|
||||
@@ -186,6 +204,16 @@ namespace OpenRA.FileFormats
|
||||
File.Move(filepath+".tmp",filepath);
|
||||
}
|
||||
|
||||
public bool IsInMap(int2 xy)
|
||||
{
|
||||
return IsInMap(xy.X,xy.Y);
|
||||
}
|
||||
|
||||
public bool IsInMap(int x, int y)
|
||||
{
|
||||
return (x >= Bounds[0] && y >= Bounds[1] && x < Bounds[0] + Bounds[2] && y < Bounds[1] + Bounds[3]);
|
||||
}
|
||||
|
||||
public void DebugContents()
|
||||
{
|
||||
foreach (var field in SimpleFields)
|
||||
|
||||
@@ -20,15 +20,24 @@
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public struct NewTileReference<T, U>
|
||||
public struct TileReference<T, U>
|
||||
{
|
||||
public T type;
|
||||
public U index;
|
||||
public U image;
|
||||
|
||||
public NewTileReference(T t, U i)
|
||||
public TileReference(T t, U i)
|
||||
{
|
||||
type = t;
|
||||
index = i;
|
||||
image = i;
|
||||
}
|
||||
|
||||
public TileReference(T t, U i, U im)
|
||||
{
|
||||
type = t;
|
||||
index = i;
|
||||
image = im;
|
||||
}
|
||||
|
||||
public override int GetHashCode() { return type.GetHashCode() ^ index.GetHashCode(); }
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public struct TileReference
|
||||
public struct OldTileReference
|
||||
{
|
||||
public ushort tile;
|
||||
public byte image;
|
||||
@@ -34,11 +34,11 @@ namespace OpenRA.FileFormats
|
||||
if( obj == null )
|
||||
return false;
|
||||
|
||||
TileReference r = (TileReference)obj;
|
||||
OldTileReference r = (OldTileReference)obj;
|
||||
return ( r.image == image && r.tile == tile );
|
||||
}
|
||||
|
||||
public static bool operator ==( TileReference a, TileReference b ) { return a.Equals( b ); }
|
||||
public static bool operator !=( TileReference a, TileReference b ) { return !a.Equals( b ); }
|
||||
public static bool operator ==( OldTileReference a, OldTileReference b ) { return a.Equals( b ); }
|
||||
public static bool operator !=( OldTileReference a, OldTileReference b ) { return !a.Equals( b ); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,13 +85,19 @@ namespace OpenRA.FileFormats
|
||||
tileIdFile.Close();
|
||||
}
|
||||
|
||||
public byte[] GetBytes(TileReference r)
|
||||
public byte[] GetBytes(TileReference<ushort,byte> r)
|
||||
{
|
||||
Terrain tile;
|
||||
|
||||
if( tiles.TryGetValue( r.tile, out tile ) )
|
||||
return tile.TileBitmapBytes[ r.image ];
|
||||
|
||||
Log.Write("Attempting to load tile {0} {1}",r.type,r.image);
|
||||
try {
|
||||
if( tiles.TryGetValue( r.type, out tile ) )
|
||||
return tile.TileBitmapBytes[ r.image ];
|
||||
}
|
||||
catch (System.ArgumentOutOfRangeException)
|
||||
{
|
||||
tiles.TryGetValue( 0xfffe, out tile );
|
||||
return tile.TileBitmapBytes[ 0 ];
|
||||
}
|
||||
byte[] missingTile = new byte[ 24 * 24 ];
|
||||
for( int i = 0 ; i < missingTile.Length ; i++ )
|
||||
missingTile[ i ] = 0x36;
|
||||
@@ -99,13 +105,10 @@ namespace OpenRA.FileFormats
|
||||
return missingTile;
|
||||
}
|
||||
|
||||
public TerrainType GetTerrainType(TileReference r)
|
||||
{
|
||||
if (r.tile == 0xff || r.tile == 0xffff)
|
||||
r.image = 0;
|
||||
|
||||
public TerrainType GetTerrainType(TileReference<ushort,byte> r)
|
||||
{
|
||||
try {
|
||||
return walk[r.tile].TerrainType[r.image];
|
||||
return walk[r.type].TerrainType[r.image];
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.FileFormats
|
||||
|
||||
public class Global
|
||||
{
|
||||
public string Map = "scm02ea.ini";
|
||||
public string Map = "mods/ra/testmap.yaml";
|
||||
public string[] Packages = {}; // filename:sha1 pairs.
|
||||
public string[] Mods = { "ra" }; // mod names
|
||||
public int OrderLatency = 3;
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace OpenRA
|
||||
|
||||
LoadModPackages(manifest);
|
||||
|
||||
Rules.LoadRules(mapName, manifest);
|
||||
Rules.LoadRules(manifest);
|
||||
Timer.Time( "load rules: {0}" );
|
||||
|
||||
world = null; // trying to access the old world will NRE, rather than silently doing it wrong.
|
||||
|
||||
@@ -35,8 +35,8 @@ namespace OpenRA
|
||||
public static Dictionary<string, VoiceInfo> Voices;
|
||||
public static Dictionary<TerrainType, TerrainCost> TerrainTypes;
|
||||
|
||||
public static void LoadRules(string map, Manifest m)
|
||||
{
|
||||
public static void LoadRules(Manifest m)
|
||||
{
|
||||
Log.Write("Using rules files: ");
|
||||
foreach (var y in m.Rules)
|
||||
Log.Write(" -- {0}", y);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.GameRules
|
||||
// External game settings
|
||||
public readonly string NetworkHost = "";
|
||||
public readonly int NetworkPort = 0;
|
||||
public readonly string Map = "scm02ea.ini";
|
||||
public readonly string Map = "mods/ra/testmap.yaml";
|
||||
public readonly int Player = 1;
|
||||
public readonly string Replay = "";
|
||||
public readonly string PlayerName = "";
|
||||
|
||||
@@ -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.
|
||||
* This file is part of OpenRA.
|
||||
@@ -46,6 +46,7 @@ namespace OpenRA.Graphics
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
/*
|
||||
var shroud = Game.world.LocalPlayer.Shroud;
|
||||
|
||||
for (int y = map.YOffset; y < map.YOffset + map.Height; y++)
|
||||
@@ -63,6 +64,7 @@ namespace OpenRA.Graphics
|
||||
}
|
||||
|
||||
spriteRenderer.Flush();
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Graphics
|
||||
|
||||
Size tileSize = new Size( Game.CellSize, Game.CellSize );
|
||||
|
||||
var tileMapping = new Cache<TileReference, Sprite>(
|
||||
var tileMapping = new Cache<TileReference<ushort,byte>, Sprite>(
|
||||
x => SheetBuilder.SharedInstance.Add(world.TileSet.GetBytes(x), tileSize));
|
||||
|
||||
Vertex[] vertices = new Vertex[4 * map.Height * map.Width];
|
||||
|
||||
@@ -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.
|
||||
* This file is part of OpenRA.
|
||||
@@ -31,22 +31,25 @@ namespace OpenRA
|
||||
|
||||
public static void AddSmudge(this Map map, bool isCrater, int x, int y)
|
||||
{
|
||||
/*
|
||||
var smudge = map.MapTiles[x, y].smudge;
|
||||
if (smudge == 0)
|
||||
map.MapTiles[x, y].smudge = (byte) (isCrater
|
||||
? (firstCrater + framesPerCrater * ChooseSmudge())
|
||||
: (firstScorch + ChooseSmudge()));
|
||||
|
||||
if (smudge < firstCrater || !isCrater) return; /* bib or scorch; don't change */
|
||||
if (smudge < firstCrater || !isCrater) return; / * bib or scorch; don't change * /
|
||||
|
||||
/* deepen the crater */
|
||||
/ * deepen the crater * /
|
||||
var amount = (smudge - firstCrater) % framesPerCrater;
|
||||
if (amount < framesPerCrater - 1)
|
||||
map.MapTiles[x, y].smudge++;
|
||||
*/
|
||||
}
|
||||
|
||||
public static void AddSmudge(this Map map, int2 targetTile, WarheadInfo warhead)
|
||||
{
|
||||
/*
|
||||
if (warhead.SmudgeType == SmudgeType.None) return;
|
||||
if (warhead.Size[0] == 0 && warhead.Size[1] == 0)
|
||||
map.AddSmudge(warhead.SmudgeType == SmudgeType.Crater, targetTile.X, targetTile.Y);
|
||||
@@ -55,9 +58,10 @@ namespace OpenRA
|
||||
if ((t - targetTile).LengthSquared >= warhead.Size[1] * warhead.Size[1])
|
||||
if (Rules.TerrainTypes[Game.world.GetTerrainType(t)].AcceptSmudge)
|
||||
map.AddSmudge(warhead.SmudgeType == SmudgeType.Crater, t.X, t.Y);
|
||||
*/
|
||||
}
|
||||
|
||||
static int lastSmudge = 0;
|
||||
static int ChooseSmudge() { lastSmudge = (lastSmudge + 1) % 6; return lastSmudge; }
|
||||
static int ChooseSmudge() { return 0; /*lastSmudge = (lastSmudge + 1) % 6; return lastSmudge; */}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,10 @@ namespace OpenRA.Traits
|
||||
public object Create(Actor self) { return new Bridge(self); }
|
||||
}
|
||||
|
||||
class Bridge : IRender, ICustomTerrain, INotifyDamage
|
||||
class Bridge // : IRender, ICustomTerrain, INotifyDamage
|
||||
{
|
||||
public Bridge(Actor self) { }
|
||||
/*
|
||||
Dictionary<int2, int> Tiles;
|
||||
List<Dictionary<int2, Sprite>> TileSprites = new List<Dictionary<int2,Sprite>>();
|
||||
List<TileTemplate> Templates = new List<TileTemplate>();
|
||||
@@ -47,7 +49,7 @@ namespace OpenRA.Traits
|
||||
Bridge northNeighbour, southNeighbour;
|
||||
|
||||
public Bridge(Actor self) { this.self = self; self.RemoveOnDeath = false; }
|
||||
|
||||
|
||||
static string cachedTheater;
|
||||
static Cache<TileReference, Sprite> sprites;
|
||||
|
||||
@@ -169,5 +171,6 @@ namespace OpenRA.Traits
|
||||
if (southNeighbour != null) southNeighbour.UpdateState();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace OpenRA.Traits
|
||||
|
||||
void DoBib(Actor self, bool isRemove)
|
||||
{
|
||||
/*
|
||||
var buildingInfo = self.Info.Traits.Get<BuildingInfo>();
|
||||
if (buildingInfo.Bib)
|
||||
{
|
||||
@@ -77,6 +78,7 @@ namespace OpenRA.Traits
|
||||
self.World.Map.MapTiles[p.X, p.Y].smudge = (byte)(i + startIndex);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
protected string GetPrefix(Actor self)
|
||||
|
||||
@@ -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.
|
||||
* This file is part of OpenRA.
|
||||
@@ -25,9 +25,9 @@ namespace OpenRA.Traits
|
||||
{
|
||||
class BridgeLoadHookInfo : StatelessTraitInfo<BridgeLoadHook> { }
|
||||
|
||||
class BridgeLoadHook : ILoadWorldHook
|
||||
class BridgeLoadHook// : ILoadWorldHook
|
||||
{
|
||||
static void MakeBridges(World w)
|
||||
/*static void MakeBridges(World w)
|
||||
{
|
||||
var mini = w.Map.XOffset; var maxi = w.Map.XOffset + w.Map.Width;
|
||||
var minj = w.Map.YOffset; var maxj = w.Map.YOffset + w.Map.Height;
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Traits
|
||||
foreach (var br in w.Actors.SelectMany(a => a.traits.WithInterface<Bridge>()))
|
||||
br.FinalizeBridges(w);
|
||||
}
|
||||
|
||||
|
||||
static void ConvertBridgeToActor(World w, int i, int j)
|
||||
{
|
||||
var tile = w.Map.MapTiles[i, j].tile;
|
||||
@@ -84,5 +84,6 @@ namespace OpenRA.Traits
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w) { MakeBridges(w); }
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,16 @@ namespace OpenRA.Traits
|
||||
public object Create(Actor self) { return new ResourceLayer(self); }
|
||||
}
|
||||
|
||||
public class ResourceLayer : IRenderOverlay, ILoadWorldHook
|
||||
class ResourceLayer// : IRenderOverlay, ILoadWorldHook
|
||||
{
|
||||
public ResourceLayer(Actor self) {}
|
||||
public void Destroy(int2 p){}
|
||||
public ResourceTypeInfo GetResource(int2 p) {return null;}
|
||||
public ResourceTypeInfo Harvest(int2 p) {return null;}
|
||||
public void AddResource(ResourceTypeInfo info, int i, int j, int n) {}
|
||||
public void Grow(ResourceTypeInfo info) {}
|
||||
public void Spread(ResourceTypeInfo info) {}
|
||||
/*
|
||||
SpriteRenderer sr;
|
||||
World w;
|
||||
|
||||
@@ -41,7 +49,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
sr = new SpriteRenderer( Game.renderer, true );
|
||||
}
|
||||
|
||||
|
||||
public void Render()
|
||||
{
|
||||
var shroud = Game.world.LocalPlayer.Shroud;
|
||||
@@ -87,7 +95,7 @@ namespace OpenRA.Traits
|
||||
if (content[x, y].type != null)
|
||||
content[x, y].density = GetIdealDensity(x, y);
|
||||
}
|
||||
|
||||
|
||||
public Sprite[] ChooseContent(ResourceTypeInfo info)
|
||||
{
|
||||
return info.Sprites[w.SharedRandom.Next(info.Sprites.Length)];
|
||||
@@ -187,6 +195,7 @@ namespace OpenRA.Traits
|
||||
content[i, j].image = ChooseContent(info);
|
||||
content[i, j].density = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ResourceTypeInfo GetResource(int2 p) { return content[p.X, p.Y].type; }
|
||||
@@ -197,5 +206,6 @@ namespace OpenRA.Traits
|
||||
public Sprite[] image;
|
||||
public int density;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -12,10 +12,10 @@ namespace OpenRA.Traits
|
||||
public void GameStarted(World world)
|
||||
{
|
||||
Game.skipMakeAnims = true; // rude hack
|
||||
|
||||
// TODO: Keep a dictionary of actor reference -> actor somewhere for scripting purposes
|
||||
foreach (var actorReference in world.Map.Actors)
|
||||
world.CreateActor(actorReference.Name, actorReference.Location,
|
||||
world.players.Values.FirstOrDefault(p => p.InternalName == actorReference.Owner)
|
||||
world.CreateActor(actorReference.Value.Name, actorReference.Value.Location,
|
||||
world.players.Values.FirstOrDefault(p => p.InternalName == actorReference.Value.Owner)
|
||||
?? world.NeutralPlayer);
|
||||
|
||||
Game.skipMakeAnims = false;
|
||||
|
||||
@@ -13,11 +13,11 @@ namespace OpenRA.Traits
|
||||
public object Create(Actor self) { return new WallLoadHook( self, this ); }
|
||||
}
|
||||
|
||||
class WallLoadHook : IGameStarted
|
||||
class WallLoadHook // : IGameStarted
|
||||
{
|
||||
WallLoadHookInfo info;
|
||||
public WallLoadHook(Actor self, WallLoadHookInfo info) { this.info = info; }
|
||||
|
||||
/*
|
||||
public void GameStarted(World w)
|
||||
{
|
||||
var map = w.Map;
|
||||
@@ -27,5 +27,6 @@ namespace OpenRA.Traits
|
||||
if (info.OverlayTypes.Contains(w.Map.MapTiles[x, y].overlay))
|
||||
w.CreateActor(info.ActorType, new int2(x, y), w.NeutralPlayer);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +1,68 @@
|
||||
MapFormat: 1
|
||||
Title: Scripted Multiplayer map
|
||||
Description:
|
||||
Author: Me
|
||||
PlayerCount: 2
|
||||
|
||||
Title: Isle of Fury (6-8)
|
||||
|
||||
Author: Westwood Studios
|
||||
|
||||
PlayerCount: 8
|
||||
|
||||
Tileset: TEMPERAT
|
||||
Preview: testmap.png
|
||||
|
||||
Tiledata: testmap.bin
|
||||
|
||||
Size: 128,128
|
||||
|
||||
Bounds: 14,17,96,96
|
||||
|
||||
Actors:
|
||||
Actor0: TC05 Neutral 93,90
|
||||
Actor1: TC04 Neutral 92,92
|
||||
Actor2: TC01 Neutral 88,92
|
||||
Actor3: T11 Neutral 96,93
|
||||
Actor4: T08 Neutral 90,94
|
||||
Actor5: MINE Neutral 67,103
|
||||
Actor6: MINE Neutral 52,97
|
||||
Actor7: MINE Neutral 48,81
|
||||
Actor8: TC05 Neutral 59,103
|
||||
Actor9: TC01 Neutral 52,102
|
||||
Actor10: T08 Neutral 71,97
|
||||
Actor11: T08 Neutral 50,94
|
||||
Actor12: MINE Neutral 47,78
|
||||
Actor13: T14 Neutral 41,52
|
||||
Actor14: MINE Neutral 37,44
|
||||
Actor15: MINE Neutral 27,52
|
||||
Actor16: MINE Neutral 64,79
|
||||
Actor17: MINE Neutral 64,62
|
||||
Actor18: MINE Neutral 61,24
|
||||
Actor19: MINE Neutral 68,27
|
||||
Actor20: MINE Neutral 61,35
|
||||
Actor21: MINE Neutral 89,50
|
||||
Actor22: MINE Neutral 67,98
|
||||
Actor23: TC04 Neutral 53,73
|
||||
Actor24: TC03 Neutral 81,65
|
||||
Actor25: TC04 Neutral 97,41
|
||||
Actor26: TC05 Neutral 67,49
|
||||
Actor27: TC02 Neutral 53,59
|
||||
Actor28: TC03 Neutral 22,51
|
||||
Actor29: TC01 Neutral 25,53
|
||||
Actor30: TC01 Neutral 47,22
|
||||
Actor31: TC02 Neutral 32,36
|
||||
Actor32: TC02 Neutral 25,77
|
||||
Actor33: TC04 Neutral 28,81
|
||||
Actor34: TC02 Neutral 29,87
|
||||
Actor35: T08 Neutral 25,81
|
||||
Actor36: T08 Neutral 52,59
|
||||
Actor37: T08 Neutral 51,57
|
||||
|
||||
Waypoints:
|
||||
spawn0: 36,75
|
||||
spawn1: 92,29
|
||||
|
||||
Players:
|
||||
neutral:
|
||||
Color:Gray
|
||||
Type:Scripted
|
||||
NoSpawn:true
|
||||
ai:
|
||||
Type:BrutalAI
|
||||
Color:Red
|
||||
Country:Russia
|
||||
# AI player starts with a pre-placed base
|
||||
NoSpawn:true
|
||||
player0:
|
||||
player1:
|
||||
|
||||
Actors:
|
||||
tree0: TC05 neutral 93,90
|
||||
tree1: TC04 neutral 92,92
|
||||
tree2: TC01 neutral 88,92
|
||||
tree3: T11 neutral 96,93
|
||||
tree4: T08 neutral 90,94
|
||||
mine0: MINE neutral 67,103
|
||||
|
||||
# <A bunch of pre-placed stuff to give ai player an advantage>
|
||||
pwn01: 4tnk ai 1,1
|
||||
pwn02: 4tnk ai 1,2
|
||||
pwn03: 4tnk ai 1,3
|
||||
# ...
|
||||
spawn0: 87,100
|
||||
spawn1: 36,75
|
||||
spawn2: 92,29
|
||||
spawn3: 31,30
|
||||
spawn4: 61,54
|
||||
spawn5: 91,63
|
||||
spawn6: 34,97
|
||||
spawn7: 63,83
|
||||
|
||||
Rules:
|
||||
Player:
|
||||
ChronoshiftPower:
|
||||
ChargeTime:1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user