Jump to content

Recommended Posts

Posted

This is my first time making a code mod, and im trying to fetch a json file, but it cant seem to find it.

`api.Logger.Notification(api.Assets.Exists(new AssetLocation("vintagediseases:diseases/testdisease.json")).ToString());` returns False


I checked my bin/Debug and the files exist and are named properly. What am I doing wrong?

 

image-1.png

  • 1 month later...
  • Solution
Posted

Essentially assets are stored in: "{modfolder}/assets/{domain}/{assetcategory}/path/to/asset".

Where `assetcategory` is something that needs to be defined. The game uses this to separate assets, decide which side needs the files and whether they affect gameplay (which has effect on whether a client only mod can patch the file).

I'm guessing your issue is probably forgetting to create the `AssetCategory`.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.