Jump to content

[KSP1.8] DMagic Module Science Animate V0.22 (11/2/19)


DMagic

Recommended Posts

It doesn't, not really, at least.

You can specify that your experiment work on all mod planets, using 1<<18, or 2^18, but there is no way to only target specific mod planets. If you just leave out the value, or leave it at the default value used by the example config it should work anywhere.

I'm also pretty sure that mod planet packs which rearrange stock planets and change their planetary index numbers will screw things up.

One thing that I should add is the ability to target on planets that don't have an atmosphere; just the opposite of the requireAtmosphere flag in the experiment definition.

Thanks for the info! And adding a non-atmosphere flag would be very, very helpful! :)

Do you need it to work on only certain planets? Otherwise I believe it defaults to working everywhere.

Well, I'm working on the config files for an experiment that would, theoretically, consume vast amounts of electricity shortly before exploding if used inside any kind of non-negligible atmosphere. :)

Link to comment
Share on other sites

I wanted to ask- does the ability to require a different (other than the science experiment) part be attached to a craft in order to run a science experiment, exist in this plugin as it is? I know we discussed it a (long) while ago, but did it ever get added? :)

I'll add this in the next version.

A simple field with the required part name (or names, adding multiple requirements isn't that difficult) will allow for specifying this type of restriction. I want to add something similar for required part modules, though I'm not really sure of the best way to get all loaded part modules (because I need to check if the required modules and parts are actually installed).

The atmosphere exclusion option will also be in the next version. Some kind of experiment failure penalty is also an interesting option.

And this obviously needs updating for KSP 1.0.5. Changes to the transmitter break the current version.

Link to comment
Share on other sites

Version 0.9 is out; get it on GitHub.

It has been updated for KSP 1.0.5.

It adds options to exclude planets with an atmosphere, and to require specific parts or part modules to be present on the current vessel. See the first post and the reference config file for details.

Link to comment
Share on other sites

Version 0.9 is out; get it on GitHub.

It has been updated for KSP 1.0.5.

It adds options to exclude planets with an atmosphere, and to require specific parts or part modules to be present on the current vessel. See the first post and the reference config file for details.

Goodbye, every non-KSP-modding task I had been planning for the rest of the day! :) :) :)

Thank you!

Edited by AlbertKermin
Link to comment
Share on other sites

  • 1 month later...

Ok, I've got a problem I've been fighting with for a while, and I can't seem to find the solution.

I've made a science experiment, using the DMModuleScienceAnimateGeneric, and it is running good - except when I actualy try to run the experiment. The buttons show up properly, its' just that when I hit them, nothing happens.

Can anyone offer any insight into what I'm doing wrong?

The code I'm using for the science experiment is-

Spoiler

MODULE
    {
    name = DMModuleScienceAnimateGeneric            //Name of the module - don't change this
    
    --------------------------
    
    //Animation Fields**** Similar to ModuleAnimateGeneric (default values shown)
    
    animationName = *"your animation name"            //Name of your animation - get the name from Unity scene
    sampleAnim = *"your sample fill animation name" //Name of the animation to be played when a sample is stored in a multiple-use experiment, experimentsLimit must be greater than 1 to function correctly
    animSpeed = 1                        //Speed to play animation
    endEventGUIName = Retract                //Title of retract animation event/action group
    showEndEvent = true                    //Do you want to show the retract event/action group - only displayed in-flight after deploy event triggered
    startEventGUIName = Deploy                //Title of deploy animation event/action group
    showStartEvent = true                    //Do you want to show the deploy event/action group
    toggleEventGUIName = Toggle                 //Title of toggle animation event/action group - Plays deploy or retract animation based on current state - Is reversible while playing
    showToggleEvent = false                    //Do you want to show the toggle event/action group - not recommended to be used together with deploy/retract events, too many unnecessary buttons
    showEditorEvents = true                    //Do you want to be able to preview the animation in the VAB/SPH
    
    *****\\
    
    --------------------------
    
    //Science Experiment Fields**** The same as ModuleScienceExperiment (default values shown)
        
    collectActionName = Collect Data            //Name of the EVA data collection event
    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
    experimentActionName = Collect Data            //Name for action group and right-click data collection function
    experimentID = SEP_InteriorHeatScan            //Experiment name - from the "id = " field in your ScienceDefs.cfg for this experiment
    hideUIwhenUnavailable = false                //Hide the right-click data collection buttons when experiment cannot be used
    interactionRange = 1.2                    //Range for EVA interaction in meters
    rerunnable = true                    //Can the part be used more than once
    resettable = true                    //Does nothing???
    resettableOnEVA = true                    //Allow EVA Kerbals to reset the part - removes any existing science reports
    resourceResetCost = 1                    //Multiplier for the resource cost to reset the experiment with a science lab
    resourceToReset = ElectricCharge            //Can't change????
    resetActionName = Reset Experiment            //Name for action group and right-click reset function
    reviewActionName = Review Data                //Name for action group and right-click review data function
    transmitWarningText = *empty string            //Warning text when transmitting data - only applicable for non-rerunnable parts - do not add anything here unless you want the warning to show
    useActionGroups = True                    //Are the VAB/SPH action groups available - does not affect the availability of right-click functions
    useStaging = False                    //Control experiment activation through staging (may not actually work)
    xmitDataScalar = 0.5                    //Transmission data value, determines the percentage of the baseValue (from your ScienceDefs.cfg) recovered from a transmission
    usageReqMaskExternal = -1                //Bit Mask to define external usage conditions; 8 specifies that the EVA kerbal must be a scientist to deploy the experiment; 4 will allow any Kerbal to deploy from EVA; -1 means nothing can use the experiment externally
    
    *****\\
    
    --------------------------
    
    //Science Experiment - Animation Fields**** (fields are from my magnetometer setup)
    
    customFailMessage = The magnetometer is not suitable for use during atmospheric flight, try again on the ground or in space.
                        //Default = Can't conduct experiment here
                                //Message to be displayed when you attempt an experiment in an unsuitable situation - from the situationMask in your ScienceDefs.cfg file
    deployingMessage = Close proximity to the craft scrambles the magnetometer's sensors, deploying the scanner now.
                        //Default = empty string    //Message to be displayed when you try to conduct experiment with the part undeployed
    experimentAnimation = true        //Default = true        //Do you want your experiment to be dependent on the animation playing/already being deployed - why else would you be using this plugin?
    experimentWaitForAnimation = true    //Default = false        //Do you want to wait for the animation to complete before you begin the experiment (or any other arbitrary amount of time)
    keepDeployedMode = 2            //Default = 0            //Determines when to play the retract animation
                                    //Value of 0 is the stock behavior (mostly) - Parts retract when the experiment is reset or the data is transmitted
                                    //Value of 1 - Retracts the part immediately after conducting the experiment - i.e. when the experiment results page appears - *probably better to set up a one way animation
                                    //Value of 2 - Part will not retract - only manual controls can retract the part
    waitForAnimationTime = -1        //Default = -1 (value set to the length of the animation)
                                    //Amount of time to wait after deploying the animation before the experiment begins - 0 will begin immediately, -1 waits for the animation to complete (this does take into account animSpeed specified above)
    oneWayAnimation = false            //Default = false        //Do you want the animation to only play in one direction - The animation should begin and end in the same position
    resourceExperiment = *empty string    //Default = ElectricCharge    //Do you want to use resources while collecting data, and what type do you want to use
                                        //This only functions while waitForAnimationTime and resourceExpCost both != 0, experimentWaitForAnimation can be set to false
                                        //Experiment will fail if you run out of the resource
    resourceExpCost = 0            //Default = 0            //The cost, in units per second, of resources used while collecting data
    asteroidReports = true            //Default = false        //Do you want to be able to collect results while landed on and/or near an asteroid
                                    //Asteroid reports in the ScienceDefs.cfg file follow the format: "AsteroidSrfLandedClassA" or "AsteroidInSpaceLowClassA" for each asteroid class, A-E
                                    //Only SrfLanded and InSpaceLow experimental situations are allowed
    planetaryMask = 524287            //Default = 524287    //Bitmask defining which planets the experiment can be performed on/around, works everywhere by default
    planetFailMessage = Can't conduct experiment here    //Default = Can't conduct experiment here         //Message to be displayed if the experiment can't be performed on the current planet/moon
    storageFullMessage = No more samples can be collected //Message to play when you can't collect any more data
    experimentsLimit = 1              //Default = 1        //Sets the limit for how many experiments can be collected and stored by an individual part
    labDataBoost = 0                //Default = 0        //Set the gain for transmission after lab processing; the default value, 0, will set the boost to 50% of the regular transmission value
    externalDeploy = true            //Default = false    //Allow the experiment to be triggered by an EVA Kerbal; still requires power if applicable
    resetLevel = 0                //Default = 0         //Level of scientist required to reset a used experiment on EVA
    
    excludeAtmosphere = false            //Default = false    //Specify experiments that can only run on planets/moons without an atmosphere
    excludeAtmosphereMessage = This experiment can't be conducted within an atmosphere       //Message to be displayed when an experiment fails because an atmosphere is present
    
    requiredParts = *empty string        //Default = none    //A list of part names that are required to be on the vessel for the experiment to work - separate part names by a , - all specified parts must be on the current vessel - use the actual part name (the name = myPart field in the part config), not the in-game title
    requiredModules = *empty string     //Default = none    //A list of part modules that are required to be used by parts on the vessel for the experiment to work - separate modules by a , - all specified modules must be used by parts on the vessel
    
    *****\\
    }

 

Link to comment
Share on other sites

Help! I can't get this plug-in to play my animations.  I have four animations on my part, one for each door, and when I use ModuleAnimateGeneric I can have all doors opening of closing without problems but I can't add much else to the cfg or the animations break. I want to use this module instead due to it incorporating science, because the part is a science cabin. My end goal is to make the part a functioning science lab and any kerbal activating the inner doors has their science collected, but I'm stuck just trying to get it play an animation. :confused:

Link to comment
Share on other sites

On 12/16/2015, 5:20:03, AlbertKermin said:

Ok, I've got a problem I've been fighting with for a while, and I can't seem to find the solution.

I've made a science experiment, using the DMModuleScienceAnimateGeneric, and it is running good - except when I actualy try to run the experiment. The buttons show up properly, its' just that when I hit them, nothing happens.

Can anyone offer any insight into what I'm doing wrong?

The code I'm using for the science experiment is-

 

That is the code you are using for reference, or that is what you actually have in your part config file? It looks like you just copy and pasted the entire config; read the top of that file, you can't just paste the entire thing in without filling in all of the fields.

 

1 hour ago, Kalzuron said:

Help! I can't get this plug-in to play my animations.  I have four animations on my part, one for each door, and when I use ModuleAnimateGeneric I can have all doors opening of closing without problems but I can't add much else to the cfg or the animations break. I want to use this module instead due to it incorporating science, because the part is a science cabin. My end goal is to make the part a functioning science lab and any kerbal activating the inner doors has their science collected, but I'm stuck just trying to get it play an animation. :confused:

 

You want something that transfers data from a Kerbal on EVA into your science lab part? This is never going to do that. It is designed for making new science experiments, not science labs or containers.

Link to comment
Share on other sites

1 hour ago, DMagic said:

You want something that transfers data from a Kerbal on EVA into your science lab part? This is never going to do that. It is designed for making new science experiments, not science labs or containers.

I know this mod wasn't made to do what I'm looking for by itself, but I figured since I need a better animation module it should be this one since, more than likely, the people who might use my part already have a lot of your science parts. I want to use this mod to run 4 separate animations on the same part so I can hopefully add more to the cfg without breaking the animations.

As of right now its just a Mk3 cabin with working doors and you can surface mount experiments inside and out. I might have to settle for making the lab a separate part that can be placed inside as well, I was just hoping your plug-in could help with my cfg troubles.

Edited by Kalzuron
Link to comment
Share on other sites

4 hours ago, DMagic said:

That is the code you are using for reference, or that is what you actually have in your part config file? It looks like you just copy and pasted the entire config; read the top of that file, you can't just paste the entire thing in without filling in all of the fields..

That is directly from my part config file. I know I left a lot of fields blank, but my experiment doesn't actually have any animations yet. Is the lack of an animation what is preventing the experiment from running, or is there another problem?

Edited by AlbertKermin
Link to comment
Share on other sites

3 hours ago, Kalzuron said:

I know this mod wasn't made to do what I'm looking for by itself, but I figured since I need a better animation module it should be this one since, more than likely, the people who might use my part already have a lot of your science parts. I want to use this mod to run 4 separate animations on the same part so I can hopefully add more to the cfg without breaking the animations.

This sounds like something that might be suited to FireSpitter. I'm not really sure how the configs for that module works, but I think it should let you handle multiple animations on a single part, and it's functions are much more generic, not tied up with science experiments like this module.

32 minutes ago, AlbertKermin said:

That is directly from my part config file. I know I left a lot of fields blank, but my experiment doesn't actually have any animations yet. Is the lack of an animation what is preventing the experiment from running, or is there another problem?

But you aren't really leaving them blank. There are lots of sample entries, quotations and asterisks in there. I don't really know what KSP's config node parser will do with those, but I assume it's nothing good. If you don't have an animation then you should remove those fields entirely and set the  experimentAnimation field to false. Any other field that you don't want to change should either be left at the default entry (which might not be what is in the reference config) or deleted (in which case the default entry, if any, will be filled in internally).

Link to comment
Share on other sites

On 12/17/2015, 6:43:21, DMagic said:

This sounds like something that might be suited to FireSpitter. I'm not really sure how the configs for that module works, but I think it should let you handle multiple animations on a single part, and it's functions are much more generic, not tied up with science experiments like this module.

But you aren't really leaving them blank. There are lots of sample entries, quotations and asterisks in there. I don't really know what KSP's config node parser will do with those, but I assume it's nothing good. If you don't have an animation then you should remove those fields entirely and set the  experimentAnimation field to false. Any other field that you don't want to change should either be left at the default entry (which might not be what is in the reference config) or deleted (in which case the default entry, if any, will be filled in internally).

Thanks. Turns out, the problem wasn't in the part configs anyway- I had a missing "}" in my science defs- but I'll be following your advice anyway.

Link to comment
Share on other sites

On 12/17/2015, 6:06:49, AlbertKermin said:

That is directly from my part config file. I know I left a lot of fields blank, but my experiment doesn't actually have any animations yet. Is the lack of an animation what is preventing the experiment from running, or is there another problem?

I, uh, yeah. That's my fault. I'm working on it.

Link to comment
Share on other sites

There shouldn't be. Are there two modules being assigned to that part somehow, maybe through a MM config? Does the part have an animation, and is the deploy event given the same name?

You can post the config file if you are still having problems and I'll look through it.

Link to comment
Share on other sites

9 hours ago, DMagic said:

There shouldn't be. Are there two modules being assigned to that part somehow, maybe through a MM config? Does the part have an animation, and is the deploy event given the same name?

You can post the config file if you are still having problems and I'll look through it.

Ok, here's the entire config file-

Spoiler

ART
{
name = SEP_LRRR
module = Part
author = AlbertKermin

MODEL
{
   model = SurfaceExperimentPackage/Parts/SEP_lrrr
}
    rescaleFactor = 1.0
    node_attach = 0.04, -0.057, 0.0, 0.0, -1.0, 0.0, 0
    node_stack_right = 0.246, 0.09, 0.0, 1.0, 0.0, 0.0, 0
    TechRequired = basicScience
    entryCost = 2500
    cost = 880
    category = Science
    subcategory = 0
    title = SEP-R01 Retroreflector
    manufacturer = Albert Kermin Labs and BDB
    description = The discovery of a new form of very bright light that tends to stay in a beam caused great excitement in the scientific community. This reflector is designed to use that light to make an extremely precise reading of the distance to a particular planet.
    attachRules = 0,1,1,1,0
    mass = 0.05
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.2
    angularDrag = 1
    crashTolerance = 80
    breakingForce = 200
    breakingTorque = 200
    maxTemp = 2000 // = 5000
    bulkheadProfiles = size1, srf

MODULE
    {
    name = DMModuleScienceAnimateGeneric

    collectActionName = Collect Data
    dataIsCollectable = true
    experimentActionName = Make Laser Range Measurement    
    experimentID = SEP_Retroreflector
    hideUIwhenUnavailable = false
    interactionRange = 1.2
    rerunnable = true
    resettable = true
    resettableOnEVA = true
    resourceResetCost = 50
    resourceToReset = ElectricCharge
    resetActionName = Reset Experiment
    reviewActionName = Review Data
    useActionGroups = False
    useStaging = False
    xmitDataScalar = 1
    usageReqMaskExternal = 8

    customFailMessage = The SEP Cold-Cathode Ion Gauge must be attached to a SEP Central Staion to work.

    experimentAnimation = false
    experimentWaitForAnimation = true
    keepDeployedMode = 2

    waitForAnimationTime = -1

    oneWayAnimation = false    
    resourceExperiment = ElectricCharge

    resourceExpCost = 0
    asteroidReports = false

    storageFullMessage = No more samples can be collected
    experimentsLimit = 1
    labDataBoost = 0
    externalDeploy = true
    resetLevel = 0
    
    excludeAtmosphere = false
    excludeAtmosphereMessage = This experiment will explode if activated within an atmosphere.
    
    requiredParts = SEP_CentralStation
    requiredModules = none

    }

    MODULE
    {
        name = ModuleKISItem
        volumeOverride = 100
        stackable = false
        allowStaticAttach = 1
        staticAttachBreakForce = 10
    }

}

My test game doesn't have MM installed, so it's not a MM problem, and the experiment doesn't have an animation currently, so I'm kind of stumped. Help?

Link to comment
Share on other sites

That's odd. Both buttons produce science results? Does it only happen when connected to other parts? 

It may be possible that both this module and the base ModuleScienceExperiment module could be producing the button, though I've never seen that happen before.

I'll try loading up a part with a similar config when I get a chance.

Link to comment
Share on other sites

@AlbertKermin, I see the problem now, it's am issue with the new stock EVA deploy method.

Try this version to see if it works properly: DropBox

It also allows for custom failure messages when parts or modules are required.

Use the fields:


requiredPartsMessage = Requires such and such parts

or 

requiredModulesMessage = Requires this and that part modules

The customFailMessage field is used when you aren't in the right situation, like when you try to use the stock seismometer in orbit.

 

Let me know if there is anything else before you release and I'll put out a proper release.

Edited by DMagic
Link to comment
Share on other sites

1 hour ago, DMagic said:

@AlbertKermin, I see the problem now, it's am issue with the new stock EVA deploy method.

Try this version to see if it works properly: DropBox

It also allows for custom failure messages when parts or modules are required.

Use the fields:


requiredPartsMessage = Requires such and such parts

or 

requiredModulesMessage = Requires this and that part modules

The customFailMessage field is used when you aren't in the right situation, like when you try to use the stock seismometer in orbit.

 

Let me know if there is anything else before you release and I'll put out a proper release.

Awesome! Thank you so much for the support!

Link to comment
Share on other sites

1 hour ago, DMagic said:

@AlbertKermin, I see the problem now, it's am issue with the new stock EVA deploy method.

Try this version to see if it works properly: DropBox

It also allows for custom failure messages when parts or modules are required.

Use the fields:



requiredPartsMessage = Requires such and such parts

or 

requiredModulesMessage = Requires this and that part modules

The customFailMessage field is used when you aren't in the right situation, like when you try to use the stock seismometer in orbit.

 

Let me know if there is anything else before you release and I'll put out a proper release.

That seems to have fixed it. I'll continue testing, but thank you!

I've been wondering if there was a way to rig an experiment so it could only be run from EVA?

Link to comment
Share on other sites

3 hours ago, AlbertKermin said:

I've been wondering if there was a way to rig an experiment so it could only be run from EVA?

There is now: DropBox

There is a new field: exclusiveExternalDeploy

Set that to true and it should only allow for EVA deploy.

Link to comment
Share on other sites

  • 3 weeks later...
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...