Jump to content

noonespecial

Members
  • Posts

    478
  • Joined

  • Last visited

Everything posted by noonespecial

  1. I've never modeled before, but I'm going to give it a go. So far, I've got the modeling learning under weigh. Still trying to figure out how to do UV Maps. After that, I'll wrestle it into Part Tools and see if I can figure that out. So far I've modeled two parts. A basic 1m struss and side attachable fuel tank. I'm planning on also making side attachable batteries and solar panels, but one step at a time and I'll try not to get ahead of myself. Here are some pictures of what I've go so far. Very rough and I'll probably redo it a few times (as a learning experience as well as to improve it) before I move onto additional models.
  2. Syrio Kerman! Hahaha. Hrm, maybe if I get off my lazy arse, I'll write a mod to rename all Kermans to GoT inspired names. Maybe even throw in a Jon Snerman for good measure.
  3. Not sure what you mean by "almost had you fooled", I wasn't trying to fool anyone. In regards to googling it, I just googled "thss tri" and it showed up. In regards to nothing there has any downloads, I don't see a download counter on the site to warrant that observation. Regardless, I've removed the link from my previous post (which will be pointless unless you also removed the quoted link from yours). As you say you did not upload your mod to that site, I will assume that neither did he. However, I am slightly vexed that you assume that the site is mine and that I'm trying to bypass Squad's requirements. That being said, I'll gladly respect any and all requirements, licenses, wishes, etc., of any and all mod creators and as such I have removed the link. Do try to be less accusatory in the future. Best regards, NOS (P.S. Rather cool nod to Game of Thrones in your quote, love it)
  4. Or you could... Find an alternate download source posted by the author of the mod. Google came in quite handy. Edit: Linked removed for suspicion of being term violation. As this was most likely uploaded by the author (User name here: Senmi, User name there: Senmi), I assume it's okay to post a link to it?
  5. Can you add the ability to select other vessels? Then highlight different parts on the wireframe of the other vessel? Such as.... docking ports? Then possibly be able to "Set Target" of docking port from the display?
  6. Wow. I've been trying to get like this working for a while now (with very little success)! Excellent job!
  7. I stated that it is used in the U.S. Government Style Guidelines, in addition to MLA, Chicago, White, and Strunk "Style Guidelines". I did not state the The U.S. Government is an authority on grammar. In fact, one would assume by the names of this Comma, that being the Oxford Comma and the Harvard Comma, that these institutes of higher learning are the authority behind the grammar. -Sincerely, An English Teacher P.S. Another fine example: The rocket is available is black and white, red and yellow, and blue and green.
  8. Actually. Both are correct. "bath, shower, and other amenities" is an example of the Serial Comma (also known as the Oxford or Harvard Comma). It is used in MLA, Chicago, White, Strunk, and the U.S. Government style guidelines. It is used less often in British English, only when they want to avoid Ambiguity. An example: Amanda found herself in the Winnebago with her ex-boyfriend, an herbalist and a pet detective. Amanda found herself in the Winnebago with her ex-boyfriend, an herbalist, and a pet detective. The first sentence has two people. Amanda and her ex-boyfriend. The ex-boyfriend is an herbalist and pet detective. The second sentence has four people, Amanda, her ex-boyfriend, herbalist, and a pet detective. -Sincerely, An English Teacher
  9. As with what UbioZur said, If it's a NON-PART plugin, change public class TestModule : PartModule to public class TestModule : MonoBehavior Also, this is very useful, give it a watch Try this and see if you get a result: using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; using KSP.IO; namespace ClassLibrary2 { public class TestModule : MonoBehavior { [KSPAddon(KSPAddon.Startup.Flight, false)] // or .Startup.MainMenu or .Startup.EveryScene public void OnStart() { // Add stuff to the log print("something silly to the log"); } public void Awake() { } public void Start() { print("Holy Sh*t the plugin started correctly!!"); } } }
  10. I changed those to your suggestions and it went from no error back to: Start() (Filename: C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/StandalonePlayer/UnityEngineDebug.cpp Line: 54) NullReferenceException: Object reference not set to an instance of an object at kADAR.kADAR.Start () [0x00000] in <filename unknown>:0 and OnRenderObject() (Filename: C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/StandalonePlayer/UnityEngineDebug.cpp Line: 54) OnRenderObject error: Object reference not set to an instance of an object The debug.logs didn't catch anything else. I just noticed the NullReferenceExceptions. Appears to be three. NullReferenceException at (wrapper managed-to-native) UnityEngine.Component:InternalGetTransform () at UnityEngine.Component.get_transform () [0x00000] in <filename unknown>:0 at PQSCity.OnSphereReset () [0x00000] in <filename unknown>:0 at (wrapper delegate-invoke) PQS/OnDefaultDelegate:invoke_void__this__ () at PQS.ResetSphere () [0x00000] in <filename unknown>:0 at PQS.OnDestroy () [0x00000] in <filename unknown>:0 (Filename: Line: -1) NullReferenceException at (wrapper managed-to-native) UnityEngine.MonoBehaviour:StopCoroutine (string) at PQS.ResetSphere () [0x00000] in <filename unknown>:0 at PQS.ResetSphere () [0x00000] in <filename unknown>:0 at PQS.OnDestroy () [0x00000] in <filename unknown>:0 (Filename: Line: -1) NullReferenceException at (wrapper managed-to-native) UnityEngine.Component:InternalGetGameObject () at UnityEngine.Component.get_gameObject () [0x00000] in <filename unknown>:0 at MapView.OnDestroy () [0x00000] in <filename unknown>:0 (Filename: Line: -1) I got the idea from a random Unity examples while searching the error. I removed it and the errors returned. Yes, it compiled without error or warning. No change. The if statements still do not generate a debug.log. I also removed those from the Debug.Log Debug.Log("OnRenderObject: myVessel is NULL") The if statement with (myVessel == null) or (!myVessel) are not called so I can only assume that myVessel is not NULL. So I did a debug log to see what it was returning and got: myVessel: Mark1-2Pod (Untitled Space Craft) (Vessel)
  11. Thanks Pizzaoverhead! That piece of information will be very useful in most, if not all, future endeavors! So, using that pieces of information, I was able to find and eliminate three obvious problems. Firstly, two of the materials weren't loading. After some tinkering, I changed the meshRenderer var to _meshRenderer = gameObject.GetComponent<MeshRenderer>();. I found a similar error with the shaders. Apparently the fixes from the JScript conversion wasn't precise, as I thought. Also noticed that some of the vars weren't visibile to the OnRenderObject() function, so I copied the declarations to here (still need to figure this one out). However, even with those, it was still returning an error about no game object. So I changed Start() to Start(Vessel myVessel) and OnRenderObject() to OnRenderObject(Vessel myVessel). So now... no errors in the log! Now the problem is.... there is still absolutely nothing displaying in KSP and with no errors to track, I'm at a loss as to what to do. Any advice? using System; using KSP.IO; using UnityEngine; using System.Collections; using System.Collections.Generic; namespace kADAR { [KSPAddon(KSPAddon.Startup.Flight, false)] public class kADAR : PartModule { public FlightGlobals myVessel = null; Color lineColor = Color.red; Color backgroundColor = Color.black; public bool Zwrite = true; public bool Awrite = true; public bool blend = true; private Vector3[] lines = null; ArrayList linesArray = null; private Material lineMaterial; public MeshRenderer _meshRenderer; int i; public string _shader = "Lines/Background"; public void Start(Vessel myVessel) { myVessel = this.vessel; //var Zwrite = true; //var Awrite = true; //var blend = true; Debug.Log("Start()"); //gameObject.AddComponent(typeof(MeshRenderer)); //_meshRenderer = (MeshRenderer)GetComponent(typeof(MeshRenderer)); _meshRenderer = gameObject.GetComponent<MeshRenderer>(); if (!_meshRenderer) //_meshRenderer = (MeshRenderer)gameObject.AddComponent(typeof(MeshRenderer)); _meshRenderer = gameObject.AddComponent<MeshRenderer>(); //_meshRenderer.material = new Material("Shader \"Lines/Background\" { Properties { _Color (\"Main Color\", Color) = (1,1,1,1) } SubShader { Pass {" + (Zwrite ? " ZWrite on " : " ZWrite off ") + (blend ? " Blend SrcAlpha OneMinusSrcAlpha" : " ") + (Awrite ? " Colormask RGBA " : " ") + "Lighting Off Offset 1, 1 Color[_Color] }}}"); _meshRenderer.material = new Material(Shader.Find("Particles/Additive")); //lineMaterial = new Material("Shader \"Lines/Colored Blended\" { SubShader { Pass { Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Front Fog { Mode Off } } } }"); lineMaterial = new Material(Shader.Find("Particles/Additive")); lineMaterial.hideFlags = HideFlags.HideAndDontSave; lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave; var linesArray = new ArrayList(); //var filter = GetComponent(typeof( MeshFilter)); var filter = GetComponent<MeshFilter>(); var mesh = filter.mesh; var vertices = mesh.vertices; var triangles = mesh.triangles; for (i = 0; i < triangles.Length / 3; i++) { linesArray.Add(vertices[triangles[i * 3]]); linesArray.Add(vertices[triangles[i * 3 + 1]]); linesArray.Add(vertices[triangles[i * 3 + 2]]); } //Vector3 Varray = new Vector3(linesArray.Count); linesArray.CopyTo(lines); } public void OnRenderObject(Vessel myVessel) { if (!myVessel) { Debug.Log("OnRenderObject: myVessel is null " + myVessel); myVessel = this.vessel; } if (!myVessel) Debug.Log("OnRenderObject: myVessel is STILL null " + myVessel); try { _meshRenderer = GetComponent<MeshRenderer>(); if (!_meshRenderer) _meshRenderer = gameObject.GetComponent<MeshRenderer>(); if (!_meshRenderer) _meshRenderer = gameObject.AddComponent<MeshRenderer>(); _meshRenderer.enabled = true; lineMaterial = new Material(Shader.Find("Particles/Additive")); Debug.Log("OnRenderObject()"); if (_meshRenderer == null) Debug.Log("OnRenderObject: meshRenderer is null"); else if (_meshRenderer.material == null) Debug.Log("OnRenderObject: meshRenderer.material is null"); else _meshRenderer.material.color = backgroundColor; if (lineMaterial == null) Debug.Log("OnRenderObject: lineMaterial is null"); else lineMaterial.SetPass(0); GL.PushMatrix(); if (transform == null) Debug.Log("OnRenderObject: transform is null"); else GL.MultMatrix(transform.localToWorldMatrix); GL.Begin(GL.LINES); GL.Color(lineColor); for (i = 0; i < lines.Length / 3; i++) { GL.Vertex(lines[i * 3]); GL.Vertex(lines[i * 3 + 1]); GL.Vertex(lines[i * 3 + 1]); GL.Vertex(lines[i * 3 + 2]); GL.Vertex(lines[i * 3 + 2]); GL.Vertex(lines[i * 3]); } GL.End(); GL.PopMatrix(); } catch (Exception ex) { Debug.Log("OnRenderObject error: " + ex.Message); } } } }
  12. Hey UbioZur, I see more than one complaint about "too many parts" or "wanting a different section" for the Welded Parts. If you can't figure out the Parts Catalog conflict or other solution, I have a suggestion. Take a peak at Subassembly loader. Instead of dropping subassembly parts into the parts list, it has a save and load function. You could do something similiar. It would help keep track of loaded parts. Just a suggestion.
  13. This is the script to test the wireframe I've adapted from here. Not sure if my conversion from JScript to C# is accurate. namespace kADAR { [KSPAddon(KSPAddon.Startup.Flight, false)] public class kADAR : PartModule { public FlightGlobals vessel = null; Color lineColor = Color.red; Color backgroundColor = Color.black; public bool Zwrite = true; public bool Awrite = true; public bool blend = true; private Vector3[] lines = null; ArrayList linesArray = null; private Material lineMaterial; private MeshRenderer meshRenderer; int i; public void Start() { var vessel = this.vessel; //var Zwrite = true; //var Awrite = true; //var blend = true; Debug.Log("Start()"); meshRenderer = GetComponent("MeshRenderer") as MeshRenderer; if (!meshRenderer) meshRenderer = gameObject.AddComponent("MeshRenderer") as MeshRenderer; meshRenderer.material = new Material("Shader \"Lines/Background\" { Properties { _Color (\"Main Color\", Color) = (1,1,1,1) } SubShader { Pass {" + (Zwrite ? " ZWrite on " : " ZWrite off ") + (blend ? " Blend SrcAlpha OneMinusSrcAlpha" : " ") + (Awrite ? " Colormask RGBA " : " ") + "Lighting Off Offset 1, 1 Color[_Color] }}}"); lineMaterial = new Material("Shader \"Lines/Colored Blended\" { SubShader { Pass { Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Front Fog { Mode Off } } } }"); lineMaterial.hideFlags = HideFlags.HideAndDontSave; lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave; var linesArray = new ArrayList(); var filter = GetComponent("MeshFilter") as MeshFilter; var mesh = filter.mesh; var vertices = mesh.vertices; var triangles = mesh.triangles; for (i = 0; i < triangles.Length / 3; i++) { linesArray.Add(vertices[triangles[i * 3]]); linesArray.Add(vertices[triangles[i * 3 + 1]]); linesArray.Add(vertices[triangles[i * 3 + 2]]); } //Vector3 Varray = new Vector3(linesArray.Count); linesArray.CopyTo(lines); } public void OnRenderObject() { Debug.Log("OnRenderObject()"); meshRenderer.material.color = backgroundColor; lineMaterial.SetPass(0); //GL. GL.PushMatrix(); GL.MultMatrix(transform.localToWorldMatrix); GL.Begin(GL.LINES); GL.Color(lineColor); for (i = 0; i < lines.Length / 3; i++) { GL.Vertex(lines[i * 3]); GL.Vertex(lines[i * 3 + 1]); GL.Vertex(lines[i * 3 + 1]); GL.Vertex(lines[i * 3 + 2]); GL.Vertex(lines[i * 3 + 2]); GL.Vertex(lines[i *3]); } GL.End(); GL.PopMatrix(); } } } But I get this in the error log: Matrix stack full depth reached (Filename: Line: 32) NullReferenceException: Object reference not set to an instance of an object at kADAR.kADAR.OnRenderObject () [0x00000] in <filename unknown>:0 How do I set the object reference with GL?
  14. I've seen many people draw lines in their plugins. MechJeb for landing markers, everything LazerTech, Hydrotech guide lines, so forth and etc. But, as I'm new to C# and Unity, I can't as of yet follow their complex code to make use of it. So I know the lines is possible, I just need a simple example. There was a simplish mod, Lightswitch, but it was abandoned and all the source taken down before I could grab it. Essentially, I want to write a IVA HUD plugin and/or in Flight "radar" system. Yes, the I guessed the wireframe rendering would have to be done per part and the idea is drawing it in a window minus the texture. I found a JScript example which looks promising, but having a big of pain converting it to C#. Particularly due to the .toBuiltIn() function that is present in JScript but not in C#.
  15. I have two questions related to a plugin I'm working on. The first, drawing lines and shapes in world space. I've played around with examples from the Unity Documentation, but have yet to get them to work in KSP. I'm particularly interested in GL. Any advice or just a point to a simple working example would be very helpful. Second. I want to take an existing 3D gameobject (a ship for sample) and render a wireframe 2D representation of that ship. I'm sure this will be no easy feat, but I've seen reference to gameobject.renderer.wireframe in documentation, but again find that I am unable to get that example working within KSP. Any advice on this or perhaps a different way to draw a 2D representation of a 3D game object in a window? Thanks in advance, NOS
  16. If you go into Graphics Settings and set the Texture resolution to Half-Res or Quarter-Res, this will greatly reduce or eliminate Memory Cap related crashes. On my primary save, I run 45 mods, including B9, NovaPunch, Fustek, DSM, KW Rockety, LLL, THSS, and many many parts heavy mods. I very rarely see crashes. Give it a try.
  17. Compatibility Report (Thus Far) Tested and Working: KW Rocketry, B9, KSPX, MechJeb, LLL(?), THSS, Kethane (Mostly) Tested and Not-Working: Parts Catalog, FAR Notable Bugs present in all tests: 1.) Lights. If more than one Light is present in a weld (including those pretty togglable cockpit lights in B9), then the weld will break. 2.) Animations. If more than one part with Animation is present in the weld, then the weld will break. These are known KSP issues, not issues with this Plugin. (As far as I know). 3.) There is an issue that if things are radially attached, the welded part becomes unattachable. Fix for 3.) I've figured out that the error is do to the plugin not knowing what to do with many attachment nodes, so far I think this is limited to upward facing nodes. To fix this error, simply "cap" the nodes you aren't going to use. Nose cones work well, in this picture I used parachutes. Mod Specific Notes. B9: Some parts in combination will break (see notes 1 and 2) LLL: Previous posters have commented that these are unweldable. However, I haven't had an issue. So, broken? Kethane: All non-animated parts work fine. But I've found that all animated parts generate an error, even if used alone. They still seem to "work", minus animation though. Parts Catalog: Will not display new parts in the catalog (even if All is chosen). Only fix that I've found is exiting the game, deleting the catalog.txt in the PluginData folder and relaunch. Not a workable fix, because it would mean having to relaunch the game each time you weld. More testing tonight.
  18. B9 Compatibility Report. Installation of B9 does not break the Weld Plug in. Good news is, seems that nearly all parts can be welded just fine. There are few odd examples. Some of the tail pieces generate an exception and are not welded but ONLY if they are preceeded by an animated storage compartment. Alone, they seem to function properly. This may be an issue with multiple animations per part. Alone, each animate part functions properly in the weld. Additionally, if more than one light is added to the weld, this seems to throw an exception to. However, if I remember, both of these are known issues with KSP (multiple animations per part and multiple lights per part are not allowed). I could be mistaken, I only vaguely recall reading that someplace. Associated Logs. KSP_Log.txt http://pastebin.com/sucSdapF Output_log.txt http://pastebin.com/breq2rTF http://pastebin.com/f1mgYBs3
  19. New Bug Report. So far I've tested it with most of the stock Squad parts with little issues, save one. If a part that has a radial attachment node is welded, it seems that the entire weld becomes unattachable using the nodes, radially attaching the entire part works though. See screen shots below. http://imgur.com/a/ogwua#0 And the part.cfg I will start testing other popular mods tonight, including KSPX, KW, B9 and others. I'll let you know if I encounter any mod specific issues.
  20. Deleting the part allows you to select other parts, which act as above. The load behind the the part list as normal, but are not "grabbed" by the mouse. The rest of the VAB remains unresponsive.
  21. Yes. On clicking the parts list, it makes the sound as if you had selected a part and the part is visible behind the parts list. But the mouse doesn't "grab" the part. Clicking again deletes the part.
  22. Bug report: After welding and getting the OK confirmation screen, VAB becomes completely unresponsive. Unable to rotate or select parts. Buttons (launch, go to space center, etc) equally unresponsive. Welded part does show up, but if game is rebooted and part is selected, VAB becomes unresponsive again. I dug this out of the outpug_lot.txt: A similiar error repeats for every part that is welded. I have tested on my usual game running many mods as well as a clean install running no mods but this one.
  23. Here is an example of the test I'm doing with GL. Thus far, I've been completely unable to have anything display on the screen and no errors appear in the log. I don't know if I'm doing the material wrong, the GL calls wrong, or if the position is wrong. Any advice? [KSPAddon(KSPAddon.Startup.Flight, false)] public class GLTest : PartModule { static Material lineMaterial; static void CreateLineMaterial() { if (!lineMaterial) { lineMaterial = new Material("Shader \"Lines/Colored Blended\" {" + "SubShader { Pass { " + " Blend SrcAlpha OneMinusSrcAlpha " + " ZWrite Off Cull Off Fog { Mode Off } " + " BindChannels {" + " Bind \"vertex\", vertex Bind \"color\", color }" + "} } }"); lineMaterial.hideFlags = HideFlags.HideAndDontSave; lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave; } } public void OnPostRender() { Vector3 firstPosition = transform.position; CreateLineMaterial(); lineMaterial.SetPass( 0 ); GL.Begin( GL.LINES ); GL.Color(Color.red); GL.Vertex3(firstPosition.x, firstPosition.y, firstPosition.z); GL.Color(Color.black); GL.Vertex3(firstPosition.x * 2, firstPosition.y * 2, firstPosition.z * 2); GL.Color(Color.blue); GL.Vertex3(firstPosition.x * 4, firstPosition.y * 4, firstPosition.z * 4); GL.Color(Color.cyan); GL.Vertex3(firstPosition.x * 8, firstPosition.y * 8, firstPosition.z * 8); GL.Color(Color.gray); GL.Vertex3(firstPosition.x * -2, firstPosition.y * -2, firstPosition.z * -2); GL.Color(Color.green); GL.Vertex3(firstPosition.x * -4, firstPosition.y * -4, firstPosition.z * -4); GL.Color(Color.magenta); GL.Vertex3(firstPosition.x * -8, firstPosition.y * -8, firstPosition.z * -8); GL.End(); } P.S. Yes, I have a part on the ship. I've had limited success with LineRenderer showing a line extending from the ship, but have been unable (yet) to figure out how to effectively manipulate the resulting line from LineRenderer.
  24. I'm rather familiar with OOP, I'm more familiar with VB and C++ than with C#, but I'm getting the hang of it, it's not too difficult. However, I'm more of an active/visual learner and have always found examples more beneficial than documentation. I usually only use documentation as a reference to understand examples, because without a context to put something into, I often have difficulty conceptualizing things. That being said, I have an idea for a mod and I've been tinkering around in Visual Studio and KSP for a little over a week. I've gotten used to the basics, and have had success building GUIs and Windows to display information and such. But the one thing that has eluded me is the ability to draw something in space. Examples, MechJeb's Landing Marker, LazerTech lasers and planet markers, Hydrotech, etc etc and so forth. Thus far I've had moderate success with using LineRenderer, but have run into a limitation as Unity only allows a single instance to be attached to a gameobject and I've yet to figure a work around. I've had zero success using GL. I've tried using examples from the Unity Reference and have yet to see anything displayed on screen. I've spent the last few days digging through MechJeb's source code to figure out how to draw something as simple as Square or Triangle in front of the vessel, but have thus far been unable to accomplish anything displaying on the screen. Anyone care to point me in the right direction or know of a simple straight forward example I can play around with to figure out how it works? Thanks again, NOS
×
×
  • Create New...