Jump to content

Multiple (science) animations in one part.


Recommended Posts

I'm currently working on unmanned soil sample collector. Model, animation sequence and draft texture are done, but when porting the part to game I had issues...

3 identical "ModuleScienceExperiment"s (part should collect up to 3 samples) in one part do get science as intended, and animation plays correctly, but only on FIRST use of any "ModuleScienceExperiment". Remaining modules do not start the animation. Experimenting with Unity animation loop settings did not help. (config example is "single animation" part)

When duplicating animation sequence in Unity (it's the same old animation from the same .blender file but with different name) I got it to work on two modules, but animation itself got corrupted (wrong turn angles) so I got to remove some colliders for testing purposes. I partly dealt with that by adding first and last keyframes to all parts at both ends of blender clip and reimporting it, but the problem still remains. (config example is "double animation" part)

When trying to add third clip at config, I realised that science modules disappeared from right-click menu and animation togglers appeared which were not there. (config example is "triple animation" part)

Game parts, blender and unity files are in archive.

I'm currently stuck and see three posibilities of what went wrong.

1) Maybe I understood the "FxModules" option and it's relation to "ModuleAnimateGeneric" completely wrong. Absolutely no info on that in Google.

2) Maybe it was not a good idea to animate and re-animate LocRot on parts that only go Loc in Blender.

3) Maybe I'm still missing something important in Unity animation parameters.

Can anyone help me finish that, please? Do not want to rework such a nice part for single use.

Link to comment
Share on other sites

I don't really know how FxModules works. I though that it just called ModuleAnimateGeneric if it was present, but it's probably more complicated than that. I'm not aware of any way to get this to work using the stock ModuleScienceExperiment and ModuleAnimateGeneric. Those modules are really only suited for static experiments and for stock parts. And ModuleAnimateGeneric really doesn't handle multiple animations on the same part very well.

It's possible to make this type of multiple-sample experiment, but it requires a plug-in and it's not exactly straightforward.

My Science experiment plugin handles animations better: DMModuleScienceAnimateGeneric, but it still only handles one sample per module. You could try putting three of those modules on a single part, it might work better.

I've since made a somewhat more generic science module that does work with multiple samples, I might try to work that into DMModuleScienceAnimateGeneric, but probably not any time soon.

Link to comment
Share on other sites

Tried with your plugin. Just one module for a start.


MODULE
{
name = DMModuleScienceAnimateGeneric


animationName = drill
animSpeed = 1 //Speed to play animation
showEndEvent = false
showStartEvent = false
showToggleEvent = false

showEditorEvents = false


collectActionName = Collect samples
collectWarningText = *empty string //Warning text to display when retrieving data from the part during EVA - Only applicable with non-rerunnable parts
dataIsCollectable = true //Allow EVA Kerbals to collect science reports from the part
collectActionName = Take away sample
experimentActionName = Take Sample #1
experimentID = surfaceSample
hideUIwhenUnavailable = true
interactionRange = 1.2 //Range for EVA interaction in meters
rerunnable = false
resettable = false
resettableOnEVA = true
resourceResetCost = 200
resourceToReset = ElectricCharge
resetActionName = Discard sample
reviewActionName = Review sample
transmitWarningText = There's nothing to transmit here! You'll just waste the sample!
useActionGroups = True
xmitDataScalar = 0


customFailMessage = No collectable samples found. Are you flying?

experimentWaitForAnimation = true
keepDeployedMode = 2
oneWayAnimation = true
}
}

Animation plays continuously in loop even in VAB, won't stop playing at launchpad and does not react to experiment button. Tried with both "keepDeployedMode = 2" and "keepDeployedMode = 1" - still the same. Unity animation is set to "default", which means "play once if there are no external calls for loop". Did I miss something in config?

Speaking about plugins - it would be just wonderful, if someone write a plugin to collect science to OTHER part (with data storage module) than the part in action. It would only require one animation for multiple experiments and allow to implement Luna-16-style unmanned missions, where returning capsule contained only samples and not the drill itself.

Edited by Dr. Jet
Link to comment
Share on other sites

The default wrap mode should be 'once', but you might want to set it to that just to be sure.

It sounds like you might have the 'play automatically' box checked and the culling type set to 'always animate'. Make sure the box is unchecked and the culling type is set to 'based on renderers'. Those are the only reason I can think of for why your animation would be looping all of the time like that. The plugin doesn't really support looping animations, and never explicitly uses them, so the Unity settings are the only things that should affect how the animation behaves.

Link to comment
Share on other sites

It sounds like you might have the 'play automatically' box checked and the culling type set to 'always animate'. Make sure the box is unchecked and the culling type is set to 'based on renderers'. Those are the only reason I can think of for why your animation would be looping all of the time like that.

But the generic animation module (single) works fine with the same .mu! How can it be?

Edited by Dr. Jet
Link to comment
Share on other sites

But the generic animation module (single) works fine with the same .mu! How can it be?

I'm guessing that ModuleAnimateGeneric explicitly disables the animation on loading and sets it to run in clamp/once mode. Mine does neither of those things.

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