[C#] Mapmaking in csharp

qbz

qbz

Level 4
Joined
Dec 1, 2019
Messages
80
Running into an issue, not sure whether or not what I'm doing is expected to be supported. I try to deserialize a json str to an array of custom types.

The following C#

Code:
static public void LoadInputData(string jsonStr)
    {
        if (!m_bLoadedInputData)
        {
            try
            {
                m_UnitInputData = System.Text.Json.JsonSerializer.Deserialize<InputData.Unit[]>(jsonStr);
                Log.Quick("Deserialized json");
            }
            catch(Exception e)
            {
                Log.Error(e.Message);
            }

            m_bLoadedInputData = true;
        }
        else
        {
            Log.Error("Attempting to load input data from json str after it's already been loaded.");
        }
    }

generates the following lua

Code:
        LoadInputData = function (unitInputData)
          if not m_bLoadedInputData then
            class.m_UnitInputData = unitInputData
            m_bLoadedInputData = true
          else
            Helpers.Log.Error("Attempting to load input data from array after it's already been loaded.", 30)
          end
        end
        LoadInputData1 = function (jsonStr)
          if not m_bLoadedInputData then
            System.try(function ()
/*18851:*/ class.m_UnitInputData = SystemTextJson.JsonSerializer.Deserialize(jsonStr, nil, ArrayUnit)
              Helpers.Log.Quick("Deserialized json", 15)
            end, function (default)
              local e = default
              Helpers.Log.Error(e:getMessage(), 30)
            end)

            m_bLoadedInputData = true
          else
            Helpers.Log.Error("Attempting to load input data from json str after it's already been loaded.", 30)
          end
        end
        InitFromInputData = function ()
          if not m_bLoadedInputData then
            Helpers.Log.Error("Attempting to init data but no input data has been laoded.", 30)
          end

which errs with..
war3.map.lua.18851: attempt to index a nil value (upvalue 'SystemTextJson')

I can deserialize the same constant string in a standalone c# console app using the same types.
 
Last edited:
Level 12
Joined
Jan 1, 2018
Messages
526
war3.map.lua.18851: attempt to index a nil value (upvalue 'SystemTextJson')
This means that the class/namespace does not exist. In this case you'd have to implement it yourself, or ask for it to be implemented here (though the core library is meant to be lightweight so it may not get added).
If you add it yourself, you can take a look here.
 

qbz

qbz

Level 4
Joined
Dec 1, 2019
Messages
80
Ah ok. I'll head over to the c# lua repo and ask what he recommends for serialization, if anything is supported. If not, maybe I'll look into supporting it. Gotta decide if itd be easier to add support or just generate a c# header that constant initializes data instead of generating a header with a chunk of data I can deserialize. Thanks
 

qbz

qbz

Level 4
Joined
Dec 1, 2019
Messages
80
Not sure if I've messed up my project somehow or this functionality regressed because I know I've used it successfully before, but trying to use any War3Api.Blizzard functionality results in a crash. I wanted to SetUnitLifeBJ, also tested IsUnitAliveBJ and IAbsBJ. They all crash with"
war3map.lua:17973: attempt to index a nil value (field 'Blizzard').

C#
Code:
                try
                {
                    //SetUnitLifeBJ(wu, (float)u.m_StatData.m_Health);
                    //IsUnitAliveBJ(wu);
                    Helpers.Log.Warning(IAbsBJ(-2).ToString());
                }
                catch(Exception e)
                {
                    Helpers.Log.Error(e.Message);
                }

lua
Code:
        System.try(function ()
          --SetUnitLifeBJ(wu, (float)u.m_StatData.m_Health);
          --IsUnitAliveBJ(wu);
          Helpers.Log.Warning(System.Int32.ToString(War3Api.Blizzard.IAbsBJ(- 2)), 20)
        end, function (default)
          local e = default
          Helpers.Log.Error(e:getMessage(), 30)
        end)

I use plenty of War3Api.Common 1.32.0.4-beta2 with no issues in the same file. The project includes War3Api.Blizzard 1.32.0.4-beta2 as a package.
 
Level 12
Joined
Jan 1, 2018
Messages
526
Not sure if I've messed up my project somehow or this functionality regressed because I know I've used it successfully before, but trying to use any War3Api.Blizzard functionality results in a crash.
Thanks for reporting this bug, it's fixed in v1.5.8 of the CSharpLua package.
 
Level 12
Joined
Jan 1, 2018
Messages
526
Update:
  • War3Net.Build updated to v1.0.0-rc2, adding mostly some constructors for data types that were previously read-only, allowing you to instantiate them through code in addition to parsing.
  • Added some more warnings when building a map, when it expects a certain file but cannot find it.
Since there's only one week left until reforged releases, I don't expect any more updates until then (unless there's some critical bug that need fixing).
 

qbz

qbz

Level 4
Joined
Dec 1, 2019
Messages
80
Not sure if intended to support existing map with units already in it but I figure you probably at least dont intend it to crash. Not really a big problem for me, 2 second workaround, but just figured youd wanna know.

upload_2020-1-21_19-39-44.png

upload_2020-1-21_19-39-50.png
 
Level 12
Joined
Jan 1, 2018
Messages
526
Not sure if intended to support existing map with units already in it but I figure you probably at least dont intend it to crash. Not really a big problem for me, 2 second workaround, but just figured youd wanna know.
I have been working on supporting that recently. Can you send me the war3mapUnits.doo file that causes this exception?
 

qbz

qbz

Level 4
Joined
Dec 1, 2019
Messages
80
Attached units.doo from two maps. One has a single bandit and repros, the other is exactly the same except no units and works as expected.
 

Attachments

  • war3mapUnits_ReproAndNotRepro.zip
    414 bytes · Views: 17
Level 12
Joined
Jan 1, 2018
Messages
526
Attached units.doo from two maps. One has a single bandit and repros, the other is exactly the same except no units and works as expected.
I'm unable to reproduce the error, can you check that you're using the latest package versions?
 

qbz

qbz

Level 4
Joined
Dec 1, 2019
Messages
80
Uh i updated to rc2 last night which i figured let me remove explicit inclusion of c sharp lua 1.5.8.

One added complexity is the map is made in reforged editor and I'm loading it in old wc3 maybe? I can test when i get home if it repros with old wc3 editor.

But i can repro 100% dropping a unit into my map and saving it. Goes away after removing unit and re-saving map.

If needed i can give you read access to my private repo to make a repro easier.
 
Level 12
Joined
Jan 1, 2018
Messages
526
Uh i updated to rc2 last night which i figured let me remove explicit inclusion of c sharp lua 1.5.8.

One added complexity is the map is made in reforged editor and I'm loading it in old wc3 maybe? I can test when i get home if it repros with old wc3 editor.

But i can repro 100% dropping a unit into my map and saving it. Goes away after removing unit and re-saving map.

If needed i can give you read access to my private repo to make a repro easier.
The thing is, you showed an exception occuring somewhere in the MapUnits.Parse method, but when I add the files you uploaded to the test suite here, the test passes for those files.
 

qbz

qbz

Level 4
Joined
Dec 1, 2019
Messages
80
Ah I cant believe I made the same mistake twice. I sent the file from generated artifacts instead of the input map. Hopefully this repros. I tried to clone and repro in war3 net but unfamiliar with c# test stuff not sure how to actually run the tests. Renamed to .txt b/c it won't let me upload a .doo
 

Attachments

  • war3mapUnits.txt
    246 bytes · Views: 16
Level 12
Joined
Jan 1, 2018
Messages
526
Ah I cant believe I made the same mistake twice. I sent the file from generated artifacts instead of the input map. Hopefully this repros. I tried to clone and repro in war3 net but unfamiliar with c# test stuff not sure how to actually run the tests. Renamed to .txt b/c it won't let me upload a .doo
Thank you so much for this test file, I was finally able to figure out how to properly parse war3mapUnits.doo (you may remember this earlier issue). It turns out that you should actually check the subversion as well as the version to determine whether or not to parse TFT-only data.
I have not yet uploaded a new package version with this fix, since I want to make some more changes first, but you can expect a new version later today.
 

qbz

qbz

Level 4
Joined
Dec 1, 2019
Messages
80
Did you pull down template changes? I know the syntax for player data changed so if you have old versions of the player data and map info flies they'll no longer compile with newer packages
 
Level 12
Joined
Jan 1, 2018
Messages
526
Is the template up-to-date? I can't build it, it complains about undefined MapInfo and PlayerData for example. This started happening after I updated the packages.
It's not fully updated, since it targets War3Net.Build v1.0.0-rc1, while latest is v1.0.0-rc2.
The errors you get are probably from some backwards-compatibility breaking changes that have happened in the past. I think I have commented about them in this thread before, but I'll repeat them since the thread has been getting quite large and I don't expect you to read through it all finding the answer.
  • The class MapInfo was relocated from namespace War3Net.Build to War3Net.Build.Info.
  • The class PlayerData no longer has a public constructor that takes 0 arguments. You can now use the static method PlayerData.Create instead.
These two changes are probably the ones causing an error for you. I think you can probably figure out from here what changes you need to make to get things working again, but if not feel free to ask.

EDIT: War3Net.Build is now updated to v1.0.0-rc3.
 
Last edited:
Level 4
Joined
Oct 22, 2019
Messages
32
It's not fully updated, since it targets War3Net.Build v1.0.0-rc1, while latest is v1.0.0-rc2.
The errors you get are probably from some backwards-compatibility breaking changes that have happened in the past. I think I have commented about them in this thread before, but I'll repeat them since the thread has been getting quite large and I don't expect you to read through it all finding the answer.
  • The class MapInfo was relocated from namespace War3Net.Build to War3Net.Build.Info.
  • The class PlayerData no longer has a public constructor that takes 0 arguments. You can now use the static method PlayerData.Create instead.
These two changes are probably the ones causing an error for you. I think you can probably figure out from here what changes you need to make to get things working again, but if not feel free to ask.

EDIT: War3Net.Build is now updated to v1.0.0-rc3.
Here's what I did:

diff --git a/War3Map.Template.Launcher/MapInfo.cs b/War3Map.Template.Launcher/MapInfo.cs
index 0827aa3..f5952af 100644
--- a/War3Map.Template.Launcher/MapInfo.cs
+++ b/War3Map.Template.Launcher/MapInfo.cs
@@ -1 +1 @@
-using War3Net.Build.Info;
+using War3Net.Build;
@@ -9 +9 @@ namespace War3Map.Template.Launcher
- var mapInfo = MapInfo.Default;
+ var mapInfo = new MapInfo();
diff --git a/War3Map.Template.Launcher/PlayerAndForceSettings.cs b/War3Map.Template.Launcher/PlayerAndForceSettings.cs
index cf2e33c..95d83f9 100644
--- a/War3Map.Template.Launcher/PlayerAndForceSettings.cs
+++ b/War3Map.Template.Launcher/PlayerAndForceSettings.cs
@@ -1 +1 @@
-using War3Net.Build.Info;
+using War3Net.Build;
@@ -10 +10,2 @@ namespace War3Map.Template.Launcher
- var player0 = PlayerData.Create(0);
+ var player0 = new PlayerData();
+ player0.PlayerNumber = 0;
@@ -17 +18,2 @@ namespace War3Map.Template.Launcher
- var player1 = PlayerData.Create(1);
+ var player1 = new PlayerData();
+ player1.PlayerNumber = 1;
@@ -24 +26,2 @@ namespace War3Map.Template.Launcher
- var player2 = PlayerData.Create(23);
+ var player2 = new PlayerData();
+ player2.PlayerNumber = 23;
diff --git a/War3Map.Template.Launcher/Program.cs b/War3Map.Template.Launcher/Program.cs
index 787fe47..973093a 100644
--- a/War3Map.Template.Launcher/Program.cs
+++ b/War3Map.Template.Launcher/Program.cs
@@ -15,0 +16 @@ namespace War3Map.Template.Launcher
+ private const string BaseMapPath = @"..\..\..\..\MyMapFolder.w3x";
@@ -22 +23 @@ namespace War3Map.Template.Launcher
- private const string Warcraft3ExecutableFilePath = null;
+ private const string Warcraft3ExecutableFilePath = @"C:\Program Files\Warcraft III\x86_64\Warcraft III.exe";
@@ -32,2 +33 @@ namespace War3Map.Template.Launcher
- var buildResult = mapBuilder.Build(options, AssetsFolderPath);
- if (buildResult.Success)
+ if (mapBuilder.Build(options, AssetsFolderPath, BaseMapPath))
@@ -67,4 +66,0 @@ namespace War3Map.Template.Launcher
- else
- {
- throw new Exception(buildResult.Diagnostics.Where(diagnostic => diagnostic.Severity == Microsoft.CodeAnalysis.DiagnosticSeverity.Error).First().GetMessage());
- }
diff --git a/War3Map.Template.Launcher/War3Map.Template.Launcher.csproj b/War3Map.Template.Launcher/War3Map.Template.Launcher.csproj
index 79a69eb..83b68f0 100644
--- a/War3Map.Template.Launcher/War3Map.Template.Launcher.csproj
+++ b/War3Map.Template.Launcher/War3Map.Template.Launcher.csproj
@@ -13 +13 @@
- <PackageReference Include="War3Net.Build" Version="1.0.0-rc1" />
+ <PackageReference Include="War3Net.Build" Version="0.2.1" />

Now I get an exception:
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=War3Net.Build
StackTrace:
at War3Net.Build.MapInfo.SerializeTo(Stream stream, Boolean leaveOpen)
at War3Net.Build.MapBuilder.Build(ScriptCompilerOptions compilerOptions, String[] assetsDirectories)
at War3Map.Template.Launcher.Program.Main() in C:\Users\User\Source\Repos\ambition\War3Map.Template.Launcher\Program.cs:line 33
Without updating packages, it works. So I guess I can just keep using the old one.
 
Level 12
Joined
Jan 1, 2018
Messages
526
Here's what I did:

diff --git a/War3Map.Template.Launcher/MapInfo.cs b/War3Map.Template.Launcher/MapInfo.cs
index 0827aa3..f5952af 100644
--- a/War3Map.Template.Launcher/MapInfo.cs
+++ b/War3Map.Template.Launcher/MapInfo.cs
@@ -1 +1 @@
-using War3Net.Build.Info;
+using War3Net.Build;
@@ -9 +9 @@ namespace War3Map.Template.Launcher
- var mapInfo = MapInfo.Default;
+ var mapInfo = new MapInfo();
diff --git a/War3Map.Template.Launcher/PlayerAndForceSettings.cs b/War3Map.Template.Launcher/PlayerAndForceSettings.cs
index cf2e33c..95d83f9 100644
--- a/War3Map.Template.Launcher/PlayerAndForceSettings.cs
+++ b/War3Map.Template.Launcher/PlayerAndForceSettings.cs
@@ -1 +1 @@
-using War3Net.Build.Info;
+using War3Net.Build;
@@ -10 +10,2 @@ namespace War3Map.Template.Launcher
- var player0 = PlayerData.Create(0);
+ var player0 = new PlayerData();
+ player0.PlayerNumber = 0;
@@ -17 +18,2 @@ namespace War3Map.Template.Launcher
- var player1 = PlayerData.Create(1);
+ var player1 = new PlayerData();
+ player1.PlayerNumber = 1;
@@ -24 +26,2 @@ namespace War3Map.Template.Launcher
- var player2 = PlayerData.Create(23);
+ var player2 = new PlayerData();
+ player2.PlayerNumber = 23;
diff --git a/War3Map.Template.Launcher/Program.cs b/War3Map.Template.Launcher/Program.cs
index 787fe47..973093a 100644
--- a/War3Map.Template.Launcher/Program.cs
+++ b/War3Map.Template.Launcher/Program.cs
@@ -15,0 +16 @@ namespace War3Map.Template.Launcher
+ private const string BaseMapPath = @"..\..\..\..\MyMapFolder.w3x";
@@ -22 +23 @@ namespace War3Map.Template.Launcher
- private const string Warcraft3ExecutableFilePath = null;
+ private const string Warcraft3ExecutableFilePath = @"C:\Program Files\Warcraft III\x86_64\Warcraft III.exe";
@@ -32,2 +33 @@ namespace War3Map.Template.Launcher
- var buildResult = mapBuilder.Build(options, AssetsFolderPath);
- if (buildResult.Success)
+ if (mapBuilder.Build(options, AssetsFolderPath, BaseMapPath))
@@ -67,4 +66,0 @@ namespace War3Map.Template.Launcher
- else
- {
- throw new Exception(buildResult.Diagnostics.Where(diagnostic => diagnostic.Severity == Microsoft.CodeAnalysis.DiagnosticSeverity.Error).First().GetMessage());
- }
diff --git a/War3Map.Template.Launcher/War3Map.Template.Launcher.csproj b/War3Map.Template.Launcher/War3Map.Template.Launcher.csproj
index 79a69eb..83b68f0 100644
--- a/War3Map.Template.Launcher/War3Map.Template.Launcher.csproj
+++ b/War3Map.Template.Launcher/War3Map.Template.Launcher.csproj
@@ -13 +13 @@
- <PackageReference Include="War3Net.Build" Version="1.0.0-rc1" />
+ <PackageReference Include="War3Net.Build" Version="0.2.1" />

Now I get an exception:

Without updating packages, it works. So I guess I can just keep using the old one.
The NullReferenceException is caused by the properties CameraBounds and CameraBoundsComplements in MapInfo being null. In the old package (v0.2.1), when using the MapInfo constructor, these do not get set to a default value. However, if you update to v1.0.0, you can instead use the MapInfo.Default static property, and they'll be set to their default value:
C#:
const int DefaultSize = 32;
const int DefaultLeftComplement = 6;
const int DefaultRightComplement = 6;
const int DefaultTopComplement = 8;
const int DefaultBottomComplement = 4;
const int DefaultHorizontalBoundsOffset = 4;
const int DefaultVerticalBoundsOffset = 2;
const float TileSize = 128f;
info._cameraBounds = new Quadrilateral(
    -TileSize * (DefaultSize - DefaultLeftComplement - DefaultHorizontalBoundsOffset),
    TileSize * (DefaultSize - DefaultRightComplement - DefaultHorizontalBoundsOffset),
    TileSize * (DefaultSize - DefaultTopComplement - DefaultVerticalBoundsOffset),
    -TileSize * (DefaultSize - DefaultBottomComplement - DefaultVerticalBoundsOffset));
info._cameraBoundsComplements = new RectangleMargins(DefaultLeftComplement, DefaultRightComplement, DefaultBottomComplement, DefaultTopComplement);
info._playableMapAreaWidth = (2 * DefaultSize) - DefaultLeftComplement - DefaultRightComplement;
info._playableMapAreaHeight = (2 * DefaultSize) - DefaultBottomComplement - DefaultTopComplement;
 
Level 12
Joined
Jan 1, 2018
Messages
526
Very minor issue not sure if intended to be supported but facing information for existing units in a map is lost and they're set to 0 degrees
Might be related to needing to convert radians/degrees, I'll look into it later.
 
Level 12
Joined
Jan 1, 2018
Messages
526
I just downloaded 1.32 and the first thing I did was update my packages.
  • War3Api.Common and War3Api.Blizzard updated to v1.32.0 (you can see the changes since 1.32.0.4 beta here).
  • War3Net.Build updated to v1.0.0 (no more messing with prerelease waiting for reforged to finally arrive). From now on I will try to properly document all changes I make, so it should be easier to update when there are breaking changes in a new version. You can find the changelog here.
I haven't actually tested anything myself yet, since my laptop has only 4GB RAM, so I can no longer multitask with visual studio and warcraft III open at the same time.
 

qbz

qbz

Level 4
Joined
Dec 1, 2019
Messages
80
Hm interesting. I have two guesses as to what it could be.

First, looks like you used a tileset other than the default. Maybe it's related to that? I'm sure that's intended to be supported but i haven't personally tested it.

Second, maybe it was regressed in recent package updates? I think the final version was tested in rc2 of wc3 build. My personal project uses rc3 no problem but i haven't tried the newest packages yet

I'll poke around and see if i can repro later tonight
 
Level 12
Joined
Jan 1, 2018
Messages
526
I followed tutorial and imported terrain from a base map, but my terrain textures are broken in-game when I run War3Map.Template.Launcher.
Have you tried testing the base map in the world editor to see if it also looks like this?
If it does, it's a reforged bug.
If not, only cause I can think of right now might be that the tileset you used is different from the default MapInfo.Tileset property.
 
Level 4
Joined
Dec 19, 2004
Messages
73
Have you tried testing the base map in the world editor to see if it also looks like this?
If it does, it's a reforged bug.
If not, only cause I can think of right now might be that the tileset you used is different from the default MapInfo.Tileset property.
Yes, I've tested it in the world editor and there is no bug.
I just used the Sunken Ruins tileset and applied some elavation cliffs on small bricks texture.
There was no MapInfo.Tileset property set in my MapInfo.cs

Adding

mapInfo.Tileset = Tileset.SunkenRuins;

fixed my issue, thank you.



4MX6M6y.jpg
 
Last edited:
Level 12
Joined
Jan 1, 2018
Messages
526
Which one supports 1.31 patch? Kinda out of loop after a while. Just getting back on C# ropes.
You should be able to use the latest package when developing for 1.31, just make sure you set the MapInfo.FormatVersion to MapInfoFormatVersion.Lua, since the default is now Reforged.
 
Level 12
Joined
Jan 1, 2018
Messages
526
Update:
  • Support unit, item, and destructable skins in reforged .doo files.
  • Default MapInfo.FormatVersion set back to v1.31 format.
    • If you want to set reforged-only properties of the MapInfo, you must now first set its FormatVersion to Reforged, or you get a NotSupportedException.
You can find the full changelog here.
Latest version of War3Net.Build is now v1.1.0
 

qbz

qbz

Level 4
Joined
Dec 1, 2019
Messages
80
1.0.0 throws

System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'
InvalidDataException: The .w3i file has a Reforged file format version, but contains non-Reforged PlayerData.
 
Level 12
Joined
Jan 1, 2018
Messages
526
1.0.0 throws

System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'
InvalidDataException: The .w3i file has a Reforged file format version, but contains non-Reforged PlayerData.
Two ways to fix this. Either you set MapInfo.FileFormat to .Lua, or you set the boolean argument when creating PlayerData to true. The first method is probably easier so I'd try that.
 
Level 12
Joined
Jan 1, 2018
Messages
526
Ya that got me past it. Hang on load also present in 1.0.0
Can you check the diff for artifacts/war3map.lua for v1.0.0-rc3 and v1.0.0? If it's not the map script that's causing it, I'm not really sure what else could the cause be right now.
 

qbz

qbz

Level 4
Joined
Dec 1, 2019
Messages
80
Hmm not sure. "." is escaped now in paths but i reverted that in lua files and issue persisted so thats probably fine. only other lua dif is im guessing radians to degrees in create unit calls generated for the existing units in my map.

All binary files are identical except .w3i and .w3x

Both sets artifacts attached
 

Attachments

  • artifacts.zip
    598.2 KB · Views: 31
Level 12
Joined
Jan 1, 2018
Messages
526
Hmm not sure. "." is escaped now in paths
Hmm that might actually be the cause, I was lazy and use Regex.Escape, but it escapes more characters than needed (only \\ \t \r \n \f needs to be escaped).

All binary files are identical except .w3i and .w3x
For .w3i the only difference is the GameVersion (v1.31.something vs v1.32.something). If you wanna be safe, you can try setting it to 1.31.1.12164 but it really shouldn't matter.

Edit: I'll upload the fix for escaping '.' tomorrow, hopefully by then this issue will be fixed as well so I don't need to upload a new package version just for that. You can keep using rc3 in the meantime.

Edit2: Updated War3Net.CSharpLua to 1.5.9 and War3Net.Build to 1.1.1, let me know if you're still running into issues.
 
Last edited:
Level 12
Joined
Jan 1, 2018
Messages
526
Is there an easy way to create object editor data without the World Editor?
It would certainly make things more interesting.

Perhaps Ceres would do... or the Object Merger.
This is something I want to support eventually, but right now you'll have to make your own system for this.

If you know the file format, it's not that hard really. You can also check here for an example implementation in C#.
 
Level 4
Joined
Oct 22, 2019
Messages
32
This doesn't seem to support regions? The map fails to load.
Steps to reproduce:
  1. Clone template
  2. Make a map for it that contains a region
  3. Try to run, empty error box appears at main menu
I think this is the .w3r format, in case you need it:
Code:
HEADER
        i32     versionNumber=5
        i32     numRects
RECT DEFINITION REPEATED numRects TIMES
        f32     left, bottom, right, top
        char[]  name
        char    ='\0'
        i32     creationNumber
        char[4] weatherId
        char[]  sndName
        char    ='\0'
        u8      r, g, b
        u8      =0xFF
 
Level 12
Joined
Jan 1, 2018
Messages
526
This doesn't seem to support regions? The map fails to load.
Steps to reproduce:
  1. Clone template
  2. Make a map for it that contains a region
  3. Try to run, empty error box appears at main menu
I think this is the .w3r format, in case you need it:
Code:
HEADER
        i32     versionNumber=5
        i32     numRects
RECT DEFINITION REPEATED numRects TIMES
        f32     left, bottom, right, top
        char[]  name
        char    ='\0'
        i32     creationNumber
        char[4] weatherId
        char[]  sndName
        char    ='\0'
        u8      r, g, b
        u8      =0xFF
Regions should be supported, but I haven't really tested maps containing them in-game yet. Can you upload the .w3r file so I can have a look?
 
Top