#Space Warp

1 messages · Page 4 of 1

timber cedar
#

you cant iframe

#

i tried xd

#

i was trying to make a three.js embed in a readme

#

and you cant

mossy kraken
#

ahh, you are correct

#

Might work if we generate with an unique id and make it so the script can edit our readme file

timber cedar
#

no thats not how to do it one sec

#

i got it

#

yep

#

works

#

by adding a query, github doesnt cache it

mossy kraken
#

LOL 😄 Nice workaround

timber cedar
#

ye

#

let me try rebuilding the images

#

:c maybe it doesnt work

#

should be 707 now

mossy kraken
#

damn

timber cedar
#

oh

#

i understand how they do it

mossy kraken
#

😮

timber cedar
#

access-control-allow-origin: *
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
cache-control: max-age=120, s-maxage=120
cf-cache-status: MISS
cf-ray: 7a7353b11d9e6420-SJC
content-encoding: br

#

here is the response header of the shields.io badge

#

cache-control

#

u see

#

expires: Mon, 13 Mar 2023 09:44:27 GMT

mossy kraken
#

Ahh yes, you can define a age and maxage

timber cedar
#

ye

#

ok i need to figure out how

#

xdd

#

ok

#

ok

#

ok

#

this should be it

#

hm maybe that wont work

timber cedar
#

xdd

#

my server time is off

#

by 17 minutes

#

no wonder the expire commands are broken

timber cedar
#

@mossy kraken

#

xdd

#

im so dumb

#

i did it

#

now for the cron job

#

ok i think its done?

#

yep

#

you can just copy paste it now

mossy kraken
#

Wow!

timber cedar
#

works for you?

mossy kraken
#

Gonna check later

timber cedar
#

xd its insane that in the like 2 hours i spent doing that

#

we got like 35 downloads

sacred jasper
#

Ayo so im off spring break so am more able to work on this

timber cedar
#

:O

#

insane

#

look at the sexy live counter

lime plaza
#

Which line endings are you using?

wicked wyvern
#

it wasn't the issue, and it's already working

#

just had to figure out the correct format for language columns

lime plaza
wicked wyvern
#

I did it without and the terms did not get automatically translated when using the game's LocKey properties

#

only when I added the language code

#

the localizations that are already in the game also had their language code set to "en"

#

so i did the same

lime plaza
#

I found crlf will include the carriage return in the language name

sacred jasper
#

Crlf was a mistake

wicked wyvern
#

Yep, CRLF

wicked wyvern
sacred jasper
#

Hey instead of one character for new lines have two~

lime plaza
wicked wyvern
#

Will try

timber cedar
#

average windows crlf user

mossy kraken
timber cedar
#

same

#

hmmm

timber cedar
#

done

mossy kraken
#

woo nice, awesome job sinon!

sacred jasper
#

Anyways, time to get back to work on SW after I do homework

sacred jasper
#

Homework is complete

sacred jasper
#

@mossy kraken ftilly very much feels like a bot to me

wicked wyvern
#

honestly it was kinda funny but confusing as hell

sacred jasper
#

Anyways, going to work on .version checking

#

Or basically

Okay, so the KSP .version format has so much overlapping metadata with swinfo.json, that its a better idea to add an optional field to the swinfo.json called "version_check" which just points to a place to pull an online swinfo from the web

wicked wyvern
#

I'd just like to mention that when CKAN for KSP 2 comes out, most mods are probably going to need the .version file anyway

sacred jasper
wicked wyvern
#

Yeah, I get it, but still, I doubt that they will be open to parsing the information from swinfo.json, so the duplication will most likely happen

lime plaza
#

Pretty sure ckan is going to parse swinfo.json

wicked wyvern
#

Really? I'd have expected a more universal solution that would also support BIE and internal mod loader

#

in that case nevermind

sacred jasper
#

Should I prompt for each new mod if their versions should be checked or if space warp as a whole should check all mods versions?

#

@wicked wyvern

wicked wyvern
#

I'd be probably just for the second approach

sacred jasper
#

Fuck I have nothing to test version checking with/

#

hmm, actually

#

I can quickly test space warps version

#

We need to find a good place to host space warps version info

wicked wyvern
#

shouldn't the main branch on GitHub be enough?

sacred jasper
#

Fair actually, I'll keep it like that

#

thats how I was gonna test

wicked wyvern
#

as long as it always contains the latest released version, it should be just fine

sacred jasper
#

yep

sacred jasper
#

@wicked wyvern Here we go

wicked wyvern
#

Nice!

sacred jasper
#

I should do KSP version checking and highlight the mods as red that don't "support" the current KSP version

wicked wyvern
#

Sounds like a good idea

sacred jasper
#

Just need to figure out where I can get KSP2 versionj

wicked wyvern
#

it's a non-namespaced class

sacred jasper
#

Why is it not namespace

wicked wyvern
#

no idea, but there are tons of classes like that in the dll

sacred jasper
#

Anyways made the PRs

sacred jasper
#

@mossy kraken you wanna look over them?

timber cedar
#

i can merge them?

#

if ewy ded

sacred jasper
timber cedar
#

both?

sacred jasper
#

yes

timber cedar
#

k

wicked wyvern
#

@sacred jasper about the latest issue on UI: I think it might not be a bad idea to use something like what Twiner/Got suggested here: #🔴mod-dev message

#

From what I'm reading, it seems to be equivalent to the Unity UI in-editor stuff, but with the additional ability to create the UI at runtime

sacred jasper
#

Hmm, maybe

wicked wyvern
#

the main issue is that afaik, it's not included with the game's assemblies, and would need to be basically added as a dependency in a mod

little bay
#

@sacred jasper do not just do VersionID.VERSION_TEXT

#

in case you did that

#

use reflection to get the value at runtime instead

#

otherwise you won't actually be checking the version of the running KSP

#

you'll be checking against the version of KSP that SpaceWarp was compiled against

sacred jasper
#

facepalm

#

I forgot thats how const worked

sacred jasper
#

I blame KSP2s versionid class for this blunder

#

/hj

#

I shouldve looked closer

sacred jasper
#

@little bay it hath been fixed

#

var kspVersion = typeof(VersionID).GetField("VERSION_TEXT",BindingFlags.Static | BindingFlags.Public)?.GetValue(null) as string;

sacred jasper
#

@wicked wyvern I just need to make it look a bit better

wicked wyvern
#

awesome

sacred jasper
#

And its displaying all the space warp mods twice for some reason

wicked wyvern
#

oh yeah, didn't even notice that 😆

sacred jasper
#

I figured out why

wicked wyvern
#

btw I just noticed that "ModListHeader" label at the top

sacred jasper
#

changing it

#

Going to add an empty space between them but @wicked wyvern @late condor how does this look

wicked wyvern
#

I'd suggest maybe adding a matching header like "SpaceWarp Mods" on the top

sacred jasper
#

Almost there, accidentally added a space

#

It hath been added to 1.0.0

wicked wyvern
#

nice

sacred jasper
#

<@&1078770539688112168> <@&1079271050644303922> could we push for having 1.0.0 be released on the same day as the first patch if it comes thursday?

lime plaza
bronze anchor
mossy kraken
#

Sounds good to me

timber cedar
#

idm

sacred jasper
wicked wyvern
#

Hm

#

On one hand it does seem like something very useful

#

but it seems like it there would be A LOT of it

sacred jasper
#

The other option is extension method hell :3

wicked wyvern
#

What I mean is, I think the abstracted API would have to cover a lot of ground to be really useful and to avoid having to mix and match with the game API

sacred jasper
#

Thoughts?

#

Asking you specifically munix

wicked wyvern
#

Not sure if extension methods are the way to go, it might be a bit disorienting, but I don't know

wicked wyvern
#

I just feel like in this case it might be a bit confusing to be able to call some methods on existing types that you can't find when for example looking through the original types in a disassembler

sacred jasper
#

I don't know how much of an issue that is?

wicked wyvern
#

I'm definitely not an expert in designing library APIs or anything of that sort, so it might as well just be completely fine and I'm just paranoid

sacred jasper
#

Also is it a dumb idea to just grab a private property like this?
public static VesselVehicle ActiveVesselVehicle => GameManager.Instance.Game.ViewController._activeVesselVehicle;

wicked wyvern
#

You will get tons of exceptions before ViewController is instantiated

#

happened to me in Kerbonaut Manager

sacred jasper
wicked wyvern
#

oh I'm dumb, nvm

sacred jasper
#

It's literally exposing it for people to quickly grab the active vehicle

wicked wyvern
#

I didn't notice the ">"

sacred jasper
#

@wicked wyvern look at the latest branch i made, and see what you think

#

I gtg for now

wicked wyvern
#

Yeah I guess that works

wise swift
#

if you get errors make sure its in flight mode first
GameManager.Instance.Game.GlobalGameState.GetGameState()

storm quail
#

Cheese how did you handle such a ginormous growth in the discord server in the first week

storm quail
#

lol

wicked wyvern
#

Alright, seems like I got UITK loaded successfully, but still don't know fully how to use it from code without loading bundles

sacred jasper
#

It's gonna be weird to have that as an external dependency as we package everything in space warp already

wicked wyvern
#

I get it, but also it will be nice to provide that for BIE-only mods, too

#

since it has nothing to do with SpaceWarp

sacred jasper
#

One thing, I doubt much of anyone will be using BIE only mods

#

but yeah I get that

#

I meant exclusively

#

fuck

#

missed a word only BIE only mods

wicked wyvern
#

yeah, but even then, if someone wanted to build a mod without SpaceWarp and use UITK, they would still have to have a SW dependency

sacred jasper
#

Not necessarily, I mean just package the entire plugin in the thirdparty folder, like we do w/ bie and configuration manager, we can still put it separately out

#

@wicked wyvern waddya think of that?

wicked wyvern
#

I guess so

sacred jasper
wicked wyvern
#

yeah it makes sense

#

I was mostly against making it an inseparable part of SpaceWarp itself

#

don't really care if it's packaged with it though

sacred jasper
#

oh for sure no

wicked wyvern
#

it's very much just an experimental version

#

I can build it and when I put it in the game, I can access some UI Toolkit types, that's as far as I've verified it so far

#

it might not need all the .dlls specified, and it might need more for other stuff that I haven't tested yet

#

added an experimental pre-release, too

wicked wyvern
#

I don't think there's any way yet to dynamically load UXML from a file/string, seems like the only way for now is bundles

#

but it should be possible to create the UI tree just using C# instead of UXML

sacred jasper
wise swift
wise swift
#

going to try out your 0.0.1

wicked wyvern
#

That seems to be an editor-only thing

#

Not for runtime

wise swift
#

we will see

wicked wyvern
#

Also, the pre-release I have does allow you to use the types from UITK, but it's not complete

#

I tried making a C#-only UI before I went to bed and ended up with a loop of exceptions saying that a shader that it needs couldn't be found

#

I'm pretty sure I'll have to include a default bundle with it

#

Seems that someone made USS loading work at runtime, but not UXML yet

wicked wyvern
sacred jasper
sacred jasper
#

@wise swift how did you do the input block for notepad, as I was trying to do something similar for the console to no avail

wise swift
sacred jasper
#

Its ... that easy? facepalm

#

I was trying to do control locks

wise swift
#

yes. would like to have some automatic detection when user is inputting to a text area but IDK how.

#

so I just did the manual button

sacred jasper
#

Wait till we use uitk basically

wise swift
#

exactly why im excited for it

gilded kettle
#

is there any easy way to add a module to all X type parts? just like @Module[Antenna]

#

or would i need to go through all parts and filter by what i want (probably in category or family)

sacred jasper
#

Can you show how you want to add modules?

gilded kettle
#

so i just wanted to do something like, on postInitialized or smth, remove all Module_Antenna and then add a custom Module_NSRTAntenna

#

something like a Parts.GetByModule<ModuleType>() would be nice cause then ican just foreach it

#

but feel free to implement it as you think is best

sacred jasper
#

aaron about to yell at me for extension methods again
But yeah that makes sense

#

Can't be an extension method I don't think but I have an idea

#

Actually nope, I found the partsprovider class

#

@gilded kettle it should hopefully be in the next versions

#

Just working on it rn

gilded kettle
#

great :) no need to be an extension tho, if we can get an IEnumerator with the parts thats enough

sacred jasper
#

Or in a bit cuz rider is being annoying

gilded kettle
#

lmao tyt

sacred jasper
#

It makes sense as an extension though

gilded kettle
#

it does

sacred jasper
#

lemme just quickly work on this in visual studio if rider is gonna be dumb

#

    public static IEnumerable<PartCore> WithModule<T>(this PartProvider provider) where T : ModuleData
    {
        return provider._partData.Values.Where(part => part.modules.OfType<T>().ToArray().Length > 0);
    }
#

So you can do Parts.WithModule<Antenna>

#

gonna quickly make it slightly better

#

@gilded kettle it will be in the next update

#

Would it be worth adding extensions to add/replace modules to parts with a module kinda like a module manager kinda thing

wicked wyvern
#

honestly I'd leave that to a tool more like MM in scope

sacred jasper
#

That's fair yeah

wicked wyvern
#

although, I suppose there is no reason SpaceWarp can't try to do something like that (using some sort of json schema for similar purposes to MM patches perhaps)

#

it's already sort of an all-in-one kind of project

#

but that would be a pretty big undertaking for now

sacred jasper
#

Might be worth looking into, but as you said seems a bit much for now

wicked wyvern
#

and considering there are 0 released parts mods as of now, it makes sense to wait a bit

gilded kettle
wicked wyvern
#

That's such a dumb bug if it's true husK

gilded kettle
#

hmm i wonder, a channel for sharing unfinished mods for testing would be nice... Like i'd like to make de gridfins available to who wants to use them even tho their state, but i dont think that creating a new project would be right

#

or maybe i just create a project for the mod and mark it as alpha or smth

wicked wyvern
#

I'd say just go for it and make a project post, since #1079110458969165864 is for finished mods

#

so you can totally post WIP stuff in #1078701690762571866

gilded kettle
#

hmm ok will look into it then

sacred jasper
#

Time for some fun

#

documentation&+

#

Imma quickly run down our entire API and document it ahead of tomorrow

#

Also, I updated rider, bad idea

#

it no work for me now

#

have to use VS for the time being

wise swift
wicked wyvern
#

Yeah I agree (in my next message after that)

#

but I don't think it needs to be a priority right now

sacred jasper
#

@lime plaza when you create localizations to put in an addressables bundle do you still need to create a csv file for the LanguageSourceAsset or do you have the editor script?

lime plaza
sacred jasper
lime plaza
sacred jasper
lime plaza
#

You add them

sacred jasper
#

Gotcha

#

I'm just trying to update documentation

sacred jasper
#

Example of the updated documentation

#

Im hoping to finish this tomorrow for the space warp release

lime plaza
#

If another mod depends on my mod, my mod's onInit will run before theirs right?

sacred jasper
#

@timber cedar I created a PR on the docs repository for version 1.0.0 documentation

timber cedar
#

:O kk

#

goddam nice job 👍

#

a couple fixes

#

probably should have not merged that branch, and left it as a 1.0.0 branch

#

because i can assign differenent version in readthedocs

sacred jasper
#

rip

#

you can undo

timber cedar
#

yeah ik

#

ok ik how to fix

sacred jasper
#

Pog

#

Imma sleep now

#

I was just speedrunning documentation

timber cedar
#

xd

#

cya

#

should be good now

mossy kraken
#

Sorry I been a bit busy, it is spring break here in Norway this week 😄
Have the new patch come out of KSP2?

gilded kettle
#

[Info :Asset Loader] Did not load asset bundles for Spaceplace and Orbital Recovery and Reutilize companY as no asset bundles folder existed!

Is this only meant for UI? cuz for now all adressables are being loaded from the addressables folder right?

wicked wyvern
#

you can use both bundles and addressables

#

but for parts you need addressables

gilded kettle
#

oh ok, will this be changed? it makes more sense for all bundles to be there

wicked wyvern
#

I mean, they are two different types of bundles

#

so it makes sense for them to be separated

gilded kettle
#

oh wtf ok, thought they were the same

wicked wyvern
#

I mean, addressables are a subtype of asset bundles

late condor
#

You can use both, but its really a good idea to only use one or the other and do it well

wicked wyvern
#

yeah, what I really meant was that SpaceWarp allows you to use either

sacred jasper
#

Theoretically everyone should use addressables buttt

sacred jasper
#

I did speedrun writing documentation yesterday

#

So if people wanna write tutorials

mossy kraken
#

Alright

timber cedar
#

xd waiting

sacred jasper
#

Itll be at least an hour I presume

timber cedar
#

hope

#

they already have it up i think

#

just not public

late condor
#

Patch suddenly experiences RUD

timber cedar
#

RUD?

late condor
#

Rapid, unplanned, disassembly

timber cedar
#

xd

#

yeah

#

very likely

wicked wyvern
#

Not sure if UITK is worth pursuing for now, at least I personally can't seem to make it work

#

It's what Unity Explorer and BIE Configuration Manager are built with

sacred jasper
wicked wyvern
#

it's using the Unity UI framework rather than UI Toolkit, but it allows you to build UIs using C# without Unity Editor, too

wicked wyvern
#

tried both creating it fully from C# and injecting it into the scene, and loading a prefab with UI made in the Editor

#

neither shows up

sacred jasper
#

Alright, if you can share what you have, I'll take a look later

wicked wyvern
sacred jasper
#

Alright, I am doing school work right now

#

can someone confirm that SW works on 0.1.1

mossy kraken
#

Patch looks really good

#

I will test

#

Updating as we speak

sacred jasper
#

Alright, imma grab lunch rq then work on pushing out v1.0.0

mossy kraken
#

It booted

#

Have not tested with v1.0.0 yet

wicked wyvern
#

all mods I've tested so far work, too

silk wigeon
#

Some people talking in KSP general are saying that some mods work

#

Still, I'd update SW to make sure everything still works

mossy kraken
#

I just built myself a v1.0.0 of Space Warp and it just booted up flawlessly!

#

This is really promising

silk wigeon
#

Das good

mossy kraken
#

Gonna check the performance of the game itself

#

If it feels any better

gilded kettle
#

SpaceWorp 0.4.1 wen?

mossy kraken
#

never

#

We are releasing v1.0.0 instead

wicked wyvern
#

1.0.0 is coming today (most likely)

mossy kraken
#

Out of beta, releasing on time

gilded kettle
#

no i want 0.4.1 wtf

#

😭

mossy kraken
#

rip 🪦🥲

gilded kettle
#

Ebic gamers, is this right? or is it a typo? sauhsahusa

#

sounds funny eitherway

mossy kraken
#

prob typo 😮

gilded kettle
#

Extensions for vehicle controls and getting parts added by cheese3660. the one im most excited to play around ngl

sacred jasper
#

@wicked wyvern should I still provide the standalone Space Warp, or just only provide BIE packaged in

wicked wyvern
#

I mean, I don't see much use for a standalone download, and it seems to only confuse people

mossy kraken
#

^

wicked wyvern
#

does this version still need the bepinex config file?

sacred jasper
#

Gotcha
Yes it still needs the change in the configuration.

wicked wyvern
#

it would make sense to release the standalone for the very few people who already have BIE and want to keep their config

#

but if we overwrite it anyway, then there's no point

mossy kraken
#

Its going to be fun to see how many days it will take until v1.0.0 shows up on the graph

sacred jasper
#

And updated on space dock, and curseforge

#

just the forum post needs to be updated

inland lichen
#

does the sw1.0.0 download zip still include bepinex?

wicked wyvern
#

yeah, it's the only version now

#

to reduce confusion

sacred jasper
#

So CKAN does use swinfo files, independently of dependency on SpaceWarp

wicked wyvern
#

Nice to see

inland lichen
#

Usability issue: SpaceWarp UI does not scale with game UI scale. Text is unreadably tiny when game is at 4k resolution.

sacred jasper
inland lichen
#

for reference, this is on a completely clean install of the new game patch.

mossy kraken
sacred jasper
#

@wicked wyvern you should likely update the mod templat

wicked wyvern
#

yeah that's a good idea

sacred jasper
#

fuck I need to update the space warp nuget package

#

yet I suck at nuget packages

wicked wyvern
#

anything important that I should update/add?

sacred jasper
#

The version check field?

wicked wyvern
#

that's about it, right?

#

maybe an example of vessel control

sacred jasper
#

yee

#

I'll work on the UITK stuff tomorrow, I have a pathfinder game soon

#

@wicked wyvern as well, if you wouldn't mind creating an updated nuget package that I can publish?

wicked wyvern
#

FYI, the SpaceWarp.csproj file still has version tag set to 0.4.0

sacred jasper
#

F

#

That should be fixed

gilded kettle
wicked wyvern
#

heh

gilded kettle
#

Ctrl+click on any SpaceWarp class

wicked wyvern
#

should version_check be required?

sacred jasper
#

It shouldn't be?

wicked wyvern
#

I'm just asking since I'm getting all these errors with old mods (which is pretty much all of them)

mossy kraken
#

v1.0.0 just hit 200 downloads

sacred jasper
#

I'm dumb

#

required.allow null makes the thing required

wicked wyvern
#

1.0.1 might not be a bad idea, with a couple of hotfixes like this + the project version

wicked wyvern
#

I can take care of those two things quickly and PR

mossy kraken
#

@timber cedar I made a few tiny updates to https://github.com/SpaceWarpDev/SpaceWarpDownloads/blob/main/downloads.py

It is now sorted by versions with major.minor.patch for both graphs and updated some color and font stuff
https://github.com/SpaceWarpDev/SpaceWarpDownloads/blob/main/downloads.py

Not sure if you have to manually update the script on your server thingy or if it pulls it from git on commit

GitHub

A repository to keep track of all the Space Warp downloads from all the different platforms. - SpaceWarpDownloads/downloads.py at main · SpaceWarpDev/SpaceWarpDownloads

#

Are we going for a v1.0.1 patch?

sacred jasper
#

but I'm unable to release it today ree

mossy kraken
#

Game breaking?

sacred jasper
#

not really?

mossy kraken
#

Nice

wicked wyvern
#

nah, just some unneeded errors and one that prevents a NuGet package from being uploaded

#

also for some reason modders seem to use "dependencies": ["SpaceWarp"] when that's not supported

#

just a thing I noticed

timber cedar
#

thx

#

ill update it now

#

cool thing about the system i made is that i can just drop and replace the file :D

#

ok

#

i think i updated it

mossy kraken
#

Cool! Just gotta wait for it to have it scheduled run again in a min or two

timber cedar
#

it updated

#

dw

mossy kraken
#

yeah

timber cedar
mossy kraken
#

just saw it

timber cedar
#

:D

mossy kraken
timber cedar
#

i did the change just in time

mossy kraken
timber cedar
#

yep

#

should put the actual number of downloads above each bar

#

on the top image

mossy kraken
#

Font has to be tiny then, I tested it and did not like it

timber cedar
#

hm

#

ill try

#

good point though

sacred jasper
#

I'll accept the pr then update it tomorrow

wicked wyvern
#

am dumb

#

forgot swinfo.json lol

timber cedar
#

xd

wicked wyvern
#

the exact opposite problem of the original

wicked wyvern
#

actually now that I'm writing the example code for SpaceWarp.Template, I still think it might have been a better idea to instead of

public static VesselVehicle ActiveVesselVehicle => GameManager.Instance.Game.ViewController._activeVesselVehicle;
public static VesselComponent ActiveSimVessel => GameManager.Instance.Game.ViewController.GetActiveSimVessel();

do something like

public static VesselVehicle ActiveVesselVehicle => GameManager.Instance.Game?.ViewController?._activeVesselVehicle;
public static VesselComponent ActiveSimVessel => GameManager.Instance.Game?.ViewController?.GetActiveSimVessel();

so that accessing these properties at the wrong time gives you a null instead of an exception

#

but that might just be me

little bay
#

to be clear, I don't actually hate extension methods

#

the idea is just to get you to seriously consider how much each extension actually helps

#

so you don't go overboard

little bay
sacred jasper
#

Why I normally use rider

rocky pollen
#

Hey, is there a working version of Unity Explorer for SpaceWarp 1.0.0?

sacred jasper
#

Oh I can push out the 1.0.1 patch

#

After lunch

wicked wyvern
#

(pls merge the latest PR first, it has the updated swinfo.json version which i stupidly forgot in the first one)

wise swift
#

could we get a dark mode for the docs

sacred jasper
#

@wicked wyvern sw patch has been pushed out, next should I work on MM-esque stuff or UI

wicked wyvern
#

it's totally up to you, but I'd personally like to get the UI working first

sacred jasper
#

I'm still waiting on UITK to work
Good thing is they are 2 separate things so I can just make branches for each

wicked wyvern
#

it doesn't seem to want to

#

but I'm not sure whether it's a KSP-related bug or just me doing something wrong/missing something and not realizing

sacred jasper
#

Hmm, I want to see if theres a way to get a module type by string

#

Gods the amount of reflection this MM thing will have to do will be insane, but fun

#

Okay this looks like pain if I wanna stick to a text format

timber cedar
late condor
#

If you're doing reflection for access purposes you might try using linq expressions instead, they have less overhead

#

As long as you cache it

#

If you're using reflection for discovery, they don't help with that afaik, but you could still stich together the end result with linq expressions

sacred jasper
#

Okay, I have no clue how the entire module system works atm

wicked wyvern
#

it's definitely a huge project, from figuring out how the in-game system works, to defining a full-featured schema for the patch format (in JSON i presume), to implementing it

sacred jasper
#

It seems there are ModuleData and PartBehaviourModules, PartCore, and IInteractivePart, and looking into it I'm trying to find the difference

wicked wyvern
#

we've been trying to do that as well

#

#🔴mod-dev message

sacred jasper
#

Yeah it seems to be a mess

wicked wyvern
#

the engine modules are particularly messy

#

like 0 apparent separation of concerns

#

I'm looking into UniverseLib but I can't say I love what I'm seeing

#

UITK would definitely be preferred if it can be actually made to work

timber cedar
#

@sacred jasper done

wicked wyvern
#

could you upload a 1.0.1 nuget package please?

wicked wyvern
#

not sure if any other configuration is needed, I literally just ran "Pack Selected Project" in Rider

sacred jasper
wicked wyvern
#

Yeah, since it seems to be configured in the .csproj

#

Although, actually looking into the project file, it might need more configuration there to correctly set all the nuget stuff

#

How did you package it?

sacred jasper
#

Manually

wicked wyvern
#

This is how I set the properties for nuget

#

And <GeneratePackageOnBuild> makes it so i don't even have to package it in a separate step, just need to build

sacred jasper
#

I uploaded the package you sent me so it should be about an hour

wicked wyvern
#

Alright, thanks

wicked wyvern
#
#

Was I just hallucinating or was that already a feature before 1.0?

#

Was that removed because of the switch to BIE?

timber cedar
#

It was, I implemented it

little bay
#

its possible to force SpaceWarp plugins to have that functionality

#

but i guess that wasn't done?

sacred jasper
#

Itd be an interesting thing to implement

#

We'd have to force BIE not to load the dll, so renaming it

#

But im not sure we can rename the dll while the game is running

wicked wyvern
#

https://learn.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext https://learn.microsoft.com/en-us/dotnet/api/system.appdomain are either of those possible to be used to that effect? (even if it might require a custom BepInEx fork)

#

Seems like they both support creating a context/domain for loading and unloading assemblies

#

it's the closest thing to unloading an assembly at runtime that I could find

gilded kettle
#

Hey cool people

#

can you check the Colors documentation pls?

#

already found an incosistency, textureMapType should be marked as code

wicked wyvern
#

do you have a repo somewhere with it where I could submit a PR with some minor edits or anything like that?

#

(e.g. your fork of the official SpaceWarpDocs)

gilded kettle
#

yup

#

i'll also add the How to create custom modules and the whole json thing in this fork

#

wtf, just realized that the code examples for DelcareParts dont show

#

updated

wicked wyvern
#

I'm a bit confused by the setup of branches in the SpaceWarpDev/SpaceWarpDocs repo

#

why is the en branch 8 commits ahead and 36 commits behind main?

#

As far as I understand it, the actual live docs are taken from the language branches and not main

#

So what are commits to main for?

wicked wyvern
#

For example, this is in main (and by extension in your fork)

#

While this is in the live docs

gilded kettle
#

yeah wtf

#

hmm maybe it uses en, ru, etc etc for live docs depending on the selected language

wicked wyvern
#

it does

gilded kettle
#

instead of using main for all

wicked wyvern
#

but I don't understand the purpose of the main branch then

gilded kettle
#

which isnt optimal? ig?

#

it should be all in main no?

wicked wyvern
gilded kettle
#

yeah maybe, well its just a matter of copy paste into en

wicked wyvern
#

Ok, turns out all the newest commits to main were just updates of README

gilded kettle
#

lmao

wicked wyvern
#

The last commit that was actually editing any of the documentation happened two weeks ago, and then the language branches were created

gilded kettle
#

maybe i should do the same as addresablles loading and lead into a new file?

wicked wyvern
#

whichever way you do it, just do it in the en branch

#

😆

gilded kettle
#

lmao, will do! i'll commit now then

#

feel free to do your changes

wicked wyvern
#

By the way is there even need for the source-en and source-ru folders in main? It just makes it more confusing and doesn't seem to be used anyway, and if that's the case, it would be better to just delete them in the next commit

#

(that's not directed to you as much as it is the docs contributors)

timber cedar
wicked wyvern
#

thanks

timber cedar
#

just have the readme and listened

#

liscense

#

they were there before i realized how read the docs really works

gilded kettle
#

wait so you, to update the docs, will accept all prs when the new version releases?

timber cedar
#

... not all prs

#

all good ones :D

gilded kettle
#

yeah lmao

#

hmm, ok, as soon as munix does his pass on the docs i'll pr

timber cedar
#

i need to clean up the docs repo a bit

#

ok a deleted some stuff :D

#

now im going to remove the 0.4 docs

timber cedar
#

:D

#

merged

#

nice work

gilded kettle
#

THE FEATURE ISNT IN YET nooooooooo

#

but thx <3

timber cedar
#

xd then what

#

was the r

#

docs

#

xdddd

#

eh it’s fineeee

#

guys if u want to

#

make docs for new version

#

please checkout the branch with en-<version>

gilded kettle
#

the doc is for something that was already merged on the 1.1.0 version

timber cedar
#

which is a not released

#

xd it’s fine just later

gilded kettle
#

yes exactly, yeah

#

no cuz i was expecting you to leave it as a pr till the version released lmao

timber cedar
#

xdd

#

ist good

#

just make the pr immediately to new branch

#

illl update readme to say that

little bay
#

my idea would be to let the plugin load through bep, but then just not do the spacewarp stuff

#

so instead of disabled mods not being loaded, they're loaded, but disabled

wicked wyvern
#

They wouldn't be disabled, their lifecycle methods will still run

#

Not loading them in SpaceWarp will only cause On(Pre/Post)Initialized to not be run, right?

sacred jasper
#

Yeahh

#

It might cause error spam

sacred jasper
#

Should we push out a 1.1.0 with just the colors patch

#

Or is there any other in progress feature close to being finished

gilded kettle
#

i can pack my mods with my version of colors patch until 1.1.0

wicked wyvern
#

it doesn't seem like a big enough thing for a minor version update but idk

gilded kettle
#

but usually y has more than 1 feature added

wicked wyvern
#

yeah that's what I mean

#

it seems like a very small update considering the scope of the previous updates

sacred jasper
#

I'm just wondering moreso what stuff is being worked on

#

And what I should be working on

gilded kettle
#

work on fixing ksp bugs 🙏

#

we need a pepe pray in here

#

or a variant of pray

wicked wyvern
#

I think the priority should be bug fixes

sacred jasper
#

Thats #1081724578822377522

gilded kettle
#

doge pray ie

wicked wyvern
#

which would be the version checking bug for now

#

0.2 isn't recognized as > 0.1.1

gilded kettle
#

oh also, big names bugs the alt-m

sacred jasper
#

I do need to see why

#

On both of those

#

Just don't use big names munley

gilded kettle
#

my mod has a bigname you can test with it

#

tbh i can just put SORRY as a name

wicked wyvern
gilded kettle
#

you can just check the size of the name string, and if over x put [...] in the end

sacred jasper
#

Inb4 someone pulls out an arabic name

gilded kettle
#

theres no arabic support yet?

#

shame on you

sacred jasper
#

Depends on unity's IMGui support for arabic

gilded kettle
#

i can think of a quick fix for the version checker, why not just make versions as a struct of int
Major
Minor
(forgot the other one)

#

then just check per int

sacred jasper
#

Cuz that'd break every single mod in existence

gilded kettle
#

"Modders, update your .swinfo" :D

#

let me take a look into the version checker

sacred jasper
#

I might just be doing something dumb to be honest

#

The versionsutility class is not the correct version checker btw

wicked wyvern
#

and compare them consecutively

sacred jasper
#

So I might of just flipped a comparison

timber cedar
#

just add a "first time" part to the reader

#

itll auto-update the mods if they dont exist

#

idk

sacred jasper
#

That sounds like pain

timber cedar
late condor
#

Why not just use the .net Version class

sacred jasper
#

Wai- wha

wicked wyvern
sacred jasper
#

Cuz we have the "*" in the versions for some reason

#

Though I can just replace ".*" with ""

timber cedar
#

if you have * you should replace with "any" so its a little more readable

#

also you should force version

late condor
#
  • is any value right?
sacred jasper
#

eys

timber cedar
#

because obv

late condor
#

So just exclude that value from both sides

timber cedar
#

hm

#

just make a custom reader function for comparing and reading

#

0.2.* = 0.2.3

late condor
#

Mod says "1.1.*"
SpaceDock says "1.2.4"
FileVersionInfo.Parse("1.1.0") > FileVersionInfo.Parse("1.2.0")

#

You'd have to cascade down'

#

so

timber cedar
#

yeah

late condor
#

1.*.5 would technically be invalid

#

but you just ignore that

timber cedar
#

bad

#

💀

sacred jasper
#

If someone does that, they deserve their ankles broken

late condor
#

FileVersionInfo.Parse("1.0.0") > FileVersionInfo.Parse("2.1.2")

wicked wyvern
#

I only accept mod version *.*.5

late condor
#

lol

timber cedar
late condor
#

my point is that you basically just 0 out any value starting from * to the last version element

timber cedar
#

yeah

late condor
#

and then your check is still valid

#

and let .NET do the rest for you

#

you can use > < >= <= == with FileVersionInfo

#

so FileVersionInfo.Parse(versionString.Replace("*", "0"))

timber cedar
#
internal static void CheckKspVersions()
    { 
        var kspVersion = typeof(VersionID).GetField("VERSION_TEXT",BindingFlags.Static | BindingFlags.Public)?.GetValue(null) as string;
        foreach (var plugin in SpaceWarpPlugins)
        {
            ModsUnsupported[plugin.SpaceWarpMetadata.ModID] =
                !plugin.SpaceWarpMetadata.SupportedKsp2Versions.IsSupported(kspVersion);
        }

        foreach (var info in NonSpaceWarpInfos)
        {
            ModsUnsupported[info.ModID] = !info.SupportedKsp2Versions.IsSupported(kspVersion);
        }
    }
#

is this the current one?

wicked wyvern
#

well that's just for KSP

timber cedar
#

💀

#

one sec

late condor
#

And if people make invalid versions, thats on them

wicked wyvern
#

you also need checking for dependency version and for the mod updates

gilded kettle
#

wait its the ksp version and not the mods version?

lime plaza
gilded kettle
#
        {
            string[] strings = versionString.Split('.');
            int[] ints = new int[3];

            for (int i = 0; i < 3; i++)
            {
                string s = strings[i];

                if (s != "*")
                {
                    if(int.TryParse(s, out int version))
                    {
                        ints[i] = version;
                    }
                    else
                    {
                        ints[i] = int.MinValue;
                    }
                }
                else
                {
                    ints[i] = int.MaxValue;
                }
            }

this should parse no?

late condor
#

So you have to do a little legwork i guess

gilded kettle
#

then i have a Compare on the Version class

wicked wyvern
#

this is getting wild considering we're only talking version checking 😆

late condor
#

You need to identify the position that * shows up in, and update the version string on. Kth sides

#

Eh, a custom type is probably better for this

timber cedar
#
    IEnumerator CheckVersion(ModInfo pluginInfo)
    {
        var www = UnityWebRequest.Get(pluginInfo.VersionCheck);
        yield return www.SendWebRequest();

        if (www.result != UnityWebRequest.Result.Success)
        {
            Logger.LogInfo($"Unable to check version for {pluginInfo.ModID} due to error {www.error}");
        }
        else
        {
            
            var results = www.downloadHandler.text;
            var checkInfo = JsonConvert.DeserializeObject<ModInfo>(results);
            SpaceWarpManager.ModsOutdated[pluginInfo.ModID] = OlderThan(pluginInfo.Version, checkInfo.Version);
        }
    }
```what is this 💀  why do we have network checking
late condor
sacred jasper
#

Why would we not?

late condor
#

We aren't even considering the wider implications of these things

timber cedar
#

is it breaking if you're offline

sacred jasper
#

No

timber cedar
#

good

late condor
#

Is that code not run if there is no network?

#

Because that code will error if there is no network

sacred jasper
#

It just fails

timber cedar
#

hm

sacred jasper
#

UnityWebRequest returns a failure if there isn't network right?

late condor
#

Hmm, I have error handling anywhere i use it, but now I'm not sure I'm recalling why correctly

timber cedar
#

yeah, but the problem is that it gives errors

#

i dont like that it gives errors if you're offline

#

should just stay silent

late condor
#

Thats a messy one

#

Sometimes you might want the errors

lime plaza
sacred jasper
timber cedar
#

yeahhhh but ehhhh
i can just block the specific no connection errors

late condor
#

Networking is pain

timber cedar
#

^ but why would you need either

#

internet down isnt spacewarps problem

sacred jasper
gilded kettle
#

what are the current problems of the version checking?

wicked wyvern
#

now we're getting recursive

#

haven't even thought about that

gilded kettle
#

PLEACE DONT

lime plaza
wicked wyvern
#

check KSP version supported by mod -> check mod update -> check mod update's KSP version -> check mod update's dependencies updates -> check mod update's dependencies' KSP version -> ... munley

#

we could go on forever

late condor
#

Perhaps they are blocking the connection accidentally

#

Or they have some other local issue preventing them from getting what they want rhat they need to resolve

gilded kettle
#

wtf why are u thinking about the user experience?

#

ur not a real programmer

sacred jasper
late condor
#

Lol, only good programmers think about user experience :p

timber cedar
#

it wouldnt be spam every time it fails

late condor
#

I might not be real, but neither is PI, and just think about how useful PI is 😉

timber cedar
#

you dont use PI in programming

#

you use an approximation

lime plaza
timber cedar
#

a real number

late condor
#

Shhhh

late condor
#

😄

timber cedar
#

:O

late condor
#

You have engaged in battle with dad

timber cedar
#

no kidding ^

sacred jasper
wicked wyvern
timber cedar
#

thats completely managable

wicked wyvern
#

I don't think it's necessary anyway

#

all you need is to download the mod's online swinfo.json, check the version in it and at most check the KSP version in it

#

easy

lime plaza
timber cedar
late condor
#

Why even solve this independently

late condor
#

Ckan handles all of this

#

If you want to auto update mods why not use ckan to do it

sacred jasper
#

It doesn't auto update :/

#

It just checks a version

late condor
#

Its a library

#

It does what you tell it to do

timber cedar
#

ckan doesnt solve the version :D

wicked wyvern
sacred jasper
#

KSPAvc exists for a reason, and is used by lots of KSP players, and does basically the same thing as this feature

wicked wyvern
#

and so it can tell you whether you should update

late condor
#

Can ckan tell you that there is a newer version of a mod?

timber cedar
sacred jasper
#

Update requests??

timber cedar
#

difference between having an update, and an incompatible version of the mod installed

timber cedar
sacred jasper
#

So we shouldn't check if mods have updated versions? Yet our users do want that to be a thing?

#

I am confused

wicked wyvern
#

if your mod is incompatible, it's in red

#

if there's an update, it's in yellow

#

it's basically two separate features

timber cedar
timber cedar
wicked wyvern
#

no

#

it does nothing like that

sacred jasper
#

Sinon's saying it should

timber cedar
#

im saying that it should

wicked wyvern
#

oh

#

well yeah, that's also what I was saying

timber cedar
#

xD

sacred jasper
#

It's something that shan't be too hard

#

I do need to add a log if the online swinfo is an incorrect format

timber cedar
#

saved

wicked wyvern
late condor
#

Thats cruel

wicked wyvern
#

archived in #🔹admins-best-hits

timber cedar
#

anytime theres a new feature request

late condor
#

Whenever I tell my boss it will take me an hour it takes me 3 months

#

Whenever I tell him it till take 3 months, it will take an hour

sacred jasper
#

Okay

#

It's something extremely hard

#

I have to go in and patch the KSP2 dll manually to add spacewarp and bepinex straight into the DLL, which will take years

timber cedar
#

just rewrite ksp2 🙄

sacred jasper
#

Imma rewrite KSP2 in cheese

timber cedar
#

cheese_pl gogogo

wicked wyvern
sacred jasper
#
fn ksp2 => void
  runPerfectlyWithoutBugs()
timber cedar
sacred jasper
#
if bug
  dont(bug)
wicked wyvern
#

Dakota already tried hitting the "fix performance" button and it didn't work

timber cedar
#

fr ^

sacred jasper
#

Cheese is still in progress

timber cedar
#

commit today

sacred jasper
#

I've only just finished the parser to a degree that it works

timber cedar
#

i think breaking changes

sacred jasper
#

look at the github repo for cheese lol

timber cedar
#

yeah ik i looked in the morning

#

i look everyday in case 1.0.0. release

sacred jasper
#

bruh, the first version will be 0.0.1

timber cedar
wicked wyvern
#

oh lol I thought you were memeing

timber cedar
#

xdd

wicked wyvern
#

didn't know it was an actual thing

timber cedar
#

ofc it is

wicked wyvern
#

to be fair I'm not even surprised

#

seems like a cheese thing to do

timber cedar
sacred jasper
wicked wyvern
#

can't say I know you very well, but this tracks

timber cedar
#

best buds

little bay
wicked wyvern
#

hm

#

it still isn't very clean though

#

it could already have had some side effects at that point

#

like setting up Harmony patches etc

little bay
#

sure

#

which is why you would need to enforce having OnDisable implemented

wicked wyvern
#

I guess that could be doable

#

and if the mods don't properly clean up, it's on them and not SpaceWarp

little bay
#

that would also mean mods could be enabled and disabled without restarting the game

wicked wyvern
#

yeah that was the idea

#

AppDomain still would have been the best way

#

dumb Unity

little bay
#

no, it really wouldn't

#

AppDomains suck ass

#

even if they were supported

#

to get data between them, you effectively have to marshal things over all the time

#

like

#

assemblies in another AppDomain effectively exist in a different world

wicked wyvern
#

yeah i know the general gist of it

little bay
#

like it were a new process

#

they wouldn't be able to interact with the running game

wicked wyvern
little bay
#

which is why AppDomains no longer exist in .NET

#

they've been replaced by AssemblyLoadContexts

#

which actually do what you want

#

but they don't exist yet

wicked wyvern
#

well they do

#

just not in mono

little bay
#

don't exist in unity

#

I mean

wicked wyvern
#

yeah that's basically the same thing

little bay
wicked wyvern
#

it's not ideal, yeah

#

but in general I like the idea of sandboxing them

#

at least to some degree

#

so they can be loaded/reloaded/unloaded

#

still, much of the useful functionality in current mods is implemented with Harmony patches, and I don't think that would interact well

little bay
#

sandboxing and C# just really do not mix

wicked wyvern
#

yeah :/

timber cedar
#

i think we should rewrite to cheese

little bay
#

lua mods can totally work like that though

wicked wyvern
#

JavaScript rewrite of KSP 2 wen

timber cedar
#

no.

#

i think we should add js mod support

#

js roslyn compiler

wicked wyvern
#

well it wouldn't be impossible

#

it could be pretty much the same thing as the (already kinda existing half-baked) Lua support

timber cedar
#

it is impossible

#

because no one would work on it

wicked wyvern
#

well

#

technically possible

timber cedar
#

xd

#

yes

wicked wyvern
#

=/= usable

timber cedar
#

klueless= munix

wicked wyvern
#

it is my favorite emoji on the server

#

so maybe that speaks for something

timber cedar
#

nooooooooo > klueless

wicked wyvern
#

fair, my top three in no particular order are munley klueless nooooooooo

timber cedar
#

munley is 💯

wicked wyvern
#

but anyway back on topic, I actually really like Aaron's suggestion

timber cedar
#

wait let me reaed it

#

ok

#

...

timber cedar
wicked wyvern
#

We could toggle a mod off by disabling its component and enforcing OnDisable

little bay
#

you can just add public abstract void OnDisable(); to BaseSpaceWarpPlugin

#

10/10 no problems

wicked wyvern
#

leave it to the mods to clean up their stuff after themselves instead of BIE or SW

#

I like it

timber cedar
#

OnDisable(
Application.Quit();
);

little bay
#

lgtm

timber cedar
#

^^ was a joke that will kill ksp2

wicked wyvern
#

OnDisable() {throw new Exception("You can't stop me");}

timber cedar
#

GameObject.Destroy()

timber cedar
wicked wyvern
#

lmao

sacred jasper
#

Enforcing ondisable would be breaking though would it not

wicked wyvern
#

yeah, you could keep it on the backburner for 2.0

#

but I'm thinking - is there at least some way to make BepInEx not load certain .dlls (other than moving/renaming/deleting them)?

#

I don't think mod disabling needs to be a runtime thing, it's almost a bit unreasonable to require

#

but it be nice to at least have after game restart

sacred jasper
#

At runtime itd have to unregister a lot of shit

#

Addressable bundles and such

wicked wyvern
#

yeah exactly

sacred jasper
#

Wait can KSP2s part system support runtime part welding?

wicked wyvern
#

so I'm wondering if BepInEx might maybe have some API hooks for loading mods

#

I haven't really looked into it at all tbh

wicked wyvern
#

don't really know how the part system handles/would handle for example multiple Modules of the same type

timber cedar
#

that sounds like the most laggy thing ever created

wicked wyvern
#

well I think the goal is the opposite

#

to reduce part count lag

timber cedar
#

some guy was doing a rewrite for the craft json

#

i think

#

should ask him

timber cedar
#

hear me out

to convert 2.1.* and stuff like that to a comparitve state

public static int CompareSemanticVersionStrings(string version1, string version2)
{
#

wait

#

wait

#

dumb

#

nvm

#

i give up

#

too hard

#

gonna go back to writing kernel

wicked wyvern
#

fixed it for ya

#

(including some tests)

#

I think it should be working fine

timber cedar
#

yeah

#

thats what i was going for

#

👍

#

wait can you run c# standalon

wicked wyvern
#

in what sense?

timber cedar
#

like not in game

#

just

#

script

#

like nodejs

wicked wyvern
late condor
timber cedar
late condor
#

no, I hate javascript :p

wicked wyvern
#

yeah I was going to say that I'm 99% sure there's an interpreter already

late condor
#

but its really just about exposing stuff to IronJS

timber cedar
#
Console.WriteLine(CompareSemanticVersionStrings("1.*.5", "1.0.1"));
#

nononon

#

nnonoonon

#

onnonono

#

no

#

nononononon