Jump to content

Multiple animated science experiments?


Recommended Posts

Hello I am considering making a gravioli/thermometer part for the project im working on at the moment and want each piece to animate extending out from the science package when called on to do science. I seem to remember seeing something to do with being able to set an animation to play to only half way through and then get another one to play the other half, but I can't really remember any details and I can't seem to refind that little helpful snippet of information.

I guess my questions can be summerized threefold

  1. is this actually possible? (pretty sure the answer is yes but I haven't confirmed that yet at all)
  2. how is it you go about setting animations to play only sections of the animation clip?
  3. how do you actually reference an animation in a science experiment? looking at the Mystery goo I assume it has something to do with "FxModules = 0" but I have no idea what the 0 is referring to how generally how that references the animation.

Quite eager to get making this but I don't really want to start without knowing some info about how it works. the only information I have been able to gleam is from this post which states "It automatically activates animations set up with the default ModuleAnimateGeneric module." when referring to ModuleScienceExperiment. but is that going to be a problem when trying to have 2 different experiments animated?

EDIT: looking into it a bit more I found that what I was talking about was the animTime variable mentoned here

so could I set up multiple moduleanimategeneric's (does that even work?) one with animTime 0 and another with animTime 0.5, or one moduleanimategeneric with both those times referenced and then get the science experiments to reference those times to start playing from?

I should probably just make a test animation and try this out but I really don't know where to start with the modulescienceexperiment and getting it to do animation.

sorry haha so many questions!

Edited by Squiggsy
Link to comment
Share on other sites

The stock animation module does not support multiple animations. You would need to use something like firespitter to do that. Even with that having multiple animated objects on a single part isn't the best idea. In reality you should separate each animated object into it's own part so they can each be used individually.

This doesn't mean they have to each be their own physical part in KSP. They need to be separate in unity with their own animations. For instance, make 4 separate parts in blender with their own animations. Import all 4 parts into unity. Once in unity you can child them all to the same gameobject, as long as their animations all have different names. When you export that gameobject to KSP it will show up in game as a single part but you can reference each animation in the cfg separately and even call them simultaneously and it will work.

Edited by raidernick
Link to comment
Share on other sites

ah thank you for the reply! yes I had thought multiple animations on one part was a no go but its just on one object ey? thats good news making multiple objects with multiple animations and combining them in unity is easy enough.

don't suppose you know about calling on animations with modulescienceexperiment too? it would be so much simpler if the module just enabled you to call an animation by name to trigger on science experiment, but alas I have been learning over the last month that things never turn out quite that simple :P

Link to comment
Share on other sites

ah fair enough, well thanks for the help! :) I will have to make a test object and have a muck around seeing how things work I guess.

EDIT:

ah hah! love it when you start researching something different and find something that might be the solution to your problem :

DeployModuleIndex is the index of the animation module that opens your cargo bay. If your deploy animation is the first module in your part config, this should be 0. If it is the 2nd module, this should be 1. 3rd = 2 ....

this will be the same for the FXModule = 0 I saw in the the goo cfg, which means that if i can possibly get away with one animation on a moduleanimategeneric and one on the new moduleanimategroup or something similar to that, then maybe i can add 2 modulescienceexperiments and get them to call the different animations when they run...

EDIT (again): nope I am wrong the FXModules = 0 seems to be what point in the animation it starts from, since in the log as it does the animation it says it is changing it from 0 to 1, then when the experiment is reset it say changing from 1 to 0

unfortunately setting it to 0.5 breaks the game, but setting it to 2 doesn't, it just also doesnt seem to do anything in particular.

Moduleanimategroup seems to be pretty exclusively for some of the new parts like scanners, ISRU refineries and drills, it'll animate without being used for those however it just wont animate being tied to another module that i've found apart from those.

I think I might just have one science experiment animated and not the other, going to be a whole lot less of a headache unless i come across some more information on this FXModules line in modulescienceexperiment, and looking through partmodules in MonoDevelop isnt helping too much

Edited by Squiggsy
Link to comment
Share on other sites

I have had general sucess using multiple ModuleAnimateGeneric on the same part / in the same .cfg file. Just don't have them share any objects/meshes between the animations and there should be no problems.

For example one of my command modules has 3 ModuleAnimateGeneric implemented on it (docking light, cabin lights, and extending a transmitter): https://github.com/shadowmage45/KSPMods/blob/master/GameData/SSTU/Parts/ShipCore/series_c/SC-C-108a-CM.cfg, and all function without issue (both on .90 and 1.x).

I really think the problems often come from attempting to use multiple animations that animate the same part, or in a few cases I have seen where it is merely a hierarchy issue (I solved a couple animation issues by adding the secondary animations directly to the animated part rather than on the root part as is common practice).

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