Jump to content

How do you make Kerbals run faster in a plugin?


Recommended Posts

Hello,

I am writing a plugin for KSP, and I am trying to figure out how to make the kerbals run faster. This is the current code I have so far:

ConfigNode newKerbal = ConfigNode.CreateConfigFromObject(parts);
newKerbal.GetNode("PART").GetNode("MODULE").SetValue("walkSpeed", 3.0, false);
ConfigNode.LoadObjectFromConfig(parts, newKerbal);

 

Basically, I tried to edit the config file for a kerbal and load in the kerbal using the new config file, but this didn't work. Does anybody have ideas on how to fix this problem? There might be a way to do this without editing config files, I just haven't found one yet.

I don't know if this information is useful or not, but I am using Microsoft Visual Studio to write this plugin, and I am using a bunch of dll files from KerbalSpaceProgram/KSP_x64_data/Managed as references.

Link to comment
Share on other sites

You don’t need a plugin to do this, it should be possible with a ModuleManager patch (which is a .cfg file). That would look something like this:

@PART[KerbalEVA*]:AFTER[Squad]

{

@MODULE[*whatever the MODULE is called, I can’t check right now but it’ll be in every KerbalEVA part file]

{

@walkSpeed = 3

}

}

Though with a walk speed of 3m/s they’ll look more like they’re skating across the surface than walking.

 

Link to comment
Share on other sites

9 hours ago, jimmymcgoochie said:

You don’t need a plugin to do this, it should be possible with a ModuleManager patch (which is a .cfg file). That would look something like this:

@PART[KerbalEVA*]:AFTER[Squad]

{

@MODULE[*whatever the MODULE is called, I can’t check right now but it’ll be in every KerbalEVA part file]

{

@walkSpeed = 3

}

}

Though with a walk speed of 3m/s they’ll look more like they’re skating across the surface than walking.

 

Awesome, thanks! Do you know how to write/edit this module manager patch through a plugin? I want to be able to adjust their walk speed in game.

Link to comment
Share on other sites

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