adya / npcs-names-distributor Goto Github PK
View Code? Open in Web Editor NEWA Framework to distriubte any names to any NPCs
License: MIT License
A Framework to distriubte any names to any NPCs
License: MIT License
All Keyword Priorities will be moved to new Priority
property of Name Definition, allowing it to specify it's default priority.
Currently NNDTitleless
is used for both Title
and Obscurity
scopes. This poses certain limitation, as original name can be either used in both or none at all. Furthermore, with introduction of separate Title
scope a keyword NNDTitleless
is confusing (it doesn't affect custom titles).
To solve these issues we're gonna need to:
NNDTitleless
-> NNDDisableDefaultTitle
- a bit more wordy, but makes it perfectly clear on what it doesNNDExcludedTitleless
-> NNDEnableDefaultTitle
- now this makes even bigger impactNNDExcludedUnique
-> NNDNotUnique
- this should add a bit more clarity.NNDUnique
- this is fine ๐NNDKnown
- this is also fine. Note: Known
keyword doesn't need a counterpart like others, because by default everyone who can be obscured will be obscured.NNDTitleless
Create a new pair of keywords similarly to new title keywords, but that will work for obscurity.
NNDDisableDefaultObscurity
NNDEnableDefaultObscurity
Renamings should automatically happen along with other routines in modernize
Actually, backward compatibility will be embedded using this distr:
Keyword = NNDDisableDefaultTitle|NNDTitleless
Keyword = NNDEnableDefaultTitle|NNDExcludedTitleless
Keyword = NNDNotUnique|NNDExcludedUnique
This should silently distribute new keywords without needed to update all custom made patches.
Allow toggling features using hotkeys:
Ctrl+Shift+N
: Toggle Names distribution. This will enable/disable generated names.RCtrl+O
: Toggle Obscuring distribution. This will enable/disable obscured names.RCtrl+L
: Reload settings.RCtrl+RShift+G
: Regenerate all names. Show a message box with confirmation.RCtrl+G
: When crosshair points to an NPC, regenerate this NPC's name. No confirmation.Probably allow customizing these hotkeys in INI.
Currently default titles and obscurities are being stored within NNDData
.
This leads to the need for cumbersome checks and storing extra data in cosave when it's not needed there.
To mitigate this NNDData::UpdateDisplayName()
and NNDData::GetName()
should be updated to receive an Actor
and be able to substitute GetFullName()
for title when needed.
This would also remove the need to store UpdateMask::kObscurity
since it will never be persisted in a cosave.
To extend this even further we can remove the need for UpdateMask::kDisplayName
, by not saving displayName
either.
It will be reconstructed anyway, so why bother.
Allow Name Definitions to be used for Titles. Custom titles will replace original names where they were used as titles.
Note: Custom Titles ignore NNDTitleless keyword, since this keyword used to indicate when originalName should not be used as title.
With recent release of wSkeever's mod it is now apparent that any further useful dynamic additions to the name is not possible.
To mitigate this NND should be able to:
[race]
- race[sex]
- sex[relation]
- relationship disposition[class]
- class or combat style (e.g. warrior, mage)[carry]
- show carry weight[break]
- new lineReview some requested mods to provide built-in compatibility
In order to keep NNDData
up-to-date with external configuration (Name Definitions
, _DISTR
files, options) NND needs to be able to refresh flags for all cached NNDData
, e.g. to detect the following events:
Name Definition
s addedSome of these were already handled in #28. But it performs continuous checks to determine whether an update is needed even though it's only needed once.
The problem is that NNDData
is created in-place when requested for the first time and then is reused.
This makes it hard to update NNDData
once per session, since the only way to do it now is to continuously run this routine when a name is requested (which happens a lot).
Instead of introducing yet another flag and keep checking it, NND can do pre-caching of NNDData
when an actor is loaded for the first time in this session. This would give a chance to refresh all flags.
Name Definitions in YAML format should be more compact and cleaner, thus easier to understand.
In cases where originalName
must be used within generated names NND should take TESNPC
's GetFullName
(or GetShortName
depending on requested name style).
The originalName
that is passed from hooks is unreliable and may provide altered names (e.g. updated via SetDisplayName
or other means). Additionally it would carry over a bug with multiple generated names, since those are stuck as "original names" (see #30)
Name Definition chance is quite redundant since it can be controlled by SPID.
In addition to #13, allow customizing name formats when title is used.
This would be a port of existing feature in NND 1.0:
List of options:
- None: Torvar Stormwall
- New Line: Torvar Stormwall
Whiterun Guard- Hyphen: Torvar Stormwall - Whiterun Guard
- Round Brackets: Torvar Stormwall (Whiterun Guard)
- Square Brackets: Torvar Stormwall [Whiterun Guard]
- Comma: Torvar Stormwall, Whiterun Guard
- Semicolon: Torvar Stormwall; Whiterun Guard
- Full Stop: Torvar Stormwall. Whiterun Guard
- Space: Torvar Stormwall Whiterun Guard
Allow defining completely custom format using [name]
and [title]
placeholders.
Per user request, add an option Obscurity:bObituary
to reveal names of dead NPCs when player is looting them ๐
Extend list of available priorities with Clan priority. It will be higher than Faction priority.
This addition will match number of priority levels in each tier:
Rework Obscuring Names to make more sense.
NNDKnown
this feature should be disabled by default unless included with NNDObscured
.Algorithm for obscurity:
A circumfix (abbreviated circ)[1] (also confix or ambifix) is an affix which has two parts, one placed at the start of a word, and the other at the end.
Add a flag that will allow treat Prefix and Suffix components as circumfixes:
When enabled, will synchronize picked prefix and suffix, e.g. when there are 3 prefixes and suffixes, Name Definition will pick one index for both lists.
Note that number of prefixes and suffixes must match, otherwise length of the shortest one will be used.
Apparently, it causes issues ๐ presumably conflicting around Load3D
, which prevents any name generation from happening.
Details are in Discord's PM
Add another segment to name definitions to support Middle name segment.
โ
Names will be assembled like this: First + Middle + Last
Currently, by using names in SPID filters, games in other languages won't work, since SPID would fail to distribute.
By switching to FormIDs mod will become truly language-independent.
Currently Unique NPCs are completely ignored by naming.
Allow using Custom Titles to attach those to unique names of the NPCs.
Note: Only Custom Titles can be attached. If Custom Title is not provided then the original name will be used (as it is now)
Allow writing default obscurity placeholder in ini file
When multiple Scopes are specified in Name Definition, the first picked name from this Definition should fulfill all scopes and do not look those names further.
Mannequins are detected as talkable, and thus affected by obscurity which in turn breaks their default behavior and instead offers to "talk" to them.
Hooking GetDisplayFullName
doesn't provide context as to where the name will be used.
As such it should only be used as default fallback option. Whereas specific calls to this function should be hooked to provide context-aware name replacements.
Nested Behavior
objects proven to be redundant. As such all options presented there will be moved to top-level object.
Also Combine
behavior should be renamed to Inherit
for clarity.
After #29 There will be a single place that will be able to un-bake stuck obscure names and multiple names.
Not sure whether this needs to be done in first release (or at all) since NND 2.0 will reroute all names.
Scopes feature replaces and extends old Behavior.Obscuring
, by allowing Name Definition to be used in arbitrary number of scopes.
Possible scopes will be: Name
Title
Obscuring
Several scopes can be combined in a single Name Definition
Expose some Papyrus functions to GetRandomName
And Get various generated name variants. Also Setters might be useful.
This would allow patching other mods that want to dynamically change NPCs names to merge generated names with their variants.
If an NPC is killed while being obscured their name will be forever frozen to obscure. Not sure how to handle that yet.
Also, for reanimated npc using kDisplayName doesn't look good. Fixed. NPCs will automatically reveal their name.
I probably need to introduce a separate category for Reanimated. Done. kCrosshairMinion
Turned out #43 hadn't fixed the root cause, but only mitigated some symptoms. The problem seems to be that RaceMenu's BodyGen changes lifecycle of an Actor. In particular, it calls Load3D function earlier than the original game did, and at this moment there are no keywords on an Actor yet. This consequently causes NND to fail to pick any name and caching empty result, effectively breaking name generation for that Actor.
The solution would be to switch the hook.
NND 2.0 defines 3 Name Styles:
Full Name
and Title
.Full Name
Full Name
.Title
if available (either a custom Title is provided or isTitleless = false
). Otherwise shows Full Name
.Each of these styles can be used in one of the following places:
User will be able to customize which style is used in those places separately in INI config file.
No more formatting styles that determine how Title
is appended to a Full Name
. (at least for now)
Compass Navigation Overhaul seems to not use any existing calls to GetDisplayFullName
, so that generated name never shows up on compass.
One way to solve this is to introduce some API, and patch CNO (and also TrueHUD) to use this API to obtain correct name. One benefit of this solution would be ability to control name style with separate context.
Prepare documentation, screenshots, etc.
Add required prefix NND
to ensure that it only changes NND
keywords
Add ability to shorten generated names and display those where appropriate.
Configuration options will be provided separetely.
Ensure that when sFormat
is explicitly set to empty string NND will use default format instead.
When reloading, cached NNDData
entries must be updated if they have unresolved fields.
So if title
was not picked last time (e.g. originalName
was used). Then this data needs to be regenerated, to see if title has changed.
For this feature to be efficient NND needs to save the composition of last used Name Definitions in form of pairs: NameDefinition's file name + checksum of that file.
Before loading NNDData
entries, serializer should load this segment and determine whether data needs to be updated (e.g. whether composition of Name Definitions has changed since last time).
If changes are detected, then the following fields should be considered:
If those segments used default values (e.g. empty
or defaultName
or originalName
) then an update is warranted.
UpdateDisplayName
must also be called after that regardless of whether Name Definitions have changed, and/or any new names were picked, to account for possible change of Changes in options had also been added to snapshot.DisplayName::format
. (perhaps also cache last used format).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.