void SoundGenerator::load(ESMReader &esm) { esm.getHNT(type, "DATA", 4); creature = esm.getHNOString("CNAM"); sound = esm.getHNOString("SNAM"); }
void ESM::RefNum::load (ESMReader& esm, bool wide, const std::string& tag) { if (wide) esm.getHNT (*this, tag.c_str(), 8); else esm.getHNT (mIndex, tag.c_str()); }
void ProjectileState::load(ESMReader &esm) { BaseProjectileState::load(esm); mBowId = esm.getHNString ("BOW_"); esm.getHNT (mVelocity, "VEL_"); }
void ESM::ObjectState::load (ESMReader &esm) { mVersion = esm.getFormat(); bool isDeleted; mRef.loadData(esm, isDeleted); mHasLocals = 0; esm.getHNOT (mHasLocals, "HLOC"); if (mHasLocals) mLocals.load (esm); mEnabled = 1; esm.getHNOT (mEnabled, "ENAB"); mCount = 1; esm.getHNOT (mCount, "COUN"); esm.getHNOT (mPosition, "POS_", 24); if (esm.isNextSub("LROT")) esm.skipHSub(); // local rotation, no longer used mFlags = 0; esm.getHNOT (mFlags, "FLAG"); // obsolete int unused; esm.getHNOT(unused, "LTIM"); // FIXME: assuming "false" as default would make more sense, but also break compatibility with older save files mHasCustomState = true; esm.getHNOT (mHasCustomState, "HCUS"); }
bool Cell::getNextRef(ESMReader &esm, CellRef &ref, bool& deleted) { // TODO: Try and document reference numbering, I don't think this has been done anywhere else. if (!esm.hasMoreSubs()) return false; // NOTE: We should not need this check. It is a safety check until we have checked // more plugins, and how they treat these moved references. if (esm.isNextSub("MVRF")) { esm.skipRecord(); // skip MVRF esm.skipRecord(); // skip CNDT // That should be it, I haven't seen any other fields yet. } ref.load (esm); // Identify references belonging to a parent file and adapt the ID accordingly. adjustRefNum (ref.mRefNum, esm); if (esm.isNextSub("DELE")) { esm.skipHSub(); deleted = true; } else deleted = false; return true; }
void Race::load(ESMReader &esm) { mName = esm.getHNString("FNAM"); esm.getHNT(mData, "RADT", 140); mPowers.load(esm); mDescription = esm.getHNOString("DESC"); }
void AiEscort::load(ESMReader &esm) { esm.getHNT (mData, "DATA"); mTargetId = esm.getHNString("TARG"); esm.getHNT (mRemainingDuration, "DURA"); mCellId = esm.getHNOString ("CELL"); }
void BaseProjectileState::load(ESMReader &esm) { mId = esm.getHNString("ID__"); esm.getHNT (mPosition, "VEC3"); esm.getHNT (mOrientation, "QUAT"); esm.getHNT (mActorId, "ACTO"); }
void Door::load(ESMReader &esm) { model = esm.getHNString("MODL"); name = esm.getHNOString("FNAM"); script = esm.getHNOString("SCRI"); openSound = esm.getHNOString("SNAM"); closeSound = esm.getHNOString("ANAM"); }
void AiFollow::load(ESMReader &esm) { esm.getHNT (mData, "DATA"); mTargetId = esm.getHNString("TARG"); esm.getHNT (mRemainingDuration, "DURA"); mCellId = esm.getHNOString ("CELL"); esm.getHNT (mAlwaysFollow, "ALWY"); }
void load(ESMReader &esm) { model = esm.getHNString("MODL"); name = esm.getHNOString("FNAM"); esm.getHNT(data, "MCDT", 12); script = esm.getHNOString("SCRI"); icon = esm.getHNOString("ITEX"); }
void Ingredient::load(ESMReader &esm) { model = esm.getHNString("MODL"); name = esm.getHNString("FNAM"); esm.getHNT(data, "IRDT", 56); script = esm.getHNOString("SCRI"); icon = esm.getHNOString("ITEX"); }
void EffectList::load(ESMReader &esm) { ENAMstruct s; while (esm.isNextSub("ENAM")) { esm.getHT(s, 24); mList.push_back(s); } }
void Door::load(ESMReader &esm) { mModel = esm.getHNString("MODL"); mName = esm.getHNOString("FNAM"); mScript = esm.getHNOString("SCRI"); mOpenSound = esm.getHNOString("SNAM"); mCloseSound = esm.getHNOString("ANAM"); }
void BirthSign::load(ESMReader &esm) { mName = esm.getHNString("FNAM"); mTexture = esm.getHNOString("TNAM"); mDescription = esm.getHNOString("DESC"); mPowers.load(esm); }
void InventoryList::load(ESMReader &esm) { ContItem ci; while (esm.isNextSub("NPCO")) { esm.getHT(ci, 36); mList.push_back(ci); } }
void ESM::GlobalMap::load (ESMReader &esm) { esm.getHNT(mBounds, "BNDS"); esm.getSubNameIs("DATA"); esm.getSubHeader(); mImageData.resize(esm.getSubSize()); esm.getExact(&mImageData[0], mImageData.size()); }
bool Cell::getNextMVRF(ESMReader &esm, MovedCellRef &mref) { esm.getHT(mref.mRefNum.mIndex); esm.getHNOT(mref.mTarget, "CNDT"); adjustRefNum (mref.mRefNum, esm); return true; }
void ProjectileState::load(ESMReader &esm) { BaseProjectileState::load(esm); mBowId = esm.getHNString ("BOW_"); esm.getHNT (mVelocity, "VEL_"); mAttackStrength = 1.f; esm.getHNOT(mAttackStrength, "STR_"); }
void Class::load(ESMReader &esm) { mName = esm.getHNOString("FNAM"); esm.getHNT(mData, "CLDT", 60); if (mData.mIsPlayable > 1) esm.fail("Unknown bool value"); mDescription = esm.getHNOString("DESC"); }
void Skill::load(ESMReader &esm) { esm.getHNT(mIndex, "INDX"); esm.getHNT(mData, "SKDT", 24); mDescription = esm.getHNOString("DESC"); // create an ID from the index and the name (only used in the editor and likely to change in the // future) mId = indexToId (mIndex); }
void Probe::load(ESMReader &esm) { mModel = esm.getHNString("MODL"); mName = esm.getHNOString("FNAM"); esm.getHNT(mData, "PBDT", 16); mScript = esm.getHNOString("SCRI"); mIcon = esm.getHNOString("ITEX"); }
void load(ESMReader &esm) { while(esm.isNextSub("INDX")) { PartReference pr; esm.getHT(pr.part); // The INDX byte pr.male = esm.getHNOString("BNAM"); pr.female = esm.getHNOString("CNAM"); } }
void Skill::load(ESMReader &esm) { bool hasIndex = false; bool hasData = false; while (esm.hasMoreSubs()) { esm.getSubName(); uint32_t name = esm.retSubName().val; switch (name) { case ESM::FourCC<'I','N','D','X'>::value: esm.getHT(mIndex); hasIndex = true; break; case ESM::FourCC<'S','K','D','T'>::value: esm.getHT(mData, 24); hasData = true; break; case ESM::FourCC<'D','E','S','C'>::value: mDescription = esm.getHString(); break; default: esm.fail("Unknown subrecord"); } } if (!hasIndex) esm.fail("Missing INDX"); if (!hasData) esm.fail("Missing SKDT"); // create an ID from the index and the name (only used in the editor and likely to change in the // future) mId = indexToId (mIndex); }
void ESM::DebugProfile::load (ESMReader& esm, bool &isDeleted) { isDeleted = false; while (esm.hasMoreSubs()) { esm.getSubName(); switch (esm.retSubName().intval) { case ESM::SREC_NAME: mId = esm.getHString(); break; case ESM::FourCC<'D','E','S','C'>::value: mDescription = esm.getHString(); break; case ESM::FourCC<'S','C','R','P'>::value: mScriptText = esm.getHString(); break; case ESM::FourCC<'F','L','A','G'>::value: esm.getHT(mFlags); break; case ESM::SREC_DELE: esm.skipHSub(); isDeleted = true; break; default: esm.fail("Unknown subrecord"); break; } } }
void SpellState::load(ESMReader &esm) { while (esm.isNextSub("SPEL")) { std::string id = esm.getHString(); std::map<const int, float> random; while (esm.isNextSub("INDX")) { int index; esm.getHT(index); float magnitude; esm.getHNT(magnitude, "RAND"); random[index] = magnitude; } mSpells[id] = random; } while (esm.isNextSub("USED")) { std::string id = esm.getHString(); TimeStamp time; esm.getHNT(time, "TIME"); mUsedPowers[id] = time; } mSelectedSpell = esm.getHNOString("SLCT"); }
void Door::load(ESMReader &esm) { while (esm.hasMoreSubs()) { esm.getSubName(); uint32_t name = esm.retSubName().val; switch (name) { case ESM::FourCC<'M','O','D','L'>::value: mModel = esm.getHString(); break; case ESM::FourCC<'F','N','A','M'>::value: mName = esm.getHString(); break; case ESM::FourCC<'S','C','R','I'>::value: mScript = esm.getHString(); break; case ESM::FourCC<'S','N','A','M'>::value: mOpenSound = esm.getHString(); break; case ESM::FourCC<'A','N','A','M'>::value: mCloseSound = esm.getHString(); break; default: esm.fail("Unknown subrecord"); } } }
void StartScript::load(ESMReader &esm, bool &isDeleted) { isDeleted = false; bool hasData = false; bool hasName = false; while (esm.hasMoreSubs()) { esm.getSubName(); switch (esm.retSubName().val) { case ESM::SREC_NAME: mId = esm.getHString(); hasName = true; break; case ESM::FourCC<'D','A','T','A'>::value: mData = esm.getHString(); hasData = true; break; case ESM::SREC_DELE: esm.skipHSub(); isDeleted = true; break; default: esm.fail("Unknown subrecord"); break; } } if (!hasName) esm.fail("Missing NAME"); if (!hasData && !isDeleted) esm.fail("Missing DATA"); }
void AiWander::load(ESMReader &esm) { esm.getHNT (mData, "DATA"); esm.getHNT(mDurationData, "STAR"); // was mStartTime mStoredInitialActorPosition = false; if (esm.isNextSub("POS_")) { mStoredInitialActorPosition = true; esm.getHT(mInitialActorPosition); } }
void Cell::loadData(ESMReader &esm) { // Ignore this for now, it might mean we should delete the entire // cell? // TODO: treat the special case "another plugin moved this ref, but we want to delete it"! if (esm.isNextSub("DELE")) { esm.skipHSub(); } esm.getHNT(mData, "DATA", 12); }