Jump to content

Apollo13

Members
  • Posts

    1,411
  • Joined

  • Last visited

Everything posted by Apollo13

  1. Here's the Creative Commons license included in the download. I'm trying to help a friend out by providing the link. Okay? If you consider this a problem, please have a moderator contact me to resolve the issue.
  2. In the following, I'm attempting to create a Clip and play it. I'm successfully instantiating the animation object (anim). I verified that "openClip" is not null. However, when I execute "anim.Play("openScreen")" for the clip, the clip does not play. I verified the return value, which is TRUE. That is, Unity thinks it played the clip. The model has a single baked animation "Scene", which is from frames 1 through 89. Scene will eventually have other clips. private Animation anim; private AnimationClip openClip; public override void OnStart(PartModule.StartState state) { anim = part.FindModelAnimators("Scene")[0]; openClip = new AnimationClip(); anim.AddClip(openClip, "openScreen", 1, 89, false); anim.Play("openScreen"); } I could create the clips in the Unity Editor. However, I want to attach AnimationEvents to the clips. Specifically, I want to know when each clip has finished playing. So: 1) what is incorrect in my method of creating and playing clips in the script? 2) can I attach an AnimationEvent to a clip I define in the Unity Editor versus doing it in the compiled script? Bonus question: How can I play a clip backwards? That is, is this legal: anim.AddClip(closeClip, "closeScreen", 89, 1, false); note that the Start frame is greater than the End frame
  3. Is there a class to modify/add/subtract achievements (funds, science, reputation)? I googled that topic and found nothing. EDIT: malkuth responded to my PM and showed me how to do this. THANK YOU. Funding.Instance.AddFunds(double amount ,TransactionReasons) ResearchAndDevelopment.Instance.AddScience(float amount,TransactionReasons) Reputation.Instance.AddReputation(float amount, TransactionReasons)
  4. There are cases for odd-shaped meshes where I don't set Convex. Best thing to do is to experiment with each project. If you test it without Convex and it works and that's what you need, then go for it.
  5. noonespecial, I appreciate the thought. However, SpeedyB and I are working together to update the Hex Truss System. He's creating new parts while I work elsewhere such as the solar panels et al. Results may be available Soonâ„¢
  6. I'm able to use private without problem. But, I'll keep that in mind if I run into quirky problems in the future. thanks
  7. As you know, Kerbals have a hard time with higher math. They have hard time counting past five. So, the standard six-sided Hub has always confused them. Well, be confused no more. Introducing the Hex Truss five-sided Hub. Just like the standard Hex Truss Hub, but with one less connection point. Give your space stations a unique look as well. And, of course, pipes are optional. Here, it's shown with the standard six-sided Hex Truss Hub for comparison. Attached are three Long Trusses. On one of those Long Trusses, pipes have been removed. Go here for the parts archive: New Hex Truss parts Included parts: 1. Long Truss 2. Five-Sided Hub for Hex Truss System Installation: Install under the GameData directory. Usage: While in the VAB, right-click a part to remove the pipes. Right-click again to restore the pipes. License: same as SpeedyB's Hex Truss System. SpeedyB has my permission to include this in all Hex truss distributions. In post #46/47, we discussed the five-sided hub. This is the result of that discussion. If you have questions, PM Apollo13 on the forum
  8. The plugin prevents rendering, which speeds-up performance. In my PM to you, I explain how the plugin can be applied to all the Hex Trusses. We don't need anything as complicated as firespitter to remove the pipes. pipesVisible = !pipesVisible; compPipes.renderer.enabled = pipesVisible; Events["ChangePipes"].guiName = (pipesVisible ? "No pipes" : "Add pipes");
  9. Solar Panels for the Hex Truss System (3 Sizes) Retrieve the archive file here No plugins are required. They use the Squad stock Solar Panels module. LICENSE: Same license as SpeedyB's Hex Truss System Distribution: SpeedyB has my permission to distribute these solar panel models with his Hex Truss System. If you have questions or suggestions, PM me.
  10. I use x64 Blender version. This addon works perfectly. My addons go to: C:\Program Files\Blender Foundation\2.71\scripts\addons\io_object_mu-master Note that below "Blender Foundation", it is "2.71", not "Blender". Here's the directory structure from the ZIP archive. Note, it, too, shows "2.71", not "Blender" "C:\Program Files\blender-2.71-windows64\2.71\scripts\addons"
  11. KasperVid. Thanks for changing it. I give Rep points every now and then (never gave more than 2 in a 24-hour period). So, the reduction to five limitation ought to work well.
  12. For some models, you don't need to create a separate collision mesh. Rather, simply add "Mesh collider" component in Unity. Be sure to set the "Convex" attribute for the Mesh Collider.
  13. I agree. Depending on folks to self-limit is a slippery slope.
  14. It's a bit of an annoyance that having given somebody a Rep point, you cannot do so again until you've given number of points to X number of other users. Yes, I realize this is to prevent spamming points on somebody so they get a bazillion points. However, when somebody has helped this newbie modder with several unrelated problems that are not in the same thread, I'd like to give credit where credit is due. Currently, I can offer only my public gratitude for their assistance. What's the solution? Perhaps trust that folks won't spam the points. Anyway, just something to consider for the future.
  15. That is good info which will be used in many mods to come. Thank you. Added a forum Rep point to you as well.
  16. I have checked the forum rules and am in compliance.As I've mentioned several times for my other mods to SpeedyB's mod, the license is the same as his Hex Truss System. I am not releasing this as a separate mod. Concerning source code, I've seen many, many mods where source code is not available.
  17. Configurable Trusses In post #52, a request for trusses without pipes was made. There was further discussion about whether that could be configurable in the VAB. The answer is Yes, it can be. This is a direct replacement for the Hex Truss Long. Configurable Hex Truss Long Installation: place the directory under the GameData directory Usage: In the VAB, after adding the Truss, right-click on it. Click the "No pipes" button. If you change your mind, right-click again. Note: (1) Trusses without pipes will not automatically feed fuel. You can still manually transfer fuel. (2) Trusses can be configured only in the VAB, not on the Launchpad nor in-flight. I have provided the plugin source code to SpeedyB. I want to say again that SpeedyB's system of modeling, i.e., UV mapping, has made my mod here easier. He did all the texturing and UV-mapping perfectly.
  18. "isPersistent" was the final piece of the puzzle. THANK YOU. Final code: using System.Collections; using UnityEngine; namespace RenderTest { public class RenderTest : PartModule { [KSPField(isPersistant = true, guiActive = false)] private bool blueVisible = true; private Component compBlue; public override void OnStart(PartModule.StartState state) { compBlue = part.FindModelComponent<Component>("blue"); compBlue.renderer.enabled = blueVisible; } [KSPEvent(active = true, guiActive = false, guiActiveEditor = true, guiName = "Invisible")] public void ClickRed() { blueVisible = ! blueVisible; Events["ClickRed"].guiName = (blueVisible? "Invisible" : "Visible"); compBlue.renderer.enabled = blueVisible; } } } It's strange that I needed to use a KSP extension. There should be a Unity method to maintain component states across scene changes. I'l research this further. @m4v: tried to give you a forum Rep point; no can do. So, my gratitude is all I can offer.
  19. thanks. While awaiting an answer here, I tried [KSPField(guiAcitve = false)]. I'll try without the "guiActive" and with the "isPersistent"
  20. The code now looks like this. However, the value of "blueVisible" is not maintained between the VAB and Launchpad. That is, in the VAB, I set it to False. Upon going to the Launchpad, it's True again. Yet, the Attribute state(Events["ClickRed"].guiName) is maintained. sing System.Collections; using UnityEngine; namespace RenderTest { public class RenderTest : PartModule { private bool blueVisible = true; private Component compBlue; public override void OnStart(PartModule.StartState state) { compBlue = part.FindModelComponent<Component>("blue"); Debug.Log("state = " + state); Debug.Log("OnStart " + blueVisible); compBlue.renderer.enabled = blueVisible; } [KSPEvent(active = true, guiActive = true, guiActiveEditor = true, guiName = "Invisible")] public void ClickRed() { blueVisible = ! blueVisible; Debug.Log("ClickRed: " + blueVisible); Events["ClickRed"].guiName = (blueVisible? "Invisible" : "Visible"); compBlue.renderer.enabled = blueVisible; } } }
  21. EDIT: See next post. I have a part with a bool value which enables/disables the renderer for a component. I can set it in the VAB/SPH and the component disappears and reappears. However, when I go to the launchpad, the part is created with the invisible component as visible. I've looked through some other people's code to determine how they do it. No joy. using System.Collections; using UnityEngine; namespace RenderTest { public class RenderTest : PartModule { private bool blueVisible = true; private Component compBlue; public override void OnStart(PartModule.StartState state) { compBlue = part.FindModelComponent<Component>("blue"); } [KSPEvent(active = true, guiActive = true, guiActiveEditor = true, guiName = "Invisible")] public void ClickRed() { blueVisible = ! blueVisible; Debug.Log("VAB: " + blueVisible); Events["ClickRed"].guiName = (blueVisible? "Invisible" : "Visible"); compBlue.renderer.enabled = (blueVisible? true : false); } public void onLoad() { Debug.Log("onLoad: " + blueVisible); compBlue.renderer.enabled = (blueVisible ? true : false); } } }
  22. In Blender, those are polygons. When you go into Edit mode, you can view and modify the individual polygons that shapes are made from, including faces, edges, and vertices. "Dimensions" are the size of the part in Blender units. It's frustrating that Blender is adding those deformations during export to FBX.
  23. OK. I'll give that a try. I just don't understand why Blender is adding these deformations. I sure as hell didn't add them. Unfortunately, I must be away from my computer until Saturday, so I'll experiment on Sunday. Thank you to you and raidernick for your patience and assistance.
  24. Yeah, I just discovered and tried that a few minutes ago. No joy. I cleared all keyframes. I then rekeyed (Location, rotation). I'm trying to put into practice what you provided previously. Here's the FBX file that was created and I imported to Unity: FBX file Revised Blender file with textures
×
×
  • Create New...