-
Posts
485 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by MrHappyFace
-
Possible Planet Additions (Revised)
MrHappyFace replied to Samio's topic in KSP1 Suggestions & Development Discussion
I am: http://www.reddit.com/r/KerbalSpaceProgram/comments/1uio7b/poll_would_you_be_interested_in_an_interstellar/ -
Possible Planet Additions (Revised)
MrHappyFace replied to Samio's topic in KSP1 Suggestions & Development Discussion
Samio, I would like to add these planets in my interstellar travel mod. I sent you a PM with details, I hope you consider it! -MrHappyFace, CEO of HappyFace Industries -
Active Vessel
MrHappyFace replied to MrHappyFace's topic in KSP1 C# Plugin Development Help and Support
At the beginning of Update(), I could move it to Start() though -
Active Vessel
MrHappyFace replied to MrHappyFace's topic in KSP1 C# Plugin Development Help and Support
It keeps saying it it is null -
Active Vessel
MrHappyFace replied to MrHappyFace's topic in KSP1 C# Plugin Development Help and Support
I am trying to find the active vessel in flight -
How can I find the active vessel? FlightGlobals.ActiveVessel does not work for me
-
What in the configs can I edit to get a faster max speed out of wheels
-
Thanks for the quick reply, ill try that. another related question: what is the error message mean? EDIT: i added this: Debug.Log("Crap: Changing mun..."); Mun.orbitDriver.orbitColor = XKCDColors.ReddishBrown; if(MunHeight != null) { ChangeHeightMap(MunHeight, Mun, 700f, 1400d, -2000d); } else Debug.Log("AndrewCrap: MunHeight = null..."); if(MunColor != null) { ChangeColorMap(MunColor, Mun, 1.0f); } else Debug.Log("Crap: MunColor = null..."); And it still sadi the same debug message, but didnt say that MunColor or MunHeight were null either
-
This code is based off of some code from NovaSilisko's mod, Alternis Kerbol, but I cant figure out whats wrong public CelestialBody Mun; public CelestialBody Kerbin; public Texture2D MunColor; public Texture2D MunHeight; public Texture2D MunBump; private string path = "HappyFaceIndustries/Crap/Textures/"; public void ChangeHeightMap(Texture2D map, CelestialBody cb, float deformity, double heightMapDeformity, double heightMapOffset) { GameObject OldHeight = cb.pqsController.transform.FindChild("_Height").gameObject; if (OldHeight != null) { //sets deformity foreach (PQSMod_VertexHeightNoiseVertHeightCurve2 c in OldHeight.GetComponentsInChildren<PQSMod_VertexHeightNoiseVertHeightCurve2>()) { c.deformity = deformity; } //creates VertexMap PQSMod_VertexHeightMap VertexMap = OldHeight.GetComponent<PQSMod_VertexHeightMap>(); //edits VertexMap, sets height map if (VertexMap != null && map != null) { VertexMap.heightMap.CreateMap(MapSO.MapDepth.Greyscale, map); VertexMap.heightMapDeformity = heightMapDeformity; VertexMap.heightMapOffset = heightMapOffset; } if(map = null) {Debug.Log("Crap: map null...");} } } public void ChangeColorMap(Texture2D color, /*Texture2D bumpMap,*/ CelestialBody cb, float blend) { //sets color map PQSMod_VertexColorMapBlend OldColor = cb.transform.GetComponentInChildren<PQSMod_VertexColorMapBlend>(); if (OldColor != null) { OldColor.vertexColorMap.CreateMap(MapSO.MapDepth.RGB, color); OldColor.blend = blend; } //sets color noise PQSMod_VertexSimplexNoiseColor oldColorNoise = cb.transform.GetComponentInChildren<PQSMod_VertexSimplexNoiseColor>(); if (oldColorNoise != null) { oldColorNoise.order = OldColor.order + 1; oldColorNoise.blend = 0.1f; } //sets scaledspace maps foreach (Transform t in ScaledSpace.Instance.scaledSpaceTransforms) { t.gameObject.renderer.material.SetTexture("_MainTex", color); } } public void Awake() { MunColor = GameDatabase.Instance.GetTexture(path + "MunColor", false); MunHeight = GameDatabase.Instance.GetTexture(path + "MunHeight", false); } public void Start() { foreach(CelestialBody CB in FlightGlobals.Bodies) { if(CB.name == "Mun") Mun = CB; } //Mun Mun.orbitDriver.orbitColor = XKCDColors.ReddishBrown; ChangeHeightMap(MunHeight, Mun, 700f, 1400d, -2000d); ChangeColorMap(MunColor, Mun, 1f); } When i run KSP, it gives me this error: NullReferenceException: Object reference not set to an instance of an object at Crap.BaseCrap.ChangeColorMap (UnityEngine.Texture2D color, .CelestialBody cb, Single blend) [0x00000] in <filename unknown>:0 at Crap.BaseCrap.Start () [0x00000] in <filename unknown>:0
-
Whenever i try to write a foreach loop, nothing pops up in the auto-complete field, and when i try to just go ahead and type it, it does not recognize the code and gives me errors. I am using monodevelop unity because I am too lazy to install regular monodevelop, but it has worked perfectly for me in the past so it might not be the problem.
-
Mod directory question
MrHappyFace replied to EvilKot's topic in KSP1 C# Plugin Development Help and Support
Maybe vessel.goOnRails or something along those lines -
simple if/then code in part cfgs
MrHappyFace replied to seanth's topic in KSP1 C# Plugin Development Help and Support
You could do something similar to this, however, I am not at my computer so this exact code might not work. Just put this code in a class extending partmodule in the OnUpdate function and put the module in your part, no code in the config required! float ResourceRate; If(vessel.mainBody.name = "Kerbin") ResourceRate = 0.21; If(vessel.main body.name = "Laythe") ResourceRate = 0.15; Part.RequestResource("Oxygen", ResourceRate); [\CODE] -
using code similar to this: foreach(CelestialBody body in FlightGlobals.fetch.bodies) { if(body.bodyName == "Kerbin") { body.atmosphere = true; body.atmosphericAmbientColor = Color(0.99, 0.67, 0.11, 1); } } it says that 'UnityEngine.Color' is a 'type' but is used like a 'variable'. What kind of variable does atmosphereicAmbientColor use and how can I set it?
-
use mechjeb, its more stable