Jump to content

[0.25] Tweakable Wheels (Adjustable Brakes, Steering, and Torque for Wheels!)


OrbitusII

Recommended Posts

Ever wanted more control over Rover Wheels? Are your rovers flipping because you forgot to remove the front wheels' brakes during construction in the SPH or it's turning too hard? Worry no more, for Tweakable Wheels is here to help!

Here's a quick overview of what it does:

-OLD VIDEO-

Context menu (Brakes only)

wlatiX0.png

Same as stock with the exception of the new slider for Percent of Maximum Brake Torque.

Context Menu (All Tweaks)

NzkLGQn.png

How is this Helpful?

Tweakable Wheels adds a slider to adjust braking torque on any wheel, whether it be for rovers or planes.

By decreasing the braking torque in front, massive, top-heavy monsters like this guy become practical and easy to stop!

V0UwyE6.png

Or you can put torque into the front only and flip almost anything onto its top. It's up to you.

Torque for accelerating also has its own tweakable, similar to Thrust Limiter on engines.

To install:

Put the TweakableBrakes/GameData folder contents into your KSP/GameData folder.

Put the craft files in TweakableBrakes/Ships into their respective folders into KSP/Ships.

ModuleManager.dll is now included!

Included:

- Plugin for adding more tweakable parameters to wheels

- affects both rover wheels and plane landing gear!

- ModuleManager.dll and config so you don't have to change the config file of EVERY wheel part

- Sample craft file

Things I plan on adding:

- Adjustable Suspension

- Config control over which Tweakables are visible

- Proper handling of steering tweakable for wheels with tank steering

Direct Download

Alternate Configs -OBSOLETE-

Source Code

License

Tweakable Wheels is licensed under Creative Commons Attribution-NonCommercial-Sharealike 4.0

88x31.png

Let me know what you think!

Edited by OrbitusII
Link to comment
Share on other sites

Sounds interesting. Made a MM patch for you:

DELETED 
WORKING VERSION NOW INCLUDED IN DOWNLOAD IN OP

Don't know if your addon works with landing gear or not. If it doesn't, delete the second half of the patch.

Edited by a__gun
Removed MM patch
Link to comment
Share on other sites

Sounds interesting. Made a MM patch for you:

-snip-

Don't know if your addon works with landing gear or not. If it doesn't, delete the second half of the patch.

I haven't made it explicitly compatible with landing gear but that is something I have planned. It might work without a major code change but I'll have to see how the landing gear work with wheels. Thanks for doing this! I'll try it out to make sure it works.

Link to comment
Share on other sites

ModuleManager config file works fine! Thanks to a__gun for doing that.

Config file Download

This doesn't come bundled with ModuleManager itself (for now, anyway- I need to bundle everything together) but so many mods use it that it shouldn't be hard to find. This only affects rover wheels (parts with ModuleWheel) currently but I might be able to get landing gear working by tonight.

Link to comment
Share on other sites

I am confused - because I thought wheels already had tweakable breaks?

Or did I only ever use a mod part ... :confused:

Stock wheels do not have tweakable brakes, they have the action group settings and that setup only has on/off brake settings. This plugin adds the ability to change the torque used in braking so that you can have less brake torque at the front of a rover to prevent flipping and stuff. You still have the action groups with this installed, you just get more control over braking.

Link to comment
Share on other sites

ModuleManager config file works fine! Thanks to a__gun for doing that....

No problem happy to help :)

Idea for the future - ability to quickly switch between different user-definable presets (With action groups perhaps..?)

Also (Don't know if you have implemented this yet or not) it would be great to set the torque before leaving the SPH/VAB.

Looking forward to seeing how this progresses

Link to comment
Share on other sites

Idea for the future - ability to quickly switch between different user-definable presets (With action groups perhaps..?)

That might be nice, I'll have to look into it.

Also (Don't know if you have implemented this yet or not) it would be great to set the torque before leaving the SPH/VAB.

You can set the torque in VAB/SPH since it's just a standard tweakable.

Link to comment
Share on other sites

Updated the OP with a zip file containing everything needed to use the plugin with minimal install effort, including ModuleManager.dll and a sample craft file.

Instructions for doing so is in the OP. Try it.

Unfortunately the landing gear do not use ModuleWheel like rover wheels do, and my plugin runs an explicit check for ModuleWheel, so it won't work until I add in support for landing gear. I expect it will be a similar process, but the landing gear wheels do not have the same variables as ModuleWheel which will probably cause some issues.

Edit: did some quick checks into the ModuleLandingGear part module and it looks like they also have a BrakeTorque variable (difference between this and ModuleWheel is capitalization of the first "b"). Writing up the necessary code now...

Edit 2: Finished landing gear support and updated the zip file containing everything. I really have no idea why this stuff isn't stock, it's so simple and useful! :P

Edited by OrbitusII
Link to comment
Share on other sites

Hm.

Instead of creating a new module which affects ModuleWheel, why not inherit from ModuleWheel and simply replace all the modules in the configs for the new module?

I tried inheriting from ModuleWheel but it caused issues. I might go back and look at it again later, but for now the tiny amount of code necessary works fine. :)

Link to comment
Share on other sites

I tried inheriting from ModuleWheel but it caused issues. I might go back and look at it again later, but for now the tiny amount of code necessary works fine. :)

Aye, from looking at it, it's not a big hurdle, but the lesser the modules the better :P And what kind of issues?

Anywho, good work.

Link to comment
Share on other sites

Aye, from looking at it, it's not a big hurdle, but the lesser the modules the better :P And what kind of issues?

Anywho, good work.

I couldn't get references to the right variables and even once I got past that the wheels wouldn't display right or add motor torque correctly, to name a few. It might just be me or it might be something wrong with Unity (in my 3.5 years with it, I haven't seen something like that before).

Thanks for checking it out!

Link to comment
Share on other sites

Instructions for doing so is in the OP. Try it.

I did, aircraft with tweaked landing gear brakes seem to have random sudden jumps resulting in a big boom in the sky and dead kerbal. Removing the part for the landing gears made the problem go away. So as I said, really hoping for landing gear support to go well :)

Link to comment
Share on other sites

I did, aircraft with tweaked landing gear brakes seem to have random sudden jumps resulting in a big boom in the sky and dead kerbal. Removing the part for the landing gears made the problem go away. So as I said, really hoping for landing gear support to go well :)

I just added it in this evening. a_gunn's original code won't work since ModuleWheelB is for ModuleWheel only. The new version in the download has support for landing wheels and a module manager config that handles those.

Basically this:

- ModuleWheel (regular rover wheels) gets ModuleWheelB

- ModuleLandingGear (landing gear for planes) gets LandingGearBrakes

Both are handled in the ModuleManager config (not the one in a-gunn's post but the one included in the most recent download).

Are you using the newest version? Try redownloading and installing it (get rid of old stuff) and let me know how it works.

Link to comment
Share on other sites

redownloading right now. Dang you're fast :)

tried one flight so far but so far it is working great :)

Yeah, I can write code pretty fast (it helps that each part of the plugin is only 17 lines).

Good to hear it's working now!

Removed my patch now to avoid confusion

Thanks for clearing that up and for coming up with it in the first place. :) I haven't developed stuff for ModuleManager before now so it probably wouldn't be done this fast. :P

Link to comment
Share on other sites

I love this! Thank you very much.

I do have a few ideas...

Adjustable Power- I wish I could squeeze more juice into these wheels (mainly the medium wheels) to increase acceleration and top speed.

Adjustable Torque- I need to climb that steep hill, or not flip over. This could be interesting to balance torque vs. electrical horsepower.

Link to comment
Share on other sites

Adjustable Power- I wish I could squeeze more juice into these wheels (mainly the medium wheels) to increase acceleration and top speed.

Adjustable Torque- I need to climb that steep hill, or not flip over. This could be interesting to balance torque vs. electrical horsepower.

Interesting, Unity WheelColliders only have one variable for torque/power but I think I can make it work... there is a variable for friction! :D

Link to comment
Share on other sites

Interesting, Unity WheelColliders only have one variable for torque/power but I think I can make it work... there is a variable for friction! :D

Glad to here you are willing to try! :)

There is this in the wheel code..

torqueCurve

{

key = 0 170 0 0

key = 2.5 100 0 0

key = 12 0 0 0

}

I don't know if you could use this at all to mess with the torque curve on the fly. Howvever, I don't even know how the game uses this code (very limited coding knowledge).

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