Jump to content

Making custom colored suits with Kerbal Space Program 1.12: "On Final Approach”


UomoCapra

Recommended Posts

Hi everyone,

I hope you are all enjoying our latest release KSP 1.12: On Final Approach!

As all other suits in the game, you can also design your own custom color schemes for the new Slim Suit!

Last year, @Just Jim created a detailed guide that shows you the steps you need to take in order to achieve this, which we highly recommend you to check out!
 

On 7/2/2020 at 7:46 PM, Just Jim said:

Hi everyone. We hope you all are enjoying KSP 1.10: "Shared Horizons”.

We wanted to take a minute and point out something you all might not be aware of yet, but we here think you're going to really like.
Not only do we have the new Suit Picker in 1.10, it is very easy now to make your own custom colored suits!!!

 

screenshot002.png

 

screenshot001.png


screenshot003.png

 

So here are the complete instructions. You will find the link to download the blank texture files at the bottom of this post.

 

The Suit Picker

It is a tool introduced in KSP 1.10 Update, designed to let players choose among the available suits and colors for EVA.
si0OYeZypwmtZVFQTLLespljSKxVPbsYW3fYrXrI

The Materials

Attached you will find the following (link to attachment below):

A UV Map file that lets you identify the wireframe of the model of the character.

84njQX9_LyLHmE6lG11Hn9JjuPVXotCwd5HwGnlbafHHM4OpWOUoqd7S4cxDw7UifRN-j3BFYGOIq5H7

 

And an ID Map so it is easier to select colors and create combinations.

SGp5hI7uyIRY3YR_N2xo0Y7opz1iux_03nd-TJWlrbMF_zQPKUkhbCS_woWHlSANBAtTT8zXKsIROiSC

Adding Customized Suits - Instructions

In order to add a new suit variant the player has to create a folder called Suits inside the GameData/Squad folder.

Inside Suits, other three folders called Config, Icons and Textures.


DkrL97xOWmLnPf1wU60SpTY1_dQssIneR5yMam1v

Then in the Config folder we need to create a .cfg file called SUITCOMBOS with the following properties:

  • DisplayName: The name of the variant shown at the suit title in the suit picker window.
  • SuitType: The suit type the variant belongs to; Default, Vintage (Making History) or Future (Breaking Ground)
  • Gender: The gender this variant belongs to; Male or Female
  • Name: A unique string to identify the suit combo, example CustomSuit1
  • Suit Texture: The path where the custom suit texture is (Textures folder).
  • Sprite: The path where the texture variant icon is (Icons folder).
  • Primary Color: The primary color used in the texture variant button, in hexadecimal.
  • Secondary Color: The secondary color used in the texture variant button, in hexadecimal.

 

Example:














SUITCOMBOS
{   
    SUITCOMBO
    {
        displayName = Custom Suit 1
        suitType = Future
        gender = Male
        name = CustomSuit1
        suitTexture = Squad/Suits/Textures/futureSuit_diffuse_redBlue
        sprite = Squad/Suits/Icons/kerbalicon_suit_future
        primaryColor = #012957
        secondaryColor = #b3313a
 	}
}

 

To add more variants there’s no need to create multiple files, adding a new “SUITCOMBO“ block in the cfg like the one above is enough.

 

PNG or DDS:

EnTaKnSZQ0wSIeaHULLrNMctZ1e-Qkg_OC9lT_tU

PNG or DDS file formats have a different orientation in the game, if you notice your texture isn’t displaying in a correct way it may be missing a vertical flip.

 

ICON:

E2vY9_JiHRpxXqEpgFeehYB7DlRbFKcaZv_A5ezM

Icons should be added to the “Icon” folder. It should be a small image only 33 pixels width 54 pixels height, preferably with transparency.

VEalo6QoQF2LV-Qeocxf3L6TlcF6OMC9ntw8pw9y

Make sure to add the texture and icon files in their respective folders: Icon and Textures. And more importantly; have fun!

 

BIjKvtgQqHgLv9Evvv-2cMleCMJ-CjQQgoskc99Y

 

Here is the link to the map files you can use.

 

This is quickly becoming one of my favorite features in 1.10, and all of us here really look forward to seeing what you come up with.

To help you out with the new suit, we wanted to share the following with you:

 

  • A UV Map file that lets you identify the wireframe of the model of the character.

ksp_1-12_suit_uvmap.gif
ksp_slimsuit_uv_map.png

  • And the an ID Map so it is easier to select colors and create combinations.

 

ksp_1-12_suit_idmap.gifksp_1-12_suit_idmap.png

You can download the map files within the attached zip file below!
ksp 1-12 suit idmap uvmap.zip
 

If you are interested in modding you can check the Modders Notes of 1.12.0 for useful information, as well as the latest PartTools package for modders:

On 6/28/2021 at 7:35 AM, JPLRepo said:

Modders Notes the Dev team have thrown together for 1.12.0.

 We upgraded the project to Unity 2019.4.18f1 LTS to position KSP on a long term support version of Unity. This should not have any major impact on mods.

API documentation can be found here.

 

Wheels and Landing Legs changes
ModuleWheelBase.useNewFrictionModel by default is false. Which means all wheels and landing legs using this module will use the old behaviour/logic by default. Set it to true in the part.cfg file to use the new friction model.

ModuleWheelSuspension.useDistributedMass by default is false. Which means all wheels and landing legs using this module will use the old behaviour/logic by default for suspension processing. Set it to true in the part.cfg file to use the new friction model.

ModuleWheelSteering.autoSteeringAdjust by default is false. Which means all wheels and landing legs using this module will use the old behaviour/logic by default for steering processing. Set it to true in the part.cfg file to use the new friction model.

 Refer to the Wheels Devblog for more information about the functional changes that were made to wheels and landing legs. 

 

 Maneuver Tool
The maneuver tool app has been designed in such a way to allow modders to easily add additional maneuver types to the app.

To do this you will need to create your own mod c# class that inherits class 

TransferTypeBase - Base class for the transfer types.

The Manuever Tool app on startup finds all classes based on this base class and adds them into it’s maneuver type list. Refer to the API documentation for the abstract methods your class has to implement.

Additionally you must implement your own data class for your transfer type. Use this class as the base and assign to currentSelectedTransfer: 

  • TransferDataBase - Base class for the TransferData for each transfer type. This class inherits AppUI_Data class that allows you to define UI fields for your transfer that will appear in the center part of the manuever tool UI. See the section below called “Generic UI framework” on how to define your UI fields.  You will also want to assign your dataChangedCAllback and calculationStateChangedCallback.

Additionally you can use the following base class to define your own data class for the top slide out section of the maneuver tool app: 

  • TransferDataTopDataBase - Base class for the TransferDataTop for each transfer type. This class also inherits from AppUI_Data class.

Another important class is ManeuverToolUIFrame. This manages the UI for the Manuever Tool App and has a number of useful methods. Refer to the API documentation.

  

AlarmClock App
The Alarm Clock follows a similar idea to most moddable things in KSP. The fundamental building blocks are:

  • AlarmClockScenario: The scenario module that runs and manages the alarms
  • AlarmTypeBase: The abstract class that all alarm types inherit from

I won’t go into all the specifics here as the API help should cover many of these things, but here’s some key pointers.

The scenario maintains the list of alarms and persists them into the save file. AddAlarm, RemoveAlarm, GetNextAlarm, etc help you manage the alarm list.There are GameEvents for changes to the list as well. 

There is currently no “GetAllAlarms” method - Triggers apologies - this will be fixed

You define the input fields you want by attributing fields or properties with AppUI_Control types. These fields/properties can then be used in the AlarmType class to define the time for the alarm and any other behaviour. An example here is AppUI_InputDateTime which will give you a datetime input when creating/editing an alarm.

 Some key fields/overrides in the alarm type include:

  • id - the persistent identifier for an alarm
  • GetDefaultTitle() - the string that will be the title of a new alarm
  • iconURL - a gamedatabase path to the icon to use in the drop downs and lists - the default ones are 64x64 pngs
  • ut - the time of the alarm in universal time
  • RequiresVessel() - when true the alarm will only be available in the UI to add when a vessel can be selected
  • CanSetAlarm(AlarmUIDisplayMode displayMode) - lets you control when the inputs are valid in add and edit mode to save changes
  • OnInputPanelUpdate(AlarmUIDisplayMode displayMode) - called in the Monobehavior update loop by the app for each alarm when it is displayed in the app
  • OnScenarioUpdate - called in the Monobehavior update loop by the scenario when the alarm is in the list.

 Here’s an example of a very simple alarm type that will let you set a date




public class AlarmTypeTest : AlarmTypeBase
{
    [AppUI_InputDateTime(guiName = "Alarm Date", datetimeMode = AppUIMemberDateTime.DateTimeModes.date)]
    public double alarmDate;
    public AlarmTypeTest()
    {
        iconURL = "TriggerTech/TestMod/AlarmIcons/DavesTest";
    }

    public override bool CanSetAlarm(AlarmUIDisplayMode displayMode)
    {
        return true;
    }

    public override string GetDefaultTitle()
    {
        return "Daves Test Alarm";
    }

    public override bool RequiresVessel()
    {
        return false;
    }

    public override void OnUIEndInitialization(AlarmUIDisplayMode displayMode)
    {
        if(displayMode == AlarmUIDisplayMode.Add)
        {
            alarmDate = Planetarium.GetUniversalTime() + 600;
        }
        AppUIMemberDateTime m = (AppUIMemberDateTime)uiPanel.GetControl("alarmDate");
        m.DatetimeMode = AppUIMemberDateTime.DateTimeModes.date;
    }

    public override void OnInputPanelUpdate(AlarmUIDisplayMode displayMode)
    {
        ut = alarmDate;
    }
}


Generic UI framework
The key driver for this system is the idea of moddable inputs to applications for various moddable functions. The fundamental idea being that in a UI you can place a panel that has a vertical layout group and an AppUIPanel component, call Setup with a data class and it will present the user with an editable section of UI that correlates to the data inputs. It edits the data class and the code can then use the edited object directly.

Steps to use it:

  1. Create a “panel” in your UI that will hold the input fields.
  2. Create a class that holds the inputs (inherits class AppUI_Data).
  3. Apply the attributes to the fields that are for input within the class.
  4. “Setup” the panel at the right time in code.

Classes of interest
AppUI_Data - this is your data class which can use attributes on fields to create UI controls.

 The following UI controls can be used as attributes on your fields in your AppUI_Data class.:

  • AppUIMemberDataTime
  • AppUIMemberDropdown
  • AppUIMemberDropdownMultiLine
  • AppUIMemberHeading
  • AppUIMemberInput
  • AppUIMemberInputFloat
  • AppUIMemberLabel
  • AppUIMemberLabelList
  • AppUIMemberRadioBool
  • AppUIMmeberSliderFloat
  • AppUIMemberSliderFloatMultiLine
  • AppuiMemberToggleBool


File Folder Browser
Craft files are still stored as text in .craft files. The thumbnail naming convention has changed, but otherwise the thumbnail itself is generated no differently.

The search classes don’t have any exposed methods that can be used to actually do anything aside from literally starting and stopping a search using whatever information is in the search input text field.

The folder-action confirmation dialog for deleting and creating folders can be created and passed callbacks that are fired when the indicated action is confirmed.

The folder browser doesn’t use any config files that could be modified. Public methods and properties include querying if the currently selected folder is a player-craft or stock-craft folder, and querying if the currently displayed folder structure is for the VAB or SPH. Folder highlighting can be overridden using a craft’s file-path, and folder highlight overrides can also be turned off. Also exposed is a method for updating folder file-counts for all folders as well as for a specific folder.

Properties are exposed that return the local machine’s file path for the stock craft folder, the expansion directory folders, and the mission craft folders

 
Lights
We added the ability to disable and enable the Color Picker of the lights - use the KSPField disableColorPicker in the part.cfg file.

Also if one light has more than one transform you can control it with the same Module light. You can do this by defining one or more LIGHT submodes within the ModuleLight node in your part.cfg file. Eg:




MODULE
{
    name = ModuleLight
    …. (normal ModuleLight fields)

    LIGHT
    {
        lightName = light1
        lightR = 1.0
        lightG = 1.0
        lightB = 1.0
        flareRendererName = flare1
    }
    LIGHT
    {
        lightName = light2
        lightR = 1.0
        lightG = 1.0
        lightB = 1.0
        flareRendererName = flare2
    }
}

 

 

Docking Port rotations.
Docking port parts are now able to do an alignment rotation once they are docked. In order to make a dock being able to rotate, you need to configure them so:

  • canRotate: set to True, when this rotating feature should be available to this part
  • rotationTransformName: Name of the transform of the model that will rotate.
  • maxMotorOutput: this is used for the electric charge resource consumption calculations. set this according to the part’s design guidelines
  • RESOURCE definition: this one should be the same for all docking ports that use this rotating feature. This is used to specify which resource is consumed by doing the rotation

These other KSPFields are optionally available to configure as well:

  • rotationAxis: The rotation axis, defaulted to the z axis. This is necessary as some docks might have a different rotation axis. Can be "X", "X-", "Y", "Y-" or "Z", "Z-"
  • traverseVelocity: The traverse speed (in deg/s for rotational motion)
  • hardMinMaxLimits: The angle range that's defined by the physical limits of the part model and/or the part's designer. The default values are -15, 15. A player must not be able to set an angle beyond this range. This is a Vector2 so, could be defined as “-15, 15“, for example.
  • efficiency: Servo efficiency (1 = 100%)
  • baseResourceConsumptionRate: Base resource consumption on motor output when the servo is moving
  • referenceConsumptionVelocity: The transform velocity (angular or positional) at which the resource consumption is 1 x the baseResourceConsumptionRate

 

New Slim Suit ID Maps

 

ksp_1-12_suit_idmap.gifksp_1-12_suit_uvmap.gif

 

ksp_slimsuit_uv_map.zip 859.5 kB · 4 downloads

ksp_1-12_suit_idmap.zip 454.11 kB · 2 downloads

Other misc modding changes

  • Failed reflection calls to incompatible or otherwise invalid mods are now handled, so they don't stop the game from loading.
  • Custom suits now show the corresponding icon in all relevant screens. These have to be provided by the mod, the game will not generate them.
  • Added an additional useCustomThreshold field to ModuleOrbitalSurveyor. Setting it to true will allow the module to recalculate the minimum and maximum altitudes beyond the stock values.
  • When multiple versions of the same assembly are present, KSP now makes sure only the most recent one is loaded. It’s still a good idea to encourage people not to do this, to avoid clutter.
  • Tuned the logic to calculate space object resource percentages based on the lowRange and highRange values, preventing space objects from always having > 80% resources regardless of the range values.
  • Added a GameEvent for revert to launch that returns the current FlightState.

 

 

On 5/11/2017 at 8:30 AM, JPLRepo said:

The PartTools package is a set of utilities provided by Squad to be used by modders to:-

  • Create their own 3D models and parts in KSP.
  • Create KSPedia pages for their mods.
  • Create Internal 3D models for their parts in KSP.

PartTools also includes the coloranimation tool and the KSPAssetCompiler tool (for compiling asset bundles).


PartTools have been updated and re-compiled for Unity 2019.4.18f1 for KSP 1.12+ to include all of these tools in one unity asset bundle.
Current latest version is here

PartTools_AssetBundles_2019.4.18f1.zip 1.3 MB · 3 downloads


To install Follow these Instructions:

  • Download Unity 2019.4.18f1 and run it. Then open your Mod project, upgrade it to Unity 2019.4.18f1.
  • Uninstall the built-in Unity TMPro package from Unity 2019.4.18f1 - Go to Window - Package Manager in Unity and Select TMPro and uninstall it.
  • Download this exact file "TextMesh Pro Release 1.0.56 - Unity 2017.3 " from https://forum.unity.com/threads/useful-information-download-links.458634/#post-3304434 and import it into your Mod project in Unity using Assets - Import Package, Custom Package menu option.
  • Import the custom bundle in the zip file above into your Unity project.
  • Disable "Validate References" for the KSPAssedCompiler.dll and KSPAssets.dll in the "Assets/Plugins/KSPAssets" folder.
  • Restart Unity and reopen your mod project.
  • That's ALL you have to do.

For information about how to build and use fonts for Localization please refer to this link.

Previous Versions:

For the old Unity 2019.2.2f1 PartTools use this file:

PartTools_AssetBundles_2019.2.2f1.zip 1.29 MB · 2 downloads

For the old Unity 2017 PartTools you can use this file:

PartTools_AssetBundles_2017.zip 1.28 MB · 2 downloads

 

 

Have fun and happy launchings!

 

 

Link to comment
Share on other sites

@UomoCapra At the time of posting this, I am also seeing the same thing the Doodling Astronaut reported. When the ZIP file link is click  it links to a page that says “This attachment is not available. It may have been removed or the person who shared it may not have permission to share it to this location.”  Just want to let you know. By the way thank you for posting this information about modding the slim suits.

Edited by Sivako Aerospace
Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...
  • 3 months later...
On 6/29/2021 at 5:49 AM, UomoCapra said:

It should be working now, let us know if you experience more issues ;p

That zip file is still not available.

Quote

Oops!

This attachment is not available. It may have been removed or the person who shared it may not have permission to share it to this location.

 

Link to comment
Share on other sites

  • 2 weeks later...
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...