How I Make My Mods / Plugins for Kerbal Space Program

Поділитися
Вставка
  • Опубліковано 7 лют 2025

КОМЕНТАРІ • 87

  • @Gameslinx
    @Gameslinx  4 роки тому +21

    Update: Added timestamps so you can quickly scrub to each relevant part of the video. The video should now be split up into chapters you can easily see. Enjoy!

  • @johiahdoesstuff1614
    @johiahdoesstuff1614 4 роки тому +59

    As someone who knows the basics of coding but not how to set up dependencies with outside programs, this was incredibly helpful.

    • @DS-tv2fi
      @DS-tv2fi 4 роки тому +2

      Johiah plays games I know a bit of java, but that’s it.

    • @jeffreywitty3088
      @jeffreywitty3088 4 роки тому +1

      1000% agreed! we need more, I'm adding them all to my wiki page for my mod (off forum so it cant "wipe")

  • @milkhbox
    @milkhbox 4 роки тому +38

    An EXCELLENT tutorial! Quick, concise, no unnecessary information, no screwing about. Any other UA-camr would've made this a 20 minute video detailing their goldfishes life story interspersed with little nuggets of actually useful information that are hard to pick out from the garbage. I've no intention of making my own plugins, but I've thoroughly enjoyed this tutorial. Thank you, sir!

    • @Gameslinx
      @Gameslinx  4 роки тому +12

      Thank you! I feel like some parts may go over a lot of heads for those who don't know how to program, but I decided not to explain everything because it just takes too long
      I think too many YTers try to explain how to code instead of what their code is actually doing (the how to code part has to be done by the viewer, the information doesn't need repeating!)
      Thanks dude o7

    • @milkhbox
      @milkhbox 4 роки тому +4

      @@Gameslinx I agree with that sentiment. If one doesn't already have the basics of coding down, then this isnt the first video one should be watching. I think you did a masterful job of providing all the relevant information without the over explanation that seems omnipresent in tutorials of this category.

  • @Gameslinx
    @Gameslinx  4 роки тому +27

    This video is for the people who requested it and hopefully for anyone new who wants to get into plugin / mod development for KSP :)
    Note: By no means am I any good at this, lol

    • @linuxuser1234
      @linuxuser1234 3 роки тому

      @Linx how do I make a orbital decay plugin where the orbit change a certain time

    • @thepenguinprolemonstealer2644
      @thepenguinprolemonstealer2644 2 роки тому

      are you kidding?! you're one of the best ones out there! Parallax is amazing

  • @epicfailtackular
    @epicfailtackular 4 роки тому +13

    think about how many mods you just enabled the creation of
    thank you my man

  • @cloverdove
    @cloverdove 4 роки тому +21

    This could actually be really useful for cinematics for when a ship explodes during reentry or an attack or something

  • @linecraftman3907
    @linecraftman3907 4 роки тому +12

    FINALLY A TUTORIAL FOR KSP PLUGINS

  • @TWGuardian
    @TWGuardian 4 роки тому +11

    Really well done. Very clear, concise and to-the-point. Few things that I want to point out though:
    1. It's generally good practice to use the 'sealed' keyword on classes that you know aren't going to be inherited further. Especially in the case of custom attributes, this gives some optimizations besides making your code more secure.
    2. The 'Update' method and all other built-in MonoBehaviour messages (such as OnValidate, Awake, Start, LateUpdate and FixedUpdate) are called regardless of accessibility. You can also mark it as private and it'll still work. In fact, you can label built-in message methods as 'protected virtual' or 'protected abstract' if you want to override them later, and it'll all work perfectly.
    3. You're currently creating a new instance of System.Random every frame, which will result in persistent memory pollution. In fact, the higher your framerate, the faster your memory will fill up. I recommend removing line 20 at 4:43, and instead, directly inside 'RandomPartExplosion', write:
    private static readonly System.Random rnd = new System.Random();
    Readonly is safe here because you aren't going to assign a new instance of System.Random. Static is also safe in this case because all instances of this script will use a random number generator with the same seed, so using 'static' means that the generator instance is shared between instances of 'RandomPartExplosion' instead of Unity having to create a new instance of System.Random every time it creates a new RandomPartExplosion instance.
    The benefit of using that static keyword is that the System.Random instance is created on game startup, otherwise it is re-created every time you enter the flight scene. It slightly lowers the amount of memory garbage generated by a scene switch whilst also lowering the amount of memory that is to be allocated when entering the flight scene.
    4. FlightGlobals might not be ready when Update first runs. So check if it is, and if not, abort the method early because otherwise there is no list of parts to refer to because the vessel isn't ready yet. This saves some NullReferenceExceptions. If you want to be particularly fancy, you can use this initialization to cache your reference to the active vessel, like so:
    private Vessel activeVessel = null;
    void Update()
    {
    if (activeVessel == null)
    {
    if (!FlightGlobals.ready)
    return;
    activeVessel = FlightGlobals.ActiveVessel;
    }
    }
    Creating this localized pointer also increases performance a bit.
    5. (key == true) and (key) are actually not identical. The former also includes a call to the boolean == operator without producing any different results. The latter option is simpler and saves a few CPU instructions. The compiler _might_ catch it, but it's probably best to play it safe.
    6. Don't forget to update Properties/AssemblyInfo.cs. KSP defines the 'KSPAssembly' attribute for this file. It makes it easier to detect and catalog KSP mod dll's by the game. Especially when combined with the other attribute, 'KSPAssemblyDependency'. KSPAssemblyDependency refers to the values of KSPAssembly to determine which dll's are dependencies of another dll, and so whether to skip loading a certain dll because its dependencies are missing, or whether to postpone loading a certain dll until its dependencies have been loaded.
    7. I need to update KS3P.

  • @Kadekuru
    @Kadekuru 4 роки тому +13

    Oh damn he actually made it

  • @enclave2k1
    @enclave2k1 4 роки тому +4

    Sup my dude. New sub, long time software engineer. Had I known it was this simple, I'd be doing this several years ago.
    Just wanted to say thanks, you inspired this dev to start modding.

  • @holoday2291
    @holoday2291 4 роки тому +3

    Thanks for making this! As a moderately experienced programmer, all I needed was a way into modding KSP. This plugin itself could even has use on my channel, where I make KSP cinematics. Keep this great content coming, I like your videos.

  • @MCNarret
    @MCNarret 4 роки тому +1

    This was amazingly helpful. I am just wrapping up a c# class, and this might be what will get me into mod making for ksp.

  • @EaglePancake
    @EaglePancake 4 роки тому +2

    I had no idea it was possible mod ksp using C#, that's awesome man ! I would really love to see more tutorials on other aspects like showing message boxes etc.

    • @EaglePancake
      @EaglePancake 4 роки тому

      @Not A offical gamer I've been using unity for 3+ years and have medicore C# experiece. I just didnt know it was possible to mod the game with C# using premade libraries :)

  • @justinv.1819
    @justinv.1819 4 роки тому

    I've been looking for a good intro to creating KSP plugins and this helped a great deal just to know where to start from and let google take it from there. Thanks a bunch for making this and look forward to seeing what else you put out on the subject!

  • @daskampffredchen
    @daskampffredchen 4 роки тому +1

    I would love to see some more videos on this.I always wanted to mod some games and KSP seems to be very accesable

  • @jaredw43
    @jaredw43 4 роки тому

    This is a really helpful guide to getting started, thank you so much for sharing!

  • @jeffreywitty3088
    @jeffreywitty3088 4 роки тому +1

    @Linx MORE PLEASE! lots, your one of the few making videos after the KSP v1.5 unity engine update! I'm @aazard on ksp forums, I make the humanStuff mod, a big part of that is teaching new users to start with head and suit textures and then skyboxes, finishing on making DLL's and such (I used your video to make my 1st DLL to add custom DSS load screens outside of typical user interaction.
    YOUR AWESOME, I can make object classes/dll's now!

  • @mrspliffie8906
    @mrspliffie8906 4 роки тому +2

    Underrated channel

  • @ZQMBGN
    @ZQMBGN 4 роки тому

    Thanks man, great tutorial, concise and precise

  • @sidspooki
    @sidspooki 2 роки тому

    Very helpful! Thanks for this.

  • @iantemones5865
    @iantemones5865 4 роки тому +1

    I dont know anything about coding but i think im gonna come back here when i know how to code

  • @ka-50withsaams36
    @ka-50withsaams36 4 роки тому +1

    Thank you. This is really informative.

  • @adgVelaepyaety
    @adgVelaepyaety 4 роки тому +4

    “Your first step is to open visual studio”
    *closes tab*

  • @crazydoodleman
    @crazydoodleman 4 роки тому +1

    Thank you for this.

  • @jessemclaughlan1425
    @jessemclaughlan1425 4 роки тому +3

    You are amazing Jesse_spaceman on Twitch.... it's the conoization Ship that goes to Rhode 😃😃😃😃

  • @sachinsolanki7329
    @sachinsolanki7329 4 роки тому +1

    Thanks for this

  • @BigGuyLev
    @BigGuyLev 4 роки тому

    Amazing! Thank you!

  • @scavorthespacecowboy2096
    @scavorthespacecowboy2096 4 роки тому +2

    Are you gonna make a new planet making tutorial? Just wanna know lol

  • @temitelko4413
    @temitelko4413 3 роки тому +2

    Can u make a tutoriell with kopernicus...

  • @annonymousrandomfum5880
    @annonymousrandomfum5880 10 місяців тому

    plz try to make a mod that make any said craft hover in place in atmosphere no matter the height above ground

  • @13_potatoes_why
    @13_potatoes_why 3 роки тому

    Please make a video on how to recompile source code of outdated mods.

  • @_mikolaj_
    @_mikolaj_ 4 роки тому +3

    You gave us too much power...
    Unlimited POWER....
    (Hmm, how about mod, that every 10s replaces your random part, to random part from part list. Probably impossibile, but lets try)

    • @Gameslinx
      @Gameslinx  4 роки тому +4

      I've thought about it, I might try it but there could be a whole bunch of problems if the part doesn't actually have nodes to connect to, too big, etc

    • @milkhbox
      @milkhbox 4 роки тому +4

      @@Gameslinx Those don't sound like problems, they sound like extra fun occurrences.

  • @Fellthrogures
    @Fellthrogures 9 місяців тому

    Noice. Shouldnt be TOO hard to learn

  • @randomkerbal
    @randomkerbal 4 роки тому

    Please make a tutorial on making part mods!

  • @MrMonkey3
    @MrMonkey3 11 місяців тому

    Could you do a tutorial how to place objects with a mod on planets i wanted to make a cool mod but cant find any help?

  • @le_zoink
    @le_zoink 4 роки тому +1

    i understood... maybe... the first 1:30? yeah, that sounds about right

  • @Anarchy_Venus
    @Anarchy_Venus Рік тому

    I can't open the create new project menu, I can't find it anywhere

  • @animationspace8550
    @animationspace8550 4 роки тому

    I know I'm a bit late and you might not see this, but if you do, do you mind explaining how to add in an animated model and put it in as a part (landing legs and robotics) please?

  • @mdalabs
    @mdalabs 4 роки тому +1

    rly useful lol

  • @Cramblit
    @Cramblit 4 роки тому

    "How to make mods in KSP"
    "It's complicated. The End"

  • @siriusk1453
    @siriusk1453 4 роки тому +1

    Does this type of program is needed for planet building?
    If so can you do a planet making tutorial?

    • @Gameslinx
      @Gameslinx  4 роки тому +1

      This doesn't apply to planet modding - You don't need to code for that

    • @siriusk1453
      @siriusk1453 4 роки тому +1

      @@Gameslinx Wha-

  • @linuxuser1234
    @linuxuser1234 4 роки тому

    how do I make a plug-in where there is a window with simple controls to change the kerbals camera position to move around in iva mod and also interact with hatches switches toggles etc computers

  • @dalnori_steam
    @dalnori_steam 6 місяців тому

    it worked but can you do a same video but how to make a visual mod, like the EVE or prallax, btw i have subscribed

  • @8_bit-dev293
    @8_bit-dev293 3 роки тому

    is there any where to do this on linux?
    edit:
    i got it to work with monodevelop but when i attempt to run the plugin it lags really bad. could there be any particular reason why?

  • @mdalabs
    @mdalabs 4 роки тому +1

    Could you make a tutorial for part modding?

    • @Gameslinx
      @Gameslinx  4 роки тому

      I don't do part modding, so it's a no from me!

  • @xzznnn845
    @xzznnn845 4 роки тому

    1:50-ish, im trying to make a visual mod, i dont know what to put in "startup."

    • @geostorm2860
      @geostorm2860 3 роки тому

      ik its been 8 months but visual mods usually aren't actual plugins, they're usually just configs for other mods such as Distant Object, Environmental Visual Enhancements, Scatter, Parallax, etc.

  • @anshifemaden2596
    @anshifemaden2596 4 роки тому

    Hey bro can you make mod for tweaking engine thrust

  • @zx.hash.r
    @zx.hash.r 3 роки тому

    is there any documentations?

  • @diablo.the.cheater
    @diablo.the.cheater 4 роки тому +5

    Libraries? ahhh yes.... enslaved code

    • @diablo.the.cheater
      @diablo.the.cheater 4 роки тому +3

      is there a documentation with all the methods and classes?

    • @Gameslinx
      @Gameslinx  4 роки тому +6

      The only documentation I could find is this: forum.kerbalspaceprogram.com/index.php?/topic/161054-official-api-documentation-ksp-191/

    • @diablo.the.cheater
      @diablo.the.cheater 4 роки тому +1

      @@Gameslinx Thanks.

  • @britishgreen6868
    @britishgreen6868 3 роки тому

    I dont see class library

  • @Booster_4
    @Booster_4 4 роки тому

    im trying to download it but I don't know what to choose for workloads

    • @daskampffredchen
      @daskampffredchen 4 роки тому

      Do you mean Visual Studio?
      If so you need the C#/Visual Basic and maybe the Unity (but I think the dependencies are enougth)

  • @krio1267
    @krio1267 4 роки тому +1

    Thonk

  • @viking_1880s
    @viking_1880s 2 роки тому

    Are u a game dev ?

  • @buder5116
    @buder5116 5 місяців тому

    why the needed stuff are outdated HUHHH

    • @Gameslinx
      @Gameslinx  5 місяців тому

      This isn't outdated, and still holds up now. Make sure you're using .NET 4.8 if Visual Studio mentions anything else

    • @buder5116
      @buder5116 5 місяців тому

      @@Gameslinx
      kinda but its still better than all i found
      most other tutorial i find are 11y and 6y old
      and you have to use VS 2022
      like what addon or workload i have to add ? i didn't know so i checked all box 40gb of stuff
      and i did use 4.8 since it refused to use the 4.7.2
      but i gave up trying to update that mod from that guy
      FullAutoStrut
      he has a infinite windows offset when you open the windows
      but since i can't make the github version to work i can't fix it
      and its not like i know what i am doing lol
      i'll have better luck making the whole mod from nothing with chatgpt

  • @dosluke
    @dosluke Рік тому

    oh no he did the if var == tru :/

  • @konona8982
    @konona8982 4 роки тому

    I hate visual studio...
    There should be designed tools to do mods.
    Recently I got over 9000 errors while trying to compile Juce.

  • @AstronomerKSP
    @AstronomerKSP 4 роки тому

    Thanks! Very fast talking omg lol

  • @solangerivera4846
    @solangerivera4846 4 роки тому +3

    I still didnt understand a word you said

    • @Gameslinx
      @Gameslinx  4 роки тому +3

      At least I wasn't speaking Minecraft enchanting table like some of the other tutorials out there haha

    • @astralnomad
      @astralnomad 4 роки тому

      @@Gameslinx thanks for the tutorial but can i make a suggestion? slow it down a bit... you went through it at like mach 20 with your hair on fire.. i had a hard time keeping up. lol
      On a side note: do we not need PartTools anymore? I see you referencing the KSP methods, but you didnt tell us if we needed to add PartTools for it? I assume its because you had it already installed from your previous explosion build if it does need to be used.

    • @Gameslinx
      @Gameslinx  4 роки тому +3

      Speedy tutorials are better than slow ones - cut to the chase, no bullshit, and it's much nicer to follow. You could play back at 50% speed or pause the video at any point!
      PartTools is for part modding I'm fairly sure. You use it in Unity when dealing with parts. I have never had to use it before

    • @daskampffredchen
      @daskampffredchen 4 роки тому

      @@astralnomad Then just pause from time to time.And if the video is so short its not so bad to watch it again

    • @PineCone227_
      @PineCone227_ 4 роки тому

      Yup. Im terrified of 8 hour long python tutorials. Its best when its as straight and fast as possible but also with enough explanations like demonstrated here.

  • @miguelsgamingch
    @miguelsgamingch 4 роки тому

    I Want To Make A Rocket Part In KSP, Not this useless plugin!

  • @epicplayz4858
    @epicplayz4858 2 роки тому

    I don't see class library