Jump to content

How do you make a custom throttle prop?


Recommended Posts

Like the topic says: How do you make a custom throttle prop?

Looking at the prop.cfg file for Squad's throttle prop, it shows a module with the name InternalLeverThrottle.

But it doesn't give any hints on how the model should be configured.

So does anyone have experience with custom throttles?

Link to comment
Share on other sites

Like the topic says: How do you make a custom throttle prop?

Looking at the prop.cfg file for Squad's throttle prop, it shows a module with the name InternalLeverThrottle.

But it doesn't give any hints on how the model should be configured.

So does anyone have experience with custom throttles?

I don't have a definite answer to that question, but I can make a guess. If I seach for strings in the prop's model, I see the string "throttle" popping up repeatedly, along with "throttleLever". I would guess that there's a transform by that name that the module uses. There are also transforms named "throttleHeadR" and "throttleHeadL".

The InternalLeverThrottle module exposes angleMax (float), angleMin (float), axis (vector3), leverInitial (quaternion), leverName (string), leverObject (UnityEngine.collider), and speed (float). Presumably, you can these values to control the part.

If you're willing to go the plugin route, RasterPropMonitor can control a transform (rotation / translation / whatever) that's tied to the throttle setting.

Link to comment
Share on other sites

Hey thanks for your reply. How would you configure a throttle for RPM, cfg wise.

The simplest approach is to add something like this to your PROP:


MODULE
{
name = JSIVariableAnimator
refreshRate = 12

VARIABLESET
{
controlledTransform = ThrottleArrowRot
variableName = THROTTLE
scale = 0 , 1
localRotationStart = 0, 0, 0
localRotationEnd = 30, 0, 0
}
}

refreshRate is the number of frames between updates. On a typical 60Hz monitor, assuming KSP isn't lagging, a 12 translates to 12/60 of a second. I use much smaller numbers for important items that should update often (as low as 3, for instance).

controlledTransform is the name of the transform that this animation controls.

variableName and Scale should be used as-is for a throttle.

localRotationStart and End are the rotation in degrees on the <x, y, z> axes, based on the default position of the transform.

There's quite a bit you can do with this animator beyond rotating a transform. Full documentation is here. Or ping me with questions.

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