Code Monkey home page Code Monkey logo

spacewarp's Introduction

Cool Banner

Build Status

Main Branch

Space Warp

Curseforge Downloads
SpaceDock Downloads

Documentation

Space Warp is a modding API for Kerbal Space Program 2 with support for BepInEx and the official mod loader.*

*Note: The official mod loader is unfinished, so BepInEx is currently still required to enable it.

Installation

It is highly recommended to use CKAN Download Here to install Space Warp

If you for some reason want to manually install it, here are the instructions:

Note: Don't worry about the BepInEx installation, it already comes in the zip folder!

Download the latest release of UITK for KSP 2.

Drag the contents of UitkForKsp2's .zip file into your KSP2 directory, commonly located at C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2.

Download the latest Space Warp release from this page under the Releases section above.

Drag the contents of Space Warp's .zip file into your KSP2 directory, commonly located at C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2.

In the case of installing on Linux under Wine/Proton, you need to override winhttp DLL in winecfg, as described in BepInEx documentation.

To install the downloaded mods, simply drag them into the plugins folder location: C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2\BepInEx\plugins. Remember that mods don't go into the SpaceWarp plugin folder, they go along side with it in the BepInEx\plugins folder.

That should be it, you can now launch the game and enjoy!

Compiling

To compile this project, you will need to follow these steps:

  1. Install .NET 7+ SDK
  2. Run dotnet restore inside the top directory to install the packages.
  3. Run dotnet build -c <Configuration> to build the project, where <Configuration> is one of the following:
    • Debug - Builds the project in debug mode
    • Deploy - Builds the project in debug mode and copies the output to the KSP2 directory
    • DeployAndRun - Builds the project in debug mode, copies the output to the KSP2 directory, and runs the game
    • Release - Builds the project in release mode, zips the output, and builds a NuGet package

or you can use Visual Studio 2022 or JetBrains Rider to build the project.

There are also scripts in the scripts folder that can be used to build the project in each of the configurations, they simply run the dotnet build command with the correct arguments.

The outputs can be found in dist/<Configuration>. The Release zip will be in the dist folder, and the NuGet package will be in the nuget folder.

Mod Structure

The mod structure is still a work in progress. However, the current structure is as follows:

KSP2_Root_Folder/
├── BepInEx/
│   ├── Plugins/
│   │   ├── mod_id_folder_name/
│   │   │   ├── swinfo.json
│   │   │   ├── README.md
│   │   │   ├── assets/
│   │   │   │   ├── bundles/
│   │   │   │   │   ├── *.bundle
│   │   │   │   ├── images/
│   │   │   │   │   ├── *
│   │   │   │   ├── soundbanks/
│   │   │   │   │   ├── *.bnk
│   │   │   ├── localizations/
│   │   │   │   ├── *.csv
│   │   │   ├── addressables/
│   │   │   │   ├── catalog.json
│   │   │   │   ├── *
│   │   │   ├── *.dll 

spacewarp's People

Contributors

adamsong avatar astroclef avatar baanish avatar celisium avatar cheese3660 avatar chilla55 avatar cskartikey avatar eivindnorling avatar ewyboy avatar falki-git avatar fengyuan0529 avatar girhubmoment avatar h4ckerxx44 avatar halbann avatar jan-bures avatar jaxoncarelos avatar joaoburatto avatar kosti05 avatar luxstice avatar mboutray avatar michal2229 avatar nipperyslipples avatar penumbra779 avatar redstonewizard08 avatar rexicon226 avatar rockfactory avatar sea-ex avatar shanepaton avatar windows10ce avatar x606 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spacewarp's Issues

[FEATURE] Mod state per save

Feature Information

Feature description

Currently we only have a global mod state, where a mod is either installed or not. We should add a way to set whether a mod is enabled for any given save.

Solution proposal
  1. Add a field in the campaign creation where you can add or remove mods for this save
  2. Enforce a contract w/ mods that only allows them to do stuff when they are loaded in a save.
    (Except for mods that do stuff on the main menu)

[FEATURE] Moving to BepInEx

Feature Information

Feature description

It has become clear to me that BepInEx still provides things that we do not, and that there are still bugs in the BepInEx version of Space Warp, I would like to propose moving to BepInEx as a possible solution to this.

Solution proposal
  1. We switch Space Warp to a fully BepInEx based plugin
  2. Remove [MainMod]
  3. Register mods with by searching through all plugins assemblies for classes that implement mod
  4. Move all asset loading to the loading screen with the registered mod information, then provide event abstractions to the mod once assets have been loaded.
  5. Keep our current GUI abstractions, and toolbar abstractions.
  6. Remove the bespoke modloader
  7. Keep a mods folder structure but move it into the mods plugin folder for BepInEx

This is only an idea, but I would like it to be discussed, as I feel as if it could be beneficial.

Another purpose to this change is that it could provide more direction to this project as we won't be doing 2 different things at once, one of which is reinventing the wheel.

This branch has been created in line with this issue
https://github.com/SpaceWarpDev/SpaceWarp/tree/experimental-bepinex-library

[BUG] Scroll Lock Handle Offscreen

The code for scroll lock causes the handle for the console UI to be permanently off screen.

foreach (string message in SpaceWarpConsoleLogListener.DebugMessages)
{
    string new_message = "" + message + "\n";
    GUILayout.Label( new_message);
    if(_autoScroll)
    {
          _scrollView.Set(_scrollView.x, Mathf.Infinity );
          _scrollPosition = _scrollView;
    }
    else
     {
          _scrollPosition = _scrollView;
     }
}

[FEATURE] Add way to get celestial body component by name

Feature Information

Feature description

The way currently to get a CelestialBodyComponent by name is to get the position of a body by that name then get the body at that position, there should be a quicker way to get one by name

Solution proposal

Add a API.Game.CelestialBodies.GetComponentByName(string) function

Crash

After patching, when starting new save or loading from flight to KSC game will crash. With mods or witouh - all the same
[ LagRemover] [Info] Loaded JOINT_RIGIDITY with value of1500000
[LagRemover] [Info] Loaded JOINT_RIGIDITY with value of1500000
[LagRemover] [Info] Loaded JOINT_RIGIDITY with value of1500000
[LagRemover] [Info] Loaded JOINT_RIGIDITY with value of1500000
[LagRemover] [Info] Loaded JOINT_RIGIDITY with value of1500000
[LagRemover] [Info] Loaded JOINT_RIGIDITY with value of1500000
[LagRemover] [Info] Loaded JOINT_RIGIDITY with value of1500000
[General] [State] Swapping game state! prev: [FlightView] --> new: [Loading]
[Debug] Loading Local Space Kerbin...
[Debug] Kerbin - Local-Space Load Finished. 1.8256s
d3d11: failed to create staging 2D texture w=128 h=2 d3dfmt=10 [887a0005]
d3d11: failed to create buffer (target 0x5 mode 0 size 480) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 60) [0x887A0005]
d3d11: failed to create 2D texture id=5589 width=8 height=8 mips=4 dxgifmt=77 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5591 width=8 height=8 mips=4 dxgifmt=77 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5593 width=8 height=8 mips=4 dxgifmt=72 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5537 [D3D error was 887a0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 4800) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 768) [0x887A0005]
d3d11: failed to create 2D texture shader resource view id=5539 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5595 width=8 height=8 mips=4 dxgifmt=77 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5541 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5543 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5545 [D3D error was 887a0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 4576) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 324) [0x887A0005]
d3d11: failed to create 2D texture shader resource view id=5547 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5549 [D3D error was 887a0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 1320) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 168) [0x887A0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 5120) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 672) [0x887A0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 6760) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 900) [0x887A0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 14080) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 2112) [0x887A0005]
d3d11: failed to create 2D texture shader resource view id=5551 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5553 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5597 width=8 height=8 mips=4 dxgifmt=77 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5555 [D3D error was 887a0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 20608) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 3336) [0x887A0005]
d3d11: failed to create 2D texture shader resource view id=5557 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5559 [D3D error was 887a0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 961520) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 116838) [0x887A0005]
d3d11: failed to create 2D texture shader resource view id=5561 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5563 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5565 [D3D error was 887a0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 187328) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 32160) [0x887A0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 3328) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 396) [0x887A0005]
d3d11: failed to create 2D texture id=5599 width=8 height=8 mips=4 dxgifmt=71 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5567 [D3D error was 887a0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 1056) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 144) [0x887A0005]
d3d11: failed to create 2D texture shader resource view id=5569 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5571 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5573 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5575 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5577 [D3D error was 887a0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 25920) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 4632) [0x887A0005]
d3d11: failed to create 2D texture shader resource view id=5579 [D3D error was 887a0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 104600) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 12120) [0x887A0005]
d3d11: failed to create 2D texture id=5601 width=8 height=8 mips=4 dxgifmt=72 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5581 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5583 [D3D error was 887a0005]
d3d11: failed to create 2D texture shader resource view id=5585 [D3D error was 887a0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 15232) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 2832) [0x887A0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 5120) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 672) [0x887A0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 53020) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 4248) [0x887A0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 71856) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 8844) [0x887A0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 649296) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 155850) [0x887A0005]
d3d11: failed to create buffer (target 0x1 mode 0 size 5120) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 672) [0x887A0005]
d3d11: failed to create 2D texture id=5603 width=8 height=8 mips=4 dxgifmt=78 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5605 width=8 height=8 mips=4 dxgifmt=71 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5607 width=32 height=8 mips=6 dxgifmt=78 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5609 width=8 height=8 mips=4 dxgifmt=72 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5611 width=8 height=8 mips=4 dxgifmt=78 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5613 width=8 height=8 mips=4 dxgifmt=72 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5615 width=8 height=8 mips=4 dxgifmt=77 [D3D error was 887a0005]
d3d11: failed to create staging 2D texture w=128 h=2 d3dfmt=10 [887a0005]
d3d11: failed to create buffer (target 0x5 mode 0 size 480) [0x887A0005]
d3d11: failed to create buffer (target 0x2 mode 0 size 60) [0x887A0005]
d3d11: failed to create 2D texture id=5617 width=8 height=8 mips=4 dxgifmt=71 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5619 width=8 height=8 mips=4 dxgifmt=72 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5621 width=8 height=8 mips=4 dxgifmt=78 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5623 width=8 height=8 mips=4 dxgifmt=77 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5625 width=8 height=8 mips=4 dxgifmt=77 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5627 width=8 height=8 mips=4 dxgifmt=77 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5629 width=8 height=8 mips=4 dxgifmt=77 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5631 width=8 height=8 mips=4 dxgifmt=72 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5633 width=8 height=8 mips=4 dxgifmt=72 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5635 width=8 height=8 mips=4 dxgifmt=71 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5637 width=8 height=8 mips=4 dxgifmt=77 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5639 width=8 height=8 mips=4 dxgifmt=72 [D3D error was 887a0005]
d3d11: failed to create 2D texture id=5641 width=8 height=8 mips=4 dxgifmt=77 [D3D error was 887a0005]

[FEATURE] Add abstractions for setting the active vehicles throttle/sas/all that

Feature Information

Feature description

Currently to set an active vehicles throttle you have to do this.

GameManager.Instance.Game.ViewController.flightInputHandler.OverrideInputThrottle(float deltaT)

Which is imprecise
Or go through a large heap of stuff to set it like the following

private static void SetThrottle(float throttle)
    {
        if (!Game.ViewController.TryGetActiveVehicle(out var vehicle)) return;
        var asVehicle = vehicle as VesselVehicle;
        asVehicle.AtomicSet(throttle, null, null, null, null, null, null, null, null, null, null, null, null,
            null, null, null, null, null);
    }
Solution proposal

Add abstractions for setting the active vehicles throttle/x/y/z inputs/gear state/etc...

[FEATURE] UI Assets Overhaul

Feature Information

Feature description

We provide a lot of UI assets w/ space warp, but the GUISkin is incomplete in the assets we provide

  • UI Scrollbar - Not yet added
  • UI Click Through Blocker - Started in #49
  • UI Boarders - Requested in #66
  • UI Scaling Window - Added in #166
  • UI Scaling Elements - The window itself now scales with resolution, now we gotta make the elements scale too
Solution proposal

Complete the assets for the Space Warp GUISkin

[FEATURE] Space Warp localizations

Feature Information

Feature description

Space Warp is currently in English only, it should be localized, obviously not possible by 1.0.0 release, but should be done soon.

Solution proposal

Use the existing localization system to localize space warps messages and such for use in translating to other languages.

[FEATURE] Completely move out of IMGui for Space Warp

Feature information

Feature description

Switch our UI windows from IMGui to unities UI assets

Solution proposal

Use our asset bundle loading system to load assetbundles for our space warp UIs, they can reference the scripts in the dll iirc so that wont be an issue.

Additional context

IMGui is meant for debugging and development and has not so great performance.

[FEATURE] Get parts by modules

Feature Information

Feature description

There is no in game way for a person to get all parts that contain a module.

Solution proposal

Allow for modders to get all parts that contain a module via an extension method on the partsprovider class

[FEATURE] Add proper scaling to UI

Feature Information

Feature description

Our console and mods UI does not scale properly with some resolutions and window sizes

Solution proposal

Create a more consistent UI scale that works better for any resolutions and window sizes

[FEATURE] Add button to open mods folder

Feature Information

Feature description

The mods folder is buried one layer deep in the ksp2 directory and is named plugins, we should add a way to open this folder in game.

Solution proposal

Add a button in the modlist UI to open up the BIE/Plugins folder

[FEATURE] Switch around MainMenuPatcher to use an event subscriber and add an API for mods to add buttons on the main menu

Feature Information

Feature description

We have a patching system for the main menu, but it can only be used by space warp internally, it should be exposed in a way for mods to use it

Solution proposal
  1. Change the harmony patcher to instead ping an event that mods can subscribe to
  2. Have the Space Warp API subscribe to this ping
  3. Add a method to the Space Warp API to register a menu button, that stores all registered buttons and adds them every time the main menu is opened by responding to the ping

[FEATURE] Show non Space Warp plugins in the Mods UI

Feature Information

Feature description

Space warp currently only shows SW plugins in the mods list, it should show BIE plugins as well.

Solution proposal

Show bepinex plugins with limited information in a "not managed by SW" section of the mods list
This limited info being GUID, version, and whatever other metadata we find viable to show to users
Also respect a non-spacewarp mods swinfo.json file if it has one

[BUG] Incorrectly Identifying Compatible Mod Versions

Version Information

KSP 2 Version

0.1.1

Space Warp Version

1.0.1


Bug Information

Describe the bug

SpaceWarp is failing to correctly understand the min and max compatible KSP2 versions for mods. There are numerous mods (e.g.,
Community Fixes, Cheat Menu, Kerbal Part Manager, etc.) where the max compatible version is set to a value larger than 0.1.1 (e.g. 0.2.0) and yet spacewarp.modlist is showing them as "(unsupported)". The only mods I'm aware of that don't have this problem are using a max of either 1 or *.

To Reproduce

Select MOD menu at game stat or press Alt-M in the game. Click any SpaceWarp mod that's listed in red. Check the KSP2 version range.

Expected behavior

SpaceWarp should show mods where the current KSP2 version is bounded between the min and max values listed for the mod as being compatible.

Link to crashlog [If Applicable]

N/A

Screenshots

Easily reproduced on any system

Additional context

Thanks! Love SpaceWarp and the mods that are available! Keep up the good work!

[FEATURE] Colored spacewarp.console output depending on log level

Feature Information

Feature description

To make looking into spacewarp.console easier, we should color output depending on log level.

Solution proposal
  1. Color fatal errors in bright red
  2. Color errors in red
  3. Color warnings in yellow
  4. Color messages in white
  5. Color info in light gray
  6. Color debug in dark gray

[BUG] Audio not working on v1.1.0

Version Information

KSP 2 Version

The KSP 2 Version

Space Warp Version

The Space Warp Version 1.1.0


Bug Information

Describe the bug

Have no sound with 1.1.0 it works with the version before

To Reproduce

Steps to reproduce the behavior: start the game - no sound

Expected behavior

haviing sound

Link to crashlog [If Applicable]

Ctrl + V here

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

[FEATURE] Make Mod App Buttons accessible in all states

Are there concrete plans for how to make mod app buttons accessible in other states?

The VAB has its own APP. BAR that could be integrated into.
The KSC and the Tracking Station don't their own App Bar, but as far as I can see the "inflight app bar" is still loaded with the parent gameobject disabled, maybe it could be forced on with only mod app icons enabled?
The main menu has no app bar and would need its own implementation.

In theory it might be a good idea to have mods be able to specify on which screens they should be accessible (you wouldn't need a Maneuver Node Editor in the VAB or an Alarm Clock in the main menu), but since mod windows persist you could run into issues where you can't close a mod window that you opened earlier.

Needed locations

  • VAB
  • KSC
  • Tracking Station
  • Main Menu

[BUG] The plugins doesn't load

Version Information

KSP 2 Version

0.1.0.0.20892

Space Warp Version

0.4.0


Bug Information

Describe the bug

The mods aren't loading in any circunstance.

To Reproduce

Just install BepInEx and SpaceWarp 0.4.0 and put your UPDATED mods on the plugins folder.

Expected behavior

I expected to the mods load.

BepInEx Log

LogOutput.log

Mods not persisting through "Quit to Main Menu"

Mod GameObjects (or rather all GameObjects) are subject to being removed when quitting to main menu thanks to the DestroyAllGameObjectsFlowAction.

Game Objects are only spared if they :

  1. are the GameManager or
  2. have a DOTweenComponent or
  3. are tagged "Game Manager" or "Graphics Manager" (see _dontDestroyTags)

The two obvious ways to evade this destruction is to either tag your GameObjects as "Game Manager" or "Graphics Manager", or to set your object's hideFlags to HideFlags.HideAndDontSave (or any other hide flag) so that the routine will not find your GameObjects.

Mods can theoretically implement either of these workarounds on their own, but it might be worth investigating a mod loader solution to have all mods persist through quitting to menu by default.

This could either be achieved by protecting the individual mod game objects or by just protecting the SpaceWarp object and making sure all mods get reinstantiated after loading into the main menu.

[FEATURE] Try to add System.IO.Ports.dll error.

Hello.
First of all I'm new to mods, sorry for the inconvenience.
I'm trying to make a mod that can read data via usb, to control the vessel. I have added the library to my project. But I don't know where I have to add the dll for spacewarp to find it.

imagen

Spacewarp log error:

imagen

[Warning:Space Warp] System.TypeLoadException: Could not load type of field 'Project1.Project1Plugin:puertoSerial' (26) due to: Could not load file or assembly 'System.IO.Ports, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. assembly:System.IO.Ports, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 type: member:(null) signature:
[Warning:Space Warp] System.TypeLoadException: Could not load type of field 'Project1.Project1Plugin+<>O:<1>__PuertoSerial_DataReceived' (1) due to: Could not load file or assembly 'System.IO.Ports, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. assembly:System.IO.Ports, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 type: member:(null) signature:
[Warning:Space Warp] Types failed to load from assembly com.github.peacho.mimod, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null due to the reasons below, continuing anyway.

Thank you so much!!

[BUG] TypeLoadException

Version Information

KSP 2 Version

0.1.0

Space Warp Version

0.4.0


Bug Information

Describe the bug

TypeLoadException

To Reproduce

Install and launch the game. It only happens to me.

Expected behavior

Can play the game.

Link to crashlog [If Applicable]

[LOG 20:01:39.224] [System] ******* Log Initiated *******
OS: Windows 11 (10.0.22000) 64bit
CPU: AMD Ryzen 7 2700 Eight-Core Processor (16)
RAM: 16336
GPU: AMD Radeon RX 6700 XT (12243MB)
SM: 50 (Direct3D 11.0 [level 11.1])
RT Formats: ARGB32, Depth, ARGBHalf, Shadowmap, RGB565, ARGB4444, ARGB1555, Default, ARGB2101010, DefaultHDR, ARGB64, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8, ARGBInt, RGInt, RInt, BGRA32, RGB111110Float, RG32, RGBAUShort, RG16, BGRA10101010_XR, BGR101010_XR, R16

Log started: lun., mar. 06, 2023 20:01:39

[LOG 20:01:39.764] Version Info: 0.1.0.0.20892
[LOG 20:01:39.764] Command Line Args:C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2\KSP2_x64.exe
[LOG 20:01:40.785] [UI] Primary EventSystem Selected: 'GameManager'(instance id: 205062)
[LOG 20:01:40.878] [UI] Localization sources updating
[LOG 20:01:41.094] [UI] Localization sources updating
[EXC 20:01:41.100] TypeLoadException: Could not resolve type with token 01000444 (from typeref, class/assembly SpaceWarp.StartupManager, SpaceWarp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
KSP.Game.GameManager.Start () (at <8c5bdf369a8c45f68951f69eb825ef73>:0)

[FEATURE] AddOn abstract class that allows for between mod's communication

Feature Information

Feature description

An abstract class that the mod developer can inherit from to create a public facing API to be used by other modders to communicate with his mod. He would redestribute that on his github (or wherever he likes) so that other modders could download that, add to their codes and use the methods without having to reference the original code.

Solution proposal

Something like what RemoteTech2 has with its abstract AddOn class

Additional context

This came from this chat in discord where the modder couldn't properly build an integration with ManeuverNodeController properly. He had to use reflection to achieve the desired behaviour.

[FEATURE] Repository admins accept content reports

Feature Information

Working on completing the Community Standards section for this GitHub repository.
We need to enable "Repository admins accept content reports" to complete this.
Most of the other items in the checklist is completed by #135 #137 #133 #136 #134 once we merge the branches

Feature description

To enable the "Repository admins accept content reports" feature in your GitHub repository, you can follow these steps:

Go to the Settings tab of your repository on GitHub.
Scroll down to the "Options" section and click on "Community standards".
In the "Community standards" section, check the box next to "Repository admins accept content reports".
Optionally, you can also specify the email address where reports should be sent and add custom text to the report form.
Once you've enabled this feature, anyone who visits your repository's content (such as issues, pull requests, or comments) can report it if they believe it violates your community standards. The report form will include options for the user to explain why they are reporting the content, and the report will be sent to the email address you specified (if any) and appear in your repository's "Reports" tab.

As a repository admin, you can then review the report and take appropriate action, such as removing or editing the content, warning the user who posted it, or blocking them from the repository.

Screenshots / Images

image

[FEATURE] Show warning in main menu when SW detects an outdated mod

Feature Information

Feature description

Player loads the game, sees that there's a warning that some mods are outdated, he goes to the Mods section to see details.

Solution proposal

Show a warning icon in main menu next to the MODS item. Using colors would be nice; yellow usually means a warning (mods are outdated, but they could be working normally). Yellow triangle or circle.

Screenshots / Images

Example:
image

[FEATURE] Linux installation guide

Linux installation guide

Feature description

Currently this does not work on Linux machines at least not the same way it seem to work for others. If at all possible it would be cool to know what to do on a linux machine. When i try to use this via proton, the DLL does not seem to be loaded. So the menu options "mods" does not appear ingame and there is also no indication in Log files that something went wrong. Although there is a line stating "Modlog : Unable to locate the mods directory!" but it seem not be related to spacewarp as its still there after i remove every added file.

After some digging on BapInEx i found, that for wine it used to exists a hardpatcher of BapInEx, but i was unable to find it on their CI as mentioned on https://docs.bepinex.dev/articles/user_guide/installation/hardpatching.html .

I also tried version 0.3.0 as well as 0.4.0 without success.

Solution proposal

Make a guide for linux users on how to get mods running.

Additional context

I run KSP2 on ubuntu 22.04 with proton.

Screenshots / Images

Ctrl + V here

[BUG] Mod config menus dont close correctly and interact weirdly

Version Information

KSP 2 Version

0.1.0.0.20892

Space Warp Version

0.3.0


Bug Information

Describe the bug

When using the Mod menu on the main menu, some things go wrong.
Firstly the buttons behind the window can be interacted with, which leads to overlapping menus, I dont know if this can be easily changed but I think it would be a more logical solution

The mod menu itself has no apparent way to be closed (except for clicking the mod menu button again which seems a weird way)

(This is caused by another bug which I will file a seperate report for, but still kind of a bug)
More importantly, the Configure menu can not be closed (pressing the save and close button does nothing) and when pressing the Configure button again, another configuration menu opens, which seems counter intuitive. It seems like this is caused by a lack of config file, but i feel like it should still allow me to close the window

To Reproduce

Use the Mods menu, not much more to describe.

Expected behavior

This is a kind of both feature and bug report, I think I describe everything I would expect in the "Describe the bug" part.

Screenshots

image

Log

Ksp2.log

[FEATURE] Version checking

Feature Information

Feature description

There should be a way for Space Warp to check mod versions to notify the user to update them

Solution proposal
  1. Make a prompt that asks the user if they want to check mod versions against the latest version
  2. If the user agrees, check every plugin that has a .version (KSP1 format) file against the online hosted version and display a warning if it is out of date

[FEATURE] Add key bindings to mod config

Feature Information

Feature description

Some mods need to have key bindings. It would be nice to have a common way for mods to have configurable key bindings, along with UI to input key bindings.

Solution proposal

I'm not super familiar with how the new input system works in Unity, but it should probably be implemented in line with that. Perhaps mod config classes should be able to have InputBinding fields, and then they can create their own InputActions from these bindings.

Default values can be in line with the Unity binding syntax, e.g. "<Keyboard>/space" or "<Gamepad>/buttonSouth".

Example config:

[ModConfig]
[JsonObject(MemberSerialization.OptOut)]
public class MyConfig
{
    [ConfigField("ShootKeyBind")]
    [ConfigDefaultValue("<Keyboard>/space")]
    public InputBinding ShootBinding;
}

[FEATURE] faster bans

Feature Information

This would return the build number and last deploy timestamp, which would allow adding multiple users or ban lists at once, by user/ban list/user ID.

Feature description

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Solution proposal

There are too many bots on the internet think that could be solved by user-specific invites. Also to mention, bots should be allowed to hide be allowed to use the lazy method.

Additional Details

At each part creation, a retention period should be able to disable gift reception, without revealing the gifter. Retention setting should only affect events that appear in the channel would hear exactly the same stream with no resampling taking place. premium status.

Potential Problems

Yes, but there are use cases you want to remote control someone else's client: Also, bots should be allowed to hide their ban.
Yes, but are there use cases you want to remote control someone else's client?

Screenshots / Images
  • Ctrl + V here
    Ctrl + V
Extra considerations

To allow applications to choose between per-security capable websockets and E2EE websockets. think that could be solved by user-specific invites. You could provide a per-part/per-ship toggle to choose between quick deployment and deterministic propagation delay.

[FEATURE] Allow .swinfo to have optional localization keys for name and description

Feature Information

Feature description

Space Warp now supports localization loading in the localization branch, but mod names and descriptions do not support it.

Solution proposal

Allow mod names and descriptions to have localization keys in the swinfo file
Example excerpt from an SWINFO allowing this:

"name": "Mod Example",
"name_key": "ModExample/Name",
"description": "Example Mod",
"description_key": "ModExample/Description"

[FEATURE] Add abstraction for disabling an app bar button

Feature Information

Feature description

This is a clunky way of turning off an app bar button's indicator

GameObject.Find("BTN-ExampleMod")?.GetComponent<UIValue_WriteBool_Toggle>()?.SetValue(toggle);
Solution proposal

Add a SetButtonIndicator(bool) function to the appbar api that does this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.