Question If the script detects that the meta.json format of certain var packages is incorrect...

VAMVIP

New member
Messages
6
Reactions
1
Points
3
I have noticed that the format of the meta.json files in some var packages is not correct, mostly due to missing or extra punctuation marks, and a few using escape characters. As a result, Python's ujson and json cannot read meta.json correctly. Can Vam read them correctly? If so, how does it achieve this?

InkedGirls.GIRL_Mendy.1.var
InkedGirls.GIRL_SportChick.1.var
InkedGirls.GIRL_Victoria_DeVil.1.var
JUN.ERIKA_japanese.1.var
KaiMuto.Kai_big_pack.1.var
Lee.UiOther.1.var
Liquidpinky.Daemon_Girl_VaMLogo.2.var
ReignMocap.IdleMotion4CreatorsB.1.var
sfishere.mmd2timeline.8.var
SkullDrill.EllieSantaBarbara.2.var
Syrinxo.MsClaus_Elfie_3some.1.var
VAMBO.Zeina.1.var
vecterror.KriKreX.2.var
...
...
...

For example, the meta.json files in these var packages cannot be read smoothly by Python. How I solve them?
 
Could possibly be the result of creators editing the meta.json by hand? It might simply be broken JSON?
You could run it through some JSON validator, e.g. https://jsonlint.com/ to see if it's indeed valid JSON.

VaM uses a particular version of SimpleJSON to read JSON files. You could write a VaM plugin to try to load it there and see what errors it throws, if any.
Note that VaM might possibly be relying on SimpleJSON treating non-standard JSON in a particular way that's causing trouble with you Python JSON implementation.
 
Upvote 0
I've noticed that an extra comma at the end of a dependency list (like from removing one) has no effect on Vam's ability to read it. I use the Vim editor for Windows, which has a format checker for JSON. It will flag the errors red if you click on them.
 
Upvote 0
I've noticed that an extra comma at the end of a dependency...
Could possibly be the result of creators editing the meta.json by hand? It might simply be broken JSON?
```PYTHON
import json
import ujson
```
The JSON library used in Python is Simplejson. The website https://jsonlint.com/ that you provided reported that the JSON data of a certain var package is invalid format.
May I ask how the Vam program handles these erroneous JSON data in a specific way? I hope to be able to read the dependencies and references from the erroneous JSON.
 
Upvote 0
the JSON data of a certain var package is invalid format.
Do these packages load in VaM? As said, likely someone edited the meta.json by hand. If stuff is broken, don't bother with it, just tell the creator for fix it. Of course, if it DOES load in VaM? Are there any errors in the in-game log window or VaM's logfile?
The logfile is here: C:/Users/[yourusername]/AppData/LocalLow/MeshedVR/VaM/output_log.txt

May I ask how the Vam program handles these erroneous JSON data in a specific way?
Not sure, I would recommend to haver a look at the VaM source code. E.g. use ILSpy to look at VaM_Data\Managed\Assembly-CSharp.dll.
 
Upvote 0
Not sure, I would recommend to haver a look at the VaM source code. E.g. use ILSpy to look at VaM_Data\Managed\Assembly-CSharp.dll.

I looked at the simplejson code of the game using IL Spy, but couldn't find where it could correct the erroneous format of JSON on its own.

Python's simplejson or json doesn't have a parse function, but it can suggest missing or extra symbols and other suggestions. I can self-correct based on error messages until the JSON becomes a valid format.

The problem is that if there are multiple errors in the JSON, it's hard to come up with a solution for looping self-correction using a simple function that only works for adding or removing a single symbol.

I spent several hours writing last night, but haven't found a good solution yet.
 
Last edited:
Upvote 0
Back
Top Bottom