Jump to content

ModuleAnimateDualGenerics


linuxgurugamer

Recommended Posts

This is a new mod for other part modders to give them the following ability:

This mod provides a simple module which lets you have two active animations in the same part working at the same time, something that KSP itself doesn't allow.  Apparently some very old parts did allow it, before the game changed to disallow it (someone correct me if I'm wrong).

By itself it won't do anything, parts have to be made and configured to use it.

Availability

Also available via CKAN


The basic module stanza is as follows (values shown are defaults)

    MODULE
    {
        name = ModuleAnimateDualGenerics

        moduleType = Beacon

        // Activate and stop both animations

        activateActionName = Turn On <<1>>
        stopActionName = Turn Off <<1>>

        // Activate and stop the first animation

        activateAnim_1_Name = 
        stopAnim_1_Name = 

        // Activate and stop the second animation

        activateAnim_2_Name = 
        stopAnim_2_Name = 

        actionGUIName = Turn On <<1>>
        animSpeed = 1
        repeating = true

        toggleActionName = Toggle <<1>>

        // Following do not have defaults

        anim_1_name = Glow
        anim_2_name = Rotate

        // Default action group , acts as a toggle
        defaultActionGroup = Light

       }

The last three values do not have default values.

The module gives you the ability to control both animations at the same time, or individually.  There are three sets
of names, grouped together above.  If no value is given to any of the values, no button for that action will be
added to the PAW.

The toggle action works as follows:
    If no animation is running, turn on both animations
    If either or both of the animations are running, then turn them all off

The moduleType is only used as a textual name of the animation, which is put into the action prompts.  For example:

        moduleType = Beacon
        deployActionName = Turn On <<1>>

would create the following in the PAW:

        Turn On Beacon

which, by the way, shows you that the <<1>> is used as a placeholder which is replaced by the moduleType.

The defaultActionGroup allows you to be able to have the module assigned to an existing action group.

defaultActionGroup can be one of the following:

  •         None
  •         Stage
  •         Gear
  •         Light
  •         RCS
  •         SAS
  •         Brakes
  •         Abort
  •         Custom01 
  •         Custom02 
  •         Custom03 
  •         Custom04 
  •         Custom05 
  •         Custom06 
  •         Custom07 
  •         Custom08 
  •         Custom09 
  •         Custom10 
Link to comment
Share on other sites

Hi. This is a module that I had asked LinuxGuruGamer to create as older versions of KSP had allowed for creating looping animations without them being linked to another module, like the "Throttle" or "Scanning"/"Drilling". But that got broken at some point.

There are some older mods that had rotating Hazard type lights that stopped working when KSP was updated.

This is greatest benefit to this plugin as it allows for the creation of looped animations.

The example setup above was for a test Hazard light that I created. Animation 1 "Glow" turned on the light and Animation 2  "Rotate" spins the light.

ZePMRT5.png

Those names are the ones I gave my animations in my model, so those names would be changed to whatever you chose to name your animations.

Some possible uses for this plugin would include creating moving lights, creating moving radars and creating spinning habitats.

There is an older part that gave you a rotating station ring. With this mod you can create your own with lights that turn on and the part spinning.

 

    MODULE

                 {

                             name = ModuleAnimateDualGenerics

                             moduleType = Beacon  // This can be any name that you choose and will be what you see in the GUI

                            // Activate and stop both animations

                             activateActionName = Turn On <<1>>  // The "<<1>> tells the toggle to use the name you chose above.

                             stopActionName = Turn Off <<1>>

                           // Activate and stop the first animation // Animation 1 is non looping, use for things like turning lights on and off, opening and closing doors etc

                            activateAnim_1_Name =                // If you wish to toggle your first animation separately then put a name here e.g Turn on Light.

                            stopAnim_1_Name =

 

                           // Activate and stop the second animation // Animation 2 can be looping when "repeating =" is set to true. Animation will keep cycling until you turn it off.

                           activateAnim_2_Name =         // If you wish to toggle your second animation separately then put a name here e.g Spin Habitat.

                          stopAnim_2_Name =

                          actionGUIName = Turn On <<1>>

                          animSpeed = 1              // This can be used to have your animation loop faster. So changing this to 2 will make it faster.

                          repeating = true           // Setting this to false will make it non looping.

                          toggleActionName = Toggle <<1>>

                         // Following do not have defaults

                         anim_1_name =              // The name you gave to your non looping animation in the model.

                         anim_2_name =              //The name you gave to a second animation, this animation will loop if you set "repeating=" to true.

                         // Default action group , acts as a toggle

                        defaultActionGroup = Light        //If you want your animations to already be set to a toggle such as those found in the custom set up menu.

       }

Hope this helps.

 

Link to comment
Share on other sites

5 hours ago, theJesuit said:

I have a question, would this work across models?  As an example, if I was to use Ubioweld to put two or more models together in a single part.cfg, like a light and a deployable solar panel, could I use this to animate them together?

That would be a question for @Lisias, but from a quick reading on Ubioweld I would say no. I assume it is an automated way of part stacking and in your case you would be better off putting in the work to create your own configs and to manually part stack yourself.  Follow the link for some simple examples.

 

For the modders out there. LinuxGuruGamer has made it possible to have this module be in a config more than once, so if you had 4 different animations you could use 2 of them in the same config.

 

Edited by ColdJ
Link to comment
Share on other sites

Here is a link to 4 simple example models demonstrating some of the things you can do with the plugin. An unfolding and turning radar, A Hazard light that uses animation for material property, light intensity and rotation. A Hazard light that uses the stock colour changeable light system and rotation. A light that has both the rotate and bob up and down animations, spots and point light, 4 different animations using 2 of the module in 1 config.

https://github.com/ColdJ-KSP/Test-Samples

Spoiler

tuJQoIb.png dw8XTYT.png bLuWtJo.png I2ZO1xo.png FfGMqcE.png z5l2aAW.png

 

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