I just ran a tiny test copy pasting a class from the default packages - in particular, the lumberjack:
I changed the Namespace to the namespace of my mod, leaving the class name as Lumberjack, and got a crash-on-load:
Changing the class name to MyLumberjack (and renaming the file to match) cleared up the COL:
Can anyone confirm? Or... is this not what namespaces do in C#? I'm a little new to it.
Code:
using System;
using TaleWorlds.Engine;
namespace TaleWorlds.MountAndBlade
{
// Token: 0x020002F5 RID: 757
public class Lumberjack : ScriptComponentBehaviour
{
// Token: 0x060024EC RID: 9452 RVA: 0x00085C44 File Offset: 0x00083E44
protected internal override void OnTick(float dt)
{
base.OnTick(dt);
if (!this._initialized)
{
this._initialized = true;
base.GameEntity.CreateSimpleSkeleton("human_skeleton");
base.GameEntity.CopyComponentsToSkeleton();
base.GameEntity.Skeleton.SetAnimationAtChannel("lumberjack", 0, 1f, -1f, 0f);
MetaMesh copy = MetaMesh.GetCopy("peasent_hatchet", true, false);
base.GameEntity.AddMultiMeshToSkeletonBone(copy, 27);
}
}
// Token: 0x04000DB0 RID: 3504
private bool _initialized;
}
}
I changed the Namespace to the namespace of my mod, leaving the class name as Lumberjack, and got a crash-on-load:
Code:
using System;
using TaleWorlds.Engine;
using TaleWorlds.MountAndBlade;
namespace TestMod
{
// Token: 0x020002F5 RID: 757
public class Lumberjack : ScriptComponentBehaviour
{
// Token: 0x060024EC RID: 9452 RVA: 0x00085C44 File Offset: 0x00083E44
protected override void OnTick(float dt)
{
base.OnTick(dt);
if (!this._initialized)
{
this._initialized = true;
base.GameEntity.CreateSimpleSkeleton("human_skeleton");
base.GameEntity.CopyComponentsToSkeleton();
base.GameEntity.Skeleton.SetAnimationAtChannel("lumberjack", 0, 1f, -1f, 0f);
MetaMesh copy = MetaMesh.GetCopy("peasent_hatchet", true, false);
base.GameEntity.AddMultiMeshToSkeletonBone(copy, 27);
}
}
// Token: 0x04000DB0 RID: 3504
private bool _initialized;
}
}
Changing the class name to MyLumberjack (and renaming the file to match) cleared up the COL:
Code:
using System;
using TaleWorlds.Engine;
using TaleWorlds.MountAndBlade;
namespace TestMod
{
// Token: 0x020002F5 RID: 757
public class MyLumberjack : ScriptComponentBehaviour
{
// Token: 0x060024EC RID: 9452 RVA: 0x00085C44 File Offset: 0x00083E44
protected override void OnTick(float dt)
{
base.OnTick(dt);
if (!this._initialized)
{
this._initialized = true;
base.GameEntity.CreateSimpleSkeleton("human_skeleton");
base.GameEntity.CopyComponentsToSkeleton();
base.GameEntity.Skeleton.SetAnimationAtChannel("lumberjack", 0, 1f, -1f, 0f);
MetaMesh copy = MetaMesh.GetCopy("peasent_hatchet", true, false);
base.GameEntity.AddMultiMeshToSkeletonBone(copy, 27);
}
}
// Token: 0x04000DB0 RID: 3504
private bool _initialized;
}
}
Can anyone confirm? Or... is this not what namespaces do in C#? I'm a little new to it.
Last edited: