Jump to content

Nifty255

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Nifty255

  1. KSP Version: 0.1.0.20892 Operating System: Windows 10 latest CPU / GPU: Intel 9700KF / MSI Gaming X Trio RTX 3070 Description of the bug. Expected Behavior The string `Game.SessionManager.ActiveCampaignName` within a mod should be the campaign's name (such as "Nifty Space Program") Observed Behavior The string`Game.SessionManager.ActiveCampaignName` within a mod is the file name (such as "autosave_1") Steps to Replicate Load any existing campaign Inspect via mod or debug logging `Game.SessionManager.ActiveCampaignName` Note the string contains the file name loaded (such as "autosave_1") rather than the player-set campaign name (such as "Nifty Space Program") Fixes / Workarounds: None known at this time. A list of ALL mods: Draft Your Viewers 2 (Link to relevant code: https://github.com/Nifty255/DraftYourViewers2/blob/e99ddf695f8f303e5db1bd726b2d0a5613ee5010/Mod Code/Draft Your Viewers 2/SceneChangeListener.cs#L49) Other Notes / Screenshots / Log Files: Log line from the mod: [LOG 20:06:40.900] [MOD | Draft Twitch Viewers] [INFO] | HECC, a campaign with the path "<AppData Folder>/LocalLow/Intercept Games/Kerbal Space Program 2\Saves\SinglePlayer\autosave_3" loaded! EDIT: After logging `Game.SessionManager.ActiveCampaignName` frame-by-frame, it appears the property takes on the wrong value starting from this log line: [LOG 21:03:59.828] [System] Initializing Session Data completed in 0.0088s. Until this log line: [LOG 21:04:18.372] [Debug] [SaveLoadManager]: Loading succeeded [19.82s].
  2. KSP Version: 0.1.0.20892 Operating System: Windows 10 latest CPU / GPU: Intel 9700KF / MSI Gaming X Trio RTX 3070 Description of the bug. Expected Behavior Selecting another assembly should rebuild the part list in the Part Manager immediately Observed Behavior Part Manager does not rebuild its part list until the newly selected assembly is modified in some way, either by adding or removing a part. Steps to Replicate Pick and place any part. Pick and place a second, different part NOT connected to the original. This creates a second assembly. Open the Part Manager. You'll see one part. Use the Current Assembly icons to select the second part's assembly. Note the Part Manager does not yet show the newly selected second assembly's other part. Fixes / Workarounds: Add and remove any part to the newly selected assembly to rebuild the Part Manager. A list of ALL mods: None Other Notes / Screenshots / Log Files:
  3. Note @Gargamel Given the nature of KSP 2's systems, your team going to see a LOT more repos structured like mine, where its root folder is actually a Unity project, and the mod code is in a subfolder. Why? Because mod devs who want to make custom parts with custom behavior will need to both develop the behavior code AND use a Unity project to develop and bundle the part assets. It's no longer enough to simply export models from blender and toss them into a sub-folder.
  4. Though everything was in the repo originally linked, I added convenience links to folders for all code used, both for the Unity project, and for the mod itself.
  5. As it is currently, a player cannot control "vessels" which don't have any command parts. While this initially makes sense, many players will want to "control" such vessels in order to watch their collision with a body. Why? Because it looks cool. Oh, and for science of course.
  6. By Nifty255 https://github.com/Nifty255/DraftYourViewers2 - Licensed under GPLv3 Don't want to strand Jeb in space? Strand your viewers instead! Draft Your Viewers 2 is a mod for Kerbal Space Program 2. By authorizing the mod, it can get a list of viewers in your chat, and draft them into your Space Program any time you need them. Features: Draft a viewer as a Kerbal into your Roster Draw a random viewer without drafting them Block certain accounts by username or display name Coming Soon: Draft a viewer directly into your active craft Customizable sounds Support for KSP 2's built-in mod loader (when it's finished) How to Install: Download BepInEx for KSP, available on Space Dock. Follow BepInEx's install instructions. Luckily, it's pretty EZ! Download a release. Make sure you get one for your KSP 2 version. Copy the contensts of the zip file into <KSP Folder>/BepInEx/plugin FAQ: "Why did you rename it, Nifty?" - Twitch doesn't want its name in the names of other things, and I'm cool with them keeping their brand safe. "How do I close it?" - Workin' on that. For now, the top bar lets you drag the window around, and there's a button to collapse it into a small icon. "But where's the CODE code?" - There's some code for the Unity project AND some for the mod, both in the repo above. For the Unity project: https://github.com/Nifty255/DraftYourViewers2/tree/master/Assets/Scripts For the mod itself: https://github.com/Nifty255/DraftYourViewers2/tree/master/Mod Code/Draft Your Viewers 2
  7. It appears without using an external code injector, you can't. But several unity-based injectors exist, including one released sometime within the last day, as well as a mod which will let you add custom flags.
  8. Unfortunately, we don't get to decide what can and can't be restricted by a EULA, which is why I erred on the side of caution with this post. As a reminder, I have emailed Private Division for explicit permission to view the DLLs through Visual Studio's Object Browser, which will give legal access to likely hundreds of class names, public fields, etc. which will make learning and info sharing easier and much less scary. If/when I get permission, I'll post the email itself here and then start actually digging.
  9. The point of this post was to give as much info as possible without violating the EULA. If I didn't care, it'd be trivial to learn much more than that.
  10. Hey there. I'm Nifty. Literal ages ago, I made a few KSP mods (DraftTwitchViewers among others). Despite the fact I probably won't have the time or energy to mod KSP 2 as well, I found myself interested in helping the community in its modding efforts, and the devs in their efforts to make the game more moddable. To that end, I went investigating. I'm intending this post to become a sorta-central knowledgebase on KSP 2's modding capabilities that can grow and become more detailed over time. I'll check in every once in a while and compile comments into the main post as info comes in. NOTE: 100% of the info in this post has been gathered without decompiling or even touching an IDE. I want to get confirmation from Private Division that Visual Studio's Object Browser feature doesn't constitute decompiling before I go using that. I'll remove the "IDE" part once I get confirmation and dig in. KSP 2 is a Unity game. By checking the properties of "UnityPlayer.dll", the DLL's version "2020.3.33" is shown, which is a version of Unity Engine. The game lacks a "GameData" folder, which is how KSP 1 loaded mods (part models, part configurations, code via DLLs, flags, audio, so on). So assets have to be loaded a different way. The folder "KSP2_x64_Data\StreamingAssets\aa\StandaloneWindows64" holds a litany of ".bundle" files, many of which match planet and part names. At first, I thought they were Unity Asset Bundles, but it seems not. Instead, they're Addressable Assets. This may be how modders can load their own, maybe not inside this folder though. https://docs.unity3d.com/Packages/[email protected]/manual/index.html Save game data is stored in "AppData\LocalLow\Intercept Games\Kerbal Space Program 2". The data in this folder appears to be primarily JSON (thank whatever deity exists the old config syntax is dead). By popping open my own save, I was able to find out the following about the structure of a craft and its parts: A craft is composed of basic metadata as well as a list of "assemblies". Crafts seem to use GUIDs to keep track of which parts reference which other parts. Parts can be part of at most one "symmetry set". Parts can have 0 or more "modules" similar to KSP 1. These appear to be more complex than the original modules though. Strangely, KSP 2 uses modules to apply color and drag? Each module is made up of 3 components, references to actual namespace and class names can be seen in the craft file: PartComponentModule (KSP.Sim.impl.PartComponentModule_ResourceCapacities) Module (KSP.Modules.Module_ResourceCapacities) Data (KSP.Modules.Data_ResourceCapacities) Data surrounding a module such as an engine gimbal's limiter is nested within the Data component, which likely means the Module component handles logic and the PartComponentModule ties it together. Side note: this pattern of separation of logic from data suggests a "data-oriented" programming style, which tells me KSP 2 takes advantage of Unity's DOTS system to some extent. It appears one Module can have multiple Data components. For example, most parts have a data component for their role (e.g. "Data_Engine") as well as a "Data_ModuleActions". That's all I've got for now.
×
×
  • Create New...