• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Status
Not open for further replies.
I have settings.cs file and settings.settings file. Settings.cs is longer, so I think this is needed. Hm... what should I do?

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreLib.Io;
using CoreLib;
using StreamWriter = System.IO.StreamWriter;

namespace MapViewer
{
	public static class Settings
	{
		#region Basic
		private static Dictionary<string, string> data = new Dictionary<string, string>();

		private const string SettingsPath = "settings.txt";
		static Settings()
		{
			if (File.Exists(SettingsPath))
			{
				List<string> vals = File.ReadAndCleanLines(SettingsPath);
				foreach (string s in vals)
				{
					try
					{
						string[] parts = s.Split('=');
						if (parts.Length != 2)
							continue;
						parts[0].ChangeTrim();
						parts[1].ChangeTrim();

						data.Add(parts[0], parts[1]);
					}
					catch
					{
						//A key was invalid, but we don't care, we'll just skip it.
					}
				}
			}
		}

		public static string GetValue(string key)
		{
			string ret;
			if (!data.TryGetValue(key, out ret))
				return string.Empty;
			return ret;
		}
		public static string TryGetValue(string key)
		{
			string ret;
			if (!data.TryGetValue(key, out ret))
				return null;
			return ret;
		}
		public static void SetValue(string key, string value)
		{
			data[key] = value;
			Save();
		}

		private static void Save()
		{
			using (StreamWriter sw = new StreamWriter("settings.txt", false))
			{
				foreach (KeyValuePair<string, string> item in data)
				{
					sw.Write(item.Key);
					sw.Write('=');
					sw.Write(item.Value);
					sw.WriteLine();
				}
			}
		}
		#endregion

		#region File Paths
		private const string GamePathKey = "GamePath";
		public static string GamePath
		{
			get
			{
				string val = TryGetValue(GamePathKey);
				if (val == null)
					SetValue(GamePathKey, string.Empty);
				return val;
			}
			set
			{
				SetValue(GamePathKey, value);
			}
		}
		#endregion
	}
}
 
Estland said:
I have settings.cs file and settings.settings file. Settings.cs is longer, so I think this is needed. Hm... what should I do?
Ignore those files, they are source files.

All you need is settings.txt. Were you able to create it following the instructions?
 
There must be something wrong, I created settings.txt and wrote GamePath=C:\Program Files\Paradox Interactive\Doomsday, it did not work, then put MapViewer and CoreLib.dll to Doomsday folder, and MapViewer closes again, if open.
 
Estland said:
There must be something wrong, I created settings.txt and wrote GamePath=C:\Program Files\Paradox Interactive\Doomsday, it did not work, then put MapViewer and CoreLib.dll to Doomsday folder, and MapViewer closes again, if open.
You have .NET Framwork 3.5?

Try redownloading, the download could have been corrupted.

Is there a specific error message, or is it just "This program has stopped working..."?
 
INFORMATION

The MaxProvince number is actually 2608, not 2610 as MapMaker suggests.

Even doing 2608, the new adjacent.tbl will still crash the game.

After a minor fix in making adjacents, the new and original only differ in the connections between 759 (El Salvador) and 2573 (Coronado Bay). The new adjacent.tbl has them, while the original doesn't. The connection is supposed to be there, as they do border each other. However, using the new one gives a milestone crash, while using the old one doesn't. There is no reason for this discrepancy. However, to deal with the problem, a new version of MapMaker will be released, as well as adj-mod.txt, which must be put in the same place as MapMaker.

The release will come as soon as I confirm that the new lightmaps and adjacent files without the connection work.
 
Nice, I downloaded .NET Framework 3.5 and finally opened MapViewer.

Jamie550 said:
To extract files: you must run MapViewer from the commandline (unless you want to do it in the GUI by pressing Export 65 times).

What/where is commandline?
 
Estland said:
Nice, I downloaded .NET Framework 3.5 and finally opened MapViewer.



What/where is commandline?
It is the command prompt. If you have Vista, in the folder where MapViewer is, hold down shift and right click, then choose "Open Command Window Here". Type mapviewer -extract.

If you don't, then press WindowKey + R, type cmd, press enter, and then navigate to MapViewer's folder and type mapviewer -extract.
 
Gormadoc said:
Is it possible yet to mod the onmap province names ?
Yes, and also to mod the province ownership and borders

The only things that aren't editable which are planned to be editable are the tiles (rivers).

Mapsize, maxprovince, etc. have no plans to become editable.
 
Hey Jamie, I just woke up and tried to extract, this time I had about 1600 MB physical memory available and it stopped extracting at 600. Is it possible you can send me the files so I can start making some maps? :)

Oh by the way, have you fixed the green rivers problem?

Thanks. :)
 
Vladimir II said:
Could somebody explain me how this editor works. It always reports some errors about 1.radish. How to start the program? Thank you very much in advance.

Have you written the path to your HoI2 (Or in my case, victoria) in settings.txt?
 
Uh, that didn't work either.

Can't you send the files? I can't do anything about it if it doesn't work. :(
 
Nope.
 
Status
Not open for further replies.