blueskythlikesclouds / DivaModLoader

Mod loader for Hatsune Miku: Project DIVA Mega Mix+
MIT License
265 stars 11 forks source link

[Request] Partial reading of pv_db.txt #20

Open AzukiSan-png opened 1 month ago

AzukiSan-png commented 1 month ago

Currently, if you want to update the contents of pv_db.txt on the mod side, you need to include pv_db.txt in the mod folder. However, if multiple mods contain pv_db.txt, the file of the mod with the higher loading priority will be applied. (The mod at the top of the "priority = []" list in the DML’s config.toml)

Would it be difficult to make changes so that only the lines you want to reflect are written in pvdb◯◯.txt (tentative file name) and only that part is overwritten?

For example, creating a lyrics translation mod that reads pvdb◯◯.txt with only the lyric lines written like below.

pv_9999.lyric.001=abcd pv_9999.lyric.002=efgh pv_9999.lyric.003=ijkl

Reading a file with only the following descriptions and changing the recommended costumes for each PV on the module mod side.

pv_9999.performer.0.pv_costume=999

Please consider whether it is possible to respond.

Platonic-DIVA commented 1 month ago

It's called a mod_ db

Include mod_ in the prefix of the database (Ex: Mod_pv_db.txt) Only lines you need are included (But be sure to add the whole entry)

AzukiSan-png commented 1 month ago

I thought it might work with mod_pv_db.txt, but it didn’t. I only mentioned pv_db.txt in the main text to avoid confusion, but I would like you to handle mod_pv_db.txt in the same way.

It seems my explanation was not understood, so I will explain the example in the main text in more detail. For example, if there are two types of mods, one for translating lyrics and one for changing recommended modules, both would need to modify pv_db.txt, right?

However, even if both mods are enabled, one of them does not work. This is because only the pv_db.txt of the mod with the higher loading priority (the one loaded last) is read. (Please do not delve into the detailed mechanism. This is merely an example to explain the desired functionality for this request.)

Someone knowledgeable about mods can investigate the changes in pv_db.txt for each mod and combine them, but when distributing mods on a distribution site, there are various users, so you cannot just tell them to “combine it yourself.”

If both mods are created by the same author, they can simply distribute a combined mod, but if one of the mods is created by someone else, they cannot combine them without permission.

Therefore, the request is to implement a feature that reflects only the relevant lines so that the translation mod is not disabled when the mod for changing recommended modules is introduced.

As an example, I mentioned “pv_9999.lyric.001=” and “pv_9999.performer.0.pv_costume=” regarding lyrics and recommended modules, but ideally, other lines should also be reflected.

blueskythlikesclouds commented 1 month ago

This is indeed something that would be really hard to implement, but it IS doable, so I'll leave this issue open in case it gets implemented in the future.