Jump to content

CrewFiles: persistence files for individual kerbals


Ippo

Recommended Posts

CrewFiles

An API to provide persistent storage for individual kerbonauts.

DOWNLOAD

From kerbalstuff, the kommunity repository

Source code

The docs are extremely lacking right now.

Sorry about that.

What is it?

CrewFiles is a tool intended for modders that allows your mod to store data separately for each kerbal. The system maintains a database of the known crew and allows you to associate ConfigNodes to each member that you can read and write at runtime.

Additionally, it provides a mechanism to generate or update data automatically.

This project is a spin-off of my main work on DangIt!, that will use this system to handle perks.

How to use

Include the CrewFilesInterface dll as a dependency in your project. In this class you will find a manager class that you can use to retrieve the current instance of the server, which you can use to access the file for each known crew member.

You can redistribute the whole mod alongside your mod: it is safe to have multiple copies of the dll in the GameData folder (but not advisable anyway).

Data generators

You can also have the data filled in and handled automatically for you by using classes defined with the appropriate interface.

You can create a Data Generator by defining a class that implements the ICrewDataGenerator: each time that the database is loaded / saved, the server will find your class and give it a chance to run and produce a ConfigNode to store.

See the included example generator that gives each kerbal his own tastes.

Edited by Ippo
Link to comment
Share on other sites

Thanks, I too hope that it can be useful to other modders :)

Also, if anyone plans to use this I suggest they follow the mod on kerbalstuff: you get an email notification when I release an update!

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...