Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upWeapon types de-hardcoding #2134
Conversation
This comment has been minimized.
This comment has been minimized.
And if anyone is interested, here is the prototype of bow in the left hand: Left.zip openmw.cfg:
settings.cfg:
Basically, ZIP-archive contains new animations for bows and meshes with the "Weapon Bone Left" bone. |
This comment has been minimized.
This comment has been minimized.
The main questions here:
|
This comment has been minimized.
This comment has been minimized.
OK, I allow to override data via openmw.cfg now. An example for left-handed bow:
No editor support yet, but in theory it is possible to create new weapon records via Enchanted Editor since it just uses an integer field for weapon types. |
This comment has been minimized.
This comment has been minimized.
Added basic weapon types support for the editor. |
This comment has been minimized.
This comment has been minimized.
All right, time for review and testing, especially for new weapon types. As about code, I do not like much the weapon types enum with negative values, also a configuration in the openmw.cfg is not very user-friendly. Any ideas how to improve them? |
This comment has been minimized.
This comment has been minimized.
Also if we are going to move these settings to ESM files later, I can try to setup a virtual ESM::Store for weapon types, but it will not work for editor, where we setup UI widgets only once (IIRC, even before we read data from ESM). |
@@ -223,6 +228,10 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat | |||
if (!variables["skip-menu"].as<bool>() && variables["new-game"].as<bool>()) | |||
Log(Debug::Warning) << "Warning: new-game used without skip-menu -> ignoring it"; | |||
|
|||
const std::vector<std::string>& weaponTypes = variables["weapon-type"].as<Files::EscapeStringVector>().toStdStringVector(); |
This comment has been minimized.
This comment has been minimized.
Capostrophic
May 11, 2019
Collaborator
Nobody is really sure if overriding weapon types via configs is the right way to dehardcode them. Before any abrupt decisions are acknowledged in the codebase and it doesn't take too much effort not to have this, I'd reconsider having a stopgap solution this intrusive.
This comment has been minimized.
This comment has been minimized.
Replaced by #2413. |
akortunov commentedJan 19, 2019
•
edited
Changes custom bones loading, so requires new skeleton meshes for weapon sheathing: Sheath.zip
Summary of changes:
Moves most of weapontype-related logic from a lot of switches and if-s to the table.
In theory, later we can move this table to ESM or some kind of logic. This approach will allow modders to add new weapon types with new animations (one-handed spears or magic sword which requires Destruction skill instead of Long Blades, for example) or modify existing ones (move bow to the left hand or add a separate set of animations for short blades, for example).
Changes custom bones loading.

Instead of hardcoded xbase_anim_sh.nif OpenMW will scan nifs in the Animation folder and will load any node marked with "BONE" NiStringExtraData. Optimizer will not remove such nodes.
This approach allows to tweak new nodes differently for females, beast races, etc.
Here I just rotated sheathing bone for beast races only (left - old behaviour, right - new behaviour):
Related forum topic.