Jump to content

2 questions for modders that have made solar panels


pauladam316

Recommended Posts

Hello Everyone,

I am currently working on a set of solar panels for a mod, and I have 2 questions for anyone that has experience working on this,

1. Is there anything special that must be done to animations to make them work as the solar panel deploy/retract anims?

2. How do I tell the game what face of the panels has the actual panels (what side must be facing the sun to generate electricity)?

Thanks so much to anyone that can help me out!

Link to comment
Share on other sites

Fellow newb here! It was tricky, but I figured it out, and you can too!

1. Nope. Just make sure you make the name of the animation in your config the same as the name of the animation in Unity. Make sure it's set to legacy in Unity. Also, make sure the animation looks good playing backwards and forwards as Unity uses the same animation for opening and closing. I don't believe you have have separate animations for retract/deploy. Also, give smooth acceleration curves.

2. Basically, what you're going to do, is make an empty object called "suncatcher" that represents what needs to be pointed at the Sun to generate power. There's not a object for each panel. KSP doesn't care. It's best to place the sun catcher at the end of your extended solar array. Your solar cells need to be facing the +Z axis of the suncatcher object I believe. You can test out if everything is orientated correctly by spinning a craft with you solar panels on it around, and checking the "Sun Exposure" percentage in the stats for you panel.

I have a small Unity scene I can send you of my work if you want to reverse engineer it. I know Ven has the Unity file for his revamped posted on his add-on page if you want to download that and reverse engineer his panels.

I can give you newb-to-newb insight on how this is done. PM me whenever if you need help. :D

Link to comment
Share on other sites

Thanks for the reply. I can definetly try the suncatcher, however I am having problems with my animations. If I write it like this

MODULE

{

name = ModuleDeployableSolarPanel

animationName = oppertunitypaneldeploy

resourceName = ElectricCharge

chargeRate = 1.64

}

It will not run, however like this

MODULE

{

name = ModuleDeployableSolarPanel

//animationName = oppertunitypaneldeploy

resourceName = ElectricCharge

chargeRate = 1.64

}

It will now run. I also tried this

MODULE

{

name = ModuleAnimateGeneric

animationName = oppertunitypaneldeploy

isOneShot = false

startEventGUIName = Extend

endEventGUIName = Retract

actionGUIName = Toggle Antenna

allowAnimationWhileShielded = False

}

And that worked. What am I doing wrong?

Link to comment
Share on other sites

Thanks for the reply. I can definetly try the suncatcher, however I am having problems with my animations. If I write it like this

...

It will not run, however like this

...

It will now run. I also tried this

...

And that worked. What am I doing wrong?

Try this:

MODULE
{
name = ModuleDeployableSolarPanel
animationName = oppertunitypaneldeploy
sunTracking = True
raycastTransformName = suncatcher //make sure the name of your empty game object is named suncatcher
pivotName = sunPivot //this is another empty that is at the pivot point of your solar panels. The solar panels should be a child of this object.
isBreakable = true // Whatever. Can't figure out how to make this work.
isOneShot = false
resourceName = ElectricCharge
chargeRate = 1.64
powerCurve
{
key = 206000000000 0 0 0
key = 13599840256 1 0 0
key = 68773560320 0.5 0 0
key = 0 10 0 0
}
}

Send me some screens of your Unity setup. Animations, and object hierarchy. If all else fails, I'll upload my Unity scene and you can mess around in it.

idkmn1h.png

Edited by curtquarquesso
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...