Jump to content

UrlDir stuff, need help figuring it out.


Recommended Posts

Hey all,

I would like to know if anyone have any experience using the UrlDir class of KSP?

I am mainly looking to create/save/load config files from it to avoid having to reload all the database. (since PartLoader functions are privates)

Link to comment
Share on other sites

Well, they work. I use them in LoD to hide textures from GameDatabase so KSP doesn't [re]load them and as an way to find files in KSP in general, since those structure exist anyway. But its only an abstraction of the file system and to find configs its probably easier to use GameDatabase.Instance.GetConfigs("PART" / "INTERNAL"). To manipulate those abstraction just UrlDir.files / .children, but i wouldn't expect changes to automatically appear in GameDatabase...

Link to comment
Share on other sites

Thanks Faark (again).

I can save without problem without them, I would like to reload the config file I save to avoid reloading the all database. and so far I haven't found a way. Everything I need is in private (for the PartLoader), and I can't find any other way to add a config file to the database while the game is running.

Link to comment
Share on other sites

Doesn't seem possible to me. You might be able to add an AvailablePart you have created (or copied and modified) yourself to PartLoader.Instance.parts, but i don't even want to know what special cases like reloading the GameDatabase you have to consider...

Link to comment
Share on other sites

Still my welding tool, reloading the all database to load the config file I have welded bring lot of problem when used with lot of parts mods.

Also I am cnsidering linking the weld parts to the save file. and only load the config file I need considering of the saved file played (easier career management).

I do have a configNode that is clean and already in memory so maybe I can add that one to the PartLoader without reading the config file (for after the completion of the welding). I don't change any of the Part data anymore.

Edit: Humm let's add a question :)

What does KSP does to create an available part in the game?

I can get the config node, maybe I can manually create the part myself.

I guess it would be quite crazy to think of doing it, considering it could break for every update!

Edited by UbioZur
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...