Jump to content

[PLUGIN, PARTS 14.0+] MultiJointPart Framework 0.4.1


sarkun

Recommended Posts

I present a MutliJointâ„¢ Part plugin, that has the ability to animate (rotation or movement) an arbitrary number of \'arms\' on a single part. Don\'t know what I\'m talking about? Watch the video:

http://youtu.be/_Ei5pNBth4E

The animation is smooth - the jerkiness in the video is the result of my screencap software.

CURRENT FEATURES

[list type=decimal]

[li] Specify any number of arms on your MultiJointâ„¢ part[/li]

[li] Assign different rotation angle for each arm[/li]

[li] Specify one master rotation axis, or define it separately for every arm [/li]

[li] Instead of rotating, parts can now also be translated by a vector [/li]

[li] Again, you may specify one master translation, or assign different vector to each arm.[/li]

[li] Assign different extend/retract time for each arm[/li]

[li] Assign colliders to any/all/none of the arms [/li]

[li] New!: Create constantly rotating arms, that either go around in a circle, or do a sort of \'screen wipers\' motion

MultJointPart TestReel4they\'ll keep on spinning forever :)

[/li]

[li] Specify different activation methods for the parts - upon activation, like landing gear, or your very own special key[/li]

[li] Parts are now persistent - if you leave the craft with solar panels deployed - they will be deployed when you resume your flight. [/li]

[li] You can specify different drag value for extended/retracted part. Drag value is updated live when part is extending/retracting. [/li]

[li] All of those features are available by just editing the CFG file.[/li]

DOWNLOAD


  • [li]Plugin, Parts from the video and More!:
Dropbox [/li]
[li]Plugin Source: Launchpad[/li]

Installation - nothing fancy - Parts go to Parts directory, plugin dll from the Plugins goes to Plugins.

Until I figure out what license I\'ll be using, here it\'s what I\'ll be using instead:

Usage Terms And Conditions


  • [li] You may use the supplied parts for your private use and modify them in any way.[/li]
    [li] You may also study, use and modify the code for your private use. [/li]
    [li] You may use the unmodified plugin in your mod packs, provided that proper attribution is provided. [/li]
    [li] If you want to release modifications of the plugin, please contact me first - I plan to release the code completely but only AFTER it is finished - however, we may come to an agreement on an individual basis.[/li]
    [li] I disclaim ANY and ALL responsibility for damages caused by use or misuse of this plugin (not that I expect any...)[/li]

If you are a modder that want\'s to include this plugin in your pack - you\'re more than welcome to! - please contact me via PM - I\'ll provide any help I can.

Note - the plugin is early in the development - expect problems, and frequent changes. If you plan to use them on your craft you\'ve worked hours to create - backup the .craft and SFS files first - I cannot guarantee that the plugin will not break any of those.

PART CREATION GUIDELINES

I) Modeling - (Blender)

The plugin relies on proper naming of objects inside of the DAE file.

Standard objects that must be present:


  • [li] base - (any name you want) - this part is the base of the model, and it does not move.[/li]
    [li] node_collider - standard collider, use it as collider for the base part [/li]

Then the rotating parts: any number of objects that follow this convention:

  • [li] part[number] (so first part must be named part1, then part2, part3...) part numbers must be consecutive integers, and order IS important [/li]
    [li] If you wish, any (or none, or all) part may have a collider. It must be named part[number]_collider (example: part3_collider). [/li]

For performance reasons, try to limit the number of colliders to minimum.

Example: MJP_Leg.blend

part_names.jpg

II - modelling continued

All rotating arms must have their rotation set to 0 and scale to 1.0

(in blender, choose object -> Apply -> Rotation & Scale).

All translating parts must also have their origin set to (0, 0, 0)

Example: MJP_Leg.blend

part_setup.jpg

The rotation happens around the ORIGIN of each part.

Currently rotation is hardcoded as perpendicular to the part. This will change.

III - Chain construction

When game starts, the plugin will construct a \'chain\' of parts, parenting part n + 1 to part n

(so part1 is the base and parent of part2, part2 is the parent of part3, etc)

This means that rotation applied to a part earlier in the chain will affect all parts further down.

Config Files

IMPORTANT: Each part must specify that it is a multi joint part:

module = PKSMultiJointPart

EQUALLY IMPORTANT: To make configuration easier, the plugin uses it\'s own cfg files (more on that below). To be able to find those files, part name must be the same as the directory that holds the part (also, try to stick to letters and numbers only).

PART.CFG SETUP:

In the cfg file, we setup normal part parameters:

The currently exposed variables:

[list type=decimal]

[li] ArmCount - amount of animating arms - useful for testing, you may set it to lower than the actual ArmCount on the model to check part of the animation. [/li]

[li] BehaveLikeLandingGear - if set to true, the part will act like landing gear - extending / retracting on the press of the \'g\'. If omitted or set to false, parat will deploy upon activation and stay deployed. [/li]

[li]DeployOnActivate - if set to true (default value) - part will deploy automatically upon becoming active [/li]

[li]DeployOnPressOf - sets up an alternative (or additional) key that will extend/retract the part [/li]

[li]FullyDeployedDrag - sets drag value for the part when fully deployed (use the default maximumDrag for drag when retracted) - part will have partial drag when deploying/retracting. [/li]

ARM_CONFIG.CFG SETUP:

This file is an additional cfg file that allows to define animations, sort of like attachment nodes.

In this file, you must specify how each arm should animate.

You begin by specifying if the arm should rotate or translate:

ARM_first = Simple_Rotate

Like defining node_stacks, the first three letters must be ARM - what goes later is up to you. Currently available arm types are Simple_Rotate, Simple_Translate and Constant_Rotate. More are coming.

There are two common arm parameters: time it takes to rotate/move and presence of collider:

time = 3.0

collider = true

If the arm should rotate, you must specify how: by defining axis of rotation and angle when fully rotated (exactly like in the Lander Leg module).

angle = 90.0

axis = -1, 0, 0

If the arm should translate (move) instead of rotating, you just supply the vector:

vector = 0, -0.5, 0

New Constant_Rotate arm explained:

The new arm behaves differently from the Simple_Rotate arm, but uses the same variables - axis, angle, time. Instead of waiting for activation, this parts start to spin along the axis immediately, and if the angle is greater than 180.0 degrees, will spin constantly in one direction. If the angle is lower, the part will rotate until it reaches that angle and then head back, until it reaches -angle, sort of like screen wipers in a car. Check the MJPRotor part for an example.

I know this sounds pretty complicated, but when you get used to it is quite simple to do very complicated parts. If you want to experiment with those parts but are struggling with cfg editing or modeling, PM me, I\'ll provide all the help I can.

Example:

//first rotating part

ARM_first = Simple_Rotate

angle = -20.0

axis = -1, 0, 0

time = 2.0

//first telesocpic rod

ARM_tele_one = Simple_Translate

vector = 0, -0.36, 0

time = 4.0

//second telesocpic rod

ARM_tele_2 = Simple_Translate

vector = 0, -0.26, 0

time = 4.0

//the piece that touches the ground - it has a collider

ARM_cushion = Simple_Rotate

angle = 100.0

axis = -1, 0, 0

time = 3.0

collider = true

Complicated, but not impossible, right?

Link to comment
Share on other sites

I can see canadarm in the very near future.

It\'s on my to-do list. I think I\'ve figured out all the necessary components already, but I still have to go around and test it :) Plus, this being my first C# project ever does not help :)

Link to comment
Share on other sites

My mind is filled with dreams of ultra compact lander legs, complex payload shrouds, folding winglets and suchlike...

Any chance of other inputs? by which I mean, for rotation, etc? and do the different sections have to have the same movement?

Looks pretty incredible :D

Link to comment
Share on other sites

What\'s so terrible about it?

The code, not the actual arm - I can see the arm is not fully textured.

It can clip through the ground and the ship as well as itself, and I can\'t think of a reliable method to prevent that...

Link to comment
Share on other sites

I just realized that this also renders my hinges that I worked on for nearly two days straight are useless.

Hell, these probably are better. Are they physics-enabled or do they render the attached parts physicsless as mine do?

Link to comment
Share on other sites

Thank you all for your kind words :)

However, my internet connection has just died, and tethering 3g is pain. Hopefully this will get resolved soon - I\'ll answer all of the questions then. Also - If all goes according to plan, I\'ll be releasing some VERY early version tonight - mainly for testing purposes and for modellers who want to get a head start :)

Link to comment
Share on other sites

First VERY early release available in the first post!

Have fun, and report any issues. I\'m sure there\'ll be lots.

Also in the first post - guidelines on creating your own MultiJointâ„¢ parts :)

Holy balls this is cool. I\'d be happy to test this for you, I\'ve got a mac laptop, which is very good for testing compatibility and lag issues!

Now you can :) Just don\'t expect much out of it yet.

Hm, this may also allow Cargo Doors. Damn, if I had skills and software, I could do what I\'m thinking about.

Cargo doors are easily possible, but this plugin is aimed at creating chains of parts - cargo doors require separate parts. Check the gear C7 made. That is about 75% work already done I believe.

Any chance of other inputs? by which I mean, for rotation, etc? and do the different sections have to have the same movement?

Yes, specifying different rotation axes for parts is trivial - I\'m currently thinking what will be the best way to implement that setup in the cfg file :)

And I\'m not sure what you mean by \'the same movement\' - each part can rotate by a different angle, and at different speed (at least it should, seems like I broke the different time thing.)

Hell, these probably are better. Are they physics-enabled or do they render the attached parts physicsless as mine do?

You may have them completely physicless or collider-enabled. I\'m working on restricting rotation angles and collision detecting. Right now they can work as lander legs, and that\'s pretty much it I think. I have little time to test it :( so I\'m hoping the community might help with that :)

Nova - if you want to do some collaboration on this, I\'d be happy too. I plan to make a fully controllable canadaarm type thing after I figure some issues, I think it would be wonderful thing for probodobodyne (or whatever your pack is called, there\'s just too many dobobodo inside for me :))

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