Porting Mod from B18 -> 1.0 gives Whitespace Errors

Started by DarkSnowi, July 18, 2018, 10:35:01 AM

Previous topic - Next topic

DarkSnowi

Hi there,

today I decided to port my mod from B18 to the unstable 1.0. It was kinda easy, but I need your help with some debug error messages.

The mod only changes some Item-names and descriptions and worked fine in B18, now I get the following:

Config error in Gun_BoltActionRifle: description has trailing whitespace
Verse.Log:Error(String, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:78)
Verse.DefDatabase`1:ErrorCheckAllDefs() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Defs\Databases\DefDatabase.cs:146)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
Verse.GenGeneric:InvokeStaticMethodOnGenericType(Type, Type, String) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Gen\GenGeneric.cs:39)
Verse.PlayDataLoader:DoPlayLoad() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Defs\Databases\PlayDataLoader.cs:232)
Verse.PlayDataLoader:LoadAllPlayData(Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Defs\Databases\PlayDataLoader.cs:32)
Verse.Root:<Start>m__1() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\Root.cs:58)
Verse.LongEventHandler:RunEventFromAnotherThread(Action) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\LongEventHandler.cs:455)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\LongEventHandler.cs:367)


The mod still works as intended but it kinda gives a bad aftertaste. I also dont know what whitespace in that instance means. After doing some research on how whitespace in XML works it shouldn't give this message in my opinion.

Also for some reason this doesn´t trigger the error:

<!-- Pistol -->
<Operation Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName = "Gun_Revolver"]/label</xpath>
<value>
  <label>Single Action Army mod. 1873 Revolver</label>
</value>
</Operation>

<Operation Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName = "Gun_Revolver"]/description</xpath>
<value>
<description>Ancient but reliable pre war revolver design from the old world.

The Single Action Army designation originates from the fact that you need to cock the hammer for every shot. This simple weapon can hold up to 6 powerful .45 caliber rounds inside its cylinder.</description>
</value>
</Operation>


and that does:

<!-- PumpShotgun -->
<Operation Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName = "Gun_PumpShotgun"]/label</xpath>
<value>
  <label>M870 Shotgun</label>
</value>
</Operation>

<Operation Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName = "Gun_PumpShotgun"]/description</xpath>
<value>
<description>Ancient pump action shotgun design from the old World.

A versatile weapon for hunting, sport and home defense. The "easy to use" nature of this gun, plus its great reliability, makes it a popular choice for survivalists around many worlds. Sporting a 12 Gauge Slug makes it a deadly tool in close quarter combat.</description>
</value>
</Operation>


Does someone know whats going on? Theories are welcome.

DarkSnowi

Okay I somehow got rid of all the whitespace errors. Just played around with the descriptions just to revert them back in the end, don't know what fixed it.

UNIT5

Looks almost like the space right after the end of this sentence:

<description>Ancient pump action shotgun design from the old World.

Could be causing it. No idea why it would do so though.

Edit: Funnily enough I just got this message and deleting and retyping everything seemed to fix it.






AileTheAlien

No clue; I don't see any trailing whitespace in those descriptions, and copy-pasting it into an editor doesn't show anything besides the normal letters / punctuation before the </description>.