Skip to content

PsBuild

Ulysses edited this page Jan 23, 2024 · 13 revisions

PsBuild

PsBuild is a tool to compile PSB description jsons to PSB.

pcc

PsBuild is pcc compatible. PsBuild accepts both res.json(psbtools decompiler) and resx.json(PsbDecompile) as resource json.

Resource Json

resx.json is a new format of resource json used by PsBuild. When decompiling PSB, some information is lost, and resx.json is used to keep them, and provide some options for compile at the same time. However, if you use arguments for PsBuild, the corresponding setting in resx.json will be ignored.

For example, you can set CryptKey in resx.json, and the PSB will be encrypted after compiling. (This only works for EMT PSB.)

resx.json may changes with the updates of PsBuild. Be careful if you modified it and then switched to a new version of PsBuild.

Picture Resource

PsBuild identifies pictures' format by their file extensions and convert common picture formats to the format PSB used. For TLG image support, read Plugins wiki for more details.

Link

External Texture PSB is a kind of PSB whose resources are not contained in PSB itself. Since FreeMote Viewer is using DX SDK which can not support such PSB, there is a Link feature in PsBuild to embed textures into an external texture PSB and make it a normal (texture embedded) PSB. Some other features also require textures to be embedded. Texture names should be something like sample_tex000.png.

Example:

PsBuild link sample.psb sample_tex000.png sample_tex001.png

The compiled PSB does not work

  1. Use -v {Version} to set a corresponding PSB version (usually try -v 2 first). You can also set version in resx.json.
  2. If the PSB have to be encrypted, do it using PsBuild -k {Key} or EmtConvert.
  3. Make sure the jsons are valid (both syntax and content).
  4. If you are using FreeMote libs, make sure you have called PSB.Merge() before PSB.Build().
  5. If your PSB is an External Texture PSB, link textures into the PSB using PsBuild link.
Clone this wiki locally