@RunRudolf it looks like AlternativeFuta doesn't declare its resources pack as a dependency, causing NRE with package managers (I'm using VPB).
On installs that don't already have AlternativeFutaResources registered (e.g. anything using VPB's on-demand package loading), the plugin fails and spams NREs. Two root causes:
- The .var's meta.json declares no dependencies. Init() locates the morph pack via FileManagerSecure.GetPackageVersion("RunRudolf.AlternativeFutaResources.latest"), which returns -1 because nothing ever told the package manager the pack is needed. The plugin references it only by name-query, and the dependency isn't declared (confirmed in Hub too). Declaring RunRudolf.AlternativeFutaResources in meta.json fixes this at the source: Hub download offers it as a missing dependency, and on-demand loaders (VPB, etc.) resolve and register it automatically. (Verified: a build with the dependency declared loads the pack on demand with no manual intervention.)
- Update() dereferences characterRun with no null-guard. When Init() early-returns on the "not installed" path, characterRun stays null and Update() throws NullReferenceException every frame - the log fills and FPS tanks. Best to log once and disable, rather than throwing per-frame.
Thanks!
1. First of all, the main problem seems to be related to systems using on demand package loading only. Right? It's not advisable to edit the meta.json to 'add dependencies'. The meta.json is just a mirror of all the dependencies that have been automatically recognised by the .var file system, e.g. by scanning through package references in the plugin code.
I do not want to have a dependency link to a specific version in my plugin code (such as to 'RunRudolf.AlternativeFutaResources.1'), but rather search for the most recent available package version (like 'RunRudolf.AlternativeFutaResources.latest, but this method does not work for packages'). However, these kinds of 'latest' references by code are not detected by the var file system scanning for references, and thus not included in the meta.json.
I do it this way to allow users to delete old resources packs, and only keep the most recent one. Since this resources pack contains morphs, this is quite important performance wise.
But it's true, as soon as resources using a specific version of the morph pack are released (such as the one you posted), the specific version of the resource will be required to be loaded, which compromises the ability to delete old morph packs. But still, for the main plugin, this seems to work. I don't think there is a perfect solution to this in the context of VaM.
Suggestion: I can include a sepearate force-dependencies.json file with a .latest reference with my plugin, which might add it to the meta.json. I will later test whether this works. Not sure though for packages...
2. Thanks, I will fix this. Did not check for hidden error logs.
Thanks for your input, and feel free to add to this discussion!