Skip to content

Commit 4f7fff7

Browse files
committed
Update for experimental - Add COlour32 and _index attribute for non-enum arrays
1 parent 82e205b commit 4f7fff7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3181
-3072
lines changed

Tools/auto_extract/extractor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
DONT_OVERRIDE = {
160160
'TkAnimNodeFrameData': 0xDD8A411B84D2D5DC,
161161
# 'TkAnimNodeFrameHalfData',
162-
'TkGeometryData': 0xED9C2FCDA6D4B22F,
162+
'TkGeometryData': 0xE2C133EF90E9F7A3,
163163
'TkMeshData': 0xA5E773D3424BA9FA,
164164
}
165165

@@ -189,9 +189,9 @@
189189
0x0C: 'VariableSizeString', # Technically a "filename" -> GcFilename (?)
190190
0x0D: 'FLAGENUM',
191191
0x0E: 'float',
192-
0x0F: 'NMSString0x10',
193-
0x10: 'NMSString0x20A', # There seems to be no difference in use between this
194-
0x11: 'NMSString0x20A', # and this...
192+
0x0F: 'NMSString0x10', # Id
193+
0x10: 'NMSString0x20A', # Id256
194+
0x11: 'NMSString0x20A', # LocId
195195
0x12: 'sbyte',
196196
0x13: 'short',
197197
0x14: 'int',
@@ -219,6 +219,7 @@
219219
0x2A: 'halfVector3',
220220
0x2B: 'TkPhysRelVec3',
221221
0x2C: 'HashMap',
222+
0x2D: 'Colour32', # 4 channel colour with each channel packed as a byte
222223
}
223224

224225
TYPE_MAPPING_REV = {value: key for key, value in TYPE_MAPPING.items()}

Tools/auto_extract/templates/default/libMBIN-Shared.projitems.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<Compile Include="$(MSBuildThisFileDirectory)Source\MBIN\MBINFile.cs" />
2929
<Compile Include="$(MSBuildThisFileDirectory)Source\MBIN\MBINHeader.cs" />
3030
<Compile Include="$(MSBuildThisFileDirectory)Source\NMS\BaseTypes\Colour.cs" />
31+
<Compile Include="$(MSBuildThisFileDirectory)Source\NMS\BaseTypes\Colour32.cs" />
3132
<Compile Include="$(MSBuildThisFileDirectory)Source\NMS\BaseTypes\OptionalVariableSizeString.cs" />
3233
<Compile Include="$(MSBuildThisFileDirectory)Source\NMS\BaseTypes\HashMap.cs" />
3334
<Compile Include="$(MSBuildThisFileDirectory)Source\NMS\BaseTypes\halfVector3.cs" />

Tools/auto_extract/templates/default/static_templates/TkGeometryData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace libMBIN.NMS.Toolkit
88
{
9-
[NMS(GUID = 0xED9C2FCDA6D4B22F, NameHash = 0x819C3220)]
9+
[NMS(GUID = 0xE2C133EF90E9F7A3, NameHash = 0x819C3220)]
1010
public class TkGeometryData : NMSTemplate
1111
{
1212
[NMS(Index = 20)]

libMBIN/Source/MXML/MXmlProperty.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ public class MXmlProperty : MXmlBase
88
[XmlAttribute("value")]
99
public string Value { get; set; }
1010
[XmlAttribute("linked")]
11-
public string Linked {get; set; }
11+
public string Linked { get; set; }
12+
[XmlAttribute("_index")]
13+
public string Index { get; set; }
14+
[XmlAttribute("_id")]
15+
public string ID { get; set; }
1216

1317
public override string ToString()
1418
{
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
using libMBIN.Source.Common;
2+
using System;
3+
4+
namespace libMBIN.NMS
5+
{
6+
/// <summary>
7+
/// This class is a simple colour one. The values of each field must be between 0 and 1.
8+
/// To convert from the usual representation of a value between 0 and 255, you just need to divide the value
9+
/// by 255 to get the floating point representation used by the game.
10+
/// </summary>
11+
[NMS(Alignment = 0x4, Size = 0x4)]
12+
public class Colour32 : NMSTemplate
13+
{
14+
/// <summary>
15+
/// The Red component of the colour.
16+
/// </summary>
17+
public float R;
18+
19+
/// <summary>
20+
/// The Green component of the colour.
21+
/// </summary>
22+
public float G;
23+
24+
/// <summary>
25+
/// The Blue component of the colour.
26+
/// </summary>
27+
public float B;
28+
29+
/// <summary>
30+
/// The Alpha component of the colour.
31+
/// </summary>
32+
public float A;
33+
34+
35+
/// <summary>
36+
/// Creates a Colour while providing it with float RGB values.
37+
/// <br/>Values must be between 0 - 1.
38+
/// </summary>
39+
/// <param name="R">Red component of the colour. Value can be anything between 0 and 1.</param>
40+
/// <param name="G">Green component of the colour. Value can be anything between 0 and 1.</param>
41+
/// <param name="B">Blue component of the colour. Value can be anything between 0 and 1.</param>
42+
/// <param name="A">Alpha component of the colour. Value can be anything between 0 and 1.</param>
43+
public Colour32(float R, float G, float B, float A = 1f)
44+
{
45+
this.R = R;
46+
this.G = G;
47+
this.B = B;
48+
this.A = A;
49+
}
50+
51+
/// <summary>
52+
/// Creates a Colour while providing it with standard RGB values.
53+
/// <br/>Values must be whole numbers between 0 - 255.
54+
/// </summary>
55+
/// <param name="R">Red component of the colour. Value can be any whole number between 0 and 255.</param>
56+
/// <param name="G">Green component of the colour. Value can be any whole number between 0 and 255.</param>
57+
/// <param name="B">Blue component of the colour. Value can be any whole number between 0 and 255.</param>
58+
/// <param name="A">Alpha component of the colour. Value can be any whole number between 0 and 255.</param>
59+
public Colour32(byte R, byte G, byte B, byte A = 255)
60+
{
61+
this.R = R / 255f;
62+
this.G = G / 255f;
63+
this.B = B / 255f;
64+
this.A = A / 255f;
65+
}
66+
67+
public Colour32() { }
68+
}
69+
}
Lines changed: 57 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
namespace libMBIN.NMS.GameComponents
22
{
3-
[NMS(GUID = 0xC75CC88ABAB0A7E, NameHash = 0x932D2ED5)]
3+
[NMS(GUID = 0x84058ACCFDF28B8B, NameHash = 0x932D2ED5)]
44
public class GcCameraFollowSettings : NMSTemplate
55
{
66
[NMS(Index = 0)]
77
/* 0x00 */ public NMSString0x10 Name;
8-
[NMS(Index = 55)]
8+
[NMS(Index = 56)]
99
/* 0x10 */ public float AvoidCollisionLRSpeed;
10-
[NMS(Index = 57)]
10+
[NMS(Index = 58)]
1111
/* 0x14 */ public float AvoidCollisionPushSpeed;
12-
[NMS(Index = 56)]
12+
[NMS(Index = 57)]
1313
/* 0x18 */ public float AvoidCollisionUDSpeed;
1414
[NMS(Index = 9)]
1515
/* 0x1C */ public float BackMaxDistance;
@@ -29,7 +29,7 @@ public class GcCameraFollowSettings : NMSTemplate
2929
/* 0x38 */ public float CenterStartSpeed;
3030
[NMS(Index = 36)]
3131
/* 0x3C */ public float CenterStartTime;
32-
[NMS(Index = 62)]
32+
[NMS(Index = 63)]
3333
/* 0x40 */ public float CustomBlendTime;
3434
[NMS(Index = 31)]
3535
/* 0x44 */ public float DistSpeed;
@@ -43,91 +43,93 @@ public class GcCameraFollowSettings : NMSTemplate
4343
/* 0x54 */ public float LeftMaxDistance;
4444
[NMS(Index = 17)]
4545
/* 0x58 */ public float LeftMinDistance;
46-
[NMS(Index = 44)]
46+
[NMS(Index = 45)]
4747
/* 0x5C */ public float LookStickLimitAngle;
48-
[NMS(Index = 48)]
48+
[NMS(Index = 49)]
4949
/* 0x60 */ public float LRProbesRadius;
50-
[NMS(Index = 47)]
50+
[NMS(Index = 48)]
5151
/* 0x64 */ public float LRProbesRange;
52+
[NMS(Index = 44)]
53+
/* 0x68 */ public float MinMoveVelToTriggerSpring;
5254
[NMS(Index = 1)]
53-
/* 0x68 */ public float MinSpeed;
54-
[NMS(Index = 46)]
55-
/* 0x6C */ public int NumLRProbes;
56-
[NMS(Index = 49)]
57-
/* 0x70 */ public int NumUDProbes;
55+
/* 0x6C */ public float MinSpeed;
56+
[NMS(Index = 47)]
57+
/* 0x70 */ public int NumLRProbes;
58+
[NMS(Index = 50)]
59+
/* 0x74 */ public int NumUDProbes;
5860
[NMS(Index = 3)]
59-
/* 0x74 */ public float OffsetX;
61+
/* 0x78 */ public float OffsetX;
6062
[NMS(Index = 4)]
61-
/* 0x78 */ public float OffsetY;
63+
/* 0x7C */ public float OffsetY;
6264
[NMS(Index = 5)]
63-
/* 0x7C */ public float OffsetYAlt;
65+
/* 0x80 */ public float OffsetYAlt;
6466
[NMS(Index = 19)]
65-
/* 0x80 */ public float OffsetYExtraMaxDistance;
67+
/* 0x84 */ public float OffsetYExtraMaxDistance;
6668
[NMS(Index = 6)]
67-
/* 0x84 */ public float OffsetYSlopeExtra;
69+
/* 0x88 */ public float OffsetYSlopeExtra;
6870
[NMS(Index = 7)]
69-
/* 0x88 */ public float OffsetZFlat;
71+
/* 0x8C */ public float OffsetZFlat;
7072
[NMS(Index = 21)]
71-
/* 0x8C */ public float PanFar;
73+
/* 0x90 */ public float PanFar;
7274
[NMS(Index = 20)]
73-
/* 0x90 */ public float PanNear;
74-
[NMS(Index = 51)]
75-
/* 0x94 */ public float ProbeCenterX;
75+
/* 0x94 */ public float PanNear;
7676
[NMS(Index = 52)]
77-
/* 0x98 */ public float ProbeCenterY;
77+
/* 0x98 */ public float ProbeCenterX;
7878
[NMS(Index = 53)]
79-
/* 0x9C */ public float PushForwardDropoffLR;
79+
/* 0x9C */ public float ProbeCenterY;
8080
[NMS(Index = 54)]
81-
/* 0xA0 */ public float PushForwardDropoffUD;
81+
/* 0xA0 */ public float PushForwardDropoffLR;
82+
[NMS(Index = 55)]
83+
/* 0xA4 */ public float PushForwardDropoffUD;
8284
[NMS(Index = 2)]
83-
/* 0xA4 */ public float SpeedRange;
85+
/* 0xA8 */ public float SpeedRange;
8486
[NMS(Index = 34)]
85-
/* 0xA8 */ public float SpringSpeed;
86-
[NMS(Index = 50)]
87-
/* 0xAC */ public float UDProbesRange;
87+
/* 0xAC */ public float SpringSpeed;
88+
[NMS(Index = 51)]
89+
/* 0xB0 */ public float UDProbesRange;
8890
[NMS(Index = 22)]
89-
/* 0xB0 */ public float UpGamma;
91+
/* 0xB4 */ public float UpGamma;
9092
[NMS(Index = 13)]
91-
/* 0xB4 */ public float UpMaxDistance;
93+
/* 0xB8 */ public float UpMaxDistance;
9294
[NMS(Index = 12)]
93-
/* 0xB8 */ public float UpMinDistance;
95+
/* 0xBC */ public float UpMinDistance;
9496
[NMS(Index = 14)]
95-
/* 0xBC */ public float UpSlopeAdjust;
97+
/* 0xC0 */ public float UpSlopeAdjust;
9698
[NMS(Index = 15)]
97-
/* 0xC0 */ public float UpWaveAdjust;
99+
/* 0xC4 */ public float UpWaveAdjust;
98100
[NMS(Index = 16)]
99-
/* 0xC4 */ public float UpWaveAdjustMaxHeight;
101+
/* 0xC8 */ public float UpWaveAdjustMaxHeight;
100102
[NMS(Index = 40)]
101-
/* 0xC8 */ public float VelocityAnticipate;
103+
/* 0xCC */ public float VelocityAnticipate;
102104
[NMS(Index = 41)]
103-
/* 0xCC */ public float VelocityAnticipateSpringSpeed;
105+
/* 0xD0 */ public float VelocityAnticipateSpringSpeed;
104106
[NMS(Index = 42)]
105-
/* 0xD0 */ public float VertMaxSpring;
107+
/* 0xD4 */ public float VertMaxSpring;
106108
[NMS(Index = 26)]
107-
/* 0xD4 */ public float VertRotationMax;
109+
/* 0xD8 */ public float VertRotationMax;
108110
[NMS(Index = 25)]
109-
/* 0xD8 */ public float VertRotationMin;
111+
/* 0xDC */ public float VertRotationMin;
110112
[NMS(Index = 27)]
111-
/* 0xDC */ public float VertRotationOffset;
113+
/* 0xE0 */ public float VertRotationOffset;
112114
[NMS(Index = 29)]
113-
/* 0xE0 */ public float VertRotationOffsetMaxAngle;
115+
/* 0xE4 */ public float VertRotationOffsetMaxAngle;
114116
[NMS(Index = 28)]
115-
/* 0xE4 */ public float VertRotationOffsetMinAngle;
117+
/* 0xE8 */ public float VertRotationOffsetMinAngle;
116118
[NMS(Index = 24)]
117-
/* 0xE8 */ public float VertRotationSpeed;
119+
/* 0xEC */ public float VertRotationSpeed;
120+
[NMS(Index = 60)]
121+
/* 0xF0 */ public bool AvoidCollisionLRUseStickDelay;
118122
[NMS(Index = 59)]
119-
/* 0xEC */ public bool AvoidCollisionLRUseStickDelay;
120-
[NMS(Index = 58)]
121-
/* 0xED */ public bool AvoidCollisionUDUseStickDelay;
122-
[NMS(Index = 45)]
123-
/* 0xEE */ public bool EnableCollisionDetection;
123+
/* 0xF1 */ public bool AvoidCollisionUDUseStickDelay;
124+
[NMS(Index = 46)]
125+
/* 0xF2 */ public bool EnableCollisionDetection;
124126
[NMS(Index = 35)]
125-
/* 0xEF */ public bool LockToObjectOnIdle;
127+
/* 0xF3 */ public bool LockToObjectOnIdle;
128+
[NMS(Index = 62)]
129+
/* 0xF4 */ public bool UseCustomBlendTime;
126130
[NMS(Index = 61)]
127-
/* 0xF0 */ public bool UseCustomBlendTime;
128-
[NMS(Index = 60)]
129-
/* 0xF1 */ public bool UseSpeedBasedSpring;
131+
/* 0xF5 */ public bool UseSpeedBasedSpring;
130132
[NMS(Index = 30)]
131-
/* 0xF2 */ public bool VertStartLookingDown;
133+
/* 0xF6 */ public bool VertStartLookingDown;
132134
}
133135
}

libMBIN/Source/NMS/GameComponents/GcCreatureRoleData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace libMBIN.NMS.GameComponents
44
{
5-
[NMS(GUID = 0xA31ED3B06AB5F107, NameHash = 0x58E509FD)]
5+
[NMS(GUID = 0xF9E3BF5F8C3A03FB, NameHash = 0x58E509FD)]
66
public class GcCreatureRoleData : NMSTemplate
77
{
88
[NMS(Index = 4)]

libMBIN/Source/NMS/GameComponents/GcCreatureRoleDataTable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace libMBIN.NMS.GameComponents
55
{
6-
[NMS(GUID = 0xEC6AE5A26824F07E, NameHash = 0xF744FEF1)]
6+
[NMS(GUID = 0xFDF6B5348B67912D, NameHash = 0xF744FEF1)]
77
public class GcCreatureRoleDataTable : NMSTemplate
88
{
99
[NMS(Index = 0)]

libMBIN/Source/NMS/GameComponents/GcCreatureRoleDescription.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace libMBIN.NMS.GameComponents
44
{
5-
[NMS(GUID = 0x4E3B462272631D3D, NameHash = 0x4DA14594)]
5+
[NMS(GUID = 0x4F9C1A9868351C48, NameHash = 0x4DA14594)]
66
public class GcCreatureRoleDescription : NMSTemplate
77
{
88
[NMS(Index = 12)]

libMBIN/Source/NMS/GameComponents/GcCreatureRoleDescriptionTable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace libMBIN.NMS.GameComponents
55
{
6-
[NMS(GUID = 0x31658E9C354D1733, NameHash = 0xFEAF8B28)]
6+
[NMS(GUID = 0x44FA048F72B7FA57, NameHash = 0xFEAF8B28)]
77
public class GcCreatureRoleDescriptionTable : NMSTemplate
88
{
99
[NMS(Index = 0)]

0 commit comments

Comments
 (0)