Kerbalism icon indicating copy to clipboard operation
Kerbalism copied to clipboard

Changes to implement a Profile importing scheme

Open PiezPiedPy opened this issue 7 years ago • 2 comments

Changes to implement a Profile importing scheme

I needed a way to import processes for my personal changes and came up with some small code changes that enable Profiles that are stored in any config file to be imported into the loaded profile, this also allows modders to include their own Supplies, Rules or Processes and not have to edit the default profile.

The code also checks a field supplied in the imported profile to determine if the profile should be imported or not. This mechanism works by searching the GameData directory for a matching directory that is named in the moddir field of the profile.

Using

Simply create a Profile node named KerbalismSupport and include the necessary script to define the Supplies, Rules and Processes you need, as you would with the default profile. The KerbalismSupport profile node must have a modname field which is used for logging and a moddir field which is used to decide if a mods support profile should be loaded.

Profile
{
	name = KerbalismSupport    // name must be KerbalismSupport
	modname = FooBar Zoo       // Just a name for display purposes
	moddir = FooBar/Zoo           // Could use Zoo if you wish

	Supply
	{
    etc...

Example: FooBarZoo.cfg

see the commits here Profile-Import-Test. If you have any suggestions fire away, code is ready for a Pull ;)

PiezPiedPy avatar Apr 20 '17 13:04 PiezPiedPy

I am interested, but for now let's keep this on hold because the rule system is going to change in the near future. In particular I'm going to lift the MM patching limitation that currently exist for profiles. So that what you propose may be implemented purely as MM patches creating or editing new rules.

ShotgunNinja avatar Apr 26 '17 01:04 ShotgunNinja

I saw you where up to something from reading some of the other posts, so decided on putting up an issue rather than a PR.

PiezPiedPy avatar Apr 26 '17 02:04 PiezPiedPy