stupid_chris Posted January 9, 2014 Share Posted January 9, 2014 Oh thank you so much! I've been searching this for hours but I couldn't find anything. It is going to help a lot with coding part. I used the mod back then, but it was annoying for me to add a part to the vessel and then have the first person view. I am trying to avoid that in my mod. Thank you so much again!EDIT: Unfortunately the mod doesn't come with the source code in it :/ So now, my question is (I know I asked a lot of questions for a tiny little mod but I'm new to C# and modding so please don't mind me ) how can I set the interior for KerbalEVA vessel? I read B9 interior source codes and also the stock ones and in all of them the interior file is stated in the Part.CFG so the game knows the interior of that part belongs to internal.cfg. But how can I change information of KerbalEVA so I can assign my interior as internal view in its codes?You'd ave to locate the KerbalEVA parts present in the universe and add an Internal node to them I believe. Quote Link to comment Share on other sites More sharing options...
Eadrom Posted January 10, 2014 Share Posted January 10, 2014 Trying to find a concise "this is how you start making a plugin" set of instructions was a little difficult. Best one so far that I've found is Cybutek's youtube series. It's from May 2013, but hopefully it's still accurate enough to get me started.As I understand it, as long as I'm not messing around with models or textures, I don't need Unity or PartTools. If I just want to do stuff in game or use parts supplied (with permission) by other people, I should have the need for Unity/PartTools, correct? So then I would just need a c# IDE such as MS Visual Studio Express. Are these statements correct? Do I have a basic understand on what is needed? Quote Link to comment Share on other sites More sharing options...
stupid_chris Posted January 10, 2014 Share Posted January 10, 2014 Yeah, if you're not making parts, you don't need unity or PartTools, just VS or MonoDev should be enough. Quote Link to comment Share on other sites More sharing options...
TriggerAu Posted January 10, 2014 Share Posted January 10, 2014 Trying to find a concise "this is how you start making a plugin" set of instructions was a little difficult. Best one so far that I've found is Cybutek's youtube series. It's from May 2013, but hopefully it's still accurate enough to get me started.As I understand it, as long as I'm not messing around with models or textures, I don't need Unity or PartTools. If I just want to do stuff in game or use parts supplied (with permission) by other people, I should have the need for Unity/PartTools, correct? So then I would just need a c# IDE such as MS Visual Studio Express. Are these statements correct? Do I have a basic understand on what is needed?That is correct Eadrom, adding models to the game requires Unity/PartTools, but information windows/tool that do background tasks dont need anything but Visual Studio Express for Windows Desktop or Monodevelop.Some other good resources for starting out are:the wiki pages on mod making and setting up VS (these are old) - http://wiki.kerbalspaceprogram.com/wiki/Creating_your_first_module and http://wiki.kerbalspaceprogram.com/wiki/Setting_up_Visual_StudioTaranisElsu built some good starter templates to give some example ideas for plugins - http://forum.kerbalspaceprogram.com/threads/56053-Example-plugin-projects-to-help-you-get-startedHoojiwanna compiled a great list of all modding info, including plugin stuff - http://forum.kerbalspaceprogram.com/threads/25013-Compilation-of-modding-information-links-for-0-19-20-21-22-Last-update-6th-Janand ofcourse this thread and the #KSPModders IRC channel Quote Link to comment Share on other sites More sharing options...
FlowerChild Posted January 10, 2014 Share Posted January 10, 2014 (edited) This is likely a face-palmingly simple question for more experienced KSP modders, but given I've tried multiple options to no avail, I'd figure I'd ask:Does anyone know how to access the title associated with a part (eg. "Stayputnik") given a part or partModule within code, rather than the class names or what have you?I'm likely missing something obvious, but going over the variables in the Part class and trying out a number of them, I can't seem to find it.EDIT: NM, occurred to me just after I wrote the above that Deadly Reentry was displaying this so I was able to check out its code.For reference in case anyone else has this issue: part.partInfo.title does the trick. Edited January 10, 2014 by FlowerChild Quote Link to comment Share on other sites More sharing options...
lunait Posted January 14, 2014 Share Posted January 14, 2014 I have a question (which I think hasn't been asked so far in the thread - forgive me if it has, but I couldn't find it) regarding celestial body properties. I'm currently playing with the RealSolarSystem mod with clouds added to some planets to make them resemble gas giants - but you can still land on them, since their surface behavior hasn't been changed. Do you know of any way to do this, either by changing the surface itself to make it resemble that of Jool, or in some other way? Would it for example be possible, for a certain celestial body, to set an altitude limit below which the vessel explodes or breaks apart? Quote Link to comment Share on other sites More sharing options...
NathanKell Posted January 14, 2014 Share Posted January 14, 2014 I haven't looked into that myself--do you usually break apart at a certain altitude for Jool? I thought I'd seen pics of people "landed" on Jool so thought not. I also didn't see any likely variable for that in CelestialBody when I was first writing RSS. What you might want to do is write a partmodule that checks vessel's pressure outside, and starts breaking parts if pressure gets too high (maybe hook into crashTolerance as a hack for determining how strong parts are). The Deadly Reentry source would be a great place to start--in fact, maybe it should just be added as a third check (beyond heat and G force) in the DRE main loop... Quote Link to comment Share on other sites More sharing options...
lunait Posted January 15, 2014 Share Posted January 15, 2014 I haven't looked into that myself--do you usually break apart at a certain altitude for Jool? I thought I'd seen pics of people "landed" on Jool so thought not. I also didn't see any likely variable for that in CelestialBody when I was first writing RSS. What you might want to do is write a partmodule that checks vessel's pressure outside, and starts breaking parts if pressure gets too high (maybe hook into crashTolerance as a hack for determining how strong parts are). The Deadly Reentry source would be a great place to start--in fact, maybe it should just be added as a third check (beyond heat and G force) in the DRE main loop...Well, I've never actually tried going into Jool's atmosphere deep enough to notice any such effects, but I've seen those videos as well. I looked at the API wiki for CelestialBody and couldn't see anything either. I guess it's not possible to change the planets' surfaces into Jool-like surfaces, so the "break apart at a certain altitude" option was more of a backup plan in case that wouldn't work. I would prefer if the property was bound to the CelestialBody and not to the vessel, but I guess that may not be possible in that case. Quote Link to comment Share on other sites More sharing options...
NathanKell Posted January 15, 2014 Share Posted January 15, 2014 I meant something to check the current pressure (which for obvious reasons *is* dependent on the CB's stats like staticPressureASL, atmosphereMultiplier, etc) and if > some maximum, break the part. Like how DRE handles reentry heat. Quote Link to comment Share on other sites More sharing options...
KCreator Posted January 15, 2014 Share Posted January 15, 2014 (edited) To make a Gas giant out of a planet, I think you can destroy its PQS, as Jool doesn't have one. But I think that might cause bad things to happen (especially to PQSCity's)... I should test one day XD Edited January 15, 2014 by KCreator giant != gaint Quote Link to comment Share on other sites More sharing options...
NathanKell Posted January 15, 2014 Share Posted January 15, 2014 Oh, yeah. That's true. I kinda misinterpreted the question I guess. Quote Link to comment Share on other sites More sharing options...
theSpeare Posted January 15, 2014 Share Posted January 15, 2014 Can anyone help me with finding out what I can do with the FlightDriver public class? Is there some API for this? Quote Link to comment Share on other sites More sharing options...
lunait Posted January 15, 2014 Share Posted January 15, 2014 (edited) Oh, yeah. That's true. I kinda misinterpreted the question I guess.No worries, I see what you mean - and it might work, but even though it depends on a property of the CelestialBody, the code that gives the desired effect would still be "attached" to the part, right?To make a Gas giant out of a planet, I think you can destroy its PQS, as Jool doesn't have one. But I think that might cause bad things to happen (especially to PQSCity's)... I should test one day XDThat would be a neat solution if possible! The planets/moons that I'd like to convert to gas giants don't have any easter eggs or other such things on them that I'm aware of, so PQSCity issues shouldn't matter, right? Or is PQSCity used for anything else apart from placing static objects like easter eggs? (I'm quite new to the plugin coding thing as you can probably tell, so please forgive any stupid questions ) Edited January 15, 2014 by lunait Quote Link to comment Share on other sites More sharing options...
NathanKell Posted January 15, 2014 Share Posted January 15, 2014 lunait: attached, yes, but...just try out Deadly Reentry if you haven't yet. You'll get what I mean.There's two things: *looking* like a gas giant, and actually adding pressure damage. For the former, removing PQS will work. For the latter, it's as we discussed: AFAIK no built-in pressure damage. Quote Link to comment Share on other sites More sharing options...
KCreator Posted January 16, 2014 Share Posted January 16, 2014 PQSCity is just for statics, no hidden use, aside from KSC's Launchpad. Should be safe to remove PQS, even if it has some on it... If it fails, though, a GetComponentsInChildren will fix all. Quote Link to comment Share on other sites More sharing options...
Rhidian Posted January 17, 2014 Share Posted January 17, 2014 I'm getting my feet wet with just doing cfg editing for now, and I have a question regarding the Science Experiments. I'm wanting to change the baseValue for a science experiment (for example, Crew Report), and I'm not sure how to directly override the value in the ScienceDefs.cfg. I have tried using @EXPERIMENT_DEFINITION[crewReport] within my own .cfg file, yet it doesn't appear to work. I have managed to get somewhat close to what I'm looking for by creating my own Experiment (ie a near copy of the entire Crew Report definition) and changing the basic Command cockpit to referencing my experiment instead, but I am hopeful there is a way to directly change the Crew Report fields without directly changing the ScienceDefs.cfg itself. Quote Link to comment Share on other sites More sharing options...
NathanKell Posted January 17, 2014 Share Posted January 17, 2014 Requires changes to ModuleManager. They're tagged by id, not name. Oh Squad, ever consistent. Quote Link to comment Share on other sites More sharing options...
MrHappyFace Posted January 17, 2014 Share Posted January 17, 2014 How could I call a function before any flight change or scene transition. I want to save some vessel data in a config before switching or scene transitioning. Quote Link to comment Share on other sites More sharing options...
NathanKell Posted January 17, 2014 Share Posted January 17, 2014 Add a partmodule to (at least something on) the vessel, and override OnSave Quote Link to comment Share on other sites More sharing options...
MrHappyFace Posted January 17, 2014 Share Posted January 17, 2014 Add a partmodule to (at least something on) the vessel, and override OnSaveI can't do that, this is a part less mod and I don't want to use module manager, I saw something called OnGameSceneChangeRequested or something like that, but I cant Get it to work. Quote Link to comment Share on other sites More sharing options...
ferram4 Posted January 17, 2014 Share Posted January 17, 2014 Try GameEvents.onGameSceneLoadRequested.Add() with the proper arguments to register a function for the event. Quote Link to comment Share on other sites More sharing options...
Rhidian Posted January 17, 2014 Share Posted January 17, 2014 Requires changes to ModuleManager. They're tagged by id, not name. Oh Squad, ever consistent.I figured out how to do change the Experiment definitions without changing anything else. @EXPERIMENT_DEFINITION[*]:HAS[#id[crewReport]] { @baseValue = 50 @scienceCap = 50 } Quote Link to comment Share on other sites More sharing options...
MrHappyFace Posted January 18, 2014 Share Posted January 18, 2014 (edited) Does the KSPField Attribute work with all ConfigNodes, or just MODULE ones?EDIT: I did a test, it doesn't work. Another question though, how can I call a function just before switching vessels, I need to write some vessel data to a config. Edited January 21, 2014 by MrHappyFace Quote Link to comment Share on other sites More sharing options...
Rhidian Posted January 21, 2014 Share Posted January 21, 2014 (edited) Is there a way to tell through code when a Science Lab (or whatever is making use of the Science Lab's transmission boost variable) has finished processing some ScienceData?Secondary Question: How do you add a method to GameEvents? Say I'm wanting to do something like this: public class ModuleResearchExperiment : ModuleScienceExperiment { public override void OnStart(PartModule.StartState state) { base.OnStart(state); GameEvents.onPartActionUICreate.Add(someEvent) }public void someEvent(){Debug.Log("This event occurred");} }How would I go about supplying the correct argument to add to the GameEvents queue? Edited January 21, 2014 by Rhidian Quote Link to comment Share on other sites More sharing options...
DMagic Posted January 21, 2014 Share Posted January 21, 2014 Does anyone know how to return the name of the your current biome (either on the surface or flying above)? I was thinking it must be something like the vessel.mainBody.name type of thing, but nothing I've tried works.I tried print(vessel.orbit.referenceBody.BiomeMap.Map.name);but it just returns "kerbin_biomes_quantized" or mun, or whatever body you're orbiting. The same happens with vessel.mainBody.vessel.landedAt will return KSC, but it doesn't seem to work for anything else.There must be some way to check which biome you're in. Anyone have any ideas? 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.