Jump to content

DMagic

Members
  • Posts

    4,180
  • Joined

  • Last visited

Everything posted by DMagic

  1. I looked at setting this up. It took about ten minutes to rip out the fuel transfer parts, and then a few hours to figure out a half dozen minor little things... Most of the problems seem to have their root in the fact that fuel lines have a little cap that sits in front of the root of the part, whereas struts don't. It turns out that little cap is in front of the collider, which makes raycasting so much simpler. With the strut you have to cast through the collider, which has a ton of knock-on effects. Anyway, I'm setting up a release now, it should be ready soon.
  2. I'll fix the next version so that it won't choke when certain objects aren't set like that.
  3. @smjjames It looks like a lot of my contract are screwed up in your save file. Whether this is from the changes made in the 1.2 update, or something about the most recent update I'm not sure. I would go through the Contracts section and delete any of my contracts (they all start with DM...) that don't have any parameters or maybe just have one or two.
  4. @CrashTestDanny That's the Toolbar options window. Since it doesn't look like you have Blizzy's Toolbar, and I disabled the stock contract app override, there aren't any options there. I can see about either fixing the stock override or removing the button unless Toolbar is installed.
  5. Making a strut that is added like my fuel line should be pretty easy. The CompoundParts classes take care of all the tricky parts, the only thing that's left really is to handle the Kerbal interaction, disable the standard strut function in the editor, and manually show/hide the strut parts when something is connected or disconnected. Most of EVA Transfer's complexity comes from the resource transfer parts. I can look into adapting the EVA Transfer code to work as a strut. I always thought that there were a few of these EVA strut mods lying around, but I guess they are all out-dated.
  6. With KSP 1.1 we can now create and load our own KSPedia entries. This is great for making in-game tutorials, wikis, or manuals, as I’ve always suspected that only a small fraction of players actually use GitHub wikis, or in-depth forum manuals. This post will go over what is needed to make KSPedia entries, how to setup your project, and how to make your pages look similar to the stock pages. Software and Tools: Required: Unity – Current KSP version is using Unity 5.2.4 KSP Part Tools – The current package includes what is needed for generating KSPedia Asset bundles and the legacy Part Tools files Recommended: Text editor – A real text editor (like MS Word, or Open Office) is recommended; it makes catching typos, editing grammar, and saving data much easier Image editor – Unless you want your pages to be entirely text you’ll want something to edit images (Photoshop or GIMP) Open Source Fonts – The stock entries use two open source font sets (they may be added to the Part Tools package at some point) – Amaranth and Open Sans. (Use the small Down Arrow in the upper-right and select the .zip to download the font package) First off, all of the basic information about how to setup your project and export a KSPedia entry comes from @Agathorn's thread. And @TriggerAu has provided lots of information about KSPedia creation and specifics about how to make stock-alike pages. In the text below, Bolded words generally represent screen elements in Unity, such as buttons, tabs, windows, etc… Bolded and Italicized words represent the UI objects and elements and files that we are creating and manipulating. Unity Project Setup: The first step is to install Unity and add the Part Tools package. Once Unity is installed open it and create a project for KSP (there are probably other tutorials that cover setting up Unity in more detail; that isn’t really covered here). Go to the Assets Tab along the top -> Import Package -> Custom Package -> Select the PartTools_AssetBundles.unitypackage file This will load all of the bits necessary for KSPedia creation Now you want an empty scene; delete everything in the Hierarchy Window In the Main Window you’ll want to be in the #Scene Tab, in 2D mode, using regular Shaded mode. Creating a Template: It’s worth taking the time to setup a default panel prefab, something that can be copied into any project so that you don’t have to repeat the next several steps for each page. To do this we need to add a UI Panel, add some components to that, and set the Panel size. You can also save individual components as snippets that can be added to your pages; see the random notes section at the very bottom for info about saving formatted Text object snippets. Add a UI panel: GameObject Tab -> UI -> Panel This will add a Canvas with a child Panel, and an EventSystem – the Panel is what we are interested in Right click on the Panel object and rename it something, this name is only used internally, but you should probably make it something specific to your project and something unique In the Inspector Window on the right click Add Component -> Scripts -> KSPAssets.KSPedia -> Database Screen – What this does isn’t entirely clear, and you don’t need to do anything else with it, but it seems to be required In the Panel’s Rect Transform Component Window set the Width to 2048 and the Height to 1536 (you can change the sizes if you want to have a taller or wider page that can be scrolled through - Thanks @jandcando) Click the Anchor Preset (the box with the grey squares and red cross, or blue arrows) and select Top-Left If you want a Background Image you can click the circle to the right of the Source Image field in the Inspector Window See below in the Text section for information about adding Heading and Sub-Heading Text Objects to make sure that these elements are in the same place for each page This can be saved as a template prefab by dragging the Panel from your Heirarchy Window to somewhere in the Assets folder in your Projects Window; it will create a .prefab file which can be dragged into any Unity project Your setup should look something like this after you’ve created a template prefab. KSPedia Asset: We’ll come back to actually adding content later, but first we’ll go over how to setup the KSPedia asset. This involves creating the Categories and Sub-Categories for your entry, assigning pages to each Category, and determining the page order. First we need to tell Unity which asset group our prefab belongs to. In the lower-right, below the Inspector Window is the Preview Window, at the bottom of this is a selection box labeled AssetBundle Click the Box -> Select New -> Add your entry (use only lower case letters) Now we can setup the KSPedia asset through Squad’s included tool. Open the KSPedia Window: KSPAssets Tab -> KSPedia This will open a separate window called KSPedia Database, this is where we handle all of the Category creation, page ordering, etc... Click the Create button to the right of your newly made project, then click View (ignore the Build All button along the bottom, we don’t use that at all) This window has Four Tabs, an Update button for when new prefabs are added, a Save button for when you are finished, and a Back button. Under the Categories Tab create a new Category, and optionally a Sub-Category, then click Create (the names used here are for internal use) This will add the Category and allow you to enter a display name, which is what people will actually see in the KSPedia entry Use the selection box under the Title Screen column to select the prefab for that screen Use the up and down arrows along the left to change the order of Categories Click View to the right of a Category or Sub-Category to go the Category Tab; here you can change the Internal Name, Title, prefab selection, or add a new Sub-Category (only for top level categories); basically the same functions as what you have in the Categories Tab (except for one that we’ll come back to) A completed Categories Tab, note the Category and Sub-Category, and the Title field, which is what will be shown in-game. The Category Tab for the “Other_Stuff” Sub-Category, you can also set the prefab used for this page, change the Internal Name and the Title. Note the Screens section on the bottom; this is where we view and change the order of the third layer of pages; more on this below. You can create pages on three different layers: Top level Category, Sub-Category, and Screens. Screens can be added to both Categories and Sub-Categories. One page (that is, one prefab object) is added to each Category, Sub-Category or Screen. To assign a Screen to a Category or Sub-Category go to the Screens Tab Any prefab that isn’t already assigned as the Title Screen of a Category or Sub-Category will show up here with the label “Undefined" Click View on an “Undefined” prefab to go to the Screen Tab Here you can set the Screen to a Category and Sub-Category, change the Internal Name, and the Title Click the Set button; if you return to the Category Tab you will see that it now has an entry for the included Screens, change the order with the arrows along the left if you have more than one After everything is setup to your liking remember to click the Save button along the top, otherwise you’ll have to do all of this over again Here is the Screens Tab before adding the “Other Stuff” prefab to anything. Even though the Title fields are blank here, the Titles of the Categories and Sub-Categories have been set and will be shown in game. After clicking the View button in the Screens Tab we move to the individual Screen Tab. Here we can set the Category and Title. Now we can export the Asset bundle. Open the Asset Compiler Window: KSPAssets Tab -> Asset Compiler This window can be dragged and docked into any of the regular Unity window sections Again click on the Create button for your project You can view the project to see which prefabs are included and to see the .xml file, which describes the KSPedia hierarchy that the last section covered Click Update if you’ve made any changes, then Build This will place the asset file in in AssetBundles folder of your Unity project folder (this should be the same location as where your prefabs and the Part Tools files are located) The file should have a .ksp extension, if it doesn’t you’ll need to add it Place this file somewhere in KSP’s GameData folder and KSP should load up the entry and display at the end of the KSPedia contents Here the Asset Compiler Window is docked into the section with the Project Window, Update and Build your final project from here. Here is the View section of the Asset Compiler Window. You can add Author Info and other Notes. If you push the Select button for the xml file it will show you its contents in the Inspector Window, be aware that long files may be truncated here. Making KSPedia Pages: Now that we know how to setup the project and make a KSPedia asset bundle, we can start actually making pages. Some basic tips on making good pages: Keep the text to a minimum; no one likes reading Power-Point slides full of text, the same applies here Use images and diagrams wherever possible, adding captions and short descriptions where needed Don’t over-crowd pages, just create more pages when you need them Keep the focus on one element for each page, unless the page is specifically intended to be a catch-all, or “other features” kind of thing Adding Text: Add Text UI elements to your Panel: Right-click the Panel object in your Heirarchy Window -> UI -> Text This will add a Text object as a child of the Panel, rename it to something descriptive The Text Window will be added in the center of your panel, you can drag it around with your mouse and re-size it using the blue circles in the corners In the Inspector Window on the right you will see the Text Component, add the actual text in the Text Box, select the Font, and change the Font Size and Font Color The default Font Size appears very small because the Panel is so large, but if you make it too big it will overflow the box, you can change the Vertical and Horizontal Overflow properties to make it visible, or just make the Text object bigger Some notes about fonts; from TriggerAu: The fonts used in stock KSPedia entries are as follows; note that Unity uses pixel size for the font, so multiply the pt value by 1.25 to get the final Font Size (which is shown below in bold). If the fonts are not included in the Part Tools package download them and put the files somewhere in your Unity Project’s Asset folder. Amaranth Bold for the Headings and Subheadings: 56pt – Font Size of 70, #2978ef (41,120,239 in RGB color) 40pt – Font Size of 50, #2978ef (41,120,239) or #f2f2f2 (242,242,242) depending on placement Open Sans for Body font, all #f2f2f2 (242,242,242) 32pt – Font Size of 40, for most 32pt – Font Size of 40, bold when Paragraph Heading, then Paragraph Body is 28pt – Font Size of 35 28pt – Font Size of 35, italic when Notes/Captions It’s worth adding Heading and Sub-Heading Text Objects to your Template Panel before saving it. Setup the Positions, Fonts, Font Sizes, and Colors, this will ensure that these elements are in the same location for every page. The Heading Text Object is added to the Panel and the Sub-Heading Object is added to the Heading. Keeping elements paired together like this makes it easier to move them around; play with the anchor settings to get the child objects to lock to the desired position relative to the parent object. Importing Images: To use images in our pages we first have to import them into Unity and set them up. Drag any standard image file into your Unity project’s Asset folder to get started Select the Image (you can select and import multiple images at the same time) in the Unity Project Window In the Inspector Window change the Texture Type to “Sprite (2D and UI)”, uncheck Generate Mip Maps and click Apply Adding Images: To use our imported images we need to add an Image UI Object to out Panel. Right-click the Panel -> UI -> Image Move and re-size the object the same as with the Text Object For the final prefab page you should only have a single Image Object, with a transparent background, covering the entire page Make a 2048*1536, transparent image in your image editor, then paste your images onto the larger image and move them into place Positioning individual images within a larger image is difficult to do without lots of trial and error. I find it’s best to import the individual images first, then set them at the desired size and positions. After setting things up in Unity you can get the size and position information and use that to create your final image. To add an image, first create an Image Object as describe above. Select one of the imported files as the Sprite Image for your Image Object Hold Shift when re-sizing the Image to maintain the aspect ratio Once you have the Image where you want it you can read the size information from the Rect Transform Width and Height Boxes To get the position of the center of the Image you’ll need to change the Anchor Preset to Top-Left The Rect Transform Pos X Box will give the number of pixels from the left edge to the center of the Image The Pos Y Box will give the number of pixels below the top edge Use this information to re-size and place your image in the proper location in your image editor Also be aware that most stock KSPedia screenshot images have a white border around the edge, this is roughly 5 to 7 pixels wide Once you have a single, 2048*1536, transparent image file, import this into Unity and set it as the Sprite Image for the Panel’s one Image Object Read the image size and position information from the Rect Transform Component. Use this for setting up the final image in your image editor. Here are some examples of a more complex project. The Categories Tab includes a top level category and several sub-categories, each with several screens. Note how all of the panels in this project are placed under the same canvas object in the Hierarchy Window. When working on multiple panels you can disable all but the panel you are working on by unchecking the box at the very top of the Inspector Window (the one to the left of the prefab title). Be very careful when building your final project to make sure that none of your actual prefab files are disabled; the files (found in the Project Window) can be enabled or disabled independently of the objects in the Hierarchy Window. If the files are disabled when you build the project then those screens will appear blank in-game. The prefab and image files for all of the SCANsat pages can be found on the GitHub repo. A few random notes here: Squad KSPedia pages appear to all be built as separate files; I don't know how this works or if there is some benefit to it, but I've been working with a single file that contains all pages and it seems to work fine There seems to be several methods in the KSPedia classes that deal with merging and replacing entries This might imply that it is possible to replace or add to existing entries; this is entirely speculation on my part I'll add some information later about getting screenshots of parts, vessels, or planets without any background For parts I've been using a big green screen panel to attach my parts to, then removing that background in Photoshop Something similar can be done to remove the mostly black space background, or you could use Texture Replacer to completely replace the SkyBox with a solid color image When you go back after building the project to edit text elements you need to remove all of the existing prefab files for that panel Delete the prefab file - Do Not delete the actual object in the hierarchy, unless you want to start over Update the KSPedia Asset after deleting the prefab and update the Asset Compiler The text information seems to be stored directly in the xml file, and won't get properly updated unless you clear out the existing information You can save snippets with any objects from your project's hierarchy, not just completed or default Panels. For instance, you can create Text object groups with the font, size, color, and layout already setup. You can see below how different paragraph-header combinations can be created, as well as formatted text boxes, and the red note text boxes This saves a lot of time when creating entries with lots of text, since you would otherwise need to format every new Text object Add these to your pages by simply dragging them into the desired Panel. If anyone has more to add, or corrections to make, please let me know.
  7. Now that we can create Asset Bundles, UI prefabs, and KSPedia entries using Unity I think we need a new place to discuss such features. The Addon Dev forum seems like the right place. But such features are definitely not the same as Modelling and Texturing, and don't necessarily involve any coding or plugin development. Threads would be lost in the main Addon Dev forum, since it is generally used to discuss mods in development. I think a new Unity-specific sub-forum would help, tutorials and helpful threads would be much easier to find there and it would people a single location to discuss all non-part modelling Unity features.
  8. From the log you posted before exiting it looks like Stage Recovery is giving the errors. Was that log from the initial KSP loading screen? Full logs would help.
  9. Ahh... GameEvents, nice choice for the image. It looks like I have a lot to update; there seem to be a huge number of new GameEvents since I last looked into it.
  10. EVA Transfer version 4.0 is out; get it on SpaceDock. It has been updated for KSP 1.1 and fixes a bug in recognizing Kerbal professions when using foreign language versions of KSP.
  11. @linuxgurugamer It is already, but some of its dependencies are still marked as being for KSP 1.0.5. I made the changes and sent a pull request so it shouldn't be long.
  12. Well, there is an OnPartUndock event, I haven't really looked at it, but it sounds promising. I'm not sure if it gets fired from both vessels or only the vessel with the active port.
  13. OnPartCouple is used for docking. It gives a From and a To Part (the docking ports) and fires before the vessels are actually joined. The From vessel is not necessarily the active vessel, I think it is the dominant docking port, which is determined by other things. I think OnVesselCreate is the one used when undocking (and maybe decoupling, too). I think the SameVesselDocked/Undocked are used when two ports on the same vessel join together, not regular docking.
  14. @Torih It probably will, I just didn't have time to look into it and test it.
  15. The latest version should work fine under the final KSP 1.1 release. I'll see about making a few fixes to science labs soon, and about getting some options for making specific transforms appear and/or disappear when conducting experiments.
  16. Version 16.0 is out; get it on SpaceDock. It has been updated for the final KSP 1.1 release, and MechJeb 2.5.7. It includes a new, 17 page KSPedia entry, a science experiment for the low resolution resource scanner (when stock scanning is disabled), a window scaling feature, and several minor fixes and updates.
  17. Version 1.2.3 is out for the final KSP 1.1 release; get it on SpaceDock.
  18. Portrait Stats 8.0 and Celestial Body Science Editor 6.0 are out for KSP 1.1; get them on SpaceDock. Portrait Stats has new setting options which allow for replacing the stock Kerbal trait text with an icon, with forcing the display to always be visible, and for using the two tooltips.
  19. Version 6.2 is out; get it on SpaceDock. It is updated for KSP 1.1. The only real difference is that the stock contract app override is disabled.
  20. Version 2.1 is out; get it on SpaceDock. It is updated for KSP 1.1. It fixes some issues with sorting contracts by expiration/deadline. It also adds a window scaling function, which can be accessed in the settings window.
  21. Version 2.2 is out with KSP 1.1 support; get it on SpaceDock.
  22. Version 1.2.2 is out for KSP 1.1.0.1224; get it on GitHub. This fixes a few minor problems with science labs, fixes the SIGINT size issues, and fixes an error with the micro goo and micro mat bay that could cause some of the strange errors described a few posts up. @JPLRepo This also includes some changes intended for compatibility with TST. The two recon telescopes have empty transforms positioned at the aperture opening with their forward direction pointed out. It also adds a config field flag ("openDoorsOnly") that adds new right-click and action group events that will open the camera bay doors without starting the camera swivel; the standard open and shut options can be used as well when this flag is used. The transform name for the Little Brother Telescope is: "camera.forward.000" The transforms for the Big Brother Telescope are: "camera.forward.000" and "camera.forward.001" for the bottom and top cameras, respectively. Let me know if they work, or if they need to be rotated.
  23. @Cruzo You don't have to detach them when coupled to an asteroid. Just have the pod on the same vessel (meaning that they can be attached to anything on the asteroid, including the asteroid itself if using KIS, or the same vessel as the hammer is on) and you will get the bonus.
  24. @Cornholio If you want specific answers then you need to provide the specific information that would allow for someone who can help to be able to actually provide that help. One or two vague sentences means essentially nothing when attempting to figure out what is going wrong.
  25. In my experience the MPL is finicky about being added to different parts, it seems to (or at least was in the past) dependent on being added in a certain order; being the 2nd module in the part config, or something like that. But to get a proper science lab functionality you would also need a ModuleScienceConverter on the part, since that is what does the science processing part. Also, Curiosity's science lab isn't a lab in the KSP sense, it is just a suite of sensors. The internal parts, which I think is what people refer to if they are talking about a lab, is an X-Ray diffraction instrument and the Sample Analysis at Mars (SAM). SAM is several instruments used for studying the composition () of surface and atmospheric samples.
×
×
  • Create New...