Jump to content

Starting my First Mod - Fuel Adjust


Ashtoruin

Recommended Posts

Okay, so more or less I really like Talisar's Spherical Tanks mod and I'm getting slightly annoyed with the 50 tanks I have to sort through to find the one I'm looking for. Now being a Computer Science Major I figured I might as well use my skills as a programmer for the powers of evil... erm, I mean good.

So, Basically what I'm going to do first is create a GUI that you can use in the VAB/SPH to edit the % of fuel in a tank. Which to do this I'd really rather not edit each .cfg so Instead I need to figure out a way to force my PartModule onto every Part that contains any type of fuel.

After I get that working I Want to be able to edit the type of fuel in a tank Via Toggles used to determine what mods are installed ie will offer kethane support if kethane is installed, otherwise you wont see the kethane button.

So I see that there is

Part.AddModule(System.String)

but it says

Add a PartModule to this part. PartModules that are dynamically added to parts and don't exist in the original

part.cfg will not be properly restored from persistence.

So is this saying that I need to write an OnSave and OnLoad method for handling the addition of my module parts that do not include it in the CFG?

Thoughts?

Link to comment
Share on other sites

Kinda seems like thats what its saying...but dont get me fillin your head with lies...i am about the furthest thing from a programer there is.

You should, however, look at ModuleManager mod, it adds part modules to configs without actually editing the parts config. It already does the backend work your talking about...would leave only the fuel system/gui to make.

Havent seen the thread for awhile...if I find it I will throw a link your way...otherwise its in 'addon release & showcase' forum.

http://forum.kerbalspaceprogram.com/threads/31342-0-20-ModuleManager-1-3-for-all-your-stock-modding-needs

Edited by KhaosCorp
Link to comment
Share on other sites

Kinda seems like thats what its saying...but dont get me fillin your head with lies...i am about the furthest thing from a programer there is.

You should, however, look at ModuleManager mod, it adds part modules to configs without actually editing the parts config. It already does the backend work your talking about...would leave only the fuel system/gui to make.

Havent seen the thread for awhile...if I find it I will throw a link your way...otherwise its in 'addon release & showcase' forum.

Please do, I would kind of like to do the work myself, but as its my first mod and C# is somewhat of a new language to me, seeing how someone else did it would be SUPER Helpful.

EDIT: Found it http://forum.kerbalspaceprogram.com/threads/31342-0-20-ModuleManager-1-3-for-all-your-stock-modding-needs?highlight=ModuleManager

Edited by Ashtoruin
Link to comment
Share on other sites

And absolutely no harm in there being two mods for everything. 0.22 is coming up at some point but Ialdaboth* has scarcely been seen all summer; Life happens, can't blame him, but a lot of people use his mod so if 0.22 breaks it, it'll be great to have another.

Link to comment
Share on other sites

And absolutely no harm in there being two mods for everything. 0.22 is coming up at some point but Ialdaboth* has scarcely been seen all summer; Life happens, can't blame him, but a lot of people use his mod so if 0.22 breaks it, it'll be great to have another.

True, Though I have his mod installed and nothing comes up, is there a hotkey to activate the GUI?

Link to comment
Share on other sites

And absolutely no harm in there being two mods for everything. 0.22 is coming up at some point but Ialdaboth* has scarcely been seen all summer; Life happens, can't blame him, but a lot of people use his mod so if 0.22 breaks it, it'll be great to have another.

THIS for sure! But also no harm in a bit of variety imo. Sure there is already 100 mods out there for just about everything...but its the little things that make a good mod great, and those little things often come down to personal taste on the players end. The more variants of the same functionality there are the more likely it is that people find just what their looking for. Different developers will approach things just a wee bit different after all, even if the end results are somewhat the same.

Also Id imagine that changing textures on the tanks based on contents should totally be possible, the only thing youd have to be careful of is how many textures your including to accomodate this change...textures are about the biggest drain in KSP atm as far as resource usage goes.

Link to comment
Share on other sites

Also Id imagine that changing textures on the tanks based on contents should totally be possible, the only thing youd have to be careful of is how many textures your including to accomodate this change...textures are about the biggest drain in KSP atm as far as resource usage goes.

Well, I was thinking about maybe adding a colored band to the tank based on the Fuel Type in the tank, but it would depend on how hard/easy that is to implement.

Also, is there a way to reload .dlls or do I really have to restart KSP every time I want to see if it works >.>

Link to comment
Share on other sites

You can look in Firespitter or StretchyTanks for how you can do texture changes on the fly.

Dunno about reloading DLLs though.

Yeah, you have to reload KSP... Blarg... And Gah, I have to learn so much stuff for this, its like a College Class, Except I don't get Credit for it. But I guess I am at least learning useful stuff.

Link to comment
Share on other sites

  • 2 weeks later...
Yeah, you have to reload KSP... Blarg... And Gah, I have to learn so much stuff for this, its like a College Class, Except I don't get Credit for it. But I guess I am at least learning useful stuff.

Consider this:

at 1 month you learn to see.

at 2 months you learn to move your head.

at 3 months you learn to notice sound and you move your head towards sounds...

by 12 months, you have mastered your head, torso, legs, hands, fingers, arms, and balance, to the point the you have gone from not seeing to walking. You also have figured out the concept of speech by this time as well... that was a massive amount of learning in 1 year.

You have been learning all your life... might want to embrace it :)

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