Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for 14109135 #595

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion Tools/auto_extract/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def __init__(self, data: bytes, nms_mem):
self._field_name_is_duplicate = False
self.field_size = struct.unpack_from('<I', data, offset=0x24)[0]
self._array_size = struct.unpack_from('<I', data, offset=0x28)[0]
self._field_offset = struct.unpack_from('<I', data, offset=0x2C)[0]
self._field_offset = int(struct.unpack_from('<I', data, offset=0x2C)[0])

# Sort out the requirements for this field.
self.required_using: set = set()
Expand Down Expand Up @@ -533,6 +533,7 @@ def add_fields(self, fields: list[Field]):
# This is a little hacky and could be done a bit better but this does
# work...
self.fields = fields
self.fields.sort(key=lambda x: x._field_offset)
max_offset_width = 1
# For each field find if it requires something and add it to the
# required usings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ namespace libMBIN.NMS.Toolkit
[NMS(GUID = 0xC4C8B7669C8C9D44, NameHash = 0x270204EDCEE4DB62)]
public class TkAnimNodeFrameData : NMSTemplate
{
/* 0x00 */ public List<Quaternion> Rotations;
/* 0x10 */ public List<Vector3f> Translations;
/* 0x20 */ public List<Vector3f> Scales;
/* 0x00 */ public List<ushort> Rotations;
/* 0x10 */ public List<Vector3f> Scales;
/* 0x20 */ public List<Vector3f> Translations;


public override object CustomDeserialize(BinaryReader reader, Type field, NMSAttribute settings, FieldInfo fieldInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace libMBIN.NMS.Toolkit
public class TkAnimNodeFrameHalfData : NMSTemplate
{
/* 0x00 */ public List<Quaternion> Rotations;
/* 0x10 */ public List<Vector3f> Translations;
/* 0x20 */ public List<Vector3f> Scales;
/* 0x10 */ public List<Vector3f> Scales;
/* 0x20 */ public List<Vector3f> Translations;

public override object CustomDeserialize(BinaryReader reader, Type field, NMSAttribute settings, FieldInfo fieldInfo) {
var fieldName = fieldInfo.Name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ namespace libMBIN.NMS.Toolkit
[NMS(GUID = 0x3705D946A3B218D4, NameHash = 0xA74EA06001E7577E)]
public class TkGeometryData : NMSTemplate
{
/* 0x000 */ public int VertexCount;
/* 0x004 */ public int IndexCount;
/* 0x008 */ public int Indices16Bit;
/* 0x00C */ public int CollisionIndexCount;
/* 0x010 */ public List<TkJointBindingData> JointBindings;
/* 0x020 */ public List<TkJointExtentData> JointExtents;
/* 0x030 */ public List<int> JointMirrorPairs;
/* 0x040 */ public List<TkJointMirrorAxis> JointMirrorAxes;
/* 0x050 */ public List<int> SkinMatrixLayout;
/* 0x060 */ public List<int> MeshVertRStart;
/* 0x070 */ public List<int> MeshVertREnd;
/* 0x080 */ public List<int> BoundHullVertSt;
/* 0x090 */ public List<int> BoundHullVertEd;
/* 0x0A0 */ public List<int> MeshBaseSkinMat;
/* 0x0B0 */ public List<Vector4f> MeshAABBMin;
/* 0x000 */ public TkVertexLayout SmallVertexLayout;
/* 0x020 */ public TkVertexLayout VertexLayout;
/* 0x040 */ public List<int> BoundHullVertEd;
/* 0x050 */ public List<Vector4f> BoundHullVerts;
/* 0x060 */ public List<int> BoundHullVertSt;
/* 0x070 */ public List<int> IndexBuffer;
/* 0x080 */ public List<TkJointBindingData> JointBindings;
/* 0x090 */ public List<TkJointExtentData> JointExtents;
/* 0x0A0 */ public List<TkJointMirrorAxis> JointMirrorAxes;
/* 0x0B0 */ public List<int> JointMirrorPairs;
/* 0x0C0 */ public List<Vector4f> MeshAABBMax;
/* 0x0D0 */ public List<Vector4f> BoundHullVerts;
/* 0x0E0 */ public TkVertexLayout VertexLayout;
/* 0x100 */ public TkVertexLayout SmallVertexLayout;
/* 0x120 */ public List<int> IndexBuffer;
/* 0x130 */ public List<TkMeshMetaData> StreamMetaDataArray;
/* 0x0D0 */ public List<Vector4f> MeshAABBMin;
/* 0x0E0 */ public List<int> MeshBaseSkinMat;
/* 0x0F0 */ public List<int> MeshVertREnd;
/* 0x100 */ public List<int> MeshVertRStart;
/* 0x110 */ public List<int> SkinMatrixLayout;
/* 0x120 */ public List<TkMeshMetaData> StreamMetaDataArray;
/* 0x130 */ public int CollisionIndexCount;
/* 0x134 */ public int IndexCount;
/* 0x138 */ public int Indices16Bit;
/* 0x13C */ public int VertexCount;

// TODO: add the list ending to this??
public override bool CustomSerialize(BinaryWriter writer, Type field, object fieldData, NMSAttribute settings, FieldInfo fieldInfo, ref List<Tuple<long, object>> additionalData, ref int addtDataIndex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ namespace libMBIN.NMS.Toolkit
[NMS(GUID = 0xD3AC8F6F7A4D55FC, NameHash = 0xF671716161E708E3)]
public class TkMeshData : NMSTemplate
{
/* 0x00 */ public byte[] MeshDataStream;
/* 0x10 */ public ulong Hash;
/* 0x18 */ public int IndexDataSize;
/* 0x1C */ public int VertexDataSize;
[NMS(Size = 0x80, Padding = 0xFE)]
/* 0x00 */ public string IdString;
/* 0x80 */ public ulong Hash;
/* 0x88 */ public int VertexDataSize;
/* 0x8C */ public int IndexDataSize;
/* 0x90 */ public byte[] MeshDataStream;
/* 0x20 */ public NMSString0x80 IdString;

public override object CustomDeserialize( BinaryReader reader, Type field, NMSAttribute settings, FieldInfo fieldInfo ) {
var fieldName = fieldInfo.Name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace libMBIN.NMS.Toolkit
[NMS(GUID = 0x1DCCBBEBB4547EB4, NameHash = 0x2C1B6B0E807F7193)]
public class TkSceneNodeData : NMSTemplate
{
/* 0x00 */ public NMSString0x80 Name;
/* 0x80 */ public uint NameHash;
/* 0x88 */ public NMSString0x10 Type;
/* 0x98 */ public TkTransformData Transform;
/* 0xC0 */ public List<TkSceneNodeAttributeData> Attributes;
/* 0xD0 */ public List<TkSceneNodeData> Children;
/* 0x00 */ public List<TkSceneNodeAttributeData> Attributes;
/* 0x10 */ public List<TkSceneNodeData> Children;
/* 0x20 */ public NMSString0x10 Type;
/* 0x30 */ public TkTransformData Transform;
/* 0x54 */ public uint NameHash;
/* 0x58 */ public NMSString0x80 Name;

public override object CustomDeserialize( BinaryReader reader, Type field, NMSAttribute settings, FieldInfo fieldInfo ) {
var fieldName = fieldInfo.Name;
Expand Down
4 changes: 2 additions & 2 deletions libMBIN/Source/NMS/GameComponents/AxisSpecification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0xE064B06A0D53FBE6, NameHash = 0xE46A33ECA1AA62F7)]
public class AxisSpecification : NMSTemplate
{
/* 0x00 */ public Vector3f CustomAxis;
// size: 0x7
public enum AxisEnum : uint {
X,
Expand All @@ -13,7 +14,6 @@ public enum AxisEnum : uint {
NegativeZ,
CustomAxis,
}
/* 0x00 */ public AxisEnum Axis;
/* 0x10 */ public Vector3f CustomAxis;
/* 0x10 */ public AxisEnum Axis;
}
}
24 changes: 12 additions & 12 deletions libMBIN/Source/NMS/GameComponents/GcAIShipDebugSpawnData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0xD616A0433497617, NameHash = 0xDFA8A7A9DD3ACC08)]
public class GcAIShipDebugSpawnData : NMSTemplate
{
/* 0x00 */ public Vector3f Position;
/* 0x10 */ public Vector3f Facing;
/* 0x20 */ public Vector3f Up;
/* 0x30 */ public Vector3f FlightDir;
/* 0x40 */ public float Speed;
/* 0x44 */ public float IgnitionDelay;
/* 0x48 */ public float TakeOffDelay;
/* 0x4C */ public float HoverTime;
/* 0x00 */ public Vector3f Facing;
/* 0x10 */ public Vector3f FlightDir;
/* 0x20 */ public Vector3f Position;
/* 0x30 */ public Vector3f Up;
/* 0x40 */ public GcSeed Seed;
/* 0x50 */ public float HoverHeight;
/* 0x54 */ public float WarpOutTime;
/* 0x58 */ public bool Wingman;
/* 0x59 */ public NMSString0x80 SpecificModel;
/* 0xE0 */ public GcSeed Seed;
/* 0x54 */ public float HoverTime;
/* 0x58 */ public float IgnitionDelay;
/* 0x5C */ public float Speed;
/* 0x60 */ public float TakeOffDelay;
/* 0x64 */ public float WarpOutTime;
/* 0x68 */ public NMSString0x80 SpecificModel;
/* 0xE8 */ public bool Wingman;
}
}
40 changes: 20 additions & 20 deletions libMBIN/Source/NMS/GameComponents/GcAIShipSpawnData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0xBEFE1C3015A6B9AA, NameHash = 0x35C91009067A6431)]
public class GcAIShipSpawnData : NMSTemplate
{
/* 0x000 */ public NMSString0x20A Message;
/* 0x020 */ public NMSString0x20A CombatMessage;
/* 0x040 */ public NMSString0x20A OSDMessage;
/* 0x060 */ public TkInputEnum Shortcut;
/* 0x064 */ public bool WarpIn;
/* 0x068 */ public GcAISpaceshipRoles Role;
/* 0x06C */ public float MinRange;
/* 0x070 */ public Vector2f Scale;
/* 0x078 */ public NMSString0x10 Reward;
/* 0x088 */ public NMSString0x20A RewardMessage;
/* 0x0A8 */ public GcAIShipSpawnMarkerData MarkerData;
/* 0x168 */ public bool AttackFreighter;
/* 0x170 */ public NMSString0x10 AttackDefinition;
/* 0x180 */ public Vector2f Spread;
/* 0x190 */ public Vector3f OffsetSphereOffset;
/* 0x1A0 */ public Vector2f Count;
/* 0x1A8 */ public Vector2f StartTime;
/* 0x000 */ public Vector3f OffsetSphereOffset;
/* 0x010 */ public GcAIShipSpawnMarkerData MarkerData;
/* 0x0C8 */ public NMSString0x20A CombatMessage;
/* 0x0E8 */ public NMSString0x20A Message;
/* 0x108 */ public NMSString0x20A OSDMessage;
/* 0x128 */ public NMSString0x20A RewardMessage;
/* 0x148 */ public NMSString0x10 AttackDefinition;
/* 0x158 */ public List<GcAIShipSpawnData> ChildSpawns;
/* 0x168 */ public GcShipAIPerformanceArray Performances;
/* 0x178 */ public NMSString0x10 Reward;
/* 0x188 */ public Vector2f Count;
/* 0x190 */ public Vector2f Scale;
/* 0x198 */ public Vector2f Spread;
/* 0x1A0 */ public Vector2f StartTime;
/* 0x1A8 */ public float MinRange;
/* 0x1AC */ public GcAISpaceshipRoles Role;
/* 0x1B0 */ public TkInputEnum Shortcut;
// size: 0x3
public enum SpawnShapeEnum : uint {
Sphere,
Cone,
OffsetSphere,
}
/* 0x1B0 */ public SpawnShapeEnum SpawnShape;
/* 0x1B8 */ public GcShipAIPerformanceArray Performances;
/* 0x1C8 */ public List<GcAIShipSpawnData> ChildSpawns;
/* 0x1B4 */ public SpawnShapeEnum SpawnShape;
/* 0x1B8 */ public bool AttackFreighter;
/* 0x1B9 */ public bool WarpIn;
}
}
12 changes: 6 additions & 6 deletions libMBIN/Source/NMS/GameComponents/GcAIShipSpawnMarkerData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0x103B4E1E1547DE0E, NameHash = 0xDB40771B3EB38336)]
public class GcAIShipSpawnMarkerData : NMSTemplate
{
/* 0x00 */ public TkTextureResource MarkerIcon;
/* 0x88 */ public NMSString0x20A MarkerLabel;
/* 0xA8 */ public bool HideDuringCombat;
/* 0x00 */ public NMSString0x20A MarkerLabel;
/* 0x20 */ public TkTextureResource MarkerIcon;
/* 0xA4 */ public float MaxVisibleRange;
/* 0xA8 */ public float MinAngleVisible;
/* 0xAC */ public float MinVisibleRange;
/* 0xB0 */ public float MaxVisibleRange;
/* 0xB4 */ public float MinAngleVisible;
// size: 0x3
public enum ShipsToMarkEnum : uint {
None,
Leader,
All,
}
/* 0xB8 */ public ShipsToMarkEnum ShipsToMark;
/* 0xB0 */ public ShipsToMarkEnum ShipsToMark;
/* 0xB4 */ public bool HideDuringCombat;
}
}
12 changes: 6 additions & 6 deletions libMBIN/Source/NMS/GameComponents/GcAISpaceshipComponentData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0x7EB99A1C11C3D004, NameHash = 0x4F5433BCFC028B49)]
public class GcAISpaceshipComponentData : NMSTemplate
{
/* 0x00 */ public GcAISpaceshipTypes Type;
/* 0x04 */ public GcSpaceshipClasses Class;
/* 0x08 */ public GcPrimaryAxis Axis;
/* 0x0C */ public TkModelResource Hangar;
/* 0x90 */ public bool IsSpaceAnomaly;
/* 0x98 */ public NMSString0x10 CombatDefinitionID;
/* 0x00 */ public NMSString0x10 CombatDefinitionID;
/* 0x10 */ public TkModelResource Hangar;
/* 0x94 */ public GcPrimaryAxis Axis;
/* 0x98 */ public GcSpaceshipClasses Class;
/* 0x9C */ public GcAISpaceshipTypes Type;
/* 0xA0 */ public bool IsSpaceAnomaly;
}
}
8 changes: 4 additions & 4 deletions libMBIN/Source/NMS/GameComponents/GcAISpaceshipModelData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0xC56C33DA8B63CF8D, NameHash = 0xA1AD260BA61A04EE)]
public class GcAISpaceshipModelData : NMSTemplate
{
/* 0x00 */ public NMSString0x80 Filename;
/* 0x80 */ public GcSpaceshipClasses Class;
/* 0x84 */ public GcAISpaceshipRoles AIRole;
/* 0x88 */ public GcFrigateClass FrigateClass;
/* 0x0 */ public GcAISpaceshipRoles AIRole;
/* 0x4 */ public GcSpaceshipClasses Class;
/* 0x8 */ public GcFrigateClass FrigateClass;
/* 0xC */ public NMSString0x80 Filename;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0x3C57930CC9E6FEFB, NameHash = 0x74723646531009E2)]
public class GcAISpaceshipPreloadCacheData : NMSTemplate
{
/* 0x00 */ public GcRealityCommonFactions Faction;
/* 0x04 */ public GcAISpaceshipRoles ShipRole;
/* 0x08 */ public GcSpaceshipClasses ShipClass;
/* 0x0C */ public GcFrigateClass FrigateClass;
/* 0x10 */ public GcSeed Seed;
/* 0x20 */ public NMSString0x20A TextureDescriptorHint;
/* 0x00 */ public NMSString0x20A TextureDescriptorHint;
/* 0x20 */ public GcSeed Seed;
/* 0x30 */ public GcRealityCommonFactions Faction;
/* 0x34 */ public GcFrigateClass FrigateClass;
/* 0x38 */ public GcSpaceshipClasses ShipClass;
/* 0x3C */ public GcAISpaceshipRoles ShipRole;
}
}
4 changes: 2 additions & 2 deletions libMBIN/Source/NMS/GameComponents/GcAISpaceshipPreloadList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0x62AF5ABD2941E17E, NameHash = 0xC546551B048ACC33)]
public class GcAISpaceshipPreloadList : NMSTemplate
{
/* 0x0 */ public GcRealityCommonFactions Faction;
/* 0x8 */ public List<GcAISpaceshipPreloadCacheData> Cache;
/* 0x00 */ public List<GcAISpaceshipPreloadCacheData> Cache;
/* 0x10 */ public GcRealityCommonFactions Faction;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0xDFC505E8066AB0E7, NameHash = 0x95028D8CB7957BEF)]
public class GcAbandonedFreighterComponentData : NMSTemplate
{
/* 0x00 */ public TkModelResource DungeonRootScene;
/* 0x88 */ public List<GcFreighterDungeonChoice> DungeonOptions;
/* 0x98 */ public NMSString0x20A MarkerLabel;
/* 0xB8 */ public TkTextureResource MarkerIcon;
/* 0x00 */ public NMSString0x20A MarkerLabel;
/* 0x20 */ public List<GcFreighterDungeonChoice> DungeonOptions;
/* 0x30 */ public TkModelResource DungeonRootScene;
/* 0xB4 */ public TkTextureResource MarkerIcon;
}
}
16 changes: 8 additions & 8 deletions libMBIN/Source/NMS/GameComponents/GcActionSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0x2C0872F794AFE229, NameHash = 0xA14126BE226C6660)]
public class GcActionSet : NMSTemplate
{
/* 0x00 */ public GcActionSetType Type;
/* 0x04 */ public GcActionUseType Status;
/* 0x08 */ public NMSString0x20 ExternalId;
/* 0x28 */ public NMSString0x20 ExternalLoc;
/* 0x48 */ public NMSString0x20A LocTag;
/* 0x68 */ public NMSString0x20 ParentExternalId;
/* 0x88 */ public List<GcActionSetAction> Actions;
/* 0x98 */ public List<GcInputActions> BlockedActions;
/* 0x00 */ public NMSString0x20A LocTag;
/* 0x20 */ public List<GcActionSetAction> Actions;
/* 0x30 */ public List<GcInputActions> BlockedActions;
/* 0x40 */ public GcActionUseType Status;
/* 0x44 */ public GcActionSetType Type;
/* 0x48 */ public NMSString0x20 ExternalId;
/* 0x68 */ public NMSString0x20 ExternalLoc;
/* 0x88 */ public NMSString0x20 ParentExternalId;
}
}
4 changes: 2 additions & 2 deletions libMBIN/Source/NMS/GameComponents/GcActionSetAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0xA9E3A49F9DF82E9C, NameHash = 0xF69368BA4545C60E)]
public class GcActionSetAction : NMSTemplate
{
/* 0x0 */ public GcActionUseType Status;
/* 0x4 */ public GcInputActions Action;
/* 0x0 */ public GcInputActions Action;
/* 0x4 */ public GcActionUseType Status;
}
}
4 changes: 2 additions & 2 deletions libMBIN/Source/NMS/GameComponents/GcActionSetHudLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0x7AFE7D3C948876BA, NameHash = 0xC8ABA2A9ED6C9748)]
public class GcActionSetHudLayer : NMSTemplate
{
/* 0x0 */ public GcActionSetType Type;
/* 0x8 */ public List<NMSString0x10> HudLayerIDs;
/* 0x00 */ public List<NMSString0x10> HudLayerIDs;
/* 0x10 */ public GcActionSetType Type;
}
}
18 changes: 9 additions & 9 deletions libMBIN/Source/NMS/GameComponents/GcAdvancedTweaks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ namespace libMBIN.NMS.GameComponents
[NMS(GUID = 0x9C824D1D76FB05A6, NameHash = 0x1C1691C0F8971C4A)]
public class GcAdvancedTweaks : NMSTemplate
{
/* 0x00 */ public float ParticleKillSpeed;
/* 0x04 */ public float ParticleKillSpeedWrtFixed;
/* 0x08 */ public float EdgeMultiplierForTangentI;
/* 0x0C */ public float EdgeMultiplierForTangentJ;
/* 0x10 */ public float RenderNormalMultiplier;
/* 0x18 */ public List<NMSString0x40> NodesThatMustBePresent;
/* 0x28 */ public List<NMSString0x40> NodesToHide;
/* 0x38 */ public float StretchUvsToHideTextureEdges;
/* 0x3C */ public bool LeaveRenderedTrianglesUnaffected;
/* 0x00 */ public List<NMSString0x40> NodesThatMustBePresent;
/* 0x10 */ public List<NMSString0x40> NodesToHide;
/* 0x20 */ public float EdgeMultiplierForTangentI;
/* 0x24 */ public float EdgeMultiplierForTangentJ;
/* 0x28 */ public float ParticleKillSpeed;
/* 0x2C */ public float ParticleKillSpeedWrtFixed;
/* 0x30 */ public float RenderNormalMultiplier;
/* 0x34 */ public float StretchUvsToHideTextureEdges;
/* 0x38 */ public bool LeaveRenderedTrianglesUnaffected;
}
}
Loading