#KSP2 Unity Tools

1 messages · Page 2 of 1

vague karma
#

Perfection

grizzled herald
#

Hmmm... I changed it from everything (which is for making the zip I guess) to just Copy Assets Only and it forgot (?) all the JSON stuff, or is just not displaying it now.

vague karma
#

Intentional, as none of that matters for Copy Assets Only

#

only the modid

grizzled herald
vague karma
#

Thats intentional

#

It doesn't autogen a swinfo when set to copy assets only

grizzled herald
#

Should the In Game Mod Folder be where I have this go and the Build Path is therefore wrong above?

vague karma
#

therefore a lot of the information in there is useless, so it hides it

vague karma
grizzled herald
#

So perhaps this

vague karma
#

Yes

#

Exactly

grizzled herald
#

And pressing Build and Test would build, place, and then launch?

vague karma
#

Yep!

grizzled herald
#

Nifty!

vague karma
#

Make sure you set up addressables first

#

that is important

grizzled herald
#

I am pleased. But I do still want a pony. Or failing that a working LFO

teal cipher
#

I am working on the latter, but it will not in fact be just a couple of hours

#

as I am doing basically a complete rewrite

grizzled herald
teal cipher
#

and I know absolutely nothing about shaders, so red plumes it is, for now, I'm afraid

vague karma
#

But build and test does the following

Build asset bundles to - Assets/assets/bundles
Build addressables
Copy Assets/localizations to mod/localizations
Copy Assets/assets to mod/assets
Copy Assets/patches to mod/patches
Copy Assets/libraries to mod/libraries
Runs KSP2_x64.exe
grizzled herald
#

You tease! #1090450560114761749 message

grizzled herald
teal cipher
#

I mean fair, I can give you the version I currently have, but I can't guarantee it works

grizzled herald
#

I no only slightly less than you about shaders

#

so together we can double!

teal cipher
#

huh turns out the package does not actually need to be at the root @vague karma

vague karma
#

I could maybe take a stab at it myself

teal cipher
#

though it would be a bit clunky to refer to the path in the repo

grizzled herald
vague karma
#

Its meant to enable a complete part mod with possible patch manager patches to be built entirely within unity

grizzled herald
#

For localizations, it's jsut my csv file in the proper folder?

vague karma
#

Yep

grizzled herald
#

What about this file?

teal cipher
#

could you maybe instead just have a plugin_template folder to make it match SW.Template, and just copy everything inside it?

#

(@ Cheese)

vague karma
#

I was just thinking about that

#

Yeah, I shall do it

vague karma
#

Ill write that tomorrow

#

Unless @teal cipher or someone wants to make the fix
Cuz Im about to get on vr for the night

#

Though I may just do it after I am off vr

#

its honestly leess code

#

and you can drop dlls in there

cedar bronze
#

If those are the noise textures that the plumes use it would be good to include them if there will be an in game editor one day

#

thats why waterfall included all the textures

vague karma
cedar bronze
#

then yeah get those in the mods that use them

grizzled herald
#

Yep, those are not noise, they are the plume profiles you helped us make! They're from your tool.

#

This may be a bug. I've applied KSP2UT 0.5.0 to my SPARK project and imported my swinfo. The dialog is reporting my mod's version as 0.1.0, but in the swinfo it's 0.2.0

#

Why for 0.1.0?

#

Am I being forcibly downgraded?

vague karma
#

hhuh

#

close and reopen the window

teal cipher
#

the CheeseAI decided your mod doesn't deserve the 0.2 version number

grizzled herald
#

Is there some wild QC process that evaluates my mod and finds it unworthy of a mere 0.2.0?

grizzled herald
#

Foiled again.

#

Closeing the window and reopening gives the same result

vague karma
#

Ahh

#

I copied everything but version lol

grizzled herald
#

There's this?

vague karma
#

It will be fixed in the next update

grizzled herald
vague karma
#

I forgot one field from the swinfo json object to copy and its version

#

Just set it to 0.2.0 manually for now

grizzled herald
#

The Rat Strikes again! Can I get a QA role?

vague karma
#

Screw it why not

grizzled herald
#

Kidding!

vague karma
#

<@&1168697563139031121>

teal cipher
vague karma
teal cipher
#

nothing nothing

vague karma
#

So yeah

#

Time to fix the json importer and create a plugin_template folder

#

@teal cipher ksp2unitytools 0.6.0 (the PR i just made) should have all the fixes for the various bugs

#

And also change to using a plugin_template folder

#

(For @grizzled herald to be able to put the LOABE.cfg into the folder)

#

This really should just be the standard for part modding, and honestly, I'd advise people to create a new project and copy the parts over

vague karma
#

Alright, I might add an API into this for making stuff addressable under the mod group with a label or not, and with a name

vague karma
#

On the dev branch now

#

though I need to fix some stuff

#

I really want y'know ... file scoped namespaces

teal cipher
#

yeah, that would be really nice

#

but I wouldn't expect Unity to upgrade Mono any further, I think they'll probably just go straight to .NET after the current version

#

which will be who knows how long

vague karma
#

Truee

#

The fun part is going to be using that addressables API for LFO

teal cipher
#

the KSP2UTSettings file

#

I think this happened when I installed KSP2UT before importing the game, which of course causes all the compile errors

vague karma
#

Ahh yeah

teal cipher
#

deleting the two KSP2UT files and clicking Reimport on KSP2UT regenerated the files correctly now

teal cipher
#

I'm really on a roll

#

that's when trying to either build or build and test

#

when I check the path, the file that it can't find does appear there

#

but only after the error

vague karma
#

Wait

#

Do you have any addressables?

teal cipher
#

I got the engine into the game, just took the generated zip, extracted it into the game, and copied over the built addressables from the KSP2UnityToolsTempBuild folder

#

but when trying to build it automatically with KSP2UT, it just keeps throwing that same error

vague karma
#

Thats uhh extremely odd

teal cipher
#

I think I may be starting to rival schlosrat as a QA rat

vague karma
#

Can you copy the full path name it throws in the error into here

teal cipher
#

C:\Games\KSP Stuff\KSP 2 Modding\Mods\CommunityPartsPack\src\cpp_unity_project\KSP2UnityToolsTempBuild\BepInEx\Plugins\CommunityPartsPack\addressables\StandaloneWindows64\6aaefc5c0aeeb0c7d427bcdbbfa1ea5c_unitybuiltinshaders_35f82297a6512ae11437900d460e7995.bundle

vague karma
#

263 characters

#

Too long for windows

teal cipher
#

well fuck lmao

#

my base path is not even that long

#

🙃

teal cipher
#

why the hell does Unity need the builtin shaders bundle to have a 92-character filename, that's already 1/3 of the limit

#

I updated the registry value, guess I'll have to reboot to check if it worked, but first I just want to finally test adding the plume lol

vague karma
#

Why does windows have such a short path length limit

vague karma
teal cipher
#

probably some stupid backwards compatibility with 16-bit apps

teal cipher
vague karma
#

The registry key will not be reloaded during the lifetime of the process.

#

Ahh

#

I misread something

#

A restart is likely best

teal cipher
#

do I dare close Unity

#

lol

#

now that it's actually all working

#

I'll test after I test the plume

vague karma
#

Tbh I thought for sure the error couldnt be the path length at first but I had to check

teal cipher
#

fuck you Bill Gates

vague karma
#

It could have given a better error like path too long or sometjing

teal cipher
#

it really could have

#

I also keep getting these when saving part JSON

#

though it doesn't affect the saving itself

vague karma
#

Cant fix that

teal cipher
#

no problem, just wanted to let you know

teal cipher
#

one thing I kinda neglected to think about when suggesting copying over the whole plugin_template folder is that now the release is filled with .meta files

vague karma
#

I tried to not have that happen???

teal cipher
#

huh

vague karma
#

OHHHHH

teal cipher
#

this is the generated zip

vague karma
#

FileInfo.Extension ... includes the .

teal cipher
#

ohhh

#

lmao

vague karma
#

Also, I already had long paths enabled lol

#

I should add a button in the SDK to enable long paths, that would be great

teal cipher
#

noticed a small bug in the KSP2 Unity Tools window

#

when the paths in the bottom text boxes are too long, the textboxes and the buttons next to them overflow (with no scrollbar or anything)

#

while the textboxes in the above section are correctly bound to the panel width

vague karma
#

Ahh

vague karma
teal cipher
#

no fix for overflowing textboxes, sadge

vague karma
#

I have no clue how to fix that tbh

teal cipher
#

if that top part is wrapped in a scrollview or something like that, then that's probably the issue

#

wait what

#

no the issue was with the bottom part

#

ignore me

#

lmao

vague karma
#

Aaaaa I forgot the texture in there didn't I

teal cipher
#

there, fixed

#

you just needed flex-shrink: 1 on them

vague karma
#

Then I shall also add the texture and make a quick hotfix

#

And there a PR has been made for the hotfix

#

should I just push it through?

teal cipher
#

yeah

midnight sequoia
#

For the reentry shader, does each part need a separate material with it? Or is it for each LOD? Or one for all parts is ok?

vague karma
#

Ask @little junco

little junco
#

Hy Safarte
shader is for a material only used with LOD objects

vague karma
#

This next update is certainly going to be a doozy

#

as I have to create a lot of baking tools

#

Like I need to bake the entirety of science regions for example

#

Meaning I'm going to have an editor for that

#

And I'm going to allow you to use a color map to bake it :3

#

There is so much that goes into making a planet aaaa

#

Honestly @teal cipher I actually think that putting the decompiled scripts into this package or a dependency (likely better), isn't a horrible idea, it would be kind of a pain to maintain though

teal cipher
#

the biggest issue would be getting them all to compile

#

I think I already tried at some point to get a project with the decompiled stripped assemblies to compile, and I got relatively close but there were still issues

#

and it needed a lot of work to get there

#

oh I was trying to do it for the documentation

#

to be able to fill in the doc comments directly into the source

#

and I gave up in the end

vague karma
#

pain

#

It might become necessary though if we want to have a no headache way for users to do modding via unity

#

Anyways, LINQ is fun

teal cipher
#

is it, I just wish Mono didn't suck so much

#

if this was just .NET, I'd be using it everywhere

vague karma
#

Yeah

#

In the editor though, if something takes a bit longer its not as much as an issue

teal cipher
#

yeah that's true

vague karma
#

especially since you shouldn't be baking science maps every frame

midnight sequoia
vague karma
#

I should add streams into patch manager :3

#

when I add support for custom types (basically dictionaries with a @type field) maybe I will

teal cipher
#

I created and pushed tags for all version "releases" of this

vague karma
#

Gotcha

vague karma
#

@teal cipher can you make a version without the fix unity button?

teal cipher
#

I can try, but I can't promise anything, train wifi keeps going on and off

vague karma
#

Though ... based off of main, as dev has a lot of planet stuff

teal cipher
#

PR is up

vague karma
#

Thank you

teal cipher
#
UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown. No Location found for Key=localization
UnityEngine.AddressableAssets.Addressables:LoadAssetsAsync<I2.Loc.LanguageSourceAsset> (object,System.Action`1<I2.Loc.LanguageSourceAsset>)
KSP.Assets.AssetProvider:EditorLoadByLabel<I2.Loc.LanguageSourceAsset> (string,System.Action`1<I2.Loc.LanguageSourceAsset>,System.Action`1<System.Collections.Generic.IList`1<I2.Loc.LanguageSourceAsset>>)
I2.Loc.LocalizationManager:RegisterSourceInAddressables ()
I2.Loc.LocalizationManager:UpdateSources ()
I2.Loc.LocalizationManager:InitializeIfNeeded ()
I2.Loc.LocalizationManager:TryGetTranslation (string,string&,bool,int,bool,bool,UnityEngine.GameObject,string,bool,string)
KSP.Localization.PartLocalization:TryGetPartString (string,KSP.Localization.PartLocalization/PartPrefixedStrings,string&)
KSP.Localization.PartLocalization:TryGetPartDescription (string,string&)
KSP.Sim.Definitions.PartData:get_Description ()
System.Reflection.RuntimePropertyInfo:GetValue (object,object[])
Newtonsoft.Json.Utilities.ReflectionUtils:GetMemberValue (System.Reflection.MemberInfo,object)
Newtonsoft.Json.Serialization.ReflectionValueProvider:GetValue (object)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter:CalculatePropertyValues (Newtonsoft.Json.JsonWriter,object,Newtonsoft.Json.Serialization.JsonContainerContract,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization.JsonContract&,object&)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter:SerializeObject (Newtonsoft.Json.JsonWriter,object,Newtonsoft.Json.Serialization.JsonObjectContract,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization.JsonContainerContract,Newtonsoft.Json.Serialization.JsonProperty)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter:SerializeValue (Newtonsoft.Json.JsonWriter,object,Newtonsoft.Json.Serialization.JsonContract,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization.JsonContainerContract,Newtonsoft.Json.Serialization.JsonProperty)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter:SerializeObject (Newtonsoft.Json.JsonWriter,object,Newtonsoft.Json.Serialization.JsonObjectContract,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization.JsonContainerContract,Newtonsoft.Json.Serialization.JsonProperty)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter:SerializeValue (Newtonsoft.Json.JsonWriter,object,Newtonsoft.Json.Serialization.JsonContract,Newtonsoft.Json.Serialization.JsonProperty,Newtonsoft.Json.Serialization.JsonContainerContract,Newtonsoft.Json.Serialization.JsonProperty)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter:Serialize (Newtonsoft.Json.JsonWriter,object,System.Type)
Newtonsoft.Json.JsonSerializer:SerializeInternal (Newtonsoft.Json.JsonWriter,object,System.Type)
Newtonsoft.Json.JsonSerializer:Serialize (Newtonsoft.Json.JsonWriter,object,System.Type)
Newtonsoft.Json.JsonConvert:SerializeObjectInternal (object,System.Type,Newtonsoft.Json.JsonSerializer)
Newtonsoft.Json.JsonConvert:SerializeObject (object,System.Type,Newtonsoft.Json.JsonSerializerSettings)
Newtonsoft.Json.JsonConvert:SerializeObject (object,Newtonsoft.Json.JsonSerializerSettings)
KSP.IO.IOProvider:ToJson (object,Newtonsoft.Json.JsonSerializerSettings)
KSP.IO.IOProvider:ToJson (object)
ksp2community.ksp2unitytools.editor.PartEditor:OnInspectorGUI () (at ./Library/PackageCache/ksp2community.ksp2unitytools@bc61e6a86a/Editor/PartEditor.cs:188)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
#

this is an interesting new error

#

(repeats for manufacturer, title, subtitle, description)

vague karma
#

Meh

#

Ive seen it before

teal cipher
#

alright, but before it didn't happen on every JSON save

#

now it does

vague karma
#

Is it related to the tk issue

teal cipher
#

it appears even when there are no ThunderKit errors (when you choose not to import KSP2 addressables)

#

so it's probably another isolated 0.2.1 issue

vague karma
#

When you choose not to import addressables

#

I seeeee

#

And the error is relating to what?

teal cipher
#

ah it should have been obvious in hindsight

teal cipher
vague karma
#

This one

teal cipher
#

well, saving the core part data json

vague karma
#

Yes but its trying to go through addressables

teal cipher
#

it was just an empty Unity project, added an object, added a core part data component, clicked save JSON

#

that was it

vague karma
#

I see

#

But see how its trying to load the editor addressables

#

And it cant

teal cipher
#

to be fair I had no clue that it can go through some invisible hidden addressables that are imported by TK

vague karma
#

Well given the error normally doesnt happen consistently I think that may be the case

#

How does TK's addressables import work actually

teal cipher
#

no clue at all

glad wraith
#

It copies the addressable catalog from the game directory into your project in the default location where you'd setup an addressable library and then asks the addressable system to load it

vague karma
#

if that's the case, then yeah, these errors are definitely related

glad wraith
#

It also intercepts the loading process to redirect unity to the games install directory so that the addressable asset bundles don't need to be copied into the project. This is good because those assets are not editable and this removes one of a couple different things that would suggest they can be edited

#

If the game is having errors though that almost certainly has nothing to donwith tk

#

Since tk won't be involved at all st runtime

#

Or well it shouldn't be. And if somehow it is, thats tk not being used right

vague karma
#

this error is in the editor
well either we have addressables loaded by tk and not have this error and be unable to build stuff, or we don't have them loaded and we have this error but I think able to build stuff?

glad wraith
#

Am I confused?

#

The issue last night was about the game itself failing to load correctly due to a breakdown in addressables, yeah?

vague karma
#

oh

vague karma
#

I don't know much about that other issue

#

Munix who I accidentally pinged may know more

teal cipher
#

And then when we disable the import of addresables, that breaks building our own addressables, because the game code that we need to run in editor to serialize the part modules depends on the game addresables being loaded

#

So the workaround didn't really help

glad wraith
#

Oh I see you installed the addressable library

#

If you're going to install the addressable library, its certainly critical you install the same version as the game, AND do so before importing the game using ThunderKit

#

It should work in theory, I put im a fix for someone early on here

#

Or they submitted a pr?

#

I dont really recall, it was shortly after initial release

#

I'm not saying this will definitely fix anything

#

But its where to start

teal cipher
#

Alright, interesting, I'll try to look what the version the game uses is

#

But we've never had issues with this before (at least not since I've been here)

glad wraith
#

Its definitely strange, but always start with the basics

#

I'm working rn, but if you want me to look into it I can. After work.

It would be very helpful if you could setup a minimal sample

#

Lile you have errors on initial import, but also when trying to build

#

I cant test building well bexauee I dont have experience with mosding ksp2

#

Or if its really simple just give me a set of steps

teal cipher
#

So, the absolute minimum is to install TK and import KSP2, then create an empty object in the scene, add the Core Part Data component to it and press Save JSON

#

Actually, sorry, no

#

That specific error is caused by not importing addressables

#

Nevermind

#

I'll set it up when I get home

teal cipher
#

uhh probably stupid question

#

but how do I know what version the game uses husK

#

the assembly version is just 0.0.0.0

glad wraith
#

You ask the devs

#

Thats why I had put that question in way back

#

Or, you make a ton of builds with different versions of addressables in it and do a hash code check

#

Which would probably take a few hours

teal cipher
#

jesus christ

glad wraith
#

Unfortunately unity never thought it was a good idea to add an assembly version to their packages

#

Which has some merit, but sucks

#

Its reasonable because devs can always modify those packages, and in doing so they would render the version number irrelevant, putting you right back to where you have to ask devs

#

Ror2 for instance uses a modified addressables, so you cant actually just use the addressables package

teal cipher
#

can we just use the game's addressables assembly instead then?

glad wraith
#

Thats typically what I recommend

vague karma
#

Wont that like not have the editor code

glad wraith
#

You lose the ability to fully build your own addressables

#

Yes

vague karma
#

:/

teal cipher
#

oh god

#

I love Unity

vague karma
#

That is not feasible

glad wraith
#

In theory I could rebuild that for a modding environment

#

Do yall tale advantage of addressables

teal cipher
#

basically everything has to be in addressables

glad wraith
#

I always saw people just use normal bundles along side it

teal cipher
#

since the game loads stuff like parts and planets from labels

#

and we'd have to severely modify the game's asset management code to work around it

glad wraith
#

So that makes things a little difficult I suppose

#

You could try making a modified version of addressables that only includes the editor code

#

Not to suggest thatd be a simple endeavor, it may be

teal cipher
glad wraith
#

Why not just put out a question to

#

The community guy

teal cipher
#

well this will probably be faster

#

but sure, we can try

glad wraith
#

Ultimately its going to be good to know if they made any changes

#

You may do that hash code thing and find no matches

#

Which means that they modified it and therefor you'll have no useful information out the other side

glad wraith
teal cipher
#

yeah, I love to hate on Unity but I can't imagine that other engines don't exactly make it much easier

teal cipher
#

alright I did ask, so we'll see if we get anything

#

but I'm kinda worried, since everything worked fine with 0.1.5 and 0.2.0

#

and with both of those, we were using the latest version of addressables (1.21.19)

#

and now, in 0.2.1 it suddenly doesn't work, but I can't imagine they for some reason downgraded the package

#

and there is no newer version to check

#

so I'm kinda suspecting some custom changes possibly

glad wraith
#

Thats also a possibility, but if ita only a problem in the editor it could be how tk is integrating it

teal cipher
#

yeah, seems to be an editor-only issue

#

because mods with addressables built for older versions work fine in the game (even those built with 2020.3)

teal cipher
#

and still the same errors

#

when importing the game

#

this is weird, it looks like there's a reference to a file that doesn't exist, but if that was the case, then they also wouldn't be able to build the addressables, right?

glad wraith
#

It could be a configuration issue in addressables

#

What happens if you DONT install the addressable package

#

Can you do the import and use the browser?

teal cipher
glad wraith
#

So then id say the issue is somewhere with addressables configuration

#

Unfortunately, I dont have sufficient experience with addressables to guess at what that could be

#

The error makes me think that the issue is an expectation of runtime assets being loaded in

#

Whichz we are technically doing

#

It may be that the best way to handle all this would be to do it purely through the addressables library

#

The tk browser would need to be adapted to handle that situation

#

In theoryz the stuff thunderkit does to import addressables is unnecessary/wrong

#

Wrong in the "way you do things with addressables" sense

#

Tk does stuff this way to not require the package be installed

teal cipher
#

I see

vague karma
#

Ahh

#

I mean, hmm, if you used a compiled dll you could just use reflection to check for addressables, however feasible that is

glad wraith
#

My entire goal is to minimize barriers

teal cipher
#

I'm not entirely sure what you mean by that

#

(without thunderkit)

#

if you mean a setup for making parts (which is the main thing we use TK for), then we have never been able to do that without thunderkit

#

we need the game's components to make the parts, and we need the game's addressables imported in order for the game's JSON export code to work

#

this is with a completely clean install of KSP2 0.2.0 (the previous version)

#

this exact process has worked for me like 20 times before, never with those issues

#

ThunderKit version is the same, Addressables version is the same, game version is the same, Unity version is the same

#

the last time I did this was literally 5 days ago with no issues on my laptop, and that had to have been with 0.2.1

#

I just checked

glad wraith
#

I think it should be doable

glad wraith
#

so, I'm not having any problem

teal cipher
#

It seems to be weirdly inconsistent

#

On my desktop, I had no issues in 0.2.0, then after updating to 0.2.1, it didn't work, after downgrading to 0.2.0 it didn't work, and even after deleting the whole game folder and installing version 0.2.0 from Steam again, it still doesn't work

#

Yet on my laptop, it worked in 0.2.0 and it works in 0.2.1

#

I have no idea why this would happen

#

And I'm not the only one with this issue

#

My first thought was that maybe the install that works fine had some leftover files from previous versions of the game that made it work, but that can't be the case, because I only bought the laptop recently and the first version of the game that I installed was 0.2.0, so having a clean version of 0.2.0 on my desktop should have the same exact results

#

Yet it doesn't

#

I'm honestly completely confused

teal cipher
#

@vague karma honestly we should remove (or at least hide) the option to save a .patch file for a part for now, it does more harm than good, I've seen multiple people who click it accidentally then have no clue why their part is not working properly when they change something and export the JSON

#

at least until we actually get the part duplication feature working in PM

#

until then it's basically useless

vague karma
#

Hmmm

#

Maybe

fallen grove
#

I ran into the same problem as above with ThunderKit able to browse assets in one project but not another.
I don't know the "correct" way to do this, but I found a workaround. Loading TK's imported catalog when entering playmode fixes the TK addressable browser, even after leaving playmode.

#

So maybe just needs something to check after editor load if the catalog is loaded and load it if it isn't?

#
namespace Klm.Unity.Editor
{
    public class KlmPrevisGameShim : MonoBehaviour
    {
        public string kspAssetCatalogPath = "StreamingAssets/aa/catalog.json";

        public List<GameObject> enableAfterCatalogLoad;

        private IEnumerator Start()
        {
            var path = Path.Join(Application.dataPath, kspAssetCatalogPath);
            var loadKspAssetTask = Addressables.LoadContentCatalogAsync(path, false);

            yield return loadKspAssetTask;

            var result = loadKspAssetTask.Result;
            Debug.Log($"loaded {result.Keys.Count()} keys from locator {result.LocatorId}");

            Addressables.Release(loadKspAssetTask);

            foreach(var go in enableAfterCatalogLoad)
            {
                go.SetActive(true);
            }
        }
    }
}```
#

Prints
loaded 8197 keys from locator F:/repos/Klm/src/Klm.Unity/Klm.Unity/Assets\StreamingAssets/aa/catalog.json

#

Interestingly, it now shows both addressables from my own project as well as ksp.

fallen grove
#

Domain reload clears it.

fallen grove
#

I created a quick and dirty asset postprocessor that reloads the catalog after domain reload. Seems to work. ```cs
class ImportKspAddressables : AssetPostprocessor
{
static readonly string kspAssetCatalogPath = "StreamingAssets/aa/catalog.json";

    static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths, bool didDomainReload)
    {
        if (!didDomainReload)
        {
            return;
        }

        var currentLocators = Addressables.ResourceLocators.ToArray();

        var path = Path.Join(Application.dataPath, kspAssetCatalogPath);

        if (!currentLocators.Select(rl => rl.LocatorId).Contains(path))
        {
            var loadKspCatalogTask = Addressables.LoadContentCatalogAsync(path, false);

            loadKspCatalogTask.WaitForCompletion();

            var result = loadKspCatalogTask.Result;
            Debug.Log($"loaded {result.Keys.Count()} keys from locator {result.LocatorId}");

            Addressables.Release(loadKspCatalogTask);
        }
        else
        {
            Debug.Log($"Resource locator for {path} is already loaded.");
        }
    }```
#

loaded 8197 keys from locator F:/repos/Klm/src/Klm.Unity/Klm.Unity/Assets\StreamingAssets/aa/catalog.json

#

I like that this makes the ksp content visible to code that uses keys, but doesn't seem to make it visible to the addressable build system.

teal cipher
#

wait you can enter playmode with ThunderKit??

#

that would always just crash Unity for us

fallen grove
#

I can barely do anything else. 😆
can't run a player build. Can't debug ksp game dll code in the editor. I can use the addressable browser, but all of the behaviors when inspecting a prefab come up with "unknown behavior" errors.

fallen grove
#

Would you want a PR for this? I can probably clean it up and make it a settings option.

vague karma
#

sure

fallen grove
# vague karma Merged.

Wow that was fast 😄
I didn't make the setting in the menu because I've never used this editor before.
Turning on the option in the settings object and trigger a domain reload should do the trick.

glad wraith
teal cipher
#

yeah personally I was never able to, even with just an empty project and KSP2 imported

glad wraith
#

With the right work, you can get entire games to run

#

I just never found it particularly useful, so I never spent time trying to make it a thing

#

I think launching games to test mods is faster than running it in the editor with the domain reload shit

teal cipher
#

honestly this would probably be really useful at this point, for people who want to basically continue working on the game where the devs left it

glad wraith
#

I think they would be better off trying to create a project that decompiles the source and organizes it appropriately

#

do the DevX thing

#

which is easier said than done, but so is getting games to run in the editor from a TK import

teal cipher
#

I got relatively close to making the C# source project compilable, but there were some issues I couldn't get past

glad wraith
#

for RoR2 it took a bit of doing, I had to completely rebuild a few scenes by hand to recreate them in the editor environment

#

since those scenes were loading environments and needed to run in order for the game to work

#

I don't really think its an automateable process

teal cipher
#

and making it very difficult to distribute changes

glad wraith
#

yeah I mean that is going to be na issue for a continuance style situation

#

regardless of how you do it

#

unless its like

#

people distribut binary patches?

teal cipher
#

really the only option is Harmony and Mono.Cecil, or like you said, binary patches, yeah

glad wraith
#

shuoldn't even be a thing

#

stupid Take 2

teal cipher
#

yeah...

glad wraith
#

and other people

#

I'm really surprised by the whole thing, I expect Indie EA's to fail, I really didn't expect a AAA publisher to fail an EA title like that

fallen grove
# glad wraith I just never found it particularly useful, so I never spent time trying to make ...

My use case is building test rigs for faster iteration.
Waiting for the full game to load then load a savegame in the test situation takes several minutes. Domain reload and enter playmode only takes a few seconds.
For working on stuff like shaders, I can rip stuff out of renderdoc or an asset ripper and plop it in to see the effect instantly.
Not so much for behavioral overrides.
But I honestly think if I could get something that could load non-addressables assets, I could get ksp's pqs running in the editor. They left a bunch of test classes sitting in the player assembly, and some of their testing prefabs in addressables.

#

There are a lot of unity asset ripping applications. What I need is an asset reading library.

glad wraith
#

It's far from a functional tool but it is a valid poc

#

Its based on assets tools v2, so quite outdated

#

I couldn't successfully load everything

fallen grove
glad wraith
#

Cube maps never worked

#

I selfishly encourage you to fork it, update it to v3, try to keep its workflow, since it's designed to be a modding utility as well

#

You can build bundles using it that depend on files in assets files

fallen grove
teal cipher
#

I think that's the part you would have to do

#

"update it to v3"

#

oh you mean the Asset Tools, of course

#
fallen grove
#

Thanks, just figured I'd nab the latest version as a basis.

fallen grove
teal cipher
#

yeah, that's what I would assume