Jump to content

[1.8.x] KSPWheel - Physics Based Alternate Wheel Collider [API Only]


Shadowmage

Recommended Posts

1 hour ago, Svm420 said:

@Shadowmage

I was wondering if it would be possible to have gear deployment optionally cost/use resources namely EC? Kinda of niche, but I use a failure mod which can result in loss of EC in batteries and/or EC generation from the engines. If it cost EC to deploy gear it would lead to an emergency landing scenario. Again a niche request but that what why I ask. Thanks!

Not possible currently, but I could imagine some potential use for it on deployable parts.  Feel free to open a ticket up on the repo and I'll investigate during my next update pass.  I don't imagine it would be too complicated to implement and could easily be done as an optional feature, so chances are good that it'll make it in :)

Link to comment
Share on other sites

  • 3 weeks later...

Question - not sure I'm using the API correct. I've created a cfg for a model and Using debugstuff, I can see the wheelcollider (blue disc) However that collidor doesn't rotate despite the wheel model rotating. Would this be due to a hierarchy issue?

Link to comment
Share on other sites

1 hour ago, wile1411 said:

Question - not sure I'm using the API correct. I've created a cfg for a model and Using debugstuff, I can see the wheelcollider (blue disc) However that collidor doesn't rotate despite the wheel model rotating. Would this be due to a hierarchy issue?

The blue disc is not the wheel collider.  It is a proxy collider added by the API in order to prevent overcompression.  Also it should not rotate.  So what you are seeing is the expected and intended behavior.

If you need your wheel-mesh to visibly rotate you will need to use the KSPWheelRotation submodule.  If you want your wheel mesh/suspension to visibly react to changes in suspension compression you will also need the KSPWheelSuspension submodule.  Examples of both of their use can be seen in the KerbalFoundries parts.

Link to comment
Share on other sites

4 hours ago, Shadowmage said:

The blue disc is not the wheel collider.  It is a proxy collider added by the API in order to prevent overcompression.  Also it should not rotate.  So what you are seeing is the expected and intended behavior.

If you need your wheel-mesh to visibly rotate you will need to use the KSPWheelRotation submodule.  If you want your wheel mesh/suspension to visibly react to changes in suspension compression you will also need the KSPWheelSuspension submodule.  Examples of both of their use can be seen in the KerbalFoundries parts.

Ah - thanks. I figured I was misunderstanding that. The wheel I was working with is currently setup with all the submodules it requires including those you've mentioned. So it looks like the problem is elsewhere. This wheel (fromt the ASET ERS mod) looks like it can only used with FSWheel as it has some colliders that get disabled depending on orientation. FSWheel had this ability with it's modules and I was hoping I could redo the cfg with KSPWheel and make the Wheelcollider bigger than these attachment point colliders so it would roll even though it would be floating.

Link to comment
Share on other sites

11 minutes ago, wile1411 said:

This wheel (fromt the ASET ERS mod) looks like it can only used with FSWheel as it has some colliders that get disabled depending on orientation.

KSPWheel actually includes a module that will allow for removal of those colliders from the model (or any game-object/transform), as long as the game-object(s) they are attached to are not otherwise needed.  One sec and I'll try and find more info on it....

Here you go --

If you add this to the part-config (replacing the transform name with the name of collider object), it should remove the collider(s) from the prefab when the part is loaded, and thus it should be removed from all 'live' parts.

MODULE
{
	name = KSPWheelTransformRemoval
	TRANSFORM
	{
		name = FirstTransformNameGoesHere
		//this line specifies to remove from the prefab part; default is '0' which means does nothing
		when = 1
	}
	TRANSFORM
	{
		name = SecondTransformNameGoesHere
		//this line specifies to remove from the prefab part
		when = 1
	}
}

 

Link to comment
Share on other sites

9 hours ago, Shadowmage said:

KSPWheel actually includes a module that will allow for removal of those colliders from the model (or any game-object/transform), as long as the game-object(s) they are attached to are not otherwise needed.  One sec and I'll try and find more info on it....

Here you go --

If you add this to the part-config (replacing the transform name with the name of collider object), it should remove the collider(s) from the prefab when the part is loaded, and thus it should be removed from all 'live' parts.


MODULE
{
	name = KSPWheelTransformRemoval
	TRANSFORM
	{
		name = FirstTransformNameGoesHere
		//this line specifies to remove from the prefab part; default is '0' which means does nothing
		when = 1
	}
	TRANSFORM
	{
		name = SecondTransformNameGoesHere
		//this line specifies to remove from the prefab part
		when = 1
	}
}

 

Thanks for that - is there a way that KSPWheel allows that to be toggleable via the PAW?

Link to comment
Share on other sites

7 hours ago, wile1411 said:

Thanks for that - is there a way that KSPWheel allows that to be toggleable via the PAW?

Nope, not currently, it is just for 'cleaning up old models that include weird stuff'.  Specifically I built it to remove the 'Arrow' meshes from the KF parts that were intended as editor placement aids.

Curious what you are trying to accomplish?  Have some pics/images of the part/model you are trying to work on?  (knowing what the visible layout is, and what the hierarchy is, I might be able to offer better suggestions).

Link to comment
Share on other sites

On 3/2/2019 at 1:54 AM, Shadowmage said:

Curious what you are trying to accomplish?  Have some pics/images of the part/model you are trying to work on?  (knowing what the visible layout is, and what the hierarchy is, I might be able to offer better suggestions).

Sorry for the delay - was looking for options to get the ERS Rover Wheel working again but they seem awfully tied to the FSWheel module it uses  

Link to comment
Share on other sites

5 minutes ago, wile1411 said:

Sorry for the delay - was looking for options to get the ERS Rover Wheel working again but they seem awfully tied to the FSWheel module it uses  

Ahh, not familiar with that one personally.  Have a link to it you would mind sharing?

You may be correct -- it could have been tied to the module at some point.  If you are up for custom plugin work... KSPWheel is fully extendable, and 100% certain that it could be made to fill your needs if you can't find other options.  I've done pretty much exactly that for the ALG and repulsors -- they both use custom modules for part-specific functions that interact with the rest of the KSPWheel system.

Link to comment
Share on other sites

1 minute ago, Shadowmage said:

Ahh, not familiar with that one personally.  Have a link to it you would mind sharing?

I was Ok with messing around with a custom cfg file to make it work, but I think it's so tied to the FSWheel module that it's hard to get traction on the wheel collider. Wasn't up to doing any plugin work for this. The developer is still active and was seeing what I could do with just some tinkering.

Link to comment
Share on other sites

  • 3 weeks later...

@Shadowmage

Hey, Back with another request. Would it be possible to have the ALG gears use resource like you added to KSPWheelDeployment? I ask because I didn't see that module on the ALG parts so I wasn't sure if your update hit them as well. Thank you!

Link to comment
Share on other sites

18 hours ago, Svm420 said:

@Shadowmage

Hey, Back with another request. Would it be possible to have the ALG gears use resource like you added to KSPWheelDeployment? I ask because I didn't see that module on the ALG parts so I wasn't sure if your update hit them as well. Thank you!

Possible -- most likely.  Was not the intended use for those parts, so was not included in their functionality; and as they are 100% custom code for just those parts, there is no transference of functions from the standard KSPWheelDeployment module.

I'll have to give it some thought and make sure it could be implemented in an optional/non-invasive manner.  If you open up an issue ticket on the KSPWheel repository, it'll ensure I don't forget about investigating it for the next round of updates.

Link to comment
Share on other sites

25 minutes ago, Shadowmage said:

Possible -- most likely.  Was not the intended use for those parts, so was not included in their functionality; and as they are 100% custom code for just those parts, there is no transference of functions from the standard KSPWheelDeployment module.

I'll have to give it some thought and make sure it could be implemented in an optional/non-invasive manner.  If you open up an issue ticket on the KSPWheel repository, it'll ensure I don't forget about investigating it for the next round of updates.

I appreciate you investigating. I know those parts have had a lot done to keep them around. I wish people weren't so dependency adverse. Then maybe people might want to create new wheel/landing gear using this mod. Squad screwed wheels after 1.0 due to the unity change. Your work as been light years ahead of anything they've done. Hell i still see people post about using KSP version prior to the wheel change just for they're own sanity lol. Sad the community had so many big modders move on. Life never slows down i guess. :)

Link to comment
Share on other sites

  • 3 weeks later...

I really like the stock wheel models, but the way they behave is objectively inferior to the wheels on offer with this and Kerbal Foundries. Is there a way to get the stock wheel models, but have KSPWheel behavior? If so, is it easy to setup oneself, or would it require experience with the API (of which I have none)?

Link to comment
Share on other sites

On 4/20/2019 at 2:29 PM, MedicRules41 said:

I really like the stock wheel models, but the way they behave is objectively inferior to the wheels on offer with this and Kerbal Foundries. Is there a way to get the stock wheel models, but have KSPWheel behavior? If so, is it easy to setup oneself, or would it require experience with the API (of which I have none)?

https://github.com/shadowmage45/KerbalFoundries2/tree/master/KerbalFoundries-Patches/Stock

The above patches apply the KSPWheel modules to the stock wheels.  Download them and place them somewhere in your GameData/ folder.  Note:  They haven't been tested or updated in quite some time, so I cannot guarantee how well they work.  At the very least, it is a good place to start though :)

Link to comment
Share on other sites

36 minutes ago, Tonas1997 said:

Sorry for the noob question, but does this mod prevent unbreaked rovers from sliding down hills at ludricrous speeds (and blowing up on impact) like they did in stock? From what I gather the friction model has been severely improved.

If you are below the static friction point there should be very little sliding.  E.G. If the lateral (sliding) force is less than the sticking (vertical) force, then there should be no sliding (that is not the actual math that is used, but a gross simplification).

Nothing will stop sliding on extreme slopes though, at least nothing 'wheel' based -- what you need at that point are spikes or active attachment mechanisms (ground anchors), which this mod does not provide.

 

So, the answer should be 'KSPWheel doesn't do any of that silly stuff that stock wheels do'.

Link to comment
Share on other sites

  • 3 months later...

Hey, just wondering, has anyone made an implementation of this using the stock wheels, or something which looks very very close?

I would like to have the look of the stock wheels, but they do do some pretty silly stuff, and I want a rover which can actually go uphill.

Link to comment
Share on other sites

5 minutes ago, Tw1 said:

Hey, just wondering, has anyone made an implementation of this using the stock wheels, or something which looks very very close?

3 posts up, patches to make stock wheels use KSPWheel modules.

Link to comment
Share on other sites

1 hour ago, steve_v said:

3 posts up, patches to make stock wheels use KSPWheel modules.

Nice. May I suggest the inclusion of this in the prominently first post?  I did not read the whole thread, hence my post, but now I see others also are interested in this. 

 

Also, question:  Is there an easy way to download these, or do I copy the contents to files manually? 

Edited by Tw1
Link to comment
Share on other sites

7 hours ago, Tw1 said:

Is there an easy way to download these, or do I copy the contents to files manually? 

Unless you want to mess about with third-party tools or browser extensions, you'll have to grab the whole KerbalFoundries repo as a .zip (or with git CLI tools) and extract only the files you want, or download them as "raw" individually. They're just MM patches, so put 'em anywhere in GameData.
Add another reason I hate github.

Edited by steve_v
Link to comment
Share on other sites

7 hours ago, Tw1 said:

Also, question:  Is there an easy way to download these, or do I copy the contents to files manually? 

Luckily, in this case, the compiled .dlls are included in the source package's GameData folder. (Not all mods do this)..
So that means you can download the release using the second link, " Source code (zip) "...
Then extract the contents of *just* the /GameData folder to your install's /GameData folder, then extract the /
KerbalFoundries-Patches/Stock folder, to the /GameData/KerbalFoundries folder, and profit...

Link to comment
Share on other sites

18 hours ago, steve_v said:

Unless you want to mess about with third-party tools or browser extensions, you'll have to grab the whole KerbalFoundries repo as a .zip (or with git CLI tools) and extract only the files you want, or download them as "raw" individually. They're just MM patches, so put 'em anywhere in GameData.
Add another reason I hate github.

https://duckduckgo.com/html/?q=git clone specific directory

No reason to hate git. If you're learning how to use any new tool, it's normal to not know everything you can do with it. I didn't know how to extract a specific file or directory using git until right now, but I looked and found new knowledge. Thank you, @steve_v for expanding my horizon.

 

EDIT:

Well, so much for that. While the searching brought about ways to select individual files and directories, it appears as if in order to do that, git actually does have to download the entire repository regardless. Guess I still have a lot more to learn about git. Just the more so, my sincere thanks.

Edited by Corax
Try before you buy...
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...