Tweak list of fields loaded from blueprints

Based on their usage from resource analysis.
This commit is contained in:
Vsevolod Kremianskii 2021-04-12 22:01:48 +07:00
parent 5b90c6d542
commit 9c8dcdb841
11 changed files with 65 additions and 56 deletions

View file

@ -67,28 +67,18 @@ private:
int _linkedToFlags { 0 };
std::string _transitionDestin;
Faction _faction { Faction::Invalid };
bool _interruptable { false };
int _openLockDC { 0 };
int _animationState { 0 };
int _appearance { 0 };
int _hardness { 0 };
int _fortitude { 0 };
int _reflex { 0 };
int _will { 0 };
int _loadScreenID { 0 };
bool _autoRemoveKey { false };
bool _lockable { false };
std::string _keyName;
// Scripts
std::string _onOpen;
std::string _onFailToOpen;
std::string _onClosed;
std::string _onDamaged;
std::string _onDeath;
std::string _onMeleeAttacked;
std::string _onSpellCastAt;
std::string _onUnlock;
std::string _onClick;
std::string _onLock;
// END Scripts
@ -100,7 +90,6 @@ private:
// END Walkmeshes
void loadTransitionDestinFromGIT(const resource::GffStruct &gffs);
void loadTransformFromGIT(const resource::GffStruct &gffs);
void loadUTD(const resource::GffStruct &utd);

View file

@ -37,44 +37,35 @@ void Door::loadUTD(const GffStruct &utd) {
_tag = boost::to_lower_copy(utd.getString("Tag"));
_name = Strings::instance().get(utd.getInt("LocName"));
_blueprintResRef = boost::to_lower_copy(utd.getString("TemplateResRef"));
_autoRemoveKey = utd.getBool("AutoRemoveKey");
_conversation = boost::to_lower_copy(utd.getString("Conversation"));
_interruptable = utd.getBool("Interruptable");
_faction = utd.getEnum("Faction", Faction::Invalid);
_plot = utd.getBool("Plot");
_minOneHP = utd.getBool("Min1HP");
_keyRequired = utd.getBool("KeyRequired");
_lockable = utd.getBool("Lockable");
_locked = utd.getBool("Locked");
_openLockDC = utd.getInt("OpenLockDC");
_animationState = utd.getInt("AnimationState");
_appearance = utd.getInt("Appearance");
_keyName = utd.getString("KeyName");
_hitPoints = utd.getInt("HP");
_currentHitPoints = utd.getInt("CurrentHP");
_hardness = utd.getInt("Hardness");
_fortitude = utd.getInt("Fort");
_reflex = utd.getInt("Ref");
_will = utd.getInt("Will");
_loadScreenID = utd.getInt("LoadScreenID");
_genericType = utd.getInt("GenericType");
_static = utd.getBool("Static");
_onClosed = utd.getString("OnClosed");
_onDamaged = utd.getString("OnDamaged");
_onDeath = utd.getString("OnDeath");
_onHeartbeat = utd.getString("OnHeartbeat");
_onLock = utd.getString("OnLock");
_onMeleeAttacked = utd.getString("OnMeleeAttacked");
_onOpen = utd.getString("OnOpen");
_onSpellCastAt = utd.getString("OnSpellCastAt");
_onUnlock = utd.getString("OnUnlock");
_onUserDefined = utd.getString("OnUserDefined");
_onClick = utd.getString("OnClick");
_onFailToOpen = utd.getString("OnFailToOpen");
// These fields are ignored as being most likely unused:
// Unused fields:
//
// - AutoRemoveKey
// - Description
// - CloseLockDC
// - Lockable
// - Interruptable
// - PortraitId
// - TrapDetectable
// - TrapDetectDC
@ -83,10 +74,20 @@ void Door::loadUTD(const GffStruct &utd) {
// - TrapFlag
// - TrapOneShot
// - TrapType
// - KeyName
// - AnimationState
// - Appearance
// - Ref
// - Will
// - OnClosed
// - OnDamaged
// - OnDisarm
// - OnLock
// - OnSpellCastAt
// - OnTrapTriggered
// - OnUnlock
// - LoadScreenID
// - PaletteID
// - Comment
}
} // namespace game

View file

@ -58,7 +58,6 @@ private:
bool _reset { false };
int _resetTime { 0 };
int _respawns { 0 };
int _spawnOption { 0 };
std::vector<EncounterCreature> _creatures;
std::vector<glm::vec3> _geometry;
std::vector<SpawnPoint> _spawnPoints;
@ -66,8 +65,6 @@ private:
// Scripts
std::string _onEntered;
std::string _onExit;
std::string _onExhausted;
// END Scripts

View file

@ -44,15 +44,20 @@ void Encounter::loadUTE(const GffStruct &ute) {
_reset = ute.getBool("Reset");
_resetTime = ute.getInt("ResetTime");
_respawns = ute.getInt("Respawns");
_spawnOption = ute.getInt("SpawnOption");
_onEntered = ute.getString("OnEntered");
_onExit = ute.getString("OnExit");
_onExhausted = ute.getString("OnExhausted");
_onHeartbeat = ute.getString("OnHeartbeat");
_onUserDefined = ute.getString("OnUserDefined");
loadCreaturesFromUTE(ute);
// Unused fields:
//
// - SpawnOption
// - OnExit
// - OnExhausted
// - OnHeartbeat
// - OnUserDefined
// - PaletteID
// - Commnet
}
void Encounter::loadCreaturesFromUTE(const GffStruct &ute) {

View file

@ -87,6 +87,7 @@ protected:
// Scripts
std::string _onDeath;
std::string _onHeartbeat;
std::string _onUserDefined;

View file

@ -73,13 +73,11 @@ private:
bool _audible { false };
std::shared_ptr<audio::SoundHandle> _sound;
bool _randomPosition { false };
bool _random { false };
int _random { 0 };
float _randomRangeX { 0.0f };
float _randomRangeY { 0.0f };
int _intervalVrtn { 0 };
float _pitchVariation { 0.0f };
int _hours { 0 };
int _times { 0 };
int _volumeVrtn { 0 };
void loadTransformFromGIT(const resource::GffStruct &gffs);

View file

@ -43,7 +43,7 @@ void Sound::loadUTS(const GffStruct &uts) {
_looping = uts.getBool("Looping");
_positional = uts.getBool("Positional");
_randomPosition = uts.getBool("RandomPosition");
_random = uts.getBool("Random");
_random = uts.getInt("Random");
_elevation = uts.getFloat("Elevation");
_maxDistance = uts.getFloat("MaxDistance");
_minDistance = uts.getFloat("MinDistance");
@ -52,8 +52,6 @@ void Sound::loadUTS(const GffStruct &uts) {
_interval = uts.getInt("Interval");
_intervalVrtn = uts.getInt("IntervalVrtn");
_pitchVariation = uts.getFloat("PitchVariation");
_hours = uts.getInt("Hours");
_times = uts.getInt("Times");
_volume = uts.getInt("Volume");
_volumeVrtn = uts.getInt("VolumeVrtn");
@ -62,6 +60,13 @@ void Sound::loadUTS(const GffStruct &uts) {
for (auto &soundGffs : uts.getList("Sounds")) {
_sounds.push_back(boost::to_lower_copy(soundGffs->getString("Sound")));
}
// Unused fields:
//
// - Hours
// - Times
// - PaletteID
// - Comment
}
void Sound::loadPriorityFromUTS(const GffStruct &uts) {

View file

@ -58,22 +58,23 @@ private:
int _linkedToFlags { 0 };
Faction _faction { Faction::Invalid };
float _hilightHeight { 0.0f };
int _loadScreenID { 0 };
int _triggerType { 0 };
bool _trapDetectable { false };
int _trapDetectDC { 0 };
bool _trapDisarmable { false };
int _disarmDC { 0 };
bool _trapFlag { false };
bool _trapOneShot { false };
int _trapType { 0 };
std::vector<glm::vec3> _geometry;
std::set<std::shared_ptr<SpatialObject>> _tenants;
int _cursor { 0 };
std::string _keyName;
// Scripts
std::string _onEnter;
std::string _onExit;
std::string _onClick;
// END Scripts

View file

@ -23,6 +23,8 @@
#include <boost/algorithm/string.hpp>
#include "../../resource/strings.h"
using namespace reone::resource;
namespace reone {
@ -32,27 +34,35 @@ namespace game {
void Trigger::loadUTT(const GffStruct &utt) {
_tag = boost::to_lower_copy(utt.getString("Tag"));
_blueprintResRef = boost::to_lower_copy(utt.getString("TemplateResRef"));
_name = Strings::instance().get(utt.getInt("LocalizedName"));
_faction = utt.getEnum("Faction", Faction::Invalid);
_cursor = utt.getInt("Cursor");
_hilightHeight = utt.getFloat("HighlightHeight");
_loadScreenID = utt.getInt("LoadScreenID");
_keyName = utt.getString("KeyName");
_triggerType = utt.getInt("Type");
_trapDetectable = utt.getBool("TrapDetectable");
_trapDetectDC = utt.getInt("TrapDetectDC");
_trapDisarmable = utt.getBool("TrapDisarmable");
_disarmDC = utt.getInt("DisarmDC");
_trapFlag = utt.getBool("TrapFlag");
_trapOneShot = utt.getBool("TrapOneShot");
_trapType = utt.getInt("TrapType");
_onClick = boost::to_lower_copy(utt.getString("OnClick"));
_onHeartbeat = boost::to_lower_copy(utt.getString("ScriptHeartbeat"));
_onEnter = boost::to_lower_copy(utt.getString("ScriptOnEnter"));
_onExit = boost::to_lower_copy(utt.getString("ScriptOnExit"));
_onUserDefined = boost::to_lower_copy(utt.getString("ScriptUserDefine"));
// Ignored as per Bioware specification:
// Unused fields:
//
// - AutoRemoveKey
// - Cursor
// - KeyName
// - LoadScreenID
// - PortraitId
// - TrapOneShot
// - OnDisarm
// - OnTrapTriggered
// - ScriptUserDefine
// - PaletteID
// - Comment
}
} // namespace resource

View file

@ -41,6 +41,7 @@ public:
const std::string &mapNote() const { return _mapNote; }
private:
int _appearance { 0 };
bool _hasMapNote { false };
std::string _mapNote;
bool _mapNoteEnabled { false };

View file

@ -32,18 +32,19 @@ namespace reone {
namespace game {
void Waypoint::loadUTW(const GffStruct &utw) {
_appearance = utw.getInt("Appearance");
_blueprintResRef = boost::to_lower_copy(utw.getString("TemplateResRef"));
_tag = boost::to_lower_copy(utw.getString("Tag"));
_name = Strings::instance().get(utw.getInt("LocalizedName"));
_hasMapNote = utw.getBool("HasMapNote");
_mapNote = Strings::instance().get(utw.getInt("MapNote"));
_mapNoteEnabled = utw.getInt("MapNoteEnabled");
// Ignored as per Bioware specification:
// Unused fields:
//
// - Appearance
// - LinkedTo
// - LocalizedName
// - Description
// - PaletteID
// - Comment
}
} // namespace resource