JoePatrick1
Members-
Posts
400 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by JoePatrick1
-
I have this module and I would like it to be added to all parts with the "vesselType = Probe" line but only if ProbeLowPower mod is installed. MODULE { name = ProbeLowPower lowPowerRatio = 0.005 } I think the MM cfg has to look something like this but not sure, can someone tell me if this is right/what the right cfg would be. @PART:NEEDS[ProbeLowPower], :HAS[vesselType[Probe]] MODULE { name = ProbeLowPower lowPowerRatio = 0.005 } Thanks
-
I am writing a plugin to add a lower power mode to probe cores and need away to disable control whilst it's enabled then allow control when it is then disabled. So I need to be able to enable/disable control but the gui button needs to still be accessible Here is my code currently up to this point using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ProbeLowPower { public class ProbeLowPower : PartModule { [KSPField(isPersistant = true)] public bool lowPowerMode; [KSPField(isPersistant = false)] public float lowPowerRatio; public double normalRate; public double lowPowerRate; public ModuleResource moduleResource; public override void OnLoad(ConfigNode node) { if (HighLogic.LoadedSceneIsFlight) { foreach (ModuleResource modres in this.part.GetComponent<ModuleCommand>().inputResources) { if (modres.name == "ElectricCharge") { moduleResource = modres; normalRate = modres.rate; lowPowerRate = normalRate * lowPowerRatio; } } print("AWAKE, Low Power Mode: " + lowPowerMode); if (lowPowerMode) moduleResource.rate = lowPowerRate; else moduleResource.rate = normalRate; } } [KSPEvent(active = true, guiActive = true, guiActiveEditor = false, guiActiveUnfocused = false, guiName = "Low Power Mode: Disabled")] public void activateLPM() { lowPowerMode = true; moduleResource.rate = lowPowerRate; this.part.isControlSource = false; //This doesn't work as the stock ModuleCommand overites it every frame Events["activateLPM"].active = false; Events["deactivateLPM"].active = true; } [KSPEvent(active = false, guiActive = true, guiActiveEditor = false, guiActiveUnfocused = false, guiName = "Low Power Mode: Enabled")] public void deactivateLPM() { lowPowerMode = false; moduleResource.rate = normalRate; this.part.isControlSource = true; //This doesn't work as the stock ModuleCommand overites it every frame Events["activateLPM"].active = true; Events["deactivateLPM"].active = false; } } }
-
I am trying to save 'lowPowerMode' so that if I load the craft it will be whatever it was when I was last flying that vessel but it always seems to reset to false when I re-load it. Here is the code using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ProbeLowPower { public class ProbeLowPower : PartModule { [KSPField(isPersistant = true)] public bool lowPowerMode; [KSPField(isPersistant = false)] public float lowPowerRatio; public double normalRate; public double lowPowerRate; public ModuleResource moduleResource; public override void OnAwake() { if (HighLogic.LoadedSceneIsFlight) { foreach (ModuleResource modres in this.part.GetComponent<ModuleCommand>().inputResources) { if (modres.name == "ElectricCharge") { moduleResource = modres; normalRate = modres.rate; lowPowerRate = normalRate * lowPowerRatio; } } print("AWAKE, Low Power Mode: " + lowPowerMode); if (lowPowerMode) moduleResource.rate = lowPowerRate; else moduleResource.rate = normalRate; } } [KSPEvent(active = true, guiActive = true, guiActiveEditor = false, guiActiveUnfocused = false, guiName = "Low Power Mode: Disabled")] public void activateLPM() { lowPowerMode = true; moduleResource.rate = lowPowerRate; Events["activateLPM"].active = false; Events["deactivateLPM"].active = true; } [KSPEvent(active = false, guiActive = true, guiActiveEditor = false, guiActiveUnfocused = false, guiName = "Low Power Mode: Enabled")] public void deactivateLPM() { lowPowerMode = false; moduleResource.rate = normalRate; Events["activateLPM"].active = true; Events["deactivateLPM"].active = false; } } }
-
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
Thanks. Trying to get v0.4 out with the official 1.1 release if I can. -
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
Some visual improvements coming in v0.4 -
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
Not currently -
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
KerBalloons has been updated to v0.3.1 You can now set a lift limit so that you can carry smaller payloads with the bigger balloons without it accelerating to the speed of light. v0.4 is still under development but I wanted to get this feature out before then. Enjoy -
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
They do that anyway? The balloon inflates, goes up and bursts when the air pressure is too low - this is the max height. If you remove the min pressure limit, it should't burst and therefore keep rising until it doesn't produce enough lift You can reduce how high it can lift a payload by reducing its min and max lift in the config -
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
Errr yes....if the balloon doesn't burst then it can go higher....is that not obvious? -
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
You could try setting min pressure to -1, that might work -
I want to add a feature to my KerBalloons mod where the balloon will not accelerate faster than a predetermined value, e.g. 10ms-2 How would I go about doing this? I am using rigidbody.AddForceAtPosition to accelerate the balloon currently. If you use a suitable payload it works fine but if you use a small payload on one of the bigger balloons, it will accelerate so quickly that it will just explode. Will something like this work? lift = (payload mass/recommended payload mass) * lift for recommended payload I am not sure it will because of the force required vs the ship mass not being a linear relationship? The full source code for the mod can be found here if it helps. Thanks
-
He is planning on making a few other mods with my help, though not necessarily in the same pack. They don't currently work as science parts, just a camera. Some sort of science experiment may be built into it in the future though. Yes, check the original post for a video Same again, check original post for video. Zoom etc. not currently integrated but possibly in the future Just added it
-
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
This is something I am looking at working towards in the next update. Thanks, I am not sure if I will add balloons like this but I will certainly look into it. As for wind, I won't be adding it because if people want it then they can use one of the wind mods that already exist. Such as this one -
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
KerBalloons is now available to install from CKAN -
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
Not a bad idea, I'll look into something like this and see what I can come up with When the balloon reaches an altitude where the external pressure is too low - it will burst I have submitted it to be hosted on CKAN, it should be up in the next week. Also if you use kerbal.curseforge.com it is really no different to any other site - people just hold a grudge when it is unnecessary. -
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
Haha, I haven't tested it but it might work in 1.0.4 edit: just did a quick test and seems to work fine -
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
v0.3 has been released. Download it here Changlog -
[1.3] KerBalloons v0.4.2 - Balloons for KSP!
JoePatrick1 replied to JoePatrick1's topic in KSP1 Mod Development
v0.3 is almost ready for release. Here is a sneak peak.