JuhaJGamer
Members-
Posts
26 -
Joined
-
Last visited
Reputation
0 NeutralProfile Information
-
About me
Bottle Rocketeer
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Dialog boxes and Launching
JuhaJGamer replied to JuhaJGamer's topic in KSP1 C# Plugin Development Help and Support
Thanks, will look into it. Stupid that there doesn't seem to be an obvious way to do it, since so many nearly useless events have an obvious way to intercept them. Then again, the launch function was probably one of the first implemented, ever. -
So, I've got a bit of a problem. 1: I haven't coded since like 0.90, and 2: I need to get myself a dialog box BEFORE the loading screen on launches. That is, execute a function when the "Launch" button is pressed in either the editor or the ksc screens, preventing the loading until the function returns and/or is resolved in another way. For example, the recovery warning when trying to launch with a vessel on pad does this. I merely ask for two things: Is it possible, and if, how. And of course I have the alternative of using onVesselRollout or something, but I really want to do it before the loading screen. Before attacking me for this, I have spent the last hour trying to figure it out. Sorry for the possibly stupid question, just looking for help, and thanks in advance! For context I'm using a ScenarioModule with the [KSPScenario] attribute.
-
Alright thanks, but now I have an another problem, I can get any other resource, but I cant get EC for some reason, I have tried if (part.RequestResource("ElectricCharge", rayPowerUsage / 1000) < chargeFuelUsage / 1000) if (part.RequestResource("Electric Charge", rayPowerUsage / 1000) < chargeFuelUsage / 1000) and if (part.RequestResource("EC", rayPowerUsage / 1000) < chargeFuelUsage / 1000) None of them seem to work though
-
So, I fixed my rendezvous problem by stealing some Hyperedit code(totally legal) but i might have a small problem... I have a [KSPEvent] but it cant bind for some reason: [EXC 00:25:12.469] ArgumentException: Couldn't bind to method 'fireCannon'. System.Delegate.GetCandidateMethod (System.Type type, System.Type target, System.String method, BindingFlags bflags, Boolean ignoreCase, Boolean throwOnBindFailure) System.Delegate.CreateDelegate (System.Type type, System.Object target, System.String method, Boolean ignoreCase, Boolean throwOnBindFailure) System.Delegate.CreateDelegate (System.Type type, System.Object target, System.String method, Boolean ignoreCase) BaseEventList.CreateDelegates (System.Object part) BaseEventList..ctor (.Part part, .PartModule module) PartModule.ModularSetup () PartModule.Awake () UnityEngine.GameObject:AddComponent(Type) Part:AddModule(String, Boolean) Part:AddModule(ConfigNode, Boolean) PartLoader:ParsePart(UrlConfig, ConfigNode) <CompileParts>c__Iterator62:MoveNext() UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) [ERR 00:25:12.473] PartLoader: Encountered exception during compilation. System.NullReferenceException: Object reference not set to an instance of an object at PartModule.Load (.ConfigNode node) [0x00000] in <filename unknown>:0 at Part.AddModule (.ConfigNode node, Boolean forceAwake) [0x00000] in <filename unknown>:0 at PartLoader.ParsePart (.UrlConfig urlConfig, .ConfigNode node) [0x00000] in <filename unknown>:0 at PartLoader+<CompileParts>c__Iterator62.MoveNext () [0x00000] in <filename unknown>:0 [ERR 00:25:12.475] PartCompiler: Cannot compile part My code consists of: [KSPEvent(guiActive = true, guiName = "Fire cannon")] public bool fireCannon() { ScreenMessages.PostScreenMessage("The precharge will not check if you have fuel, and just use it. Check to have 7.5 units of Korex and plenty of EC"); //check if enough fuel if (part.RequestResource(korexID, chargeFuelUsage) == chargeFuelUsage) { //start charge coroutine StartCoroutine(prechargeThing()); } return false; } And this prevents PartCompiler from loading the part
-
So to me any nuke can destroy any vessel within ~30km radius. even the small 340kt. the bomber at 10km going at over 400 m/s away from the bomb. speeding up to 25 horizontal distance away from the b-61 can get destroyed in the explosion.
- 2,035 replies
-
Ok, these are the two methods that I have tried. Directly editing the "quicksave" file takes time. There could be more vessels of the same name. And after that you must load it which may give you a quick fps-spike. The stock debug tool I cant find. Anywhere. No docs, no classes, no functions, It's like it doesn't exist. Velocity, I learned it actually today so that's great