Jump to content

part config file for basic part modding/creating?


Recommended Posts

Hi guys!

I would like to start trying to make my own basic parts for KSP. I know almost 0% of c# (I only started learning over the weekend). Is there a way to take preexisting part config files from a stock or mod part, copy them into a separate file, and edit them to match my part?

Link to comment
Share on other sites

There is no fixed method like a template where you fill in the numbers. Yes, adapting an existing file to a different model is the easiest way to get going.

Before you start creating new parts, most people learn the most from making a copy from a standard part and start editing values to see the behaviour. If you need some help, let me know.

Link to comment
Share on other sites

On ‎6‎/‎26‎/‎2017 at 10:37 AM, Azimech said:

There is no fixed method like a template where you fill in the numbers. Yes, adapting an existing file to a different model is the easiest way to get going.

Before you start creating new parts, most people learn the most from making a copy from a standard part and start editing values to see the behaviour. If you need some help, let me know.

I have edited the basic stock parts before. I would like to create a bunch of new mk2 and m1k parts for space use, like rovers, rockets etc.. (anything but planes really) what config files would be easiest to use to make a mk2 cockpit? It the first part I'm going to try and do (seems easiest).

Also, are there any specific programs needed for part making other then a program like MS word or notepad and KSP it self?

 

Thanks!

Link to comment
Share on other sites

I prefer Notepad++ for writing and editing config files and MM patches...

Forum users @genericeventhandler, Justin Kerbice, and dreadicon have all written custom KSP language files for NP++ (Pretty sure many others have made their own as well)... They allow you to spot errors and make it easier to follow proper syntax for cfgs and MM patches...

A few months ago, I updated and expanded one of the cfg languages... Still not complete, but available here:

https://drive.google.com/open?id=0B0D_PFGuuyqoTVZ5enVrZzRYMkk

 

 

Edited by Stone Blue
Link to comment
Share on other sites

Just realised I forgot a link for NotePad++ itself in my previous post... :P
https://notepad-plus-plus.org/

Notepad is a VERY basic text editor, and a Microsoft product.... Notepad++ is NOT a MS product, and has a lot more features... Not the least of which is support of tons of programming languages (inc. C++, C# and python, which are widely used to create KSP mods), as well as custom languages... So using those and the custom KSP language, it highlights proper syntax usage/errors, supports automatic word and function auto-completion for those languages, allows multiple document "tabs" in one program window, displays line numbers, displays matched bracket sets, has a customisable GUI, and just overall seems a bit more intuitive than basic MS Notepad or Wordpad... Plus, I hate the weird dbl-line spacing I cant seem to get rid of in Notepad and Wordpad...

Edited by Stone Blue
Link to comment
Share on other sites

19 hours ago, nascarlaser1 said:

what config files would be easiest to use to make a mk2 cockpit? It the first part I'm going to try and do (seems easiest).

An existing cockpit, obviously. :P Because if you want a part to be a cockpit, the config file needs to include at least a ModuleCommand { } subnode (and possibly a few other supporting ones). Which you can always add by hand, but if you copy an existing cockpit, it's already there.

Are you aware of how config files work under the hood in the first place, or do you need a crash course? It might help you understand what you're doing.

Link to comment
Share on other sites

11 hours ago, Streetwind said:

An existing cockpit, obviously. :P Because if you want a part to be a cockpit, the config file needs to include at least a ModuleCommand { } subnode (and possibly a few other supporting ones). Which you can always add by hand, but if you copy an existing cockpit, it's already there.

Are you aware of how config files work under the hood in the first place, or do you need a crash course? It might help you understand what you're doing.

I know a config file has a bunch of different settings that are like fill in the blank. The most I've done is give the swivel engine the same thrust as the mainsail engine.

Link to comment
Share on other sites

Here is a crash course.   

Spoiler

@PART[*]:HAS[#CrewCapacity>0]:HAS[!RESOURCE[Supplies]]:NEEDS[USILifeSupport]:FINAL
{
	RESOURCE
	{
		name = Supplies
		amount = 50 * $../CrewCapacity$
		maxAmount = 200 * $../CrewCapacity$
	}
}

 

@PART  -  Edit a part

@PART[*]  - Edit all parts

:HAS     Edit parts that have. 

:HAS[#CrewCapacity>0]   -   edit parts that have a variable(#) CrewCapacity  greater than 0

:HAS[!RESOURCE[Supplies]]  - but I don't want (!) parts that have resources called supplies. 

:NEEDS[UsiLifeSupport]   -  Only do this if you have UsiLifeSupport installed. 

:Final  -  Do this after every other patch has been applied, because I am special and I do special things.  

RESOURCE  --  Lets add a resource

name = Supplies   - we want to add the resource Supplies. 

amount = 50 * $../CrewCapacity$   -   I want the amount of supplies to equal 50 * the amount of the variable found one step back from here ( .. ) called CrewCapacity

maxAmount = 200 * $../CrewCapacity$   -  make the max amount equal to 200 supplies per crew member, just incase I am doing a long endurance mission. 

 

hth

GEH

 

 

 

 

 

 

Link to comment
Share on other sites

6 hours ago, nascarlaser1 said:

I know a config file has a bunch of different settings that are like fill in the blank. The most I've done is give the swivel engine the same thrust as the mainsail engine.

Kinda outdated last time I referenced it, but still very useful and relevant, and in your case, I'd say a MUST read... :)

http://wiki.kerbalspaceprogram.com/wiki/CFG_File_Documentation

Link to comment
Share on other sites

On 6/28/2017 at 0:46 PM, TheRagingIrishman said:

I always use atom (https://atom.io/). It's basically Notepad++ but it works on mac and linux (I mod on a mac).

Someone wrote a ksp language for it as well, you can find it by searching Kerbal in atom's built in package manager. 

This one?
 

 

Link to comment
Share on other sites

Spoiler

PART
{
 name = mk2.1LanderCabin
 module = Part
 author = Nascarlaser's space shop
 mesh = model.mu
 scale = 1
 rescaleFactor = 1
 node_stack_bottom = 0.0, -0.4035744, 0.0, 0.0, -1.0, 0.0, 2
 node_stack_top = 0.0, 0.7519293, 0.0, 0.0, 1.0, 0.0, 2
 TechRequired = commandModules
 entryCost = 8800
 cost = 3850
 category = Pods
 subcategory = 0
 title = Mk2.1 Lander Can
 manufacturer = Nascarlaser's space shop
 description = This cozy capsule seats three, and is very lightweight. However, don't expect it to survive atmospheric entry or even a sneeze.
 attachRules = 1,0,1,1,0
 mass = 3
 dragModelType = default
 maximum_drag = 0.20
 minimum_drag = 0.15
 angularDrag = 2
 crashTolerance = 16
 maxTemp = 1400
 skinMaxTemp = 2000
 vesselType = Lander
 CrewCapacity = 3
 bulkheadProfiles = size2
 tags = capsule cmg command control ?eva fly gyro ?iva moment pilot pod react rocket space stab steer torque
 INTERNAL
 {
  name = landerCabinInternals
 }
 MODULE
 {
  name = ModuleCommand
  minimumCrew = 1
 }
 Module
 {
 name = KASModuleContainer
 }

 RESOURCE
 {
  name = ElectricCharge
  amount = 150
  maxAmount = 150
 }
 MODULE
 {
  name = ModuleReactionWheel
  PitchTorque = 20
  YawTorque = 20
  RollTorque = 20
  RESOURCE
  {
   name = ElectricCharge
   rate = 1
  }
 }
 MODULE
 {
  name = ModuleColorChanger
  shaderProperty = _EmissiveColor
  animRate = 0.8
  animState = false
  useRate = true
  toggleInEditor = true
  toggleInFlight = true
  toggleInFlight = true
  unfocusedRange = 5
  toggleName = Toggle Lights
  eventOnName = Lights On
  eventOffName = Lights Off
  toggleAction = True
  defaultActionGroup = Light
  redCurve
  {
   key = 0 0 0 3
   key = 1 1 0 0
  }
  greenCurve
  {
   key = 0 0 0 1
   key = 1 1 1 0
  }
  blueCurve
  {
   key = 0 0 0 0
   key = 1 0.7 1.5 0
  }
  alphaCurve
  {
   key = 0 1
  }
 }
 MODULE
 {
  name = ModuleScienceExperiment
  experimentID = crewReport
  experimentActionName = Crew Report
  resetActionName = Discard Crew Report
  reviewActionName = Review Report
  useStaging = False
  useActionGroups = True
  hideUIwhenUnavailable = True
  rerunnable = True
  xmitDataScalar = 1.0
  usageReqMaskInternal = 5
  usageReqMaskExternal = -1
 }
 MODULE
 {
  name = ModuleScienceContainer
  reviewActionName = Review Stored Data
  storeActionName = Store Experiments
  evaOnlyStorage = True
  storageRange = 2.0
 }
 RESOURCE
 {
  name = MonoPropellant
  amount = 50
  maxAmount = 50
 }
 MODULE
 {
  name = FlagDecal
  textureQuadName = flagTransform
 }
 
 MODULE
 {
  name = ModuleDataTransmitter
  antennaType = INTERNAL
  packetInterval = 1.0
  packetSize = 2
  packetResourceCost = 12.0
  requiredResource = ElectricCharge
  antennaPower = 6000
  optimumRange = 3000
  packetFloor = .1
  packetCeiling = 5
 }
 
 MODULE
 {
  name = ModuleProbeControlPoint
  minimumCrew = 2
  multiHop = False
 }
}

Hi guys! Finally got around to making my config file (in spoiler above. BE AWARE OF HUGE AMOUNT OF TEXT). Can someone check it over to make sure I didn't screw up anything? My current goal is to make a mk2 lander can that can hold 3 people and as such has proper mass, cost, etc. Any suggestions on how to make my part more balanced is welcomed and appreciated!

Link to comment
Share on other sites

22 minutes ago, TheRagingIrishman said:

@nascarlaser1 one thing to keep in mind is that if you use the landercan internal, only 2 of the 3 crew will show up in the row of kerbals in the bottom right corner when in flight view 

I know. I have 0 knowledge about online drawing (I can barely draw on paper lol).

Edited by nascarlaser1
Link to comment
Share on other sites

45 minutes ago, genericeventhandler said:

 Module
 {
 name = KASModuleContainer
 }

Check the syntax on this, I have never seen KASModuleContainer as a module 

I got this one off the wiki. I think its the module needed to make my command pod have access to the different inventory spots from KAS and KIS.

http://wiki.kerbalspaceprogram.com/wiki/CFG_File_Documentation

Link to comment
Share on other sites

11 minutes ago, nascarlaser1 said:

I got this one off the wiki. I think its the module needed to make my command pod have access to the different inventory spots from KAS and KIS.

http://wiki.kerbalspaceprogram.com/wiki/CFG_File_Documentation

Ok, cool, every day should be a learning experience, Sunday I learnt how to do internal KIS access!

 

Link to comment
Share on other sites

  • 3 weeks later...

One thing to remember, is that if a person gets this but doesnt have KIS/KAS installed, the part wont show up due to the error of the module not existing. 

Write the config for the stock game, and then use MM to add the kis module in if kis is installed. 

Link to comment
Share on other sites

3 hours ago, Benjamin Kerman said:

One thing to remember, is that if a person gets this but doesnt have KIS/KAS installed, the part wont show up due to the error of the module not existing. 

Write the config for the stock game, and then use MM to add the kis module in if kis is installed. 

oohhh ok thxs.

uuhh...1 question... how do I write a MM patch? I am an utter noob at this.... :blush:

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