Diazo Posted January 1, 2015 Share Posted January 1, 2015 Nope. :/Every time you want to make a change to a .dll file, you need to quit entirely and restart.The best option is to make a second KSP install for dev purposes with a minimum of parts. Loading parts is 95% of the load time so if you can pare it down to only 10 parts, it loads much faster.D. Quote Link to comment Share on other sites More sharing options...
nohelmet Posted January 1, 2015 Share Posted January 1, 2015 Nope. :/Every time you want to make a change to a .dll file, you need to quit entirely and restart.Thank you Diazo, that is a very helpful reply.Given that I was going to do the mod for fun and that this situation is no fun at all, I'm not going to do a mod after all. I might come back to it later, but seriously 35s (I measured) is way too long. To keep things fun I much prefer times under 1s. My esteem for all the modders just went even higher! I hope that some day someone figures out a way to speed up the cycle. Quote Link to comment Share on other sites More sharing options...
TriggerAu Posted January 1, 2015 Share Posted January 1, 2015 ...I hope that some day someone figures out a way to speed up the cycle.It is one of my prayers Quote Link to comment Share on other sites More sharing options...
Greep Posted January 2, 2015 Share Posted January 2, 2015 Hey, so I've modded some games a while back and I'm just curious how difficult it is to mod ksp before I attempt it. E.g., if I wanted to do something kinda simple, like change the launch button in the VAB to instead check if a condition with the ship is met (like it has a certain part or something), and instead give a popup or grey out if the condition isn't met, how difficult would this be? And if that's pretty easy, what kind of steps would I need to do to accomplish that? Quote Link to comment Share on other sites More sharing options...
Crzyrndm Posted January 2, 2015 Share Posted January 2, 2015 (edited) Covers most of the basics: http://wiki.kerbalspaceprogram.com/wiki/Plugins, and there are some great examples in TriggerAu's sig (see Plugin Framework)EditorLogic.fetch.launchBtnThat will get you the button, there will be a state reference (enabled maybe) in there. Just run whatever check you need in Update and set it to be disabled. Edited January 2, 2015 by Crzyrndm Quote Link to comment Share on other sites More sharing options...
Greep Posted January 2, 2015 Share Posted January 2, 2015 Ah okay, I just get super lost when I first start modding, after reading a bit I think I think I've figured out how to get that going. So I'd basically make a module that starts up in the VAB editor and on update check something to enable/disable the launch button or something to that effect? That doesn't sound too hard Quote Link to comment Share on other sites More sharing options...
TriggerAu Posted January 2, 2015 Share Posted January 2, 2015 Sounds simple Greep... until you start adding things Quote Link to comment Share on other sites More sharing options...
NathanKell Posted January 3, 2015 Share Posted January 3, 2015 zengei, you'll want to disable the MeshRenderer etc attached to the scaled space transform of the same name as the body. Quote Link to comment Share on other sites More sharing options...
zengei Posted January 6, 2015 Share Posted January 6, 2015 zengei, you'll want to disable the MeshRenderer etc attached to the scaled space transform of the same name as the body.Thanks, I'll give that a shot when I look into it again. Quote Link to comment Share on other sites More sharing options...
EladDv Posted January 7, 2015 Share Posted January 7, 2015 how can i draw a hex map i created on the map view of kerbin? Quote Link to comment Share on other sites More sharing options...
heaton84 Posted January 8, 2015 Share Posted January 8, 2015 How do I get the distance to the active target, it's relative velocity and the ascending/descending node numbers for it's orbit? Quote Link to comment Share on other sites More sharing options...
Diazo Posted January 8, 2015 Share Posted January 8, 2015 FlightGlobals.activeTarget is the current target, you'll have to do a IsVessel? check on it.Looking at that method in the brower, it returns a Part? Not sure what that means for when you have a planet targeted.Relative velocity is then straightforward math and the node numbers are probalby in the FlightGlobals.activeTarget.vessel.GetOrbit() object somewhere.Hope that helps,D. Quote Link to comment Share on other sites More sharing options...
TriggerAu Posted January 8, 2015 Share Posted January 8, 2015 How do I get the distance to the active target, it's relative velocity and the ascending/descending node numbers for it's orbit?For the Target you use the targetObject of the active vesselFor Distance you use the vectors of absolute position between the two objectsFor velocity its a similar thing to the distance, just use the getVelocity funtions and diff the vectorsAscendingNode/Descending node you need to do the math yourself, but you can look at existing code in MechJeb, KER, KAC or one of the others that already do thisHeres the first bit of code for the vessel, its target and distance between em Warning - this is from my head, but should be pretty closeVessel vessel1 = FlightGlobals.ActiveVesselif (Vessel1.targetObject is Vessel){ Vessel vessel2 = vessel1.targetObject Vector3D vessel1Pos = vessel1.orbit.getRelativePositionAtUT(FlightGlobals.GetPlanetariumTime()) + vessel1.orbit.referenceBody.position; Vector3D vessel2Pos = vessel2.orbit.getRelativePositionAtUT(FlightGlobals.GetPlanetariumTime()) + vessel2.orbit.referenceBody.position; Double distance = (vessel1Pos - vessel2Pos).magnitude;} Quote Link to comment Share on other sites More sharing options...
Seeker89 Posted January 8, 2015 Share Posted January 8, 2015 HelloSo I decided to edit Interstellar, to remove everything but the microwave power transmitter stuff... because that's all I want. I delete all the other .cv that didn't have to do with them, and moved on to removing the lines in the .cv that didn't matter(like the reactor power lines, and wasteheat). I have of course run to in problems... Error 1 'FNPlugin.MicrowavePowerReceiver.OnUpdate()': no suitable method found to overrideError 2 'FNPlugin.MicrowavePowerTransmitter.OnStart(PartModule.StartState)': no suitable method found to override Error 3 'FNPlugin.MicrowavePowerTransmitter.OnUpdate()': no suitable method found to override Error 4 'FNPlugin.MicrowavePowerReceiver.GetInfo()': no suitable method found to override Error 5 'FNPlugin.MicrowavePowerTransmitter.OnFixedUpdate()': no suitable method found to override What did I do wrong? Quote Link to comment Share on other sites More sharing options...
sarbian Posted January 8, 2015 Share Posted January 8, 2015 From the MicrowavePowerReceiver source : class MicrowavePowerReceiver : FNResourceSuppliableModule, IThermalSource {This class inherits from the FNResourceSuppliableModule and implement IThermalSource. So if your removed those it won't compile...You should have a look at the source before going on a delete rampage. Quote Link to comment Share on other sites More sharing options...
heaton84 Posted January 8, 2015 Share Posted January 8, 2015 For the Target you use the targetObject of the active vesselFor Distance you use the vectors of absolute position between the two objectsFor velocity its a similar thing to the distance, just use the getVelocity funtions and diff the vectorsAscendingNode/Descending node you need to do the math yourself, but you can look at existing code in MechJeb, KER, KAC or one of the others that already do thisHeres the first bit of code for the vessel, its target and distance between em Warning - this is from my head, but should be pretty closeVessel vessel1 = FlightGlobals.ActiveVesselif (Vessel1.targetObject is Vessel){ Vessel vessel2 = vessel1.targetObject Vector3D vessel1Pos = vessel1.orbit.getRelativePositionAtUT(FlightGlobals.GetPlanetariumTime()) + vessel1.orbit.referenceBody.position; Vector3D vessel2Pos = vessel2.orbit.getRelativePositionAtUT(FlightGlobals.GetPlanetariumTime()) + vessel2.orbit.referenceBody.position; Double distance = (vessel1Pos - vessel2Pos).magnitude;}Close ! I just had to use Planetarium.GetUniversalTime() instead of GetPlanetariumTime(). That works. Many thanks!Here's what I'm doing with it: http://forum.kerbalspaceprogram.com/threads/106192-LEDJeb-A-Physical-*and*-Virtual-LED-Readout Quote Link to comment Share on other sites More sharing options...
TriggerAu Posted January 8, 2015 Share Posted January 8, 2015 Close ! I just had to use Planetarium.GetUniversalTime() instead of GetPlanetariumTime(). That works. Many thanks!Here's what I'm doing with it: http://forum.kerbalspaceprogram.com/threads/106192-LEDJeb-A-Physical-*and*-Virtual-LED-ReadoutNice stuff Quote Link to comment Share on other sites More sharing options...
Seeker89 Posted January 9, 2015 Share Posted January 9, 2015 (edited) Never Mind.... I should stop trying to learn to code without taking any courses or reading any books... Edited January 9, 2015 by Seeker89 I figured it out Quote Link to comment Share on other sites More sharing options...
Seeker89 Posted January 10, 2015 Share Posted January 10, 2015 Okay, I think I figured out the questions I need help on. I'm still playing with the interstellar mod. For some reason this "works" { foreach (ModuleGenerator generator in generators) { if (generator.generatorIsActive) { double output = generator.efficiency; double gpower = part.RequestResource("ElectricCharge", output * TimeWarp.fixedDeltaTime); nuclear_power += gpower } } } but I don't know if it's just pulling the number from efficiency is the best idea but I haven't figured out how to pull the number from the rate.The second problem I'm having with is; that it's not running through FractalUK's power manger(FNResourceManager or the ORS one) to make sure that it has all the ElectricCharge it needs before sending it.The other thoughts I had was to; just remove both modules(this and ModuleDeployableSolarPanel) and just tell it to remove lets say up 1 million ElectricCharge if it all the power it needed was there. but I don't know how to do that. Thanks againSeeker Quote Link to comment Share on other sites More sharing options...
Fanatorium Posted January 10, 2015 Share Posted January 10, 2015 Hi, I have i question about KSPEvents.I have an event, which is only 'clickable' by a kerbal on EVA.For example:[KSPEvent(active = true, guiActiveUnfocused = true, guiName = "MyEvent", unfocusedRange = 20f, externalToEVAOnly = true)] private void Event() { }Now I need to get the kerbal who triggered the event because I would like to teleport the triggering kerbal to another position.Does someone know how this could be done?GreetingsFanatorium Quote Link to comment Share on other sites More sharing options...
Padishar Posted January 10, 2015 Share Posted January 10, 2015 Hi, I have i question about KSPEvents.I have an event, which is only 'clickable' by a kerbal on EVA.For example:[KSPEvent(active = true, guiActiveUnfocused = true, guiName = "MyEvent", unfocusedRange = 20f, externalToEVAOnly = true)] private void Event() { }Now I need to get the kerbal who triggered the event because I would like to teleport the triggering kerbal to another position.Does someone know how this could be done?GreetingsFanatoriumErrr, the Kerbal is on EVA so must be the currently active vessel... Quote Link to comment Share on other sites More sharing options...
Fanatorium Posted January 10, 2015 Share Posted January 10, 2015 Errr, the Kerbal is on EVA so must be the currently active vessel...Ouh damn, thought there is a difference between EVA and vessel...Thanks four your hint Quote Link to comment Share on other sites More sharing options...
intervenience Posted January 16, 2015 Share Posted January 16, 2015 MissionRecoveryDialog isn't returning the reputation, science and funds earned during flight. I've tried using both onVesselRecoveryProcessing and onVesselRecovered but neither of those will give me a value other than 0. However, each function will give me a value for the current universal time so I don't quite understand what's going wrong. An explanation would be very appreciated, thanks.public void Start(){ GameEvents.onVesselRecoveryProcessing.Add(RecoveryProcessingCallback); GameEvents.onVesselRecovered.Add(RecoveryProcessing);}void RecoveryProcessingCallback(ProtoVessel pv, MissionRecoveryDialog dlg, float recovery){ MissionRecoveryDialog dialog = new MissionRecoveryDialog(); float repEarned = dialog.reputationEarned; float sciEarned = dialog.scienceEarned; double fundsEarned = dialog.fundsEarned; Debug.Log("[Recovery Timer] Rep: " + repEarned); Debug.Log("[Recovery Timer] Sci: " + sciEarned); Debug.Log("[Recovery Timer] Funds: " + fundsEarned); double currentUniversalTime = Planetarium.GetUniversalTime(); Debug.Log("[Recovery Timer] Time of recovery: " + currentUniversalTime);}void RecoveryProcessing(ProtoVessel pv){ MissionRecoveryDialog secondaryDialog = new MissionRecoveryDialog(); float repEarned = secondaryDialog.reputationEarned; float sciEarned = secondaryDialog.scienceEarned; double fundsEarned = secondaryDialog.fundsEarned; Debug.Log("[Recovery Timer] Rep: " + repEarned); Debug.Log("[Recovery Timer] Sci: " + sciEarned); Debug.Log("[Recovery Timer] Funds: " + fundsEarned); double currentUniversalTime = Planetarium.GetUniversalTime(); Debug.Log("[Recovery Timer] Time of recovery: " + currentUniversalTime); } Quote Link to comment Share on other sites More sharing options...
sarbian Posted January 16, 2015 Share Posted January 16, 2015 You create a new MissionRecoveryDialog each time, so of course the value are 0. The callback provides the dialog instance in its parameters.Not tested but should work (I forgot what the recovery value is):public void Start(){ GameEvents.onVesselRecoveryProcessing.Add(RecoveryProcessingCallback);}void RecoveryProcessingCallback(ProtoVessel pv, MissionRecoveryDialog dlg, float recovery){ float repEarned = dlg.reputationEarned; float sciEarned = dlg.scienceEarned; double fundsEarned = dlg.fundsEarned; Debug.Log("[Recovery Timer] Rep: " + repEarned); Debug.Log("[Recovery Timer] Sci: " + sciEarned); Debug.Log("[Recovery Timer] Funds: " + fundsEarned); double currentUniversalTime = Planetarium.GetUniversalTime(); Debug.Log("[Recovery Timer] Time of recovery: " + currentUniversalTime);} Quote Link to comment Share on other sites More sharing options...
intervenience Posted January 16, 2015 Share Posted January 16, 2015 You create a new MissionRecoveryDialog each time, so of course the value are 0. The callback provides the dialog instance in its parameters.Not tested but should work (I forgot what the recovery value is):public void Start(){ GameEvents.onVesselRecoveryProcessing.Add(RecoveryProcessingCallback);}void RecoveryProcessingCallback(ProtoVessel pv, MissionRecoveryDialog dlg, float recovery){ float repEarned = dlg.reputationEarned; float sciEarned = dlg.scienceEarned; double fundsEarned = dlg.fundsEarned; Debug.Log("[Recovery Timer] Rep: " + repEarned); Debug.Log("[Recovery Timer] Sci: " + sciEarned); Debug.Log("[Recovery Timer] Funds: " + fundsEarned); double currentUniversalTime = Planetarium.GetUniversalTime(); Debug.Log("[Recovery Timer] Time of recovery: " + currentUniversalTime);}God, I'm such an idiot. That was it, thank you very much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.