Jump to content

New KSP API Documentation v1.4.1


Recommended Posts

  • 2 weeks later...
58 minutes ago, JPLRepo said:

Question: How do I get an XML version (extract) of the site for use with VS?

I was hoping no-one would ask for that. I'll have a look at the format and see what I can do.

Link to comment
Share on other sites

3 minutes ago, nightingale said:

Hmmm....  doesn't seem to be working for me - there's no save/cancel buttons, only an undo one, so I can't save any new entries.

When you click an entry a Save button should appear at the bottom of the page? Yeah annoying it's at the bottom and the undo is under the field.

@tomf - can this button be moved? and any progress on the XML extract?

Edited by JPLRepo
Link to comment
Share on other sites

On 24/05/2016 at 4:23 AM, JPLRepo said:

When you click an entry a Save button should appear at the bottom of the page? Yeah annoying it's at the bottom and the undo is under the field.

@tomf - can this button be moved? and any progress on the XML extract?

The save button is save for the entire page, the model doesn't support saving of individual elements. I'm going to spend today on the XML so I hope that will be ready in the next couple of days.

On 24/05/2016 at 4:21 AM, nightingale said:

Hmmm....  doesn't seem to be working for me - there's no save/cancel buttons, only an undo one, so I can't save any new entries.

I just tried it and it does work for me. When you finish editing you do have to click out of the box you changed for it to register the edit before you can save it. I'll try to fix that at the same time as the XML exportIf you try again can you note the time so I can look in logs?

Link to comment
Share on other sites

6 hours ago, tomf said:

The save button is save for the entire page, the model doesn't support saving of individual elements. I'm going to spend today on the XML so I hope that will be ready in the next couple of days.

Part of the problem is that there used to be the save/cancel buttons near the text editing areas, but I think the UI hinting is also a problem.  The styling of the text changes when you click into it to edit and then again when you click out.  That combined with the fact that there is a singular undo button implies to me something that is automatically saving in the background (which is not an uncommon web paradigm these days).  If you're going to have the save button at the bottom of the page, I'd suggest making it more clear that the entire page is in edit mode (eg. changing it entirely to edit boxes, and not changing back until its saved).  Better yet, would be just to auto-save when the user clicks out of the edit box (which is what I infer from the current UI anyway).

Also, a big bonus would be if you can have it do a "this page has not been saved" style popup when the user tries to navigate away (although if you're going to automatically save this might not be necessary).

Link to comment
Share on other sites

On 24/05/2016 at 4:23 AM, JPLRepo said:

When you click an entry a Save button should appear at the bottom of the page? Yeah annoying it's at the bottom and the undo is under the field.

@tomf - can this button be moved? and any progress on the XML extract?

Ok, new version released, you will notice a new option at the top for XML Documentation. This provides links to xml files for each assembly that has a modified class. Generating them is quite slow so they are cached unless someone has made changes to classes since they were last generated, in which case you get a please wait message for a while until they are done

Also I have moved the save button to the top of the page where it no longer scrolls to make it more obvious that you have to click it to save.

The XML probably isn't perfect. I tested a few classes but I'm sure the first one that anyone else looks at will be horribly broken

Edited by tomf
Link to comment
Share on other sites

This is totally awesome, and needs to be much more well-known than it is! I think I may just add it to my signature.

Went and populated some fields in ModuleAblator, since I just spent the weekend beating my head against it and trying to figure out how it works via trial and error. Did you know the module actually overrides the normal heat conductivity governing fields? I sure didn't, and it confused the heck out of me for days! Thought my KSP was broken. Hope the documentation will help people avoid that confusion in the future.

EDIT: also added some stuff to ModuleEngines and ModuleDragModifier.

Edited by Streetwind
Link to comment
Share on other sites

  • 3 weeks later...
22 minutes ago, MAAnderson22 said:

@BetaguyGZT thanks a ton for documenting it.  I need to troubleshoot one of my classes extending BaseConverter and a page with text is much preferable to empty spaces. 

No problem, it needs peer review though. It may not be completely accurate and I want to ensure that the information is correct.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • 1 month later...

Check it out: Squad posted their own API docs! https://kerbalspaceprogram.com/api/index.html

Amusingly enough, I checked a few things, and found them better documented by the community version here :P It's particularly the custom comments and explanations that go into far more detail here. So while this official thing is great for filling in gaps that the community version doesn't have filled out yet, it certainly doesn't replace it.

Link to comment
Share on other sites

1 hour ago, Streetwind said:

Check it out: Squad posted their own API docs! https://kerbalspaceprogram.com/api/index.html

Amusingly enough, I checked a few things, and found them better documented by the community version here :P It's particularly the custom comments and explanations that go into far more detail here. So while this official thing is great for filling in gaps that the community version doesn't have filled out yet, it certainly doesn't replace it.

I guess I'll have to think about how I can combine the official docs with our user generated ones.

Link to comment
Share on other sites

The problem is that some of the code has comment but not in the format required for doc generation. As @NathanKell said in an other thread we may try to improve it later, it depends on how things are going with the pre release.

Edited by sarbian
Link to comment
Share on other sites

15 minutes ago, sarbian said:

The problem is that some of the code has comment but not in the format required for doc generation. As @NathanKell said in an other thread we may try to improve it later, it depends on how things are going with the pre release.

I currently plan to download the official docs and display them along with user docs. Do you have an idea how often the published API docs will get updated? Once a release or more often?

Link to comment
Share on other sites

4 minutes ago, tomf said:

I currently plan to download the official docs and display them along with user docs. Do you have an idea how often the published API docs will get updated? Once a release or more often?

No idea :)

Link to comment
Share on other sites

I've been using the steps here to get some rudimentary Unity / KSP Intellisense documentation in Visual Studio.  There are a whole lotta XML files in that official API release.  Has anyone taken a crack at a guide for how to get either the official API docs or the community ones into VS?

Link to comment
Share on other sites

OK docuwiki 2.0 is ready!!!

It now downloads (weekly) the xml files from the squad documentation and displays any comments that it finds in them along side the user generated content.

If you aren't seeing any changes your browser is caching bits of the page that it shouldn't and will need to be cleared.

P.S. The squad API notes are for 1.2 but I am planning to hold of updating the version for the user docs until 1.2 is released.

Edited by tomf
Link to comment
Share on other sites

Great stuff!  Ideal would be the ability to add community comments to the official docs (now that we have them) but to improve could I suggest:

  • ability to search for method / field names as well.  Often easier than trying to find the class and dig down through there. In general not sure how easy it would be to add more doxygen-like browsing mechanics?
  • Each entry should have a from-to KSP version (default to 0, infinity). That way people can browse for a specific version in case APIs are added, deprecated, renamed etc.  For example, in KSP1.2, Part.findAttachNodeByPart() has been renamed to FindAttachNodeByPart().
Link to comment
Share on other sites

  • 3 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...