Skip to content

Commit b4ea613

Browse files
committed
continued character data
1 parent 0dcd4fb commit b4ea613

8 files changed

Lines changed: 453 additions & 130 deletions

CathodeLib/Scripts/CATHODE/CharacterAccessorySets.cs

Lines changed: 16 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using CATHODE.Enums;
12
using CATHODE.Scripting;
23
using CathodeLib;
34
using System;
@@ -40,20 +41,20 @@ override protected bool LoadInternal()
4041
entry.components.Arms.AccessoryIndex = reader.ReadInt32();
4142
entry.components.Collision.AccessoryIndex = reader.ReadInt32();
4243

43-
entry.asset_type = (CharacterAttributes.AssetType)reader.ReadInt32();
44-
entry.voice_actor = (CharacterAttributes.VoiceActor)reader.ReadInt32();
45-
entry.gender = (CharacterAttributes.Gender)reader.ReadInt32();
46-
entry.ethnicity = (CharacterAttributes.Ethnicity)reader.ReadInt32();
47-
entry.build = (CharacterAttributes.Build)reader.ReadInt32();
44+
entry.asset_type = (CharacterAsset)reader.ReadInt32();
45+
entry.voice_actor = (VoiceActor)reader.ReadInt32();
46+
entry.gender = (CharacterGender)reader.ReadInt32();
47+
entry.ethnicity = (CharacterEthnicity)reader.ReadInt32();
48+
entry.build = (CharacterBuild)reader.ReadInt32();
4849

4950
byte[] stringBlock = reader.ReadBytes(260);
5051
entry.face_skeleton = Utilities.ReadString(stringBlock);
5152
stringBlock = reader.ReadBytes(260);
5253
entry.gender_skeleton = Utilities.ReadString(stringBlock);
5354

54-
entry.foley.Torso = (CharacterAttributes.FoleySounds.Type)reader.ReadInt32();
55-
entry.foley.Leg = (CharacterAttributes.FoleySounds.Type)reader.ReadInt32();
56-
entry.foley.Footwear = (CharacterAttributes.FoleySounds.Type)reader.ReadInt32();
55+
entry.foley.Torso = (FoleySound)reader.ReadInt32();
56+
entry.foley.Leg = (FoleySound)reader.ReadInt32();
57+
entry.foley.Footwear = (FoleySound)reader.ReadInt32();
5758
Entries.Add(entry);
5859
}
5960
}
@@ -115,11 +116,11 @@ public class CharacterAttributes
115116
public EntityHandle character = new EntityHandle();
116117
public Components components = new Components();
117118

118-
public AssetType asset_type = AssetType.ASSETSET_01; //TODO: Is this defined by CUSTOMCHARACTERASSETDATA.BIN?
119+
public CharacterAsset asset_type = CharacterAsset.ASSETSET_01; //TODO: Is this defined by CUSTOMCHARACTERASSETDATA.BIN?
119120
public VoiceActor voice_actor = VoiceActor.CV1;
120-
public Gender gender = Gender.MALE;
121-
public Ethnicity ethnicity = Ethnicity.CAUCASIAN;
122-
public Build build = Build.STANDARD;
121+
public CharacterGender gender = CharacterGender.MALE;
122+
public CharacterEthnicity ethnicity = CharacterEthnicity.CAUCASIAN;
123+
public CharacterBuild build = CharacterBuild.STANDARD;
123124

124125
public string face_skeleton = "AL";
125126
public string gender_skeleton = "MALE";
@@ -144,71 +145,9 @@ public class Component
144145

145146
public class FoleySounds
146147
{
147-
public Type Torso = Type.HEAVY_OVERALLS;
148-
public Type Leg = Type.HEAVY_OVERALLS;
149-
public Type Footwear = Type.BOOTS;
150-
151-
public enum Type // Cathode scripting CHARACTER_FOLEY_SOUND enum
152-
{
153-
LEATHER = 0,
154-
HEAVY_JACKET = 1,
155-
HEAVY_OVERALLS = 2,
156-
SHIRT = 3,
157-
SUIT_JACKET = 4,
158-
SUIT_TROUSERS = 5,
159-
JEANS = 6,
160-
BOOTS = 7,
161-
FLATS = 8,
162-
TRAINERS = 9,
163-
}
164-
}
165-
166-
public enum AssetType // Cathode scripting CUSTOM_CHARACTER_ASSETS enum
167-
{
168-
ASSETSET_01, //Medical
169-
ASSETSET_02, //Engineering
170-
ASSETSET_03, //Generic
171-
ASSETSET_04, //Technical
172-
ASSETSET_05, // ?
173-
ASSETSET_06, // ?
174-
ASSETSET_07, // ?
175-
ASSETSET_08, // ?
176-
ASSETSET_09, // ?
177-
ASSETSET_10, // ?
178-
}
179-
public enum VoiceActor // Cathode scripting DIALOGUE_VOICE_ACTOR enum
180-
{
181-
AUTO,
182-
CV1,
183-
CV2,
184-
CV3,
185-
CV4,
186-
CV5,
187-
CV6,
188-
RT1,
189-
RT2,
190-
RT3,
191-
RT4,
192-
AN1,
193-
AN2,
194-
AN3,
195-
ANH,
196-
}
197-
public enum Gender // Cathode scripting CUSTOM_CHARACTER_GENDER enum
198-
{
199-
MALE,
200-
FEMALE,
201-
}
202-
public enum Ethnicity // Cathode scripting CUSTOM_CHARACTER_ETHNICITY enum
203-
{
204-
AFRICAN,
205-
CAUCASIAN,
206-
ASIAN,
207-
}
208-
public enum Build // Cathode scripting CUSTOM_CHARACTER_BUILD enum
209-
{
210-
STANDARD,
211-
HEAVY,
148+
public FoleySound Torso = FoleySound.HEAVY_OVERALLS;
149+
public FoleySound Leg = FoleySound.HEAVY_OVERALLS;
150+
public FoleySound Footwear = FoleySound.BOOTS;
212151
}
213152
};
214153
#endregion
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using CATHODE.Enums;
2+
using CATHODE.Scripting;
3+
using CathodeLib;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.IO;
7+
using System.Runtime.InteropServices;
8+
9+
namespace CATHODE
10+
{
11+
/* DATA/CHR_INFO/CUSTOMCHARACTERASSETDATA.BIN */
12+
public class CustomCharacterAssetData : CathodeFile
13+
{
14+
public List<Entry> Entries = new List<Entry>();
15+
public static new Implementation Implementation = Implementation.NONE;
16+
public CustomCharacterAssetData(string path) : base(path) { }
17+
18+
#region FILE_IO
19+
override protected bool LoadInternal()
20+
{
21+
using (BinaryReader reader = new BinaryReader(File.OpenRead(_filepath)))
22+
{
23+
24+
25+
}
26+
return true;
27+
}
28+
29+
override protected bool SaveInternal()
30+
{
31+
using (BinaryWriter writer = new BinaryWriter(File.OpenWrite(_filepath)))
32+
{
33+
34+
}
35+
return true;
36+
}
37+
#endregion
38+
39+
#region STRUCTURES
40+
public class Entry
41+
{
42+
43+
};
44+
#endregion
45+
}
46+
}

CathodeLib/Scripts/CATHODE/CustomCharacterConstrainedComponents.cs

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using CATHODE.Scripting;
1+
using CATHODE.Enums;
2+
using CATHODE.Scripting;
23
using CathodeLib;
34
using System;
45
using System.Collections.Generic;
@@ -43,12 +44,12 @@ override protected bool SaveInternal()
4344
Utilities.WriteString(Entries[i].Components[x].Name, writer, false);
4445
writer.BaseStream.Position += 64 - Entries[i].Components[x].Name.Length;
4546

46-
writer.Write(Entries[i].Components[x].unk1);
47-
writer.Write(Entries[i].Components[x].unk2);
48-
writer.Write(Entries[i].Components[x].unk3);
49-
writer.Write(Entries[i].Components[x].unk4);
50-
writer.Write(Entries[i].Components[x].unk5);
51-
writer.Write(Entries[i].Components[x].unk6);
47+
writer.Write((int)Entries[i].Components[x].Model);
48+
writer.Write((int)Entries[i].Components[x].Gender);
49+
writer.Write((int)Entries[i].Components[x].Ethnicity);
50+
writer.Write((int)Entries[i].Components[x].Build);
51+
writer.Write((int)Entries[i].Components[x].SleeveType);
52+
writer.Write((int)Entries[i].Components[x].SoundType);
5253
}
5354
}
5455
}
@@ -60,24 +61,21 @@ override protected bool SaveInternal()
6061
private void Read(ComponentType type, BinaryReader reader)
6162
{
6263
int entryCount = reader.ReadInt32();
63-
Entry arms = new Entry() { Type = ComponentType.ARMS };
64+
Entry entry = new Entry() { Type = type };
6465
for (int i = 0; i < entryCount; i++)
6566
{
6667
Entry.Component component = new Entry.Component();
6768
byte[] stringBlock = reader.ReadBytes(64);
6869
component.Name = Utilities.ReadString(stringBlock);
69-
70-
//TODO: these seem to get concatenated in code
71-
component.unk1 = reader.ReadInt32();
72-
component.unk2 = reader.ReadInt32();
73-
component.unk3 = reader.ReadInt32();
74-
component.unk4 = reader.ReadInt32();
75-
component.unk5 = reader.ReadInt32();
76-
component.unk6 = reader.ReadInt32();
77-
78-
arms.Components.Add(component);
70+
component.Model = (CharacterModel)reader.ReadInt32();
71+
component.Gender = (CharacterGender)reader.ReadInt32();
72+
component.Ethnicity = (CharacterEthnicity)reader.ReadInt32();
73+
component.Build = (CharacterBuild)reader.ReadInt32();
74+
component.SleeveType = (CharacterSleeve)reader.ReadInt32();
75+
component.SoundType = (FoleySound)reader.ReadInt32();
76+
entry.Components.Add(component);
7977
}
80-
Entries.Add(arms);
78+
Entries.Add(entry);
8179
}
8280
#endregion
8381

@@ -91,12 +89,12 @@ public class Component
9189
{
9290
public string Name;
9391

94-
public int unk1;
95-
public int unk2;
96-
public int unk3;
97-
public int unk4;
98-
public int unk5;
99-
public int unk6;
92+
public CharacterModel Model;
93+
public CharacterGender Gender;
94+
public CharacterEthnicity Ethnicity;
95+
public CharacterBuild Build;
96+
public CharacterSleeve SleeveType;
97+
public FoleySound SoundType;
10098
}
10199
};
102100

0 commit comments

Comments
 (0)