#Space Warp
1 messages · Page 4 of 1
ahh, you are correct
Might work if we generate with an unique id and make it so the script can edit our readme file
no thats not how to do it one sec
i got it
yep
works
by adding a query, github doesnt cache it
LOL 😄 Nice workaround
damn
😮
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
Ahh yes, you can define a age and maxage
ye
ok i need to figure out how
xdd
ok
ok
ok
this should be it
hm maybe that wont work
im gonna copy the one sheilds.io uses
xdd
my server time is off
by 17 minutes
no wonder the expire commands are broken
@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
Wow!
works for you?
Gonna check later
Ayo so im off spring break so am more able to work on this
:O
insane
look at the sexy live counter
Which line endings are you using?
it wasn't the issue, and it's already working
just had to figure out the correct format for language columns
Language code is optional for English
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
What line endings are you using?
I found crlf will include the carriage return in the language name
Crlf was a mistake
Yep, CRLF
and agreed
Hey instead of one character for new lines have two~
Swap to LF, it will allow you to leave off the code
Will try
average windows crlf user
Looks like the pie chart is not updating its download to me : O
forgot to update url
done
woo nice, awesome job sinon!
Anyways, time to get back to work on SW after I do homework
Homework is complete
@mossy kraken ftilly very much feels like a bot to me
honestly it was kinda funny but confusing as hell
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
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
The issue being, that its basically a subset of swinfo.json
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
Pretty sure ckan is going to parse swinfo.json
Really? I'd have expected a more universal solution that would also support BIE and internal mod loader
in that case nevermind
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
I'd be probably just for the second approach
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
shouldn't the main branch on GitHub be enough?
as long as it always contains the latest released version, it should be just fine
yep
@wicked wyvern Here we go
Nice!
I should do KSP version checking and highlight the mods as red that don't "support" the current KSP version
Sounds like a good idea
Just need to figure out where I can get KSP2 versionj
no idea, but there are tons of classes like that in the dll
Anyways made the PRs
@mossy kraken you wanna look over them?
sure
both?
yes
k
@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
Hmm, maybe
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
@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
Ohhh
facepalm
I forgot thats how const worked
@little bay it hath been fixed
var kspVersion = typeof(VersionID).GetField("VERSION_TEXT",BindingFlags.Static | BindingFlags.Public)?.GetValue(null) as string;
awesome
And its displaying all the space warp mods twice for some reason
oh yeah, didn't even notice that 😆
I figured out why
btw I just noticed that "ModListHeader" label at the top
changing it
Going to add an empty space between them but @wicked wyvern @late condor how does this look
I'd suggest maybe adding a matching header like "SpaceWarp Mods" on the top
Gotcha
Almost there, accidentally added a space
It hath been added to 1.0.0
nice
<@&1078770539688112168> <@&1079271050644303922> could we push for having 1.0.0 be released on the same day as the first patch if it comes thursday?
Let’s hope the patch doesn’t break anything
If after patch space warp works correctly then I am not against it
Sounds good to me
idm
@wicked wyvern do you think we should add abstractions for active vessels a la this issue
https://github.com/SpaceWarpDev/SpaceWarp/issues/141
Hm
On one hand it does seem like something very useful
but it seems like it there would be A LOT of it
Elaborate?
The other option is extension method hell :3
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
Fair
I might just add extension methods for updating specific flight controls to the dismay of Aaron
Thoughts?
Asking you specifically munix
Not sure if extension methods are the way to go, it might be a bit disorienting, but I don't know
Disorienting?
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
I don't know how much of an issue that is?
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
Also is it a dumb idea to just grab a private property like this?
public static VesselVehicle ActiveVesselVehicle => GameManager.Instance.Game.ViewController._activeVesselVehicle;
You will get tons of exceptions before ViewController is instantiated
happened to me in Kerbonaut Manager
This getter won't be used before then?
oh I'm dumb, nvm
It's literally exposing it for people to quickly grab the active vehicle
I didn't notice the ">"
@wicked wyvern look at the latest branch i made, and see what you think
I gtg for now
Yeah I guess that works
if you get errors make sure its in flight mode first
GameManager.Instance.Game.GlobalGameState.GetGameState()
Cheese how did you handle such a ginormous growth in the discord server in the first week
pain
lol
Alright, seems like I got UITK loaded successfully, but still don't know fully how to use it from code without loading bundles
Aight
It's gonna be weird to have that as an external dependency as we package everything in space warp already
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
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
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
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?
I guess so
It's for ease of SW installation is all
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
oh for sure no
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
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
@wise swift is not gonna like this
I will find a way. I always do.
going to try out your 0.0.1
we will see
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
About parsing UXML during runtime: https://forum.unity.com/threads/loading-uxml-and-uss-from-text-in-runtime.1200964/
Seems that someone made USS loading work at runtime, but not UXML yet
Made a separate post in Projects so we don't clutter this/other channels: https://discord.com/channels/1078696971088433153/1085537097714245662
EditorGUI stuff is typically not available at runtime unfortunatels
@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
GameManager.Instance.Game.Input.Enable();
InputEnabled = true;
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
Wait till we use uitk basically
exactly why im excited for it
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)
Not as of yet, make a feature request maybe, or I'll write one later
Can you show how you want to add modules?
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
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
great :) no need to be an extension tho, if we can get an IEnumerator with the parts thats enough
Or in a bit cuz rider is being annoying
lmao tyt
It makes sense as an extension though
it does
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
honestly I'd leave that to a tool more like MM in scope
That's fair yeah
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
Might be worth looking into, but as you said seems a bit much for now
and considering there are 0 released parts mods as of now, it makes sense to wait a bit
if SAS wasn't as it is rn, i'd release my gridfins... But the craft gets wobbly when using them... they do work tho, 40m/s reduction from a 5km drop, its a very good low profile alternative to Reaction Wheels
i'm guessing this is the culprit https://forum.kerbalspaceprogram.com/index.php?/topic/213439-sas-oscillations-diagnosed/#comment-4245017
The SAS appears to be miss aligned and it takes Roll inputs and produces a Yaw output and then takes Yaw inputs and produces a Roll output. I compared control surface movement to the SAS reaction while in orbit (so control surfaces had no authority) and that was the result I found.
That's such a dumb bug if it's true 
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
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
hmm ok will look into it then
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
would make sense for spacewarp to do it.
Yeah I agree (in my next message after that)
but I don't think it needs to be a priority right now
@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?
You add the terms into the language source asset data
What do the terms look like for KSP2 do they still have the / format if you are using the addressables
These are different than addressables
I know, misspoke, I'm just asking if the I2Localization terms have the Parts/Title/etc... name or are those terms preexistent and you create a special one for the part
Example of the updated documentation
Im hoping to finish this tomorrow for the space warp release
If another mod depends on my mod, my mod's onInit will run before theirs right?
yes
@timber cedar I created a PR on the docs repository for version 1.0.0 documentation
: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
Sorry I been a bit busy, it is spring break here in Norway this week 😄
Have the new patch come out of KSP2?
[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?
oh ok, will this be changed? it makes more sense for all bundles to be there
I mean, they are two different types of bundles
so it makes sense for them to be separated
oh wtf ok, thought they were the same
You can use both, but its really a good idea to only use one or the other and do it well
yeah, what I really meant was that SpaceWarp allows you to use either
Theoretically everyone should use addressables buttt
Not sure yet Im waiting for class
I did speedrun writing documentation yesterday
So if people wanna write tutorials
today in theory :/
Alright
xd waiting
Itll be at least an hour I presume
Patch suddenly experiences RUD
RUD?
Rapid, unplanned, disassembly
Not sure if UITK is worth pursuing for now, at least I personally can't seem to make it work
but this might be worth taking a look at: https://github.com/sinai-dev/UniverseLib/wiki/User-Interface-(UI)
It's what Unity Explorer and BIE Configuration Manager are built with
What are the issues you are having?
it's using the Unity UI framework rather than UI Toolkit, but it allows you to build UIs using C# without Unity Editor, too
well, I can get a game object with a UIDocument component into the scene hierarchy, types load fine, I patched in the needed shaders, but still can't figure out how to actually get anything rendered
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
Alright, if you can share what you have, I'll take a look later
it's all here: #1085537097714245662 message
Alright, I am doing school work right now
can someone confirm that SW works on 0.1.1
Alright, imma grab lunch rq then work on pushing out v1.0.0
all mods I've tested so far work, too
Some people talking in KSP general are saying that some mods work
Still, I'd update SW to make sure everything still works
I just built myself a v1.0.0 of Space Warp and it just booted up flawlessly!
This is really promising
Das good
SpaceWorp 0.4.1 wen?
1.0.0 is coming today (most likely)
Out of beta, releasing on time
rip 🪦🥲
prob typo 😮
Extensions for vehicle controls and getting parts added by cheese3660. the one im most excited to play around ngl
@wicked wyvern should I still provide the standalone Space Warp, or just only provide BIE packaged in
I mean, I don't see much use for a standalone download, and it seems to only confuse people
^
does this version still need the bepinex config file?
Gotcha
Yes it still needs the change in the configuration.
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
Its going to be fun to see how many days it will take until v1.0.0 shows up on the graph
does the sw1.0.0 download zip still include bepinex?
So CKAN does use swinfo files, independently of dependency on SpaceWarp
Nice to see
the other one has it
Usability issue: SpaceWarp UI does not scale with game UI scale. Text is unreadably tiny when game is at 4k resolution.
@mossy kraken you were doing the UI scaling stuff, maybe you can take a look at this
for reference, this is on a completely clean install of the new game patch.
It is on my todo list 😄
Gonna take a look once I get home from spring break on Sunday/ Monday
@wicked wyvern you should likely update the mod templat
yeah that's a good idea
anything important that I should update/add?
The version check field?
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?
FYI, the SpaceWarp.csproj file still has version tag set to 0.4.0
Ohhh so thats on VisualStudio decompiler it said 0.4.0, i thought i had the wrong dll 😭
heh
Ctrl+click on any SpaceWarp class
I'm just asking since I'm getting all these errors with old mods (which is pretty much all of them)
v1.0.0 just hit 200 downloads
Fuck I made a mistake
I'm dumb
required.allow null makes the thing required
1.0.1 might not be a bad idea, with a couple of hotfixes like this + the project version
Fair
Am kinda busy atm
I can take care of those two things quickly and PR
@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
Are we going for a v1.0.1 patch?
yes cuz I made some dumb mistakes
but I'm unable to release it today ree
Game breaking?
not really?
Nice
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
gotcha
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
Cool! Just gotta wait for it to have it scheduled run again in a min or two
yeah
just saw it
:D
i did the change just in time
Font has to be tiny then, I tested it and did not like it
I'll accept the pr then update it tomorrow
xd
the exact opposite problem of the original
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
.Any() 
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
but yeah, .OfType<T>().Any() or .Any(m => m is T), either works
Visual studio didn't suggest this to me when I was trying to look for it 
Why I normally use rider
Hey, is there a working version of Unity Explorer for SpaceWarp 1.0.0?
yes the normal unity explorer https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx5.Mono.zip
Thanks
(pls merge the latest PR first, it has the updated swinfo.json version which i stupidly forgot in the first one)
could we get a dark mode for the docs
@timber cedar
@wicked wyvern sw patch has been pushed out, next should I work on MM-esque stuff or UI
it's totally up to you, but I'd personally like to get the UI working first
I'm still waiting on UITK to work
Good thing is they are 2 separate things so I can just make branches for each
that makes two of us 
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
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
got it in a bit
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
Okay, I have no clue how the entire module system works atm
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
It seems there are ModuleData and PartBehaviourModules, PartCore, and IInteractivePart, and looking into it I'm trying to find the difference
Yeah it seems to be a mess
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
@sacred jasper done
could you upload a 1.0.1 nuget package please?
here's a package built from the main branch if that helps
not sure if any other configuration is needed, I literally just ran "Pack Selected Project" in Rider
Wait thats a thing you can do
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?
Manually
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
I uploaded the package you sent me so it should be about an hour
Alright, thanks
Will the ability to Enable/Disable Installed Mods from the ModList Manager at the Main Menu Screen, be added to SpaceWarp/BepInEx? It would be helpful to have for Debugging issues in game. To help determine if it is an issue with the Mod or the Base Game. Instead of having to delete/move the plug...
Was I just hallucinating or was that already a feature before 1.0?
Was that removed because of the switch to BIE?
It was, I implemented it
yes, because BIE doesn't have that capability
its possible to force SpaceWarp plugins to have that functionality
but i guess that wasn't done?
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
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
Hey cool people
can you check the Colors documentation pls?
already found an incosistency, textureMapType should be marked as code
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)
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
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?
I noticed this because you were adding stuff to main but the text in the rest of the file didn't match with what's in the live docs
For example, this is in main (and by extension in your fork)
While this is in the live docs
yeah wtf
hmm maybe it uses en, ru, etc etc for live docs depending on the selected language
it does
instead of using main for all
but I don't understand the purpose of the main branch then
it might just be how readthedocs.io requires it to be set up
yeah maybe, well its just a matter of copy paste into en
Ok, turns out all the newest commits to main were just updates of README
lmao
The last commit that was actually editing any of the documentation happened two weeks ago, and then the language branches were created
maybe i should do the same as addresablles loading and lead into a new file?
lmao, will do! i'll commit now then
feel free to do your changes
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)
nah i’m going to delete them
thanks
just have the readme and listened
liscense
they were there before i realized how read the docs really works
wait so you, to update the docs, will accept all prs when the new version releases?
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 https://github.com/SpaceWarpDev/SpaceWarpDocs/pull/5
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>
the doc is for something that was already merged on the 1.1.0 version
yes exactly, yeah
no cuz i was expecting you to leave it as a pr till the version released lmao
xdd
ist good
just make the pr immediately to new branch
illl update readme to say that
ALCs don't exist in Mono, and Unity doesn't support AppDomains
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
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?
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
i can pack my mods with my version of colors patch until 1.1.0
it doesn't seem like a big enough thing for a minor version update but idk
its a whole new feature, i see it as x.y.z
x total rewrite or something major
y new features
z fixes to features added
but usually y has more than 1 feature added
yeah that's what I mean
it seems like a very small update considering the scope of the previous updates
I'm just wondering moreso what stuff is being worked on
And what I should be working on
I think the priority should be bug fixes
Thats #1081724578822377522
doge pray ie
oh also, big names bugs the alt-m
apply the KISS principle to your names 
you can just check the size of the name string, and if over x put [...] in the end
Inb4 someone pulls out an arabic name
Depends on unity's IMGui support for arabic
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
Cuz that'd break every single mod in existence
I might just be doing something dumb to be honest
The versionsutility class is not the correct version checker btw
I mean you can just parse the version string into like 2-5 integers
and compare them consecutively
(That is basically how its done)
So I might of just flipped a comparison
just add a "first time" part to the reader
itll auto-update the mods if they dont exist
idk
That sounds like pain
... are you trying to just compare them
Why not just use the .net Version class
Wai- wha
I'm not doing anything with them
Cuz we have the "*" in the versions for some reason
Though I can just replace ".*" with ""
if you have * you should replace with "any" so its a little more readable
also you should force version
- is any value right?
eys
because obv
So just exclude that value from both sides
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
yeah
If someone does that, they deserve their ankles broken
FileVersionInfo.Parse("1.0.0") > FileVersionInfo.Parse("2.1.2")
lol

my point is that you basically just 0 out any value starting from * to the last version element
yeah
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"))
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?
well that's just for KSP
And if people make invalid versions, thats on them
you also need checking for dependency version and for the mod updates
wait its the ksp version and not the mods version?
Would this not make 1.1.* reject 1.1.1?
{
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?
You'd zero it out on both sides
So you have to do a little legwork i guess
then i have a Compare on the Version class
this is getting wild considering we're only talking version checking 😆
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
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
Tbh, its one of those topics that are deceiving
For online version checking
Why would we not?
We aren't even considering the wider implications of these things
is it breaking if you're offline
No
good
Is that code not run if there is no network?
Because that code will error if there is no network
It just fails
hm
UnityWebRequest returns a failure if there isn't network right?
Hmm, I have error handling anywhere i use it, but now I'm not sure I'm recalling why correctly
yeah, but the problem is that it gives errors
i dont like that it gives errors if you're offline
should just stay silent
Will it tell you to update to an incompatible version? What if I need not the latest either because out of date game or dependencies
It just logs
yeahhhh but ehhhh
i can just block the specific no connection errors
The problem is, no connection and "your internet choked" are not identifiably different
Networking is pain
For the moment yes
But like it doesn't really yell at you per se, just marks it yellow in the mod list
I could add a check on KSP version of the latest version of it but
what are the current problems of the version checking?
oh wow
now we're getting recursive
haven't even thought about that
PLEACE DONT
That still doesn’t allow for someone running Foo 1.0.0, which releases a breaking change, version 2.0.0, but I want Bar 1.0.0, which depends on Foo 1.0.0
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 -> ... 
we could go on forever
No, but it might be the users problem
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
fr
That'd be a pain of a thing to implement, technically possible but
Lol, only good programmers think about user experience :p
guess thats true, because we only call this function once
it wouldnt be spam every time it fails
I might not be real, but neither is PI, and just think about how useful PI is 😉
Or make it handled server side, pass KSP version, and versions of dependencies (or full mod list)
a real number
Shhhh
3 is useful
:O
You have engaged in battle with dad
no kidding ^
That'd require a server that can scale to the amount of user's KSP 2 has, and that would be a b*tch to maintain.
It'd be better to try it client side
that PI discussion reminds me of this: https://en.wikipedia.org/wiki/Indiana_Pi_Bill
its like a 200 byte request for like 5k people
thats completely managable
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
I’m saying make them mod dev handle those checks
also online swinfo.json is dangerous because it might be changed, while the currently installed mod inst
Why even solve this independently
that's what it's for
ckan doesnt solve the version :D
you provide the swinfo.json in (for example) the main branch of your mod so that SpaceWarp can check whether the version has been changed
KSPAvc exists for a reason, and is used by lots of KSP players, and does basically the same thing as this feature
and so it can tell you whether you should update
Can ckan tell you that there is a newer version of a mod?
for update requests, not for currently compatible versions
Update requests??
difference between having an update, and an incompatible version of the mod installed
update notifications idk
So we shouldn't check if mods have updated versions? Yet our users do want that to be a thing?
I am confused
SpaceWarp does both
if your mod is incompatible, it's in red
if there's an update, it's in yellow
it's basically two separate features
if the update is compatible with your current version ^
yeah i completely agree
what?
no
it does nothing like that
Sinon's saying it should
im saying that it should
xD
It's something that shan't be too hard
I do need to add a log if the online swinfo is an incorrect format

Thats cruel
archived in #🔹admins-best-hits
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
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
just rewrite ksp2 🙄
Imma rewrite KSP2 in cheese
cheese_pl gogogo
fn ksp2 => void
runPerfectlyWithoutBugs()
if bug
dont(bug)
Dakota already tried hitting the "fix performance" button and it didn't work
fr ^
Cheese is still in progress
commit today
I've only just finished the parser to a degree that it works
i think breaking changes
look at the github repo for cheese lol
bruh, the first version will be 0.0.1
oh lol I thought you were memeing
xdd
ofc it is
really?
best buds
you can also disable the component
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
I guess that could be doable
and if the mods don't properly clean up, it's on them and not SpaceWarp
that would also mean mods could be enabled and disabled without restarting the game
yeah that was the idea
AppDomain still would have been the best way
dumb Unity

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
yeah i know the general gist of it
https://www.brad-smith.info/blog/archives/500 this is somewhat how i imagined it
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
yeah that's basically the same thing
yeah, mods would have to do reflection all the time to interact with the game
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
sandboxing and C# just really do not mix
yeah :/
i think we should rewrite to cheese
lua mods can totally work like that though
well it wouldn't be impossible
it could be pretty much the same thing as the (already kinda existing half-baked) Lua support
= munix
> 
fair, my top three in no particular order are

is 💯
but anyway back on topic, I actually really like Aaron's suggestion
this is how you should do it
We could toggle a mod off by disabling its component and enforcing OnDisable
you can just add public abstract void OnDisable(); to BaseSpaceWarpPlugin
10/10 no problems
leave it to the mods to clean up their stuff after themselves instead of BIE or SW
I like it
OnDisable(
Application.Quit();
);
lgtm
^^ was a joke that will kill ksp2
OnDisable() {throw new Exception("You can't stop me");}
GameObject.Destroy()
this should be the default error of sw
lmao
Enforcing ondisable would be breaking though would it not
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
yeah exactly
Wait can KSP2s part system support runtime part welding?
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
I think it could be doable at least to some degree
don't really know how the part system handles/would handle for example multiple Modules of the same type
that sounds like the most laggy thing ever created
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
in what sense?
https://dotnetfiddle.net/ I didn't feel like creating and compiling a file so I just ran it here
Test your C# code online with .NET Fiddle code editor.
it wouldn't really be hard
do it 😉
ah yeah okok
no, I hate javascript :p
yeah I was going to say that I'm 99% sure there's an interpreter already
but its really just about exposing stuff to IronJS


