Fixed (currently on unstable branch on Steam)
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
#1
Bugs / Re: [1.3.3200 - Base+Roy - Manjaro KDE] Mouse movement doesn't register if it's slow
March 17, 2022, 08:41:47 AM #2
Bugs / Re: [1.3.3200] MinLeaflessTemperature & MaxLeaflessTemperature is not what it is
February 04, 2022, 09:32:38 AM
Interesting! I checked it and it indeed ranges from -18 to -10. I checked the git history and it's been like this at least since 2014, so even if we change the code we'll probably adjust the values to match the old behavior. Thanks for finding this!
#3
Translations / Re: Request: Help check the language workers for accuracy
August 12, 2021, 04:46:05 AMQuote from: ByJacob on November 28, 2019, 02:59:51 PM
Hi developers
It is possibile to add Polish Language Worker to code ??Code Selectpublic class LanguageWorker_Polish : LanguageWorker
{
public override string WithIndefiniteArticle(string str, Gender gender, bool plural = false, bool name = false)
{
return str;
}
public override string WithDefiniteArticle(string str, Gender gender, bool plural = false, bool name = false)
{
return str;
}
private interface IResolver
{
string Resolve(string[] arguments);
}
private class ReplaceResolver : IResolver
{
// ^Replace('{0}', 'jeden-jedna')^
private static readonly Regex _argumentRegex =
new Regex(@"'(?<old>[^']*?)'-'(?<new>[^']*?)'", RegexOptions.Compiled);
public string Resolve(string[] arguments)
{
if (arguments.Length == 0)
{
return null;
}
string input = arguments[0];
if (arguments.Length == 1)
{
return input;
}
for (int i = 1; i < arguments.Length; ++i)
{
string argument = arguments[i];
Match match = _argumentRegex.Match(argument);
if (!match.Success)
{
return null;
}
string oldValue = match.Groups["old"].Value;
string newValue = match.Groups["new"].Value;
if (oldValue == input)
{
return newValue;
}
//Log.Message(string.Format("input: {0}, old: {1}, new: {2}", input, oldGroup.Captures[i].Value, newGroup.Captures[i].Value));
}
return input;
}
}
private class NumberCaseResolver : IResolver
{
// ^Number( {0} | '# komentarz' | '# komentarze' | '# komentarzy' | '# komentarza' )^
// ^Number( {0} | '1 | 2 | 10 | 1/2 )^
private static readonly Regex _numberRegex =
new Regex(@"(?<floor>[0-9]+)(\.(?<frac>[0-9]+))?", RegexOptions.Compiled);
public string Resolve(string[] arguments)
{
if (arguments.Length != 5)
{
return null;
}
string numberStr = arguments[0];
Match numberMatch = _numberRegex.Match(numberStr);
if (!numberMatch.Success)
{
return null;
}
bool hasFracPart = numberMatch.Groups["frac"].Success;
string floorStr = numberMatch.Groups["floor"].Value;
string formOne = arguments[1].Trim('\'');
string formSeveral = arguments[2].Trim('\'');
string formMany = arguments[3].Trim('\'');
string fraction = arguments[4].Trim('\'');
if (hasFracPart)
{
return fraction.Replace("#", numberStr);
}
int floor = int.Parse(floorStr);
return GetFormForNumber(floor, formOne, formSeveral, formMany).Replace("#", numberStr);
}
private static string GetFormForNumber(int number, string formOne, string formSeveral, string formMany)
{
if (number == 1)
{
return formOne;
}
if (number % 10 >= 2 && number % 10 <= 4 && (number % 100 < 10 || number % 100 >= 20))
{
return formSeveral;
}
return formMany;
}
}
private static readonly ReplaceResolver replaceResolver = new ReplaceResolver();
private static readonly NumberCaseResolver numberCaseResolver = new NumberCaseResolver();
private static readonly Regex _languageWorkerResolverRegex =
new Regex(@"\^(?<resolverName>\w+)\(\s*(?<argument>[^|]+?)\s*(\|\s*(?<argument>[^|]+?)\s*)*\)\^",
RegexOptions.Compiled);
public override string PostProcessedKeyedTranslation(string translation)
{
translation = base.PostProcessedKeyedTranslation(translation);
return PostProcess(translation);
}
public override string PostProcessed(string str)
{
str = base.PostProcessed(str);
return PostProcess(str);
}
private static string PostProcess(string translation)
{
return _languageWorkerResolverRegex.Replace(translation, EvaluateResolver);
}
private static string EvaluateResolver(Match match)
{
string keyword = match.Groups["resolverName"].Value;
Group argumentsGroup = match.Groups["argument"];
string[] arguments = new string[argumentsGroup.Captures.Count];
for (int i = 0; i < argumentsGroup.Captures.Count; ++i)
{
arguments[i] = argumentsGroup.Captures[i].Value.Trim();
}
IResolver resolver = GetResolverByKeyword(keyword);
string result = resolver.Resolve(arguments);
if (result == null)
{
Log.Error(string.Format("Error happened while resolving LW instruction: \"{0}\"", match.Value));
return match.Value;
}
return result;
}
private static IResolver GetResolverByKeyword(string keyword)
{
switch (keyword)
{
case "Replace":
return replaceResolver;
case "Number":
return numberCaseResolver;
default:
return null;
}
}
}
Thanks for posting the LanguageWorker! However, since 1.3 we've introduced a new system which makes such custom code unnecessary. We now support "numCase" and "replace" resolvers natively and every language can use them. You could take a look at the Russian language for an example.
#4
Bugs / Re: [1.3.3066-1.3.3072] Game window visually freezes, can still hear gameplay
August 02, 2021, 07:49:13 AM
Thanks for reporting everyone, it could be because we've introduced texture atlases in 1.3 to increase performance. There could be a bug somewhere which prevents the texture atlases from being created correctly, we'll investigate this.
#5
Bugs / Re: [1.2] Scribe-loading collection fails if it contains generic from other assembly
March 12, 2021, 08:57:41 AM
Thanks, added to Mantis.
#6
Bugs / Re: Possible bug in ExplosionCellsToHit
September 17, 2020, 02:54:32 PM
Great find, it's a bug indeed. Thanks! We'll fix it.
#7
Bugs / Re: [1.2.2719] Pawns don't unload inventories after "Attack Work"
August 11, 2020, 08:32:14 AM
Thanks, we'll check it.
#8
Bugs / Re: [1.2.2719] Colonists cant be loaded into shuttle after quest completion
August 11, 2020, 05:45:38 AM
Thanks for reporting! We'll fix it today. The fix will apply to existing games as well, so it should work fine after the update.
#9
Bugs / Re: [1.1.2646] Hosted friends start doing work after update
July 28, 2020, 11:32:30 AM
Could anyone please upload a savefile where this happens? Does it still happen on the unstable branch?
#10
Bugs / Re: [1.1.2647] Hard-Freeze after ~20 min on Mac (Catalina 10.15.2)
July 28, 2020, 11:26:38 AM
Could you please upload the logfile? Maybe it's related to FMOD errors flood.
#11
Bugs / Re: [1.1.2647 Royalty] EMP grenades interaction with the bullet shield psycast
July 28, 2020, 11:20:58 AM
Does it still happen on unstable branch?
#12
Bugs / Re: [1.1.2647]]Red error pop up after 1.1.2647 update.
July 28, 2020, 11:20:33 AM
I think reinstalling the game should help, it sometimes happens when Steam fails to update files properly.
#13
Bugs / Re: [new in 1.1.2647] Colonists won't put out fire
July 28, 2020, 11:16:40 AM
Could you upload a savefile where this happens? Fire reservations should be ignored if the pawn is more than 5 cells away.
#14
Bugs / Re: [1.1.2647] Got prisoner sold into slavery mood debuff when kindly returned him.
July 28, 2020, 11:09:02 AM
It's a known issue, thanks for reporting.
#15
Bugs / Re: [1.1.2647] Bloodlust pawn gets slightly wrong buff
July 28, 2020, 11:00:16 AM
Added to todo, thanks.