Jump to content

Changing part behaviour


Recommended Posts

Hello everyone.

I have a problem, understanding how one thing works.

I am making a foldable winglet, and i have run into a problem.

So, here is my part

6HkqjYN7l94.jpg

Zo_gWCoZd1Y.jpg

I works alright, folds and extends, and the control surface is working as well.

But the thing is- i don't even understand, how to make the part change its behaviour.

Animation is just a simple animation, it doesn't affect part physics or anything.

The reason i was making it- is to fold the wing, when it is not needed, to minimize its drag.

So when it is folded, it should behave like a simple structure part, the control surface shouldn't work, and this part shouldn't generate any lift.

As i'm thinking, it should behave similar to kethane drills, or solar panels, because when they are folded, they don't work and are just simple structural parts.

Does anyone know, how do you make something like that?

Link to comment
Share on other sites

Are you familiar with the creation of new PartModules in plugins? It sounds like you'd have to make a new RetractableWing part module, and in your code, when the extract wing event is fired, not only would you trigger the animation, but you'd also play with the drag and lift. (Alternatively, in the onFixedUpdate() method, check if the wing is retracted or not, and set the drag and lift accordingly)

I haven't done anything with lift, but for drag, you can modify the maximum_drag property on the reference to the part to dynamically change the drag of your part.

Link to comment
Share on other sites

Are you familiar with the creation of new PartModules in plugins? It sounds like you'd have to make a new RetractableWing part module, and in your code, when the extract wing event is fired, not only would you trigger the animation, but you'd also play with the drag and lift. (Alternatively, in the onFixedUpdate() method, check if the wing is retracted or not, and set the drag and lift accordingly)

I haven't done anything with lift, but for drag, you can modify the maximum_drag property on the reference to the part to dynamically change the drag of your part.

Aha! So i have to write a custom .dll as well. I have never done that before =)

So much to learn, oh so much...

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