From d46f44cefaccb4dbb7cd7a2533eaff45c5ed10da Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Mon, 26 Oct 2015 14:19:03 -1000 Subject: [PATCH] Lots of reverse naming functionality added --- DataSpec/DNACommon/CMDL.hpp | 30 ++++ DataSpec/DNACommon/DNACommon.hpp | 6 +- DataSpec/DNACommon/PAK.hpp | 33 +++- DataSpec/DNAMP1/CMDL.hpp | 8 + DataSpec/DNAMP1/CMDLMaterials.hpp | 44 +++++- DataSpec/DNAMP1/DNAMP1.cpp | 64 +++++++- DataSpec/DNAMP1/DNAMP1.hpp | 3 +- DataSpec/DNAMP1/MREA.cpp | 58 +++++++ DataSpec/DNAMP1/MREA.hpp | 9 ++ DataSpec/DNAMP1/PAK.cpp | 3 + DataSpec/DNAMP1/PAK.hpp | 9 +- DataSpec/DNAMP1/SCAN.hpp | 23 +++ DataSpec/DNAMP1/SCLY.cpp | 28 +++- DataSpec/DNAMP1/SCLY.hpp | 8 +- DataSpec/DNAMP1/ScriptObjects/Actor.hpp | 17 +++ .../DNAMP1/ScriptObjects/ActorContraption.hpp | 17 +++ DataSpec/DNAMP1/ScriptObjects/AmbientAI.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/AtomicAlpha.hpp | 22 +++ DataSpec/DNAMP1/ScriptObjects/AtomicBeta.hpp | 27 ++++ DataSpec/DNAMP1/ScriptObjects/Babygoth.hpp | 70 +++++++++ DataSpec/DNAMP1/ScriptObjects/Beetle.hpp | 17 +++ DataSpec/DNAMP1/ScriptObjects/BloodFlower.hpp | 47 ++++++ DataSpec/DNAMP1/ScriptObjects/Burrower.hpp | 37 +++++ .../ScriptObjects/CameraFilterKeyframe.hpp | 9 ++ DataSpec/DNAMP1/ScriptObjects/ChozoGhost.hpp | 27 ++++ .../ScriptObjects/DamageableTrigger.hpp | 19 +++ DataSpec/DNAMP1/ScriptObjects/Debris.hpp | 15 ++ .../DNAMP1/ScriptObjects/DebrisExtended.hpp | 25 +++ DataSpec/DNAMP1/ScriptObjects/DoorArea.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/Drone.hpp | 22 +++ DataSpec/DNAMP1/ScriptObjects/Effect.hpp | 14 ++ .../ScriptObjects/ElectroMagneticPulse.hpp | 9 ++ DataSpec/DNAMP1/ScriptObjects/ElitePirate.hpp | 60 ++++++++ DataSpec/DNAMP1/ScriptObjects/EnergyBall.hpp | 32 ++++ DataSpec/DNAMP1/ScriptObjects/Eyeball.hpp | 37 +++++ DataSpec/DNAMP1/ScriptObjects/FireFlea.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/FishCloud.hpp | 10 ++ DataSpec/DNAMP1/ScriptObjects/Flaahgra.hpp | 35 +++++ .../DNAMP1/ScriptObjects/FlaahgraTentacle.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/FlickerBat.hpp | 12 ++ .../DNAMP1/ScriptObjects/FlyingPirate.hpp | 47 ++++++ DataSpec/DNAMP1/ScriptObjects/Geemer.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/GunTurret.hpp | 57 +++++++ DataSpec/DNAMP1/ScriptObjects/HUDMemo.hpp | 9 ++ .../DNAMP1/ScriptObjects/IScriptObject.hpp | 5 + DataSpec/DNAMP1/ScriptObjects/IceSheegoth.hpp | 62 ++++++++ DataSpec/DNAMP1/ScriptObjects/IceZoomer.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/JellyZap.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/Magdolite.hpp | 30 ++++ .../DNAMP1/ScriptObjects/MetareeAlpha.hpp | 12 ++ .../DNAMP1/ScriptObjects/MetroidAlpha.hpp | 16 ++ DataSpec/DNAMP1/ScriptObjects/MetroidBeta.hpp | 37 +++++ .../ScriptObjects/MetroidPrimeStage1.hpp | 136 +++++++++++++++++ .../ScriptObjects/MetroidPrimeStage2.hpp | 27 ++++ DataSpec/DNAMP1/ScriptObjects/Midi.hpp | 9 ++ .../DNAMP1/ScriptObjects/NewIntroBoss.hpp | 32 ++++ DataSpec/DNAMP1/ScriptObjects/Oculus.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/OmegaPirate.hpp | 77 ++++++++++ DataSpec/DNAMP1/ScriptObjects/Parameters.hpp | 108 +++++++++++-- DataSpec/DNAMP1/ScriptObjects/Parasite.hpp | 12 ++ .../ScriptObjects/PhazonHealingNodule.hpp | 17 +++ DataSpec/DNAMP1/ScriptObjects/PhazonPool.hpp | 24 +++ DataSpec/DNAMP1/ScriptObjects/Pickup.hpp | 22 +++ DataSpec/DNAMP1/ScriptObjects/Platform.hpp | 22 +++ DataSpec/DNAMP1/ScriptObjects/PlayerActor.hpp | 17 +++ .../DNAMP1/ScriptObjects/PointOfInterest.hpp | 5 + DataSpec/DNAMP1/ScriptObjects/PuddleSpore.hpp | 22 +++ .../DNAMP1/ScriptObjects/PuddleToadGamma.hpp | 17 +++ DataSpec/DNAMP1/ScriptObjects/Puffer.hpp | 22 +++ DataSpec/DNAMP1/ScriptObjects/Ridley.hpp | 127 ++++++++++++++++ DataSpec/DNAMP1/ScriptObjects/Ripper.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/ScriptBeam.hpp | 38 ++++- DataSpec/DNAMP1/ScriptObjects/Seedling.hpp | 22 +++ .../DNAMP1/ScriptObjects/SnakeWeedSwarm.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/SpacePirate.hpp | 22 +++ DataSpec/DNAMP1/ScriptObjects/SpankWeed.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/Steam.hpp | 9 ++ DataSpec/DNAMP1/ScriptObjects/Thardus.hpp | 142 ++++++++++++++++++ .../ScriptObjects/ThardusRockProjectile.hpp | 22 +++ DataSpec/DNAMP1/ScriptObjects/Tryclops.hpp | 12 ++ DataSpec/DNAMP1/ScriptObjects/VisorFlare.hpp | 9 ++ DataSpec/DNAMP1/ScriptObjects/VisorGoo.hpp | 9 ++ .../DNAMP1/ScriptObjects/WallCrawlerSwarm.hpp | 22 +++ DataSpec/DNAMP1/ScriptObjects/Warwasp.hpp | 22 +++ DataSpec/DNAMP1/ScriptObjects/Water.hpp | 64 ++++++++ .../DNAMP1/ScriptObjects/WorldTeleporter.hpp | 19 +++ DataSpec/DNAMP2/DNAMP2.cpp | 3 +- DataSpec/DNAMP2/DNAMP2.hpp | 3 +- DataSpec/DNAMP3/DNAMP3.cpp | 3 +- DataSpec/DNAMP3/DNAMP3.hpp | 3 +- DataSpec/DNAMP3/PAK.cpp | 3 + DataSpec/DNAMP3/PAK.hpp | 1 + 92 files changed, 2396 insertions(+), 41 deletions(-) diff --git a/DataSpec/DNACommon/CMDL.hpp b/DataSpec/DNACommon/CMDL.hpp index 094412191..07fac15be 100644 --- a/DataSpec/DNACommon/CMDL.hpp +++ b/DataSpec/DNACommon/CMDL.hpp @@ -1024,6 +1024,36 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn, return true; } +template +void NameCMDL(Athena::io::IStreamReader& reader, + PAKRouter& pakRouter, + typename PAKRouter::EntryType& entry, + const SpecBase& dataspec) +{ + Header head; + head.read(reader); + std::string bestName = HECL::Format("CMDL_%s", entry.id.toString().c_str()); + + /* Pre-read pass to determine maximum used vert indices */ + atUint32 matSecCount = 0; + if (head.matSetCount) + matSecCount = MaterialSet::OneSection() ? 1 : head.matSetCount; + atUint32 lastDlSec = head.secCount; + for (size_t s=0 ; s)> func_b; const HECL::SystemChar* fileExts[4]; unsigned weight; + std::function&, + typename PAKBRIDGE::PAKType::Entry&)> func_name; }; /* Level hierarchy representation */ @@ -304,18 +306,41 @@ public: } /* Add RigPairs to global map */ - bridge.addCMDLRigPairs(m_cmdlRigs); + bridge.addCMDLRigPairs(*this, m_cmdlRigs); progress(++count / bridgesSz); ++bridgeIdx; } /* TEMP: CSV dump */ + for (auto& entry : m_uniqueEntries) + { + const NOD::Node* node; + EntryType* ent = (EntryType*)lookupEntry(entry.first, &node); + ResExtractor extractor = BRIDGETYPE::LookupExtractor(*ent); + if (extractor.func_name) + { + PAKEntryReadStream s = ent->beginReadStream(*node); + extractor.func_name(m_dataSpec, s, *this, *ent); + } + } + for (const auto& entry : m_sharedEntries) + { + const NOD::Node* node; + EntryType* ent = (EntryType*)lookupEntry(entry.first, &node); + ResExtractor extractor = BRIDGETYPE::LookupExtractor(*ent); + if (extractor.func_name) + { + PAKEntryReadStream s = ent->beginReadStream(*node); + extractor.func_name(m_dataSpec, s, *this, *ent); + } + } + FILE* fp = HECL::Fopen(_S("/home/jacko/Desktop/mp_res.txt"), _S("w")); - for (const auto& entry : m_uniqueEntries) + for (auto& entry : m_uniqueEntries) { const EntryType* ent = entry.second.second; - fprintf(fp, "%s\t0x%s\t\t", ent->type.toString().c_str(), entry.first.toString().c_str()); + fprintf(fp, "%s\t0x%s\t%s\t", ent->type.toString().c_str(), entry.first.toString().c_str(), ent->name.c_str()); switch (ent->unique.m_type) { case UniqueResult::UNIQUE_NOTFOUND: @@ -343,7 +368,7 @@ public: for (const auto& entry : m_sharedEntries) { const EntryType* ent = entry.second.second; - fprintf(fp, "%s\t0x%s\t\t\n", ent->type.toString().c_str(), entry.first.toString().c_str()); + fprintf(fp, "%s\t0x%s\t%s\t\n", ent->type.toString().c_str(), entry.first.toString().c_str(), ent->name.c_str()); } fclose(fp); } diff --git a/DataSpec/DNAMP1/CMDL.hpp b/DataSpec/DNAMP1/CMDL.hpp index b6ffa5bd6..39c456865 100644 --- a/DataSpec/DNAMP1/CMDL.hpp +++ b/DataSpec/DNAMP1/CMDL.hpp @@ -66,6 +66,14 @@ struct CMDL return conn.saveBlend(); } + static void Name(const SpecBase& dataSpec, + PAKEntryReadStream& rs, + PAKRouter& pakRouter, + PAK::Entry& entry) + { + DNACMDL::NameCMDL, MaterialSet>(rs, pakRouter, entry, dataSpec); + } + static bool Cook(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath, const DNACMDL::Mesh& mesh) diff --git a/DataSpec/DNAMP1/CMDLMaterials.hpp b/DataSpec/DNAMP1/CMDLMaterials.hpp index 1002a65e5..fea1e3268 100644 --- a/DataSpec/DNAMP1/CMDLMaterials.hpp +++ b/DataSpec/DNAMP1/CMDLMaterials.hpp @@ -360,7 +360,6 @@ struct MaterialSet : BigDNA case ANIM_HSTRIP: case ANIM_VSTRIP: return __isz + 20; - break; case ANIM_ROTATION: case ANIM_MODE_WHO_MUST_NOT_BE_NAMED: return __isz + 12; @@ -411,6 +410,49 @@ struct MaterialSet : BigDNA DNACMDL::ReadMaterialSetToBlender_1_2(os, *this, pakRouter, entry, setIdx); } + template + void nameTextures(PAKRouter& pakRouter, const char* prefix, int setIdx) const + { + int matIdx = 0; + for (const Material& mat : materials) + { + int stageIdx = 0; + for (const Material::TEVStage& stage : mat.tevStages) + { + const Material::TEVStageTexInfo& texInfo = mat.tevStageTexInfo[stageIdx]; + if (texInfo.texSlot == 0xff) + { + ++stageIdx; + continue; + } + const NOD::Node* node; + typename PAKRouter::EntryType* texEntry = (typename PAKRouter::EntryType*) + pakRouter.lookupEntry(head.textureIDs[mat.textureIdxs[texInfo.texSlot]], &node); + if (texEntry->name.size()) + { + if (texEntry->name.size() < 5 || texEntry->name.compare(0, 5, "mult_")) + texEntry->name = "mult_" + texEntry->name; + ++stageIdx; + continue; + } + if (setIdx < 0) + texEntry->name = HECL::Format("%s_%d_%d", prefix, matIdx, stageIdx); + else + texEntry->name = HECL::Format("%s_%d_%d_%d", prefix, setIdx, matIdx, stageIdx); + + if (mat.flags.lightmap() && stageIdx == 0) + { + texEntry->name += "light"; + ++stageIdx; + continue; + } + + ++stageIdx; + } + ++matIdx; + } + } + }; } diff --git a/DataSpec/DNAMP1/DNAMP1.cpp b/DataSpec/DNAMP1/DNAMP1.cpp index fa72fd243..d0718543c 100644 --- a/DataSpec/DNAMP1/DNAMP1.cpp +++ b/DataSpec/DNAMP1/DNAMP1.cpp @@ -42,9 +42,10 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, PAKEntryReadStream rs = entry.beginReadStream(m_node); MLVL mlvl; mlvl.read(rs); - const PAK::Entry* nameEnt = m_pak.lookupEntry(mlvl.worldNameId); + PAK::Entry* nameEnt = (PAK::Entry*)m_pak.lookupEntry(mlvl.worldNameId); if (nameEnt) { + nameEnt->name = entry.name + "_name"; PAKEntryReadStream rs = nameEnt->beginReadStream(m_node); STRG mlvlName; mlvlName.read(rs); @@ -92,10 +93,11 @@ void PAKBridge::build() unsigned layerIdx = 0; /* Make MAPW available to lookup MAPAs */ - const PAK::Entry* worldMapEnt = m_pak.lookupEntry(mlvl.worldMap); + PAK::Entry* worldMapEnt = (PAK::Entry*)m_pak.lookupEntry(mlvl.worldMap); std::vector mapw; if (worldMapEnt) { + worldMapEnt->name = entry.name + "_mapw"; PAKEntryReadStream rs = worldMapEnt->beginReadStream(m_node); rs.seek(8, Athena::Current); atUint32 areaCount = rs.readUint32Big(); @@ -104,13 +106,21 @@ void PAKBridge::build() mapw.emplace_back(rs); } + PAK::Entry* savwEnt = (PAK::Entry*)m_pak.lookupEntry(mlvl.saveWorldId); + if (savwEnt) + savwEnt->name = entry.name + "_savw"; + + PAK::Entry* skyEnt = (PAK::Entry*)m_pak.lookupEntry(mlvl.worldSkyboxId); + if (skyEnt) + skyEnt->name = entry.name + "_skybox"; + /* Index areas */ unsigned ai = 0; for (const MLVL::Area& area : mlvl.areas) { Level::Area& areaDeps = level.areas[area.areaMREAId]; MLVL::LayerFlags& layerFlags = mlvl.layerFlags[ai]; - const PAK::Entry* areaNameEnt = m_pak.lookupEntry(area.areaNameId); + PAK::Entry* areaNameEnt = (PAK::Entry*)m_pak.lookupEntry(area.areaNameId); if (areaNameEnt) { STRG areaName; @@ -141,6 +151,19 @@ void PAKBridge::build() HECL::SNPrintf(num, 16, _S("%02u "), ai); areaDeps.name = num + areaDeps.name; + std::string lowerName(areaDeps.name); + for (char& ch : lowerName) + { + ch = tolower(ch); + if (ch == ' ') + ch = '_'; + } + if (areaNameEnt) + areaNameEnt->name = lowerName + "_name"; + PAK::Entry* areaEnt = (PAK::Entry*)m_pak.lookupEntry(area.areaMREAId); + if (areaEnt) + areaEnt->name = lowerName; + areaDeps.layers.reserve(area.depLayerCount-1); unsigned r=0; for (unsigned l=1 ; l>& addTo) const +void PAKBridge::addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const { for (const std::pair& entry : m_pak.m_idMap) { @@ -194,9 +218,33 @@ void PAKBridge::addCMDLRigPairs(std::unordered_mapname = HECL::Format("ANCS_%08X_%s_model", entry.first.toUint32(), ci.name.c_str()); + cskrEnt->name = HECL::Format("ANCS_%08X_%s_skin", entry.first.toUint32(), ci.name.c_str()); + cinfEnt->name = HECL::Format("ANCS_%08X_%s_skel", entry.first.toUint32(), ci.name.c_str()); + if (ci.cmdlOverlay && ci.cskrOverlay) + { addTo[ci.cmdlOverlay] = std::make_pair(ci.cskrOverlay, ci.cinf); + PAK::Entry* cmdlEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cmdlOverlay); + PAK::Entry* cskrEnt = (PAK::Entry*)m_pak.lookupEntry(ci.cskrOverlay); + cmdlEnt->name = HECL::Format("ANCS_%08X_%s_overmodel", entry.first.toUint32(), ci.name.c_str()); + cskrEnt->name = HECL::Format("ANCS_%08X_%s_overskin", entry.first.toUint32(), ci.name.c_str()); + } } + std::map> animInfo; + ancs.getAnimationResInfo(animInfo); + for (auto& ae : animInfo) + { + PAK::Entry* animEnt = (PAK::Entry*)m_pak.lookupEntry(ae.second.animId); + animEnt->name = HECL::Format("ANCS_%08X_%s", entry.first.toUint32(), ae.second.name.c_str()); + } + } + else if (entry.second->type == FOURCC('MREA')) + { + PAKEntryReadStream rs = entry.second->beginReadStream(m_node); + MREA::AddCMDLRigPairs(rs, pakRouter, addTo); } } } @@ -208,17 +256,17 @@ ResExtractor PAKBridge::LookupExtractor(const PAK::Entry& entry) case SBIG('STRG'): return {STRG::Extract, nullptr, {_S(".yaml")}}; case SBIG('SCAN'): - return {SCAN::Extract, nullptr, {_S(".yaml")}}; + return {SCAN::Extract, nullptr, {_S(".yaml")}, 0, SCAN::Name}; case SBIG('TXTR'): return {TXTR::Extract, nullptr, {_S(".png")}}; case SBIG('CMDL'): - return {nullptr, CMDL::Extract, {_S(".blend")}, 1}; + return {nullptr, CMDL::Extract, {_S(".blend")}, 1, CMDL::Name}; case SBIG('ANCS'): return {nullptr, ANCS::Extract, {_S(".yaml"), _S(".blend")}, 2}; case SBIG('MLVL'): return {nullptr, MLVL::Extract, {_S(".blend")}, 3}; case SBIG('MREA'): - return {nullptr, MREA::Extract, {_S(".blend")}, 4}; + return {nullptr, MREA::Extract, {_S(".blend")}, 4, MREA::Name}; case SBIG('MAPA'): return {nullptr, MAPA::Extract, {_S(".blend")}, 4}; } diff --git a/DataSpec/DNAMP1/DNAMP1.hpp b/DataSpec/DNAMP1/DNAMP1.hpp index b041aeeba..773cdd222 100644 --- a/DataSpec/DNAMP1/DNAMP1.hpp +++ b/DataSpec/DNAMP1/DNAMP1.hpp @@ -34,7 +34,8 @@ public: const PAKType& getPAK() const {return m_pak;} const NOD::Node& getNode() const {return m_node;} - void addCMDLRigPairs(std::unordered_map>& addTo) const; + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const; }; } diff --git a/DataSpec/DNAMP1/MREA.cpp b/DataSpec/DNAMP1/MREA.cpp index edeabf6a7..bd026538f 100644 --- a/DataSpec/DNAMP1/MREA.cpp +++ b/DataSpec/DNAMP1/MREA.cpp @@ -35,6 +35,26 @@ void MREA::ReadBabeDeadToBlender_1_2(HECL::BlenderConnection::PyOutStream& os, } } +void MREA::AddCMDLRigPairs(PAKEntryReadStream& rs, + PAKRouter& pakRouter, + std::unordered_map>& addTo) +{ + /* Do extract */ + Header head; + head.read(rs); + rs.seekAlign32(); + + /* Skip to SCLY */ + atUint32 curSec = 0; + atUint64 secStart = rs.position(); + while (curSec != head.sclySecIdx) + secStart += head.secSizes[curSec++]; + rs.seek(secStart, Athena::Begin); + SCLY scly; + scly.read(rs); + scly.addCMDLRigPairs(pakRouter, addTo); +} + bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const HECL::ProjectPath& outPath, @@ -159,5 +179,43 @@ bool MREA::Extract(const SpecBase& dataSpec, return conn.saveBlend(); } +void MREA::Name(const SpecBase& dataSpec, + PAKEntryReadStream& rs, + PAKRouter& pakRouter, + PAK::Entry& entry) +{ + /* Do extract */ + Header head; + head.read(rs); + rs.seekAlign32(); + + /* One shared material set for all meshes */ + atUint64 secStart = rs.position(); + MaterialSet matSet; + matSet.read(rs); + matSet.nameTextures(pakRouter, HECL::Format("MREA_%s", entry.id.toString().c_str()).c_str(), -1); + rs.seek(secStart + head.secSizes[0], Athena::Begin); + + /* Skip to SCLY */ + atUint32 curSec = 1; + secStart = rs.position(); + while (curSec != head.sclySecIdx) + secStart += head.secSizes[curSec++]; + rs.seek(secStart, Athena::Begin); + SCLY scly; + scly.read(rs); + scly.nameIDs(pakRouter); + + /* Skip to PATH */ + while (curSec != head.pathSecIdx) + secStart += head.secSizes[curSec++]; + rs.seek(secStart, Athena::Begin); + + UniqueID32 pathID(rs); + const NOD::Node* node; + PAK::Entry* pathEnt = (PAK::Entry*)pakRouter.lookupEntry(pathID, &node); + pathEnt->name = entry.name + "_path"; +} + } } diff --git a/DataSpec/DNAMP1/MREA.hpp b/DataSpec/DNAMP1/MREA.hpp index c53c575ca..152b764f7 100644 --- a/DataSpec/DNAMP1/MREA.hpp +++ b/DataSpec/DNAMP1/MREA.hpp @@ -103,6 +103,10 @@ struct MREA static void ReadBabeDeadToBlender_1_2(HECL::BlenderConnection::PyOutStream& os, Athena::io::IStreamReader& rs); + static void AddCMDLRigPairs(PAKEntryReadStream& rs, + PAKRouter& pakRouter, + std::unordered_map>& addTo); + static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const HECL::ProjectPath& outPath, @@ -110,6 +114,11 @@ struct MREA const PAK::Entry& entry, bool, std::function); + + static void Name(const SpecBase& dataSpec, + PAKEntryReadStream& rs, + PAKRouter& pakRouter, + PAK::Entry& entry); }; } diff --git a/DataSpec/DNAMP1/PAK.cpp b/DataSpec/DNAMP1/PAK.cpp index d9947a35d..95998071b 100644 --- a/DataSpec/DNAMP1/PAK.cpp +++ b/DataSpec/DNAMP1/PAK.cpp @@ -55,7 +55,10 @@ void PAK::read(Athena::io::IStreamReader& reader) { std::unordered_map::iterator found = m_idMap.find(entry.id); if (found != m_idMap.end()) + { m_nameMap[entry.name] = found->second; + found->second->name = entry.name; + } } } diff --git a/DataSpec/DNAMP1/PAK.hpp b/DataSpec/DNAMP1/PAK.hpp index 25ad43a2a..7228708f5 100644 --- a/DataSpec/DNAMP1/PAK.hpp +++ b/DataSpec/DNAMP1/PAK.hpp @@ -36,6 +36,7 @@ struct PAK : BigDNA Value size; Value offset; UniqueResult unique; + std::string name; std::unique_ptr getBuffer(const NOD::Node& pak, atUint64& szOut) const; inline PAKEntryReadStream beginReadStream(const NOD::Node& pak, atUint64 off=0) const @@ -52,7 +53,7 @@ struct PAK : BigDNA std::unordered_map m_idMap; std::unordered_map m_nameMap; - inline const Entry* lookupEntry(const UniqueID32& id) const + const Entry* lookupEntry(const UniqueID32& id) const { std::unordered_map::const_iterator result = m_idMap.find(id); if (result != m_idMap.end()) @@ -60,7 +61,7 @@ struct PAK : BigDNA return nullptr; } - inline const Entry* lookupEntry(const std::string& name) const + const Entry* lookupEntry(const std::string& name) const { std::unordered_map::const_iterator result = m_nameMap.find(name); if (result != m_nameMap.end()) @@ -68,7 +69,7 @@ struct PAK : BigDNA return nullptr; } - inline std::string bestEntryName(const Entry& entry) const + std::string bestEntryName(const Entry& entry) const { /* Prefer named entries first */ for (const NameEntry& nentry : m_nameEntries) @@ -79,7 +80,7 @@ struct PAK : BigDNA return entry.type.toString() + '_' + entry.id.toString(); } - typedef UniqueID32 IDType; + using IDType = UniqueID32; }; } diff --git a/DataSpec/DNAMP1/SCAN.hpp b/DataSpec/DNAMP1/SCAN.hpp index 6028bfa78..8064f799d 100644 --- a/DataSpec/DNAMP1/SCAN.hpp +++ b/DataSpec/DNAMP1/SCAN.hpp @@ -80,6 +80,29 @@ struct SCAN : BigYAML fclose(fp); return true; } + + static void Name(const SpecBase& dataSpec, + PAKEntryReadStream& rs, + PAKRouter& pakRouter, + PAK::Entry& entry) + { + SCAN scan; + scan.read(rs); + if (scan.string) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(scan.string); + ent->name = HECL::Format("SCAN_%s_strg", entry.id.toString().c_str()); + } + for (int i=0 ; i<4 ; ++i) + { + const Texture& tex = scan.textures[i]; + if (tex.texture) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(tex.texture); + ent->name = HECL::Format("SCAN_%s_tex%d", entry.id.toString().c_str(), i+1); + } + } + } }; } } diff --git a/DataSpec/DNAMP1/SCLY.cpp b/DataSpec/DNAMP1/SCLY.cpp index 4ea658cd6..df509af44 100644 --- a/DataSpec/DNAMP1/SCLY.cpp +++ b/DataSpec/DNAMP1/SCLY.cpp @@ -36,7 +36,7 @@ size_t SCLY::binarySize(size_t __isz) const return __EnumerateSize(__isz, layers); } -void SCLY::exportToLayerDirectories(const PAK::Entry& entry, PAKRouter &pakRouter, bool force) +void SCLY::exportToLayerDirectories(const PAK::Entry& entry, PAKRouter &pakRouter, bool force) const { for (atUint32 i = 0; i < layerCount; i++) { @@ -54,6 +54,32 @@ void SCLY::exportToLayerDirectories(const PAK::Entry& entry, PAKRouter& pakRouter, + std::unordered_map>& addTo) const +{ + for (const ScriptLayer& layer : layers) + layer.addCMDLRigPairs(pakRouter, addTo); +} + +void SCLY::ScriptLayer::addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const +{ + for (const std::shared_ptr& obj : objects) + obj->addCMDLRigPairs(pakRouter, addTo); +} + +void SCLY::nameIDs(PAKRouter& pakRouter) const +{ + for (const ScriptLayer& layer : layers) + layer.nameIDs(pakRouter); +} + +void SCLY::ScriptLayer::nameIDs(PAKRouter& pakRouter) const +{ + for (const std::shared_ptr& obj : objects) + obj->nameIDs(pakRouter); +} + void SCLY::fromYAML(Athena::io::YAMLDocReader& docin) { fourCC = docin.readUint32("fourCC"); diff --git a/DataSpec/DNAMP1/SCLY.hpp b/DataSpec/DNAMP1/SCLY.hpp index 929447290..6b8faf22a 100644 --- a/DataSpec/DNAMP1/SCLY.hpp +++ b/DataSpec/DNAMP1/SCLY.hpp @@ -29,6 +29,9 @@ struct SCLY : BigYAML void read(Athena::io::IStreamReader &rs); void write(Athena::io::IStreamWriter &ws) const; size_t binarySize(size_t __isz) const; + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const; + void nameIDs(PAKRouter& pakRouter) const; }; Vector layers; @@ -36,7 +39,10 @@ struct SCLY : BigYAML void write(Athena::io::IStreamWriter &ws) const; size_t binarySize(size_t __isz) const; - void exportToLayerDirectories(const PAK::Entry &, PAKRouter&, bool); + void exportToLayerDirectories(const PAK::Entry &, PAKRouter&, bool) const; + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const; + void nameIDs(PAKRouter& pakRouter) const; }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Actor.hpp b/DataSpec/DNAMP1/ScriptObjects/Actor.hpp index 936c3da83..447e8f06f 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Actor.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Actor.hpp @@ -35,6 +35,23 @@ struct Actor : IScriptObject Value unknown12; Value unknown13; Value unknown14; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + animationParameters.nameANCS(pakRouter, name + "_animp"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/ActorContraption.hpp b/DataSpec/DNAMP1/ScriptObjects/ActorContraption.hpp index 6717ac253..27b43ca79 100644 --- a/DataSpec/DNAMP1/ScriptObjects/ActorContraption.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/ActorContraption.hpp @@ -27,6 +27,23 @@ struct ActorContraption : IScriptObject UniqueID32 particle; DamageInfo damageInfo; Value active; // needs verification + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part"; + } + animationParameters.nameANCS(pakRouter, name + "_animp"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/AmbientAI.hpp b/DataSpec/DNAMP1/ScriptObjects/AmbientAI.hpp index 7f60d07cd..80bbcc5b3 100644 --- a/DataSpec/DNAMP1/ScriptObjects/AmbientAI.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/AmbientAI.hpp @@ -28,6 +28,18 @@ struct AmbientAI : IScriptObject Value unknown5; Value unknown6; Value unknown7; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + animationParameters.nameANCS(pakRouter, name + "_animp"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/AtomicAlpha.hpp b/DataSpec/DNAMP1/ScriptObjects/AtomicAlpha.hpp index 1b66ddd01..5d0c377bc 100644 --- a/DataSpec/DNAMP1/ScriptObjects/AtomicAlpha.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/AtomicAlpha.hpp @@ -26,6 +26,28 @@ struct AtomicAlpha : IScriptObject Value unknown3; Value unknown4; Value unknown5; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc); + ent->name = name + "_wpsc"; + } + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/AtomicBeta.hpp b/DataSpec/DNAMP1/ScriptObjects/AtomicBeta.hpp index a1f525c84..062dd0663 100644 --- a/DataSpec/DNAMP1/ScriptObjects/AtomicBeta.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/AtomicBeta.hpp @@ -33,6 +33,33 @@ struct AtomicBeta : IScriptObject Value unknown8; Value unknown9; Value unknown10; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (elsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc); + ent->name = name + "_elsc"; + } + if (wpsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc); + ent->name = name + "_wpsc"; + } + if (part) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(part); + ent->name = name + "_part"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Babygoth.hpp b/DataSpec/DNAMP1/ScriptObjects/Babygoth.hpp index a522f4dc9..473194315 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Babygoth.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Babygoth.hpp @@ -45,6 +45,76 @@ struct Babygoth : IScriptObject UniqueID32 texture; Value unknown11; UniqueID32 particle6; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + UniqueID32 cinf = patternedInfo.animationParameters.getCINF(pakRouter); + actorParameters.addCMDLRigPairs(addTo, cinf); + if (model && skin) + addTo[model] = std::make_pair(skin, cinf); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); + ent->name = name + "_wpsc1"; + } + if (wpsc2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc2); + ent->name = name + "_wpsc2"; + } + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_emodel"; + } + if (skin) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(skin); + ent->name = name + "_eskin"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + if (particle4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4); + ent->name = name + "_part4"; + } + if (particle5) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle5); + ent->name = name + "_part5"; + } + if (texture) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture); + ent->name = name + "_tex"; + } + if (particle6) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle6); + ent->name = name + "_part6"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Beetle.hpp b/DataSpec/DNAMP1/ScriptObjects/Beetle.hpp index 71d3a9dff..ad42ea774 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Beetle.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Beetle.hpp @@ -28,6 +28,23 @@ struct Beetle : IScriptObject Value unknown4; Value unknown5; Value unknown6; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/BloodFlower.hpp b/DataSpec/DNAMP1/ScriptObjects/BloodFlower.hpp index 4394d8dd8..ee7bcf028 100644 --- a/DataSpec/DNAMP1/ScriptObjects/BloodFlower.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/BloodFlower.hpp @@ -30,6 +30,53 @@ struct BloodFlower : IScriptObject Value unknown1; UniqueID32 particle5; Value unknown2; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); + ent->name = name + "_wpsc1"; + } + if (wpsc2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc2); + ent->name = name + "_wpsc2"; + } + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + if (particle4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4); + ent->name = name + "_part4"; + } + if (particle5) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle5); + ent->name = name + "_part5"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Burrower.hpp b/DataSpec/DNAMP1/ScriptObjects/Burrower.hpp index 26d594f4d..642eca309 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Burrower.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Burrower.hpp @@ -25,6 +25,43 @@ struct Burrower : IScriptObject UniqueID32 particle3; Value unknown; // always FF UniqueID32 particle4; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc); + ent->name = name + "_wpsc"; + } + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + if (particle4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4); + ent->name = name + "_part4"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/CameraFilterKeyframe.hpp b/DataSpec/DNAMP1/ScriptObjects/CameraFilterKeyframe.hpp index daab392d2..d2ea3ed2c 100644 --- a/DataSpec/DNAMP1/ScriptObjects/CameraFilterKeyframe.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/CameraFilterKeyframe.hpp @@ -22,6 +22,15 @@ struct CameraFilterKeyframe : IScriptObject Value unknown7; Value unknown8; UniqueID32 texture; + + void nameIDs(PAKRouter& pakRouter) const + { + if (texture) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture); + ent->name = name + "_texture"; + } + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/ChozoGhost.hpp b/DataSpec/DNAMP1/ScriptObjects/ChozoGhost.hpp index 8d5e7ad4c..90efeac76 100644 --- a/DataSpec/DNAMP1/ScriptObjects/ChozoGhost.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/ChozoGhost.hpp @@ -43,6 +43,33 @@ struct ChozoGhost : IScriptObject Value unknown11; Value unknown12; Value unknown13; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); + ent->name = name + "_wpsc1"; + } + if (wpsc2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc2); + ent->name = name + "_wpsc2"; + } + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/DamageableTrigger.hpp b/DataSpec/DNAMP1/ScriptObjects/DamageableTrigger.hpp index 41216ffbd..98aa353f5 100644 --- a/DataSpec/DNAMP1/ScriptObjects/DamageableTrigger.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/DamageableTrigger.hpp @@ -24,6 +24,25 @@ struct DamageableTrigger : IScriptObject Value lockOn; Value active; VisorParameters visorParameters; + + void nameIDs(PAKRouter& pakRouter) const + { + if (texture1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture1); + ent->name = name + "_texture1"; + } + if (texture2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture2); + ent->name = name + "_texture2"; + } + if (texture3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture3); + ent->name = name + "_texture3"; + } + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Debris.hpp b/DataSpec/DNAMP1/ScriptObjects/Debris.hpp index d5112d7ad..89bb7ca45 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Debris.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Debris.hpp @@ -30,6 +30,21 @@ struct Debris : IScriptObject Value unknown9; Value unknown10; Value unknown11; + + void nameIDs(PAKRouter& pakRouter) const + { + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part"; + } + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/DebrisExtended.hpp b/DataSpec/DNAMP1/ScriptObjects/DebrisExtended.hpp index a160e4fe1..eaa01a166 100644 --- a/DataSpec/DNAMP1/ScriptObjects/DebrisExtended.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/DebrisExtended.hpp @@ -51,6 +51,31 @@ struct DebrisExtended : IScriptObject Value unknown28; Value unknown29; Value unknown30; + + void nameIDs(PAKRouter& pakRouter) const + { + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/DoorArea.hpp b/DataSpec/DNAMP1/ScriptObjects/DoorArea.hpp index b26704e4f..b8ebb2368 100644 --- a/DataSpec/DNAMP1/ScriptObjects/DoorArea.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/DoorArea.hpp @@ -26,6 +26,18 @@ struct DoorArea : IScriptObject Value unknown6; Value unknown7; Value unknown8; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + animationParameters.nameANCS(pakRouter, name + "_animp"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Drone.hpp b/DataSpec/DNAMP1/ScriptObjects/Drone.hpp index e5d5067f4..e15daa730 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Drone.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Drone.hpp @@ -57,6 +57,28 @@ struct Drone : IScriptObject Value unknon29; Value sound; // verification needed Value unknown30; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (crsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(crsc); + ent->name = name + "_crsc"; + } + flareDefinition1.nameIDs(pakRouter, name + "_flare1"); + flareDefinition2.nameIDs(pakRouter, name + "_flare2"); + flareDefinition3.nameIDs(pakRouter, name + "_flare3"); + flareDefinition4.nameIDs(pakRouter, name + "_flare4"); + flareDefinition5.nameIDs(pakRouter, name + "_flare5"); + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Effect.hpp b/DataSpec/DNAMP1/ScriptObjects/Effect.hpp index 82276054f..aa87c22e1 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Effect.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Effect.hpp @@ -36,6 +36,20 @@ struct Effect : IScriptObject Value unknown16; Value unknown17; LightParameters lightParameters; + + void nameIDs(PAKRouter& pakRouter) const + { + if (part) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(part); + ent->name = name + "_part"; + } + if (elsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc); + ent->name = name + "_elsc"; + } + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/ElectroMagneticPulse.hpp b/DataSpec/DNAMP1/ScriptObjects/ElectroMagneticPulse.hpp index 3110e51b9..76c944fc4 100644 --- a/DataSpec/DNAMP1/ScriptObjects/ElectroMagneticPulse.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/ElectroMagneticPulse.hpp @@ -24,6 +24,15 @@ struct ElectroMagneticPulse : IScriptObject Value unknown7; Value unknown8; UniqueID32 particle; + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part"; + } + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/ElitePirate.hpp b/DataSpec/DNAMP1/ScriptObjects/ElitePirate.hpp index 576316fb2..cb9ccb764 100644 --- a/DataSpec/DNAMP1/ScriptObjects/ElitePirate.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/ElitePirate.hpp @@ -54,6 +54,66 @@ struct ElitePirate : IScriptObject Value soundID5; Value unknown17; Value unknown18; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters1.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + actorParameters2.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + if (particle4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4); + ent->name = name + "_part4"; + } + if (particle5) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle5); + ent->name = name + "_part5"; + } + if (particle6) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle6); + ent->name = name + "_part6"; + } + if (particle7) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle7); + ent->name = name + "_part7"; + } + if (elsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc); + ent->name = name + "_elsc"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters1.nameIDs(pakRouter, name + "_actp1"); + actorParameters2.nameIDs(pakRouter, name + "_actp2"); + animationParameters.nameANCS(pakRouter, name + "_animp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/EnergyBall.hpp b/DataSpec/DNAMP1/ScriptObjects/EnergyBall.hpp index 9e2913818..8c47e8b4f 100644 --- a/DataSpec/DNAMP1/ScriptObjects/EnergyBall.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/EnergyBall.hpp @@ -32,6 +32,38 @@ struct EnergyBall : IScriptObject UniqueID32 particle2; DamageInfo damageInfo2; Value unknown6; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (texture) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture); + ent->name = name + "_texture"; + } + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (elsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc); + ent->name = name + "_elsc"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Eyeball.hpp b/DataSpec/DNAMP1/ScriptObjects/Eyeball.hpp index b8bd6b675..08bfa74ab 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Eyeball.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Eyeball.hpp @@ -33,6 +33,43 @@ struct Eyeball : IScriptObject Value unknown7; // always ff Value unknown8; Value unknown9; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc); + ent->name = name + "_wpsc"; + } + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (texture1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture1); + ent->name = name + "_tex1"; + } + if (texture2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture2); + ent->name = name + "_tex2"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/FireFlea.hpp b/DataSpec/DNAMP1/ScriptObjects/FireFlea.hpp index 77f4bddfe..34ba10c6d 100644 --- a/DataSpec/DNAMP1/ScriptObjects/FireFlea.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/FireFlea.hpp @@ -21,6 +21,18 @@ struct FireFlea : IScriptObject Value unknown1; Value unknown2; Value unknown3; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/FishCloud.hpp b/DataSpec/DNAMP1/ScriptObjects/FishCloud.hpp index c48467e29..40e395659 100644 --- a/DataSpec/DNAMP1/ScriptObjects/FishCloud.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/FishCloud.hpp @@ -48,6 +48,16 @@ struct FishCloud : IScriptObject Value unknown28; Value unknown29; Value unknown30; + + void nameIDs(PAKRouter& pakRouter) const + { + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + animationParameters.nameANCS(pakRouter, name + "_animp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Flaahgra.hpp b/DataSpec/DNAMP1/ScriptObjects/Flaahgra.hpp index 901da0e71..7c6e34342 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Flaahgra.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Flaahgra.hpp @@ -35,6 +35,41 @@ struct Flaahgra : IScriptObject Value unknown7; AnimationParameters animationParameters; UniqueID32 dependencyGroup; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters1.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + actorParameters2.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); + ent->name = name + "_wpsc1"; + } + if (wpsc2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc2); + ent->name = name + "_wpsc2"; + } + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part"; + } + if (dependencyGroup) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(dependencyGroup); + ent->name = name + "_dgrp"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters1.nameIDs(pakRouter, name + "_actp1"); + actorParameters2.nameIDs(pakRouter, name + "_actp2"); + animationParameters.nameANCS(pakRouter, name + "_animp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/FlaahgraTentacle.hpp b/DataSpec/DNAMP1/ScriptObjects/FlaahgraTentacle.hpp index 4f8bfa380..f702b4b30 100644 --- a/DataSpec/DNAMP1/ScriptObjects/FlaahgraTentacle.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/FlaahgraTentacle.hpp @@ -18,6 +18,18 @@ struct FlaahgraTentacle : IScriptObject Value scale; PatternedInfo patternedInfo; ActorParameters actorParameters; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/FlickerBat.hpp b/DataSpec/DNAMP1/ScriptObjects/FlickerBat.hpp index 4d9d0e6eb..1c7a409bf 100644 --- a/DataSpec/DNAMP1/ScriptObjects/FlickerBat.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/FlickerBat.hpp @@ -22,6 +22,18 @@ struct FlickerBat : IScriptObject Value unknown2; Value unknown3; Value unknown4; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/FlyingPirate.hpp b/DataSpec/DNAMP1/ScriptObjects/FlyingPirate.hpp index c583e1c2e..66cf1b144 100644 --- a/DataSpec/DNAMP1/ScriptObjects/FlyingPirate.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/FlyingPirate.hpp @@ -48,6 +48,53 @@ struct FlyingPirate : IScriptObject Value unknown18; Value unknown19; Value unknown20; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); + ent->name = name + "_wpsc1"; + } + if (wpsc2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc2); + ent->name = name + "_wpsc2"; + } + if (wpsc3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc3); + ent->name = name + "_wpsc3"; + } + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + if (particle4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4); + ent->name = name + "_part4"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Geemer.hpp b/DataSpec/DNAMP1/ScriptObjects/Geemer.hpp index b8772e8f7..9b1c39db1 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Geemer.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Geemer.hpp @@ -28,6 +28,18 @@ struct Geemer : IScriptObject Value unknown8; Value unknown9; Value unknown10; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/GunTurret.hpp b/DataSpec/DNAMP1/ScriptObjects/GunTurret.hpp index d4f843096..808008f33 100644 --- a/DataSpec/DNAMP1/ScriptObjects/GunTurret.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/GunTurret.hpp @@ -60,6 +60,63 @@ struct GunTurret : IScriptObject Value unknown28; Value unknown29; Value unknown30; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (unknown18) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(unknown18); + ent->name = name + "_unknown18"; + } + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + if (particle4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4); + ent->name = name + "_part4"; + } + if (particle5) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle5); + ent->name = name + "_part5"; + } + if (particle6) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle6); + ent->name = name + "_part6"; + } + if (particle7) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle7); + ent->name = name + "_part7"; + } + animationParameters.nameANCS(pakRouter, name + "_animp"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/HUDMemo.hpp b/DataSpec/DNAMP1/ScriptObjects/HUDMemo.hpp index a2e7e6c93..93c3dfe6d 100644 --- a/DataSpec/DNAMP1/ScriptObjects/HUDMemo.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/HUDMemo.hpp @@ -18,6 +18,15 @@ struct HUDMemo : IScriptObject Value memoType; UniqueID32 message; Value active; + + void nameIDs(PAKRouter& pakRouter) const + { + if (message) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(message); + ent->name = name + "_message"; + } + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/IScriptObject.hpp b/DataSpec/DNAMP1/ScriptObjects/IScriptObject.hpp index 8e5366a42..47629c7e7 100644 --- a/DataSpec/DNAMP1/ScriptObjects/IScriptObject.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/IScriptObject.hpp @@ -1,6 +1,7 @@ #ifndef __DNAMP1_SCRIPTOBJECT_HPP #define __DNAMP1_SCRIPTOBJECT_HPP #include "../../DNACommon/DNACommon.hpp" +#include "../DNAMP1.hpp" #include namespace Retro @@ -28,6 +29,10 @@ struct IScriptObject : BigYAML virtual ~IScriptObject() { } + + virtual void addCMDLRigPairs(PAKRouter&, + std::unordered_map>&) const {} + virtual void nameIDs(PAKRouter& pakRouter) const {} }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/IceSheegoth.hpp b/DataSpec/DNAMP1/ScriptObjects/IceSheegoth.hpp index a256bd878..671e93ba1 100644 --- a/DataSpec/DNAMP1/ScriptObjects/IceSheegoth.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/IceSheegoth.hpp @@ -49,6 +49,68 @@ struct IceSheegoth : IScriptObject UniqueID32 particle6; Value unknown12; Value unknown13; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); + ent->name = name + "_wpsc1"; + } + if (wpsc2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc2); + ent->name = name + "_wpsc2"; + } + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + if (particle4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4); + ent->name = name + "_part4"; + } + if (particle5) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle5); + ent->name = name + "_part5"; + } + if (elsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc); + ent->name = name + "_elsc"; + } + if (texture) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture); + ent->name = name + "_texture"; + } + if (particle6) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle6); + ent->name = name + "_part6"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/IceZoomer.hpp b/DataSpec/DNAMP1/ScriptObjects/IceZoomer.hpp index 8a739dce4..5943c53f5 100644 --- a/DataSpec/DNAMP1/ScriptObjects/IceZoomer.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/IceZoomer.hpp @@ -28,6 +28,18 @@ struct IceZoomer : IScriptObject Value unknown8; DamageVulnerability damageVulnerabilty; Value unknown9; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/JellyZap.hpp b/DataSpec/DNAMP1/ScriptObjects/JellyZap.hpp index a123f2e97..10408a4e7 100644 --- a/DataSpec/DNAMP1/ScriptObjects/JellyZap.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/JellyZap.hpp @@ -32,6 +32,18 @@ struct JellyZap : IScriptObject Value unknown11; Value unknown12; Value unknown13; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Magdolite.hpp b/DataSpec/DNAMP1/ScriptObjects/Magdolite.hpp index 07734db74..ade2aa6d1 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Magdolite.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Magdolite.hpp @@ -44,6 +44,36 @@ struct Magdolite : IScriptObject Value unknown7; Value unknown8; Value unknown9; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + UniqueID32 cinf = patternedInfo.animationParameters.getCINF(pakRouter); + actorParameters.addCMDLRigPairs(addTo, cinf); + if (model && skin) + addTo[model] = std::make_pair(skin, cinf); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_emodel"; + } + if (skin) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(skin); + ent->name = name + "_eskin"; + } + if (magdoliteParameters.particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(magdoliteParameters.particle); + ent->name = name + "_part"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/MetareeAlpha.hpp b/DataSpec/DNAMP1/ScriptObjects/MetareeAlpha.hpp index d28f88276..3b6c1bbdb 100644 --- a/DataSpec/DNAMP1/ScriptObjects/MetareeAlpha.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/MetareeAlpha.hpp @@ -24,6 +24,18 @@ struct MetareeAlpha : IScriptObject Value unknown3; Value unknown4; Value unknown5; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/MetroidAlpha.hpp b/DataSpec/DNAMP1/ScriptObjects/MetroidAlpha.hpp index dbb8bd98f..005152956 100644 --- a/DataSpec/DNAMP1/ScriptObjects/MetroidAlpha.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/MetroidAlpha.hpp @@ -32,6 +32,22 @@ struct MetroidAlpha : IScriptObject AnimationParameters animationParameters3; AnimationParameters animationParameters4; Value unknown8; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + animationParameters1.nameANCS(pakRouter, name + "_animp1"); + animationParameters2.nameANCS(pakRouter, name + "_animp2"); + animationParameters3.nameANCS(pakRouter, name + "_animp3"); + animationParameters4.nameANCS(pakRouter, name + "_animp4"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/MetroidBeta.hpp b/DataSpec/DNAMP1/ScriptObjects/MetroidBeta.hpp index 65a8b5ed7..5eb59146f 100644 --- a/DataSpec/DNAMP1/ScriptObjects/MetroidBeta.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/MetroidBeta.hpp @@ -35,6 +35,43 @@ struct MetroidBeta : IScriptObject UniqueID32 particle3; UniqueID32 particle4; Value unknown10; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + if (particle4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4); + ent->name = name + "_part4"; + } + if (swhc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(swhc); + ent->name = name + "_swhc"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/MetroidPrimeStage1.hpp b/DataSpec/DNAMP1/ScriptObjects/MetroidPrimeStage1.hpp index 8a82b6e38..50a8f20df 100644 --- a/DataSpec/DNAMP1/ScriptObjects/MetroidPrimeStage1.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/MetroidPrimeStage1.hpp @@ -125,9 +125,58 @@ struct MetroidPrimeStage1 : IScriptObject Value unknown6; Value unknown7; Value unknown8; + + void nameIDs(PAKRouter& pakRouter, const std::string& name) const + { + if (unknown1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(unknown1); + ent->name = name + "_unk1"; + } + if (unknown3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(unknown3); + ent->name = name + "_unk3"; + } + if (unknown4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(unknown4); + ent->name = name + "_unk4"; + } + } } primeStruct5; Value unknown14; DamageInfo damageInfo2; + + void nameIDs(PAKRouter& pakRouter, const std::string& name) const + { + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (texture1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture1); + ent->name = name + "_tex1"; + } + if (texture2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture2); + ent->name = name + "_tex2"; + } + if (wpsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc); + ent->name = name + "_wpsc"; + } + primeStruct5.nameIDs(pakRouter, name + "_prime5"); + } } primeStruct4_1, primeStruct4_2, primeStruct4_3, primeStruct4_4; UniqueID32 wpsc1; @@ -163,7 +212,94 @@ struct MetroidPrimeStage1 : IScriptObject Value unknown2; Value unknown3; } primeStruct6_1, primeStruct6_2, primeStruct6_3, primeStruct6_4; + + void nameIDs(PAKRouter& pakRouter, const std::string& name) const + { + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + if (particle4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4); + ent->name = name + "_part4"; + } + if (particle5) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle5); + ent->name = name + "_part5"; + } + if (particle6) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle6); + ent->name = name + "_part6"; + } + if (particle7) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle7); + ent->name = name + "_part7"; + } + if (particle8) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle8); + ent->name = name + "_part8"; + } + if (swhc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(swhc); + ent->name = name + "_swhc"; + } + if (texture1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture1); + ent->name = name + "_tex1"; + } + if (texture2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture2); + ent->name = name + "_tex2"; + } + if (wpsc1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); + ent->name = name + "_wpsc1"; + } + if (wpsc2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc2); + ent->name = name + "_wpsc2"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + primeStruct4_1.nameIDs(pakRouter, name + "_prime41"); + primeStruct4_2.nameIDs(pakRouter, name + "_prime42"); + primeStruct4_3.nameIDs(pakRouter, name + "_prime43"); + primeStruct4_4.nameIDs(pakRouter, name + "_prime44"); + } } massivePrimeStruct; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + massivePrimeStruct.actorParameters.addCMDLRigPairs(addTo, + massivePrimeStruct.patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + massivePrimeStruct.nameIDs(pakRouter, name + "_massiveStruct"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/MetroidPrimeStage2.hpp b/DataSpec/DNAMP1/ScriptObjects/MetroidPrimeStage2.hpp index 71e319ff8..25e0e7db5 100644 --- a/DataSpec/DNAMP1/ScriptObjects/MetroidPrimeStage2.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/MetroidPrimeStage2.hpp @@ -23,6 +23,33 @@ struct MetroidPrimeStage2 : IScriptObject UniqueID32 elsc; Value unknown; UniqueID32 particle2; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (elsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc); + ent->name = name + "_elsc"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Midi.hpp b/DataSpec/DNAMP1/ScriptObjects/Midi.hpp index 3323e6321..c03fa3c85 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Midi.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Midi.hpp @@ -18,6 +18,15 @@ struct Midi : IScriptObject Value unknown2; Value unknown3; Value unknown4; + + void nameIDs(PAKRouter& pakRouter) const + { + if (song) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(song); + ent->name = name + "_song"; + } + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/NewIntroBoss.hpp b/DataSpec/DNAMP1/ScriptObjects/NewIntroBoss.hpp index 2760b9148..f5790879a 100644 --- a/DataSpec/DNAMP1/ScriptObjects/NewIntroBoss.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/NewIntroBoss.hpp @@ -25,6 +25,38 @@ struct NewIntroBoss : IScriptObject UniqueID32 particle2; UniqueID32 texture1; UniqueID32 texture2; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (texture1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture1); + ent->name = name + "_tex1"; + } + if (texture2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture2); + ent->name = name + "_tex2"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp b/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp index 50a8846cb..0cc5fb5d7 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp @@ -191,6 +191,18 @@ struct Oculus : IScriptObject { return "Retro::DNAMP1::Oculus"; } + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/OmegaPirate.hpp b/DataSpec/DNAMP1/ScriptObjects/OmegaPirate.hpp index 00420a096..50b47cc94 100644 --- a/DataSpec/DNAMP1/ScriptObjects/OmegaPirate.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/OmegaPirate.hpp @@ -57,6 +57,83 @@ struct OmegaPirate : IScriptObject UniqueID32 model2; UniqueID32 skin; UniqueID32 rig; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters1.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + actorParameters2.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + if (model2 && skin && rig) + addTo[model2] = std::make_pair(skin, rig); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + if (particle4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4); + ent->name = name + "_part4"; + } + if (particle5) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle5); + ent->name = name + "_part5"; + } + if (particle6) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle6); + ent->name = name + "_part6"; + } + if (particle7) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle7); + ent->name = name + "_part7"; + } + if (elsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc); + ent->name = name + "_elsc"; + } + if (model1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model1); + ent->name = name + "_model1"; + } + if (model2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model2); + ent->name = name + "_model2"; + } + if (skin) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(skin); + ent->name = name + "_skin"; + } + if (rig) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(rig); + ent->name = name + "_rig"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters1.nameIDs(pakRouter, name + "_actp1"); + actorParameters2.nameIDs(pakRouter, name + "_actp2"); + animationParameters.nameANCS(pakRouter, name + "_animp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp b/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp index 17dd09863..611f3d1cf 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp @@ -2,6 +2,7 @@ #define _DNAMP1_PARAMETERS_HPP_ #include "../../DNACommon/DNACommon.hpp" +#include "../ANCS.hpp" namespace Retro { @@ -92,6 +93,29 @@ struct AnimationParameters : BigYAML UniqueID32 animationCharacterSet; Value character; Value defaultAnimation; + + UniqueID32 getCINF(PAKRouter& pakRouter) const + { + if (!animationCharacterSet) + return UniqueID32(); + const NOD::Node* node; + const PAK::Entry* ancsEnt = pakRouter.lookupEntry(animationCharacterSet, &node); + ANCS ancs; + { + PAKEntryReadStream rs = ancsEnt->beginReadStream(*node); + ancs.read(rs); + } + return ancs.characterSet.characters.at(character).cinf; + } + + void nameANCS(PAKRouter& pakRouter, const std::string& name) const + { + if (!animationCharacterSet) + return; + PAK::Entry* ancsEnt = (PAK::Entry*)pakRouter.lookupEntry(animationCharacterSet); + if (ancsEnt->name.empty()) + ancsEnt->name = name; + } }; struct BehaveChance : BigYAML @@ -168,6 +192,15 @@ struct FlareDefinition : BigYAML Value unknown1; Value unknown2; Value unknown4; // CColor + + void nameIDs(PAKRouter& pakRouter, const std::string& name) const + { + if (texture) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture); + ent->name = name + "_texture"; + } + } }; struct GrappleParameters : BigYAML @@ -196,18 +229,6 @@ struct HealthInfo : BigYAML Value knockbackResistence; }; -struct HudColor : BigYAML -{ - DECL_YAML - Value unknown1; - Value unknown2; - Value unknown3; - Value unknown4; - Value unknown5; - Value unknown6; - Value unknown7; -}; - struct LightParameters : BigYAML { DECL_YAML @@ -270,6 +291,26 @@ struct PatternedInfo : BigYAML Value unknown14; UniqueID32 particle2; Value soundID2; + + void nameIDs(PAKRouter& pakRouter, const std::string& name) const + { + animationParameters.nameANCS(pakRouter, name + "_animp"); + if (stateMachine) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(stateMachine); + ent->name = name + "_fsm"; + } + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + } }; struct PlayerHintParameters : BigYAML @@ -298,6 +339,15 @@ struct ScannableParameters : BigYAML DECL_YAML Value propertyCount; UniqueID32 scanId; + + void nameIDs(PAKRouter& pakRouter, const std::string& name) const + { + if (scanId) + { + PAK::Entry* scanEnt = (PAK::Entry*)pakRouter.lookupEntry(scanId); + scanEnt->name = name + "_scan"; + } + } }; struct VisorParameters : BigYAML @@ -327,6 +377,40 @@ struct ActorParameters : BigYAML Value unknown4; Value unknown5; Value unknown6; + + void addCMDLRigPairs(std::unordered_map>& addTo, + const UniqueID32& cinf) const + { + if (xrayModel && xraySkin) + addTo[xrayModel] = std::make_pair(xraySkin, cinf); + if (thermalModel && thermalSkin) + addTo[thermalModel] = std::make_pair(thermalSkin, cinf); + } + + void nameIDs(PAKRouter& pakRouter, const std::string& name) const + { + scannableParameters.nameIDs(pakRouter, name); + if (xrayModel) + { + PAK::Entry* xmEnt = (PAK::Entry*)pakRouter.lookupEntry(xrayModel); + xmEnt->name = name + "_xraymodel"; + } + if (xraySkin) + { + PAK::Entry* xsEnt = (PAK::Entry*)pakRouter.lookupEntry(xraySkin); + xsEnt->name = name + "_xrayskin"; + } + if (thermalModel) + { + PAK::Entry* xmEnt = (PAK::Entry*)pakRouter.lookupEntry(thermalModel); + xmEnt->name = name + "_thermalmodel"; + } + if (thermalSkin) + { + PAK::Entry* xsEnt = (PAK::Entry*)pakRouter.lookupEntry(thermalSkin); + xsEnt->name = name + "_thermalskin"; + } + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Parasite.hpp b/DataSpec/DNAMP1/ScriptObjects/Parasite.hpp index cea566576..7c61ca4d3 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Parasite.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Parasite.hpp @@ -37,6 +37,18 @@ struct Parasite : IScriptObject Value unknown17; Value unknown18; Value unknown19; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/PhazonHealingNodule.hpp b/DataSpec/DNAMP1/ScriptObjects/PhazonHealingNodule.hpp index 66a0ce85e..71d428aed 100644 --- a/DataSpec/DNAMP1/ScriptObjects/PhazonHealingNodule.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/PhazonHealingNodule.hpp @@ -21,6 +21,23 @@ struct PhazonHealingNodule : IScriptObject Value unknown1; UniqueID32 elsc; String<-1> unknown2; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (elsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc); + ent->name = name + "_elsc"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/PhazonPool.hpp b/DataSpec/DNAMP1/ScriptObjects/PhazonPool.hpp index 7ffd49250..e5abbe464 100644 --- a/DataSpec/DNAMP1/ScriptObjects/PhazonPool.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/PhazonPool.hpp @@ -30,6 +30,30 @@ struct PhazonPool : IScriptObject Value unknown7; Value unknown8; Value unknown9; + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (model1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model1); + ent->name = name + "_model1"; + } + if (model2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model2); + ent->name = name + "_model2"; + } + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Pickup.hpp b/DataSpec/DNAMP1/ScriptObjects/Pickup.hpp index b08cd1ed6..1af3e8717 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Pickup.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Pickup.hpp @@ -30,6 +30,28 @@ struct Pickup : IScriptObject Value active; Value unknown1; UniqueID32 particle; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part"; + } + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + animationParameters.nameANCS(pakRouter, name + "_animp"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Platform.hpp b/DataSpec/DNAMP1/ScriptObjects/Platform.hpp index 2e9976fb6..79568314a 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Platform.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Platform.hpp @@ -31,6 +31,28 @@ struct Platform : IScriptObject Value unknown5; Value unknown6; Value unknown7; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (dcln) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(dcln); + ent->name = name + "_dcln"; + } + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + animationParameters.nameANCS(pakRouter, name + "_animp"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/PlayerActor.hpp b/DataSpec/DNAMP1/ScriptObjects/PlayerActor.hpp index 0525b7cb6..38267f1fa 100644 --- a/DataSpec/DNAMP1/ScriptObjects/PlayerActor.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/PlayerActor.hpp @@ -36,6 +36,23 @@ struct PlayerActor : IScriptObject Vector bools; } playerParameters; Value unknown8; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + animationParameters.nameANCS(pakRouter, name + "_animp"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/PointOfInterest.hpp b/DataSpec/DNAMP1/ScriptObjects/PointOfInterest.hpp index 8b4e56703..a092bb9b8 100644 --- a/DataSpec/DNAMP1/ScriptObjects/PointOfInterest.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/PointOfInterest.hpp @@ -18,6 +18,11 @@ struct PointOfInterest : IScriptObject Value unknown1; ScannableParameters scannableParameters; Value unknown2; + + void nameIDs(PAKRouter& pakRouter) const + { + scannableParameters.nameIDs(pakRouter, name + "_scanp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/PuddleSpore.hpp b/DataSpec/DNAMP1/ScriptObjects/PuddleSpore.hpp index 14783255b..1e1b1c6d7 100644 --- a/DataSpec/DNAMP1/ScriptObjects/PuddleSpore.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/PuddleSpore.hpp @@ -28,6 +28,28 @@ struct PuddleSpore : IScriptObject Value unknown7; UniqueID32 wpsc; DamageInfo damageInfo; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part"; + } + if (wpsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc); + ent->name = name + "_wpsc"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/PuddleToadGamma.hpp b/DataSpec/DNAMP1/ScriptObjects/PuddleToadGamma.hpp index 06e1b42a6..55e86a7c4 100644 --- a/DataSpec/DNAMP1/ScriptObjects/PuddleToadGamma.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/PuddleToadGamma.hpp @@ -29,6 +29,23 @@ struct PuddleToadGamma : IScriptObject DamageInfo damageInfo1; DamageInfo damageInfo2; UniqueID32 dcln; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (dcln) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(dcln); + ent->name = name + "_dcln"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Puffer.hpp b/DataSpec/DNAMP1/ScriptObjects/Puffer.hpp index 58eccebd7..d29610e7f 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Puffer.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Puffer.hpp @@ -28,6 +28,28 @@ struct Puffer : IScriptObject Value unknown5; DamageInfo damageInfo2; Value unknown6; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part"; + } + if (texture) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture); + ent->name = name + "_texture"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp b/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp index 2d158202c..1683f1e9d 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp @@ -57,6 +57,30 @@ struct Ridley : IScriptObject Value unknown11; Value unknown12; //CColor Value unknown13; //CColor + + void nameIDs(PAKRouter& pakRouter, const std::string& name) const + { + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (texture1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture1); + ent->name = name + "_tex1"; + } + if (texture2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture2); + ent->name = name + "_tex2"; + } + } } ridleyStruct1; Value soundID1; @@ -544,6 +568,109 @@ struct Ridley : IScriptObject { return "Retro::DNAMP1::Ridley"; } + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part"; + } + if (model1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model1); + ent->name = name + "_model1"; + } + if (model2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model2); + ent->name = name + "_model2"; + } + if (model3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model3); + ent->name = name + "_model3"; + } + if (model4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model4); + ent->name = name + "_model4"; + } + if (model5) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model5); + ent->name = name + "_model5"; + } + if (model6) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model6); + ent->name = name + "_model6"; + } + if (model7) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model7); + ent->name = name + "_model7"; + } + if (model8) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model8); + ent->name = name + "_model8"; + } + if (model9) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model9); + ent->name = name + "_model9"; + } + if (model10) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model10); + ent->name = name + "_model10"; + } + if (model11) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model11); + ent->name = name + "_model11"; + } + if (model12) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model12); + ent->name = name + "_model12"; + } + if (wpsc1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); + ent->name = name + "_wpsc1"; + } + if (wpsc2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc2); + ent->name = name + "_wpsc2"; + } + if (wpsc3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc3); + ent->name = name + "_wpsc3"; + } + if (wpsc4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc4); + ent->name = name + "_wpsc4"; + } + if (elsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc); + ent->name = name + "_elsc"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + ridleyStruct1.nameIDs(pakRouter, name + "_ridley1"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Ripper.hpp b/DataSpec/DNAMP1/ScriptObjects/Ripper.hpp index 3f9240fc1..b9edbc750 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Ripper.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Ripper.hpp @@ -20,6 +20,18 @@ struct Ripper : IScriptObject PatternedInfo patternedInfo; ActorParameters actorParameters; GrappleParameters grappleParameters; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/ScriptBeam.hpp b/DataSpec/DNAMP1/ScriptObjects/ScriptBeam.hpp index 82d50f0c2..a0a546484 100644 --- a/DataSpec/DNAMP1/ScriptObjects/ScriptBeam.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/ScriptBeam.hpp @@ -22,8 +22,8 @@ struct ScriptBeam : IScriptObject DECL_YAML Value propertyCount; Value unknown1; - UniqueID32 particel1; - UniqueID32 particel2; + UniqueID32 particle1; + UniqueID32 particle2; UniqueID32 texture1; UniqueID32 texture2; Value unknown2; @@ -37,8 +37,42 @@ struct ScriptBeam : IScriptObject Value unknown10; Value unknown11; // CColor Value unknown12; // CColor + + void nameIDs(PAKRouter& pakRouter, const std::string& name) const + { + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (texture1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture1); + ent->name = name + "_tex1"; + } + if (texture2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture2); + ent->name = name + "_tex2"; + } + } } beamParametrs; DamageInfo damageInfo; + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc); + ent->name = name + "_wpsc"; + } + beamParametrs.nameIDs(pakRouter, name + "_beamp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Seedling.hpp b/DataSpec/DNAMP1/ScriptObjects/Seedling.hpp index 61db9791d..8949ccc67 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Seedling.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Seedling.hpp @@ -26,6 +26,28 @@ struct Seedling : IScriptObject Value unknown4; Value unknown5; Value unknown6; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (unknown1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(unknown1); + ent->name = name + "_unk1"; + } + if (unknown2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(unknown2); + ent->name = name + "_unk2"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/SnakeWeedSwarm.hpp b/DataSpec/DNAMP1/ScriptObjects/SnakeWeedSwarm.hpp index 2944d3462..ed07bbefb 100644 --- a/DataSpec/DNAMP1/ScriptObjects/SnakeWeedSwarm.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/SnakeWeedSwarm.hpp @@ -37,6 +37,18 @@ struct SnakeWeedSwarm : IScriptObject Value unknown17; Value unknown18; Value unknown19; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + animationParameters.nameANCS(pakRouter, name + "_animp"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/SpacePirate.hpp b/DataSpec/DNAMP1/ScriptObjects/SpacePirate.hpp index 6681c7989..11e93db87 100644 --- a/DataSpec/DNAMP1/ScriptObjects/SpacePirate.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/SpacePirate.hpp @@ -48,6 +48,28 @@ struct SpacePirate : IScriptObject Value soundID5; Value unknown19; Value unknown20; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); + ent->name = name + "_wpsc1"; + } + if (wpsc2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc2); + ent->name = name + "_wpsc2"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/SpankWeed.hpp b/DataSpec/DNAMP1/ScriptObjects/SpankWeed.hpp index e4b2651db..10ac3cc0a 100644 --- a/DataSpec/DNAMP1/ScriptObjects/SpankWeed.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/SpankWeed.hpp @@ -23,6 +23,18 @@ struct SpankWeed : IScriptObject Value unknown3; Value unknown4; Value unknown5; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Steam.hpp b/DataSpec/DNAMP1/ScriptObjects/Steam.hpp index 49981f582..cd4674baa 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Steam.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Steam.hpp @@ -25,6 +25,15 @@ struct Steam : IScriptObject Value unknown6; Value unknown7; Value unknown8; + + void nameIDs(PAKRouter& pakRouter) const + { + if (texture) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture); + ent->name = name + "_texture"; + } + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Thardus.hpp b/DataSpec/DNAMP1/ScriptObjects/Thardus.hpp index 8e42fcb78..15691f5f9 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Thardus.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Thardus.hpp @@ -36,6 +36,148 @@ struct Thardus : IScriptObject Value unknown10; Value unknown11; Value unknown12; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (models[0]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[0]); + ent->name = name + "_model1"; + } + if (models[1]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[1]); + ent->name = name + "_model2"; + } + if (models[2]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[2]); + ent->name = name + "_model3"; + } + if (models[3]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[3]); + ent->name = name + "_model4"; + } + if (models[4]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[4]); + ent->name = name + "_model5"; + } + if (models[5]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[5]); + ent->name = name + "_model6"; + } + if (models[6]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[6]); + ent->name = name + "_model7"; + } + if (models[7]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[7]); + ent->name = name + "_model8"; + } + if (models[8]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[8]); + ent->name = name + "_model9"; + } + if (models[9]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[9]); + ent->name = name + "_model10"; + } + if (models[10]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[10]); + ent->name = name + "_model11"; + } + if (models[11]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[11]); + ent->name = name + "_model12"; + } + if (models[12]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[12]); + ent->name = name + "_model13"; + } + if (models[13]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(models[13]); + ent->name = name + "_model14"; + } + if (particles1[0]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particles1[0]); + ent->name = name + "_part1"; + } + if (particles1[1]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particles1[1]); + ent->name = name + "_part2"; + } + if (particles1[2]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particles1[2]); + ent->name = name + "_part3"; + } + if (stateMachine) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(stateMachine); + ent->name = name + "_fsm"; + } + if (particles2[0]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particles2[0]); + ent->name = name + "_part4"; + } + if (particles2[1]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particles2[1]); + ent->name = name + "_part5"; + } + if (particles2[2]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particles2[2]); + ent->name = name + "_part6"; + } + if (particles2[3]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particles2[3]); + ent->name = name + "_part7"; + } + if (particles2[4]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particles2[4]); + ent->name = name + "_part8"; + } + if (particles2[5]) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particles2[5]); + ent->name = name + "_part9"; + } + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part10"; + } + if (texture) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture); + ent->name = name + "_texture"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/ThardusRockProjectile.hpp b/DataSpec/DNAMP1/ScriptObjects/ThardusRockProjectile.hpp index 3e77fc1d4..ec4dc16d2 100644 --- a/DataSpec/DNAMP1/ScriptObjects/ThardusRockProjectile.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/ThardusRockProjectile.hpp @@ -23,6 +23,28 @@ struct ThardusRockProjectile : IScriptObject Value unknown3; UniqueID32 model; UniqueID32 stateMachine; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (model) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); + ent->name = name + "_model"; + } + if (stateMachine) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(stateMachine); + ent->name = name + "_fsm"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Tryclops.hpp b/DataSpec/DNAMP1/ScriptObjects/Tryclops.hpp index dbb5633df..e01525a27 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Tryclops.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Tryclops.hpp @@ -22,6 +22,18 @@ struct Tryclops : IScriptObject Value unknown2; Value unknown3; Value unknown4; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/VisorFlare.hpp b/DataSpec/DNAMP1/ScriptObjects/VisorFlare.hpp index cb38807f5..48e28c9f6 100644 --- a/DataSpec/DNAMP1/ScriptObjects/VisorFlare.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/VisorFlare.hpp @@ -22,6 +22,15 @@ struct VisorFlare : IScriptObject Value unknown6; Value unknown7; FlareDefinition flareDefinitions[5]; + + void nameIDs(PAKRouter& pakRouter) const + { + flareDefinitions[0].nameIDs(pakRouter, name + "_flare1"); + flareDefinitions[1].nameIDs(pakRouter, name + "_flare2"); + flareDefinitions[2].nameIDs(pakRouter, name + "_flare3"); + flareDefinitions[3].nameIDs(pakRouter, name + "_flare4"); + flareDefinitions[4].nameIDs(pakRouter, name + "_flare5"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/VisorGoo.hpp b/DataSpec/DNAMP1/ScriptObjects/VisorGoo.hpp index 096367229..208557e3b 100644 --- a/DataSpec/DNAMP1/ScriptObjects/VisorGoo.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/VisorGoo.hpp @@ -23,6 +23,15 @@ struct VisorGoo : IScriptObject Value unknown6; // CColor Value unknown7; Value unknown8; + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part"; + } + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/WallCrawlerSwarm.hpp b/DataSpec/DNAMP1/ScriptObjects/WallCrawlerSwarm.hpp index 91dbd5037..cb65d0a58 100644 --- a/DataSpec/DNAMP1/ScriptObjects/WallCrawlerSwarm.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/WallCrawlerSwarm.hpp @@ -51,6 +51,28 @@ struct WallCrawlerSwarm : IScriptObject DamageVulnerability damageVulnerabilty; Value soundID1; // verification needed Value soundID2; // verification needed + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + animationParameters.nameANCS(pakRouter, name + "_animp"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Warwasp.hpp b/DataSpec/DNAMP1/ScriptObjects/Warwasp.hpp index 02ae9af6b..d3aa1fafc 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Warwasp.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Warwasp.hpp @@ -25,6 +25,28 @@ struct Warwasp : IScriptObject DamageInfo damageInfo2; UniqueID32 particle; Value unknown3; + + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const + { + actorParameters.addCMDLRigPairs(addTo, patternedInfo.animationParameters.getCINF(pakRouter)); + } + + void nameIDs(PAKRouter& pakRouter) const + { + if (wpsc1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); + ent->name = name + "_wpsc"; + } + if (particle) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); + ent->name = name + "_part"; + } + patternedInfo.nameIDs(pakRouter, name + "_patterned"); + actorParameters.nameIDs(pakRouter, name + "_actp"); + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Water.hpp b/DataSpec/DNAMP1/ScriptObjects/Water.hpp index e46d1025b..5e17fed65 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Water.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Water.hpp @@ -94,6 +94,70 @@ struct Water : IScriptObject Value unknown38; Value unknown39; Value unknown40; + + void nameIDs(PAKRouter& pakRouter) const + { + if (texture1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture1); + ent->name = name + "_tex1"; + } + if (texture2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture2); + ent->name = name + "_tex2"; + } + if (texture3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture3); + ent->name = name + "_tex3"; + } + if (texture4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture4); + ent->name = name + "_tex4"; + } + if (texture5) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture5); + ent->name = name + "_tex5"; + } + if (texture6) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture6); + ent->name = name + "_tex6"; + } + if (texture34) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture34); + ent->name = name + "_tex34"; + } + if (particle1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1); + ent->name = name + "_part1"; + } + if (particle2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2); + ent->name = name + "_part2"; + } + if (particle3) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3); + ent->name = name + "_part3"; + } + if (particle4) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4); + ent->name = name + "_part4"; + } + if (particle5) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle5); + ent->name = name + "_part5"; + } + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/WorldTeleporter.hpp b/DataSpec/DNAMP1/ScriptObjects/WorldTeleporter.hpp index 2959acabc..2633a9d00 100644 --- a/DataSpec/DNAMP1/ScriptObjects/WorldTeleporter.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/WorldTeleporter.hpp @@ -283,6 +283,25 @@ struct WorldTeleporter : IScriptObject { return "Retro::DNAMP1::WorldTeleporter"; } + + void nameIDs(PAKRouter& pakRouter) const + { + if (model1) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model1); + ent->name = name + "_model1"; + } + if (model2) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model2); + ent->name = name + "_model2"; + } + if (strg) + { + PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(strg); + ent->name = name + "_strg"; + } + } }; } diff --git a/DataSpec/DNAMP2/DNAMP2.cpp b/DataSpec/DNAMP2/DNAMP2.cpp index 264b1ef97..8cbbf0d4f 100644 --- a/DataSpec/DNAMP2/DNAMP2.cpp +++ b/DataSpec/DNAMP2/DNAMP2.cpp @@ -186,7 +186,8 @@ void PAKBridge::build() } } -void PAKBridge::addCMDLRigPairs(std::unordered_map>& addTo) const +void PAKBridge::addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const { for (const std::pair& entry : m_pak.m_idMap) { diff --git a/DataSpec/DNAMP2/DNAMP2.hpp b/DataSpec/DNAMP2/DNAMP2.hpp index bbfc1cbc0..0c8c47e90 100644 --- a/DataSpec/DNAMP2/DNAMP2.hpp +++ b/DataSpec/DNAMP2/DNAMP2.hpp @@ -35,7 +35,8 @@ public: const PAKType& getPAK() const {return m_pak;} const NOD::Node& getNode() const {return m_node;} - void addCMDLRigPairs(std::unordered_map>& addTo) const; + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const; }; } diff --git a/DataSpec/DNAMP3/DNAMP3.cpp b/DataSpec/DNAMP3/DNAMP3.cpp index 91d3cc63b..58ff06097 100644 --- a/DataSpec/DNAMP3/DNAMP3.cpp +++ b/DataSpec/DNAMP3/DNAMP3.cpp @@ -199,7 +199,8 @@ void PAKBridge::build() } } -void PAKBridge::addCMDLRigPairs(std::unordered_map>& addTo) const +void PAKBridge::addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const { for (const std::pair& entry : m_pak.m_idMap) { diff --git a/DataSpec/DNAMP3/DNAMP3.hpp b/DataSpec/DNAMP3/DNAMP3.hpp index 463b94e23..b0a3e57bf 100644 --- a/DataSpec/DNAMP3/DNAMP3.hpp +++ b/DataSpec/DNAMP3/DNAMP3.hpp @@ -35,7 +35,8 @@ public: inline const PAKType& getPAK() const {return m_pak;} inline const NOD::Node& getNode() const {return m_node;} - void addCMDLRigPairs(std::unordered_map>& addTo) const; + void addCMDLRigPairs(PAKRouter& pakRouter, + std::unordered_map>& addTo) const; }; } diff --git a/DataSpec/DNAMP3/PAK.cpp b/DataSpec/DNAMP3/PAK.cpp index 458a46792..abeb8b989 100644 --- a/DataSpec/DNAMP3/PAK.cpp +++ b/DataSpec/DNAMP3/PAK.cpp @@ -61,7 +61,10 @@ void PAK::read(Athena::io::IStreamReader& reader) { auto search = m_idMap.find(entry.id); if (search != m_idMap.end()) + { m_nameMap[entry.name] = search->second; + search->second->name = entry.name; + } } } void PAK::write(Athena::io::IStreamWriter& writer) const diff --git a/DataSpec/DNAMP3/PAK.hpp b/DataSpec/DNAMP3/PAK.hpp index 4bdc08df1..acf986c9c 100644 --- a/DataSpec/DNAMP3/PAK.hpp +++ b/DataSpec/DNAMP3/PAK.hpp @@ -45,6 +45,7 @@ struct PAK : BigDNA Value size; Value offset; UniqueResult unique; + std::string name; std::unique_ptr getBuffer(const NOD::Node& pak, atUint64& szOut) const; inline PAKEntryReadStream beginReadStream(const NOD::Node& pak, atUint64 off=0) const