#archived-modding-development
1 messages · Page 520 of 1
I hate avolonia in visual studio
better in rider?
It's ok
just keeps having errors with little to no results when searching online + 56 not hearing of them ¯_(ツ)_/¯
If you set the classes and stuff you get autocomplete in xaml and all
I swear the openfiledialog returns null but the openfolderdialog returns empty string
amazing skills avalonia
rofl
Amazing
that's what I have too
so SaveFileDialog returns null
OpenFileDialog returns empty array
and OpenFolderDialog returns empty string
way to be consistent

The consistency we deal with here is just amazing
basically the entirety of avalonia
if only someone would design avalonia but better nope sounds like effort
lollllll you have too high hopes for the community
probably
Too high hopes for humanity
https://github.com/AvaloniaUI/Avalonia/issues/6033 watch me get rekt like "tHaT's hOw It'S sUpPoSeD tO wOrK"
Thats about as jank as c++'s long double
who maintains https://radiance.host/apidocs ? is it on github ?
Yee
PR your changes to this and I update the site
https://github.com/SalehAce1/HK-Modding-API-Docs
ty
it may or may not just take me like 30 minutes to figure out that the branch of https://github.com/HollowKnight-Modding/HollowKnight.ModLinks is called 'main' instead of 'master'
Nice
is that a new repo for just ModLinks ?
gonna be the new location of modlinks in the future
maybe also in another form than currently

i hate the github api
nvm, should work, unless people try to refresh package list more than 60 times an hour
Well I know what I’m doing for the next hour
per person or like everyone combined
per person
and if they do it borks only for them right?
yes
asking for @vocal spire
close, but different person lol
lol
(sorry other someone)
I'm currently working through all the info warning in the modding api and seeing which make sense
?
ah. vs calls them messages
Hey, while everyone is beginning to rebuild mods, I have a suggestion/request:
As much as possible, can it be a standard to have a method to minimize/hide mod UI (preferably using a customizable button press)?
It would be really cool if going forward, there was never a need to worry about mod UI overlap 
But that would involve having more random hotkeys
Solving one problem would cause another
wdym?
Having some method of removing menu UI, especially from the Pause menu.
WeaverCore accomplished this by minimizing the UI to a hamburger menu.
HKMP accomplishes this by having a remappable key (right-alt by default) be a toggle to completely hide it's menu.
Wdym by menu UI tho
I don't use many mods
So the only ones I know of having ui are customknight and debug
and debug is togglable, obviously
CustomKight and Benchwarp are two that also use the pause menu to include their UI menus. Custom Knight (by default) uses a lot of the left side of the screen. Benchwarp uses (without choice afaik) the entire top of the screen.
Just imagine if debug wasn't a toggle. But it's great that it is. And that's a design choice that I genuinely believe should be a standard, so that even if a dev is unaware that their mod UI overlaps with that of a mod that they don't use, it isn't an issue.
That's why I feel like they should always be customizable. Multiple UIs could potentially be bound to the same button, so that a player could have "sets" of menus if needed, and know that they never problematically overlap.
The toggle could not even be set by default 
Just be an option so that an implemented solution exists
Making it customisable means people have to to go settings file and add keys there
I'm aware
I think perhaps mapi should have a default way to represent all mods ui kind of like the mods option.
Hey, uh, question
It would obviously not stop mods if they really need to go above and beyond that UI system. But give a standard practice / setup that is perhaps better thought out than each mod figuring out for itself
How do I look at Colosseum enemies' FSMs
If for instance you would want to make benchwarp UI toggleable what default key would you put?
- Tilde
~ - Regardless of my answer, I did state the button would not need to be set by default. Just having it available in the settings would be a major step forward. I can make easy instructions to help people edit settings.
I see
So there are many mods that take up ui space that arent togglable?
what if -
- mapi exposes a function like unload() but simply called toggleUI()
- mods that do implement this method can use this to inform if they should have their UI visibility toggled
- clicking the name of the mod in the top left toggles the UI & hotkeys for this can be set in modding api settings.
working on a potential new way of modlinks (not .xml)
How do I look at Colosseum enemies' FSMs
If anyone knows or has an idea please tell me
I have no clue where to start
it looks very xml to me
meant as in modlinks.xml
so it'll just be called modlinks ?
i imagine this using https://github.com/HollowKnight-Modding/HollowKnight.ModLinks in a similar way to https://github.com/microsoft/winget-pkgs/, where the mods have their own folder with manifests for different versions inside, and the end product can be a (mod/)package manager
so when you say versions you mean the versions of the mod or the versions of the game ?
of the mod
can't find these in fsm view?
though both methods have the downside of having to be completely remade/wiped once a new major patch is out
sounds cool! Apart from players being able to request whatever version of the mod they'd want, and being able to maintain multiple versions of the mods. is there anything else this system would allow for ?
by adding an additional field there could be multi patch support
yes that's basically 2 versions of the mods where the mod manager can choose which one to use right ?
No, they don't exist in the scene at first
They get spawned in later by the cages
Unless you have a "scene" with all those kinds of FSMs?
sharedassets3x.assets ?
sharedassets are just prefabs
Makes sense
the scene picker won't let you open them
just click file->open and open sharedassets instead of level
oh wow, that is soo great that it shows which .assets the prefab is in
big pog
just in case you don't have the list up atm
And will I know to find to others?
yes this has been a feature in fsmviewavalonia for a while
So the shielded fools are these?
that's just the prefabs that belong to scene 32 (Room_Colosseum_Bronze)
or at least, first showed up in scene 32
Ohh I see
.
So that's what the number is for
data[32] = level32 and sharedassets32.assets
Any reason I might need them in the future?
no
you will never need to open them manually, .assets files will reference them if they are needed
probably a super noob question but : where do static members go ? how do dlls load ?
like if mapi loads a dll (subclass of mod class)
then another mod loads the same dll but this time instantiates a different class and calls a method on it that modifies a static member's value
is this the same static member that mod class has access to?
(i will gladly accept reading links if the answer is too simple)
if you load assemblies in your mod you've done something wrong.
you're probably talking about that the mapi loads the mod, your mod references something in that mod.
and static members will be the same on both ends
i'm actually kinda needing to load assembly.
because HKMP has a standalone server where i would like to have the ability to load a mod without mapi / hk.
these mods would augment HKMP if it works
if you're asking where static variables are stored, I think it's with the assembly instance
but yes that makes the static members the same everywhere
Then does this setup make sense ?
Mapi can instantiate the subclass of mod class
HKMP can instantiate the subclass of addon class
static members can be used to share data across the mod class and the addon class when running in game.
and on standalone server only the subclass of addon class can be instantiated , from the same dll.
like a singleton? I guess you could
are you saying that addons are loaded by the mod, or are just another type of mod
addons are loaded by the mod, but they may as a part of the same dll contain a mod
so they could potentially be "loaded twice and have two disconnected copies" was what i was fearing
seems like that is not the case
I'm getting a null reference exception by calling this function. Am I doing something wrong. (This works in 1.4 tho)
private bool CanDash()
{
return (bool) typeof(HeroController).GetMethod("CanDash", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(HeroController.instance, null);
}```
What is the status of releasing the modding API for 1.5? In other words, should I continue developing for 1.5 or is it still a long ways away and should I focus on 1.4 for the time being?
Thanks
I'm sure I'll be corrected, but my current understanding is that the 1.5 Mapi is pretty good-to-go, but the idea is to have the Installer + Modlinks somewhat overhauled (so that it can be updated for 1.5, while offering 1.4.3.2 legacy support) before "releasing" 1.5 as the main thing.
It seems like all work should be done for 1.5, with maybe a final legacy patch for 1432 versions if needed/wanted.
Alright, thanks for the info!
I’ve already made a version of modinstaller/modlinks that works with multiple patches, all it needs is for the 1.5 api’s files to be uploaded to google drive or something, and then add it to modlinks
which hit type is dreamshield called?
@light zodiac do you have any example mod that implements this ? I'd love to use it in the next version !
Idt there is
You have to inherit from IMenuMod
There's also a ICustomMenuMod but idk how to use that
i'll look into this for the 1.5 release then, thanks!
especially if this would make selecting skins with a controller possible
I think it will
Is there a way to specify boundaries for the camera?
CameraLockArea?
I’ll look into it later
omg thank you so much I got 10 human skins made of real flesh for freeeeeee oh no it got deleted :(
anyways back to modding
WHAT?
sad, i missed it
I don't remember who was last working on updating Mod Installer 1 (RedFrog/Someone I think), but possible idea to help it:
Can it be changed to not check for mod updates unless a "check for updates" button is pressed? And/or not even download/check modlinks until then?
Reason: a lot of people who go back and forth between vanilla and modded don't like using Mod Installer (even if they fix it), because it takes awhile to initially load, so they end up using alternate methods (like Jamie's Vanilla switcher, or making separate installs). On top of that, because hashes are used for validation and version checking, anyone who's using builds of mods newer than on the installer has to sit through "do you want to update x" messages unnecessarily every time
that one was on purpose
pretty sure
gradow thought people would just leave it outdated without it
lmoa
Yeah, I get the idea of it being automatic
And if there were only ~10 mods on the installer, it probably would be fine.
But as the community has grown, it's kinda become a problem lol
no the idea is being forced
It used to straight up update them entirely
I think

I've just seen probably a dozen people over the ~6mo who want to make a separate install just for mods, or use Jamie's switcher (which actually uses an outdated 1432 mAPI right now iirc).
So it seems like any means to make switching via installer not feel like "a hassle" would be good
example of how modlinks could look like: https://github.com/SFGrenade/HollowKnight.ModLinks
outdated modding api best modding api 😤 (i cba to change it, it's been using -57 the whole time but tbh it's mainly aimed at rando/speedrun people who don't really need the most recent api for stuff to work)
we do a little breaking
is there a github for absrads orbs
Absrads orbs?
I'm using this code to load a custom scene. For some reason a black rectangle appears in the top right of the screen. ```cs
using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace Fyremoth
{
class SceneLoader : MonoBehaviour
{
private IEnumerator Start()
{
yield return new WaitWhile(() => !Input.GetKey(KeyCode.F));
string[] scenePath = Assets.sceneBundle.GetAllScenePaths();
Fyremoth.Instance.Log(scenePath[0]);
UnityEngine.SceneManagement.SceneManager.LoadScene(scenePath[0]);
yield return new WaitForSeconds(1f);
var mat = new Material(Shader.Find("Sprites/Default"));
SpriteRenderer[] rends = FindObjectsOfType<SpriteRenderer>();
foreach (SpriteRenderer rend in rends)
{
rend.material = mat;
}
HeroController.instance.transform.position = new Vector3(101f, 55f);
yield break;
}
}
}
I've been trying to do a text format like yours but idk how
text format? I'm trying to load a scene
I am talking to send my script in discord
do 3 ` at the start and end
and add cs at the end of the first 3
Ok thx
I still need help with this
found the issue
or at least a part of it
it seems like I'm setting a wrong material
bro you are changing literally all the sprite renderers
a black rectangle appears in the top right of the screen
This is what every person who accidentally installs ModConsole but doesn't know what it is says lol
I'm assuming that's not the case here, but it made me double check what channel this was
they don't though. Every sprite renderer turns pink
yea, i know why
hello !
quick question as someone who is really inexperienced in programming and modding in general : how tough would it be to make a custom Colisseum trial? I was thinking taking the base enemies and bosses in the game and make several waves with them
for instance, a "Trial of the ancient warriors" and you'd have waves battling 2 ou 3 spirit warriors at once, and False Knight + White Defender at the end
I think jngo had something for that you could just configure
My bad attempt at trying to make one
@calm thorn , fireb0rn probably has a link in his video for that mod italy and jngo both worked on
its a bit buggy but you can go in the trial of the gods or pure masochist video
probably this I suppose
well, I'll try to make it work. Thanks !
This is really great ! Thank you!
so uhh... how is the pale court and the sanctuary mods going?
Can I just use the sprite folders from google drive to dump on SpritePacker?
pale court will never come out now
how do I use newtonsoft Json since it says that required for Spirit Packer
question, which link goes to modinstaller?
there's a few in modding help pins depending on what you want
just the standard one, i remember the one i used to use but can't find the og link anymore
the more low effort the better :P
sir, I think you should go to #archived-modding-help
there is a link for mod installer
yep I guess so
meanwhile...me tryong to figure out how to put sprites in Sprite Packer
I am getting white hair from stress
youtube videos do help but I feel like their method is different? idk
I have this file called "newtonsoft.json.dll" I seem couldn't open it
why are you trying to open it what the fuck
Because I dont know?
to find newton
I just want to use sprite packer that's it
then open it I don't get it
but the youtube video says download it
go on
I did
yes, I have a folder both spritepacker and whatever is that dill
And um
I am trying to put sprites
i already downloaded the knight
I opened the sprite packertoo, obviously
I clicked "Get single sprites" so I did that but it just led me to the link github
I am so confused
okay I thought this channel may be ok for setting up to make skins
i hate how windows wants me to use visual studio code when havin "vi" in the search bar, but visual studio with "vis" (and visual profiler [something from eclipse? idk] with "visua")
keypiranha
it isn't, i checked
this is why you use scoop 😤
scoop the fucks i give from the floor 😤
smh
though keypirinha do be looking kinda similar in functionality to something else i once had, let me remember the name
≈ Alfred/Quicksilver/Spotlight on Mac ≈ rofi/dmenu/etc on Linux
idk any other good windows ones
"Everything" is what it was called
nice
ok wow, that configuration window is definetly made by programmers, for programmers
damn, i found a typo in unity's module xmls
where
Idk
also includes that i can't make changes on the overall settings, apparently i extracted it with admin perms
i like how at the bottom it leads to a dead link
found the contact us button, maybe
nvm
customer support ticket it is
https://docs.unity3d.com/ScriptReference/CanvasRenderer.AddUIVertexStream.html if you want to see the vertex 'steam'
56 can you please merge the CK PR into MI ?
it's probably the last major CK update for 1.4.3.2
why you gotta do this to me
i am begging you just put it in the root
this folder structure is awful and i have been trying to kill it for actual months
I can't take the paths seriously because half of them use this shit and half are actually reasonable
so if i actually expand you get my favorite managed/mods/hollow_knight_data/managed/mods
I believe this had worked with MI2
Do you need everything in root of the zip ?
I can do that if that'll work on both installers
It works because I added a hack
I think it will idk
I don't care that much about 1432
i will simply enforce it in 1.5 with a new links
Lol as long as there is a standard way to do things I'm good either way
everything at root, make a mod with a zip that contains 32k+ files
The reason I'd maintained the directory structure is because that's what old CK releases had , this time I'd tweaked it a bit because it wasn't working
Hello, I have never made a Hollow Knight mod. But I really want to change the number of slots for charms + I want to change the number of slots that charms take up. Can anyone suggest how this is done? =)
I know I need to modify the Assembly-CSharp.dll file for this, but I don’t know how.
override GetInt
wait what
Thanks)
what does sfcore have to do with charm notches
Ok
You could use SFCore to make a new charm that has the notch cost you want
want to change charms from the game, not create new ones. there is a similar mod "Easier Mode - Cheap Charms". but in this mod the number of slots for charms is not changed, so I want to create my own mod, which will contain everything that is needed)
can override the getplayerdataint for charm notches to a higher count based on the real value
Hey @dark wigeon , I'm running into an odd issue in regards to AssetTools.Net. I have these ScriptableObjects called Registries, and all I'm trying to do with them is change their "modAssemblyName". If the modAssemblyName is "Assembly-CSharp" for example, then it should get changed to "CorruptedKin". But when I go to dump the contents of the Registry using UABE, it seems that half of the data in the registry object gets corrupted with data from other assets in the bundle, and I'm not entirely sure what's going on. Attempting to view the data in UABE via "View Data" causes the program to crash.
Code is here:
https://gist.github.com/nickc01/297a2553ffbee11d62bcde464e962a50
you are using monobehaviour reading too?
like monodeserializer/getmonobasefieldcached?
just saw the code and it does look like you're missing it
also the official way to check if a field exists is .IsDummy()
and you can load assetsfiles from bundles now without all the wacky memorystream stuff
Alright, I'll look into it when I get a chance
can someone link the built version of debug mod again
thanks
hmm
[ERROR]:[API] - Error: System.NullReferenceException: Object reference not set to an instance of an object
[ERROR]:[API] - at DebugMod.DebugMod.Initialize (System.Collections.Generic.Dictionary2[TKey,TValue] preloadedObjects) [0x00137] in <c4b9a59d30514948a90606b6f577131c>:0 [ERROR]:[API] - at Modding.ModLoader.LoadMod (Modding.IMod mod, System.Boolean updateModText, System.Boolean changeSettings, System.Collections.Generic.Dictionary2[TKey,TValue] preloadedObjects) [0x00047] in <85b90636b40d4597bad3d43b9f3685b0>:0
[ERROR]:[API] - at Modding.ModLoader+<LoadMods>d__8.MoveNext () [0x00b1c] in <85b90636b40d4597bad3d43b9f3685b0>:0
hmm
[ERROR]:[API] - Error: System.NullReferenceException: Object reference not set to an instance of an object
[ERROR]:[API] - at DebugMod.DebugMod.Initialize (System.Collections.Generic.Dictionary`2[TKey,TValue] preloadedObjects) [0x00137] in <c4b9a59d30514948a90606b6f577131c>:0
[ERROR]:[API] - at Modding.ModLoader.LoadMod (Modding.IMod mod, System.Boolean updateModText, System.Boolean changeSettings, System.Collections.Generic.Dictionary`2[TKey,TValue] preloadedObjects) [0x00047] in <85b90636b40d4597bad3d43b9f3685b0>:0
[ERROR]:[API] - at Modding.ModLoader+<LoadMods>d__8.MoveNext () [0x00b1c] in <85b90636b40d4597bad3d43b9f3685b0>:0
i do be using whatever mulhima linked me once alongside an outdated mapi afaik
outdated 
bruh
though that do be the latest build there is
smh, leaking
you should zoom out a bit more

that's going to take years with my internet connection rn
smh
@copper nacelle stop watching sid
nvm, last thing was just postbuild
don't have steam on c:
may be missing functionality, idk
i didn't check commits
thanks me dude
hopefully it works, wow just running debug alone takes 5 years for hk to load
bruhh
your key binds are apparently bad
so delete the config file?
probably
now it's just the preloading that's failing
[INFO]:[ModCommon] - Mod Common is done initializing!
[INFO]:[DebugMod] - Initializing
[INFO]:[DebugMod] - Building MethodInfo dict...
[INFO]:[DebugMod] - Done! Time taken: 0.0008621216s. Found 91 methods
[ERROR]:[API] - Error: System.NullReferenceException: Object reference not set to an instance of an object
[ERROR]:[API] - at DebugMod.DebugMod.Initialize (System.Collections.Generic.Dictionary`2[TKey,TValue] preloadedObjects) [0x00137] in <cd1140c20a5940458a720a58ca39d2ae>:0
[ERROR]:[API] - at Modding.ModLoader.LoadMod (Modding.IMod mod, System.Boolean updateModText, System.Boolean changeSettings, System.Collections.Generic.Dictionary`2[TKey,TValue] preloadedObjects) [0x00047] in <85b90636b40d4597bad3d43b9f3685b0>:0
[ERROR]:[API] - at Modding.ModLoader+<LoadMods>d__8.MoveNext () [0x00b1c] in <85b90636b40d4597bad3d43b9f3685b0>:0
For someone who's curious about bleeding-edge, would it be possible to get a broad overview of the current state of 1.5 modding?
1.5 modding: attempting to make work but having difficulties.
(I'm mostly interested in Randomizer and I am willing to test out potentially buggy/unbeatable versions)
But that's just me looking at messages on this channel, I don't know for sure
because I haven't used this laptop in a while
I have to update vs for it to understand the syntax?
i mean just vs2019
update to 2020?
idk check the lang version
that's c# 9
i have 2019 and i do c# 9 shit
when i occasionally open vs
according to an article from 2020/10/21, c#9 is only supported with .net5
untrue
"supported" as in you need it for like { init; }
otherwise any language feature works fine basically
like async from c# whatever isn't gonna work without the tasks
same deal
try latest
that's what it was before I changed it
everything hates me
haven't even gotten to modding this moronic game yet
I actually hate team cherry now
which version is your vs 2019?
because afaik you do be needing at least 16.8 or 16.9
it doesn't really matter, downloading it will take until I'm back home by which time I could just use my pc
so no progress on modding today I guess
thanks for all the help though
Sad
Fwiw files in properties folder wasn't updated for 4 years
How did I manage to mess up preloading a vengefly
ok
let's make a mod
I'm not sure how am I supposed to rename an fsm
also, GameObject.Instatiate doesn't take a string
GameObject.Instantiate(GameObject.Find("Health 1"));?
Because it needs something to instantiate
yea so i did this
Pretty sure it's a variable
Check the variables tab in fsm viewer for which variable to change
i'm supposed to rename it apparently
I don't get what you mean
i'm just trying to follow what sfg told me
Check the variables tab in fsm viewer for which variable has the value "health 1" and change that
well i think it's this one
but i don't understand how do i rename it. FSM doesn't seem to have a method for that or something
Not renaming the fsm, you want to
Take the gameobject "heatlh 1"
Instantiate it
Rename that new copy
Have that new copy at the correct position and with the same parent as thr hralth 1 one
Edit the fsm variables to reflect the New thing (heatlh number int to e.g. 12)
Their question was how do you rename the new copy
The question was about renaminf the fsm, though maybe renming isnt needed at all
so something like
for (int i = 12; i < 21; i++)
{
var healthGo = GameObject.Instantiate(health1Go, health1Go.transform.parent);
healthGo.name = $"Health {i}";
healthGo.transform.localPosition = new Vector3(-10.32f + (0.94f * (num - 1)), 7.7f, -2);
var healthFsm = healthGo.LocateMyFSM("health_display");
var healthFsmVars = healthFsm.FsmVariables;
healthFsmVars.GetFsmInt("Health Number").Value = i;
}
should be the complete package
you're supposed to reference modcommon and playmaker for LocateMyFSM to work, right?
modcommon not needed
oh, error while copy pasting, num is supposed to be i, but transform should be available, and health1Go should be whatever the health 1 gameobject is, i haven't added that though
Transform is unity
Did you reference UnityEngine?
i did
Wierd.

with those being fixed, it may look like this
hook?
ModHooks.Instance.
i tried using just what you gave me but that didn't work, so i thought i needed to use a hook
have this inside a On.GameCameras.Start hook, so like
// inside of the constructor of your mod, yes constructor, intialize is too late
On.GameCameras.Start += MoreHealthDisplay;
// somewhere else in your mod class
private void MoreHealthDisplay(On.GameCameras.orig_Start orig, GameCameras self)
{
orig(self);
// the code from the screenshot, though 'GamerCameras.instance' can be changed to 'self'
}
should work way better
What is get child 0,1,4
i'm guessing the fsm
because i can't trust unity to get me the correct child, i'm manually going through the tree to get to the one i want
The file above is the compiled version of this with the most recent mapi right?
https://github.com/fifty-six/HollowKnight.DebugMod
i actually don't know if it's with the fix from 14 hours ago, but that shouldn't change things
What fix?
I don't even know what was wrong
Pretty sure this is correct ("Tutorial_01", "_Enemies/Buzzer")
For vengeflies
Oh
yea i can't figure it out
also currently puzzled why its not working
everything seems fine but still no extra health on HUD
using System.Reflection;
using Modding;
using UnityEngine;
namespace MoreBaseHealthUI
{
public class MoreBaseHealthUI : Mod
{
public override string GetVersion()
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
public override void Initialize()
{
Log("Initializing...");
MoreBaseHealthUI.Instance = this;
On.GameCameras.Start += MoreHealthDisplay;
}
private void MoreHealthDisplay(On.GameCameras.orig_Start orig, GameCameras self)
{
orig(self);
var health1Go = self.gameObject.transform.GetChild(0).GetChild(1).GetChild(4).gameObject;
for (int i = 12; i < 28; i++)
{
var healthGo = GameObject.Instantiate(health1Go, health1Go.transform.parent);
healthGo.name = $"Health {i}";
healthGo.transform.localPosition = new Vector3(-10.32f + (0.94f * (i - 1)), 7.7f, -2);
var healthFsm = healthGo.LocateMyFSM("health_display");
var healthFsmVars = healthFsm.FsmVariables;
healthFsmVars.GetFsmInt("Health Number").Value = i;
}
}
internal static MoreBaseHealthUI Instance;
}
}
ok, that goes on me
change the GetChild(4) to GetChild(5)
for some reason i forgot that 0 based indizes were a thing
nvm, still only 11
oh wow
i think this is working
oh, how did you do that?
that suddenly got a lot bigger than before lol
yea, i found another fsm that sets the health to be initialized, where i though that it probably is a good idea to have the custom ones as well
what is AddGameObjectVariable? it can't find it
oh yea lol, my bad, 1 sec
also may as well say it now, sorry for making you do all of this and write all of it. HK modding is pretty complicated
and also thanks
exchange
healthFsm.AddGameObjectVariable($"Health {i}");
with
List<FsmGameObject> tmpList = new List<FsmGameObject>(healthFsmVars.GameObjectVariables)
{
new FsmGameObject($"Health {i}")
};
healthFsmVars.GameObjectVariables = tmpList.ToArray();
it's a thing i added to SFCore because of the block above this being clunky if more than one variables are added
Is this 1.4 or 1.5?
both
oh no
it may require having a preload, i have only tested with one
It is only 1.4 until you release SFCore for 1.5
idk if you've seen this: https://github.com/SFGrenade/SFCore/releases/tag/v1.5
I haven't lol
apparently not requiring a preload
maybe you don't have On.GameCameras.Start += MoreHealthDisplay; in the constructor? like
I do have it on Initialize
then it's too late, have it in the constructor
though the important code for your mod is the last line in public RadiantMenu() and the rest below the initalize
I got this error sometime after deleting my previous debug mod settings json file. May or may not have been the cause
debug mod loaded and then not loaded
Have you tired deleting debug mod.globalsettibgs?
That's what caused the error. I just opened 1432 debug, let it create a DebugMod.GlobalSettings.json. Now loading into 1.5 debug works again
Interesting
Maybe a new settings file isn't generated by the 1.5 API if it's missing
and just deleted the json file, and it's broken the same way
this seems to be the case
@fickle sparrow seems important
I assume 1.5 debug was set up incorrectly then
because it worked when I tested
like this gets generated when I use the example
by "set up incorrectly", do you mean programmer error or user error?
this do be looking good though, unless globalsettings isn't supposed to be internal
idk internal static GlobalSettings settings { get; set; } = new GlobalSettings();
need to initialize all settings fields because if the file is not present OnLoadGlobal will not be called
Seems like an easy fix
@jolly oriole oh it's working this time. thank you!
👍
Hello and good morning to you all! I am looking for the mod "Double Vessel" to give a try, is possible to got it?
1.5 or 1.4?
thanks
Who uses 1.4 anymore lol
people who use mods ig
anyone with a brain
anyone without a brain
anyone without a brain
people.....who do rando?
people who miss inv hard fall cancels and dash inv drops 😤
that'd be me then
they should've simply ported rando
smh my head
and I mean if you're using mods sure they're not updated yet but considering this is the development channel I think it'd be a bit stupid to be developing for a version which is about to be obsolete so I'd assume 1.5
yea 1.4.3.2 is like LTS
as far as modding goes 1.5 is nicer as an experience by default for the most part with a version of net that isn't infinity years old and support of portable pdbs
the only real downside is that reflection.emit is stripped by default but it looks like that's kinda fixable? anyways
i like 1.5 because i can make my mods take up 24 GB of ram
does that mean that if I copy over the pdb it gives me a file and a line number now?
yo 56, you still wanted to make some changes to the mapi, right? could i help in some capacity so we can stop doing ?pins in #archived-modding-help?
@dark wigeon I've tried applying your suggestions, such as using the MonoDeserializer and using IsDummy() to check if a field exists. The asset is no longer getting corrupted, but the "modAssemblyName" field doesn't seem to get changed now
Code : https://gist.github.com/nickc01/297a2553ffbee11d62bcde464e962a50
@light zodiac I got ICustomMenuMod to work after cannibalising code from inside the mapi lol 
if it's set to portable pdb yeah
wdym
if you need help with more additions to the mapi
all the stuff inside of Modding.Menu is related to that API
so I'd recommend just reading the docs for that
also 56 can you pin this for refs
some examples of implementing ICustomMenuMod and using the Modding.Menu API
https://github.com/Yurihaia/HollowKnight-Timer/blob/timer-1.5/src/HKTimer.cs#L64
https://github.com/hk-modding/api/blob/master/Assembly-CSharp/ModListMenu.cs#L20
yep I've been referring to ModListMenu.cs to implement this one
yeah that ones good
shows how to do scrollbar stuff
which is still sketchy as fuck
Time to move all my global settings stuff!
what did you mean when you said "reading the docs" tho ? the annotating comments in the mapi code ?
Apidocs update?
this is what i'd been referring to so far
yeah the doc commennts
The apidocs do need some updating though
then pr them to be better
hell no I don't want to touch them
if not for the apidocs i'd never have understood anything about hkmodding i think its a good starting point
then don't say anything about them
Save settings is real outdated
true I don't even think hollow knight is as old as those examples
Pls share
is there a github for traitor god?
i'd just added this in my mod & added the interface so far
its basically the code from mapi mostly lol
fwiw I wouldn't use the AddModMenuContent and just add the horizontal options by hand
yeah, that makes sense. rn this is basically the code that implements the mod menu with an extra apply button
ty
finally. Less logging statements
how does getvectortoplayer() work?
the commented out part looks like just position prediction based on the player's velocity
gone
what is in Libraries/ScriptsAssemblies
is it possible that the directory isn't correct and isdummy failed?
ah yes
That folder contains the Assemblies that Unity has built for the project, such as Assembly-CSharp.dll, WeaverCore.dll, and any other assemblies that are defined via asmdef files in the project. I’m not at my computer right now so I can’t show a picture. Since it has WeaverCore.dll, it does seem to be resolving the Registry class just fine, and I have been seeing the Log() on line 87 show up in the console.
c++ optimization sucks ass
I've updated the dlls and C# version but this error is still stands
I'm probably missing something but what could it be?
are you referencing the hook dlls
what is the full name of it?
The mmhooks_assembly-csharp
Nop I wasn't, now it seems like the errors are gone thanks
Thank you to whoever deleted that
it didn't exist for the earlier Api
Lol
is there a way to determine if the mod menu is opened from options menu or from the main menu?
(should i just check if hc is present ?)
gamemanager scenetype maybe? idk if it has a method
^ how does one do this ?
I assume that was just a mac path or something? usually it's in managed. anyway the code actually looks fine to me, could be a bug somewhere, I'm not sure. I'll let you know in a few days when I'm back home
oh wait, just use gamemanager.isnongameplayscene()
this seems to also include things like "Cinematic_Stag_Travel"
But you can’t access the menu in that scene
but this pointed me in the direction of directly using the scene name
as if you can open the menu there
you cant pause in the middle of stag travel ?
No?
Thanks for the mod idea tho
I know what I’m doing today
Being lazy and not doing that
damn sorry for doubting you SF!
tbh i just picked the first thing that jumped at me when i searched for "menu"
shhhhhhh
Just assuming though you can’t pause in a non gameplay scene
Since it’s not gameplay
1/2 of my playtime in hk is running through the pause menus cause why not
epic gameplay right there
tbh i'd expect to be able to pause a game at any moment, especially cutscenes
sometimes you just have to pause the game but not miss the cutscene
I’d feel weird seeing a frame of a cutscene while paused
i mean you wouldn't pause it just to look at the frame, presumably you'd need to be doing something else and hence pausing
so im trying to make crystal guardian spawn shockwaves whenever it lands on the ground from a jump so did how gpz does it by spawning it from a global pool but unsure of what to do as this isnt working, was wondering if i could have some help
<@&283547423706447872>
ty
thx
Ok cool. I do have a fallback solution that I can do. It’s messier and more limited, but it will allow me to at least get the mods to load up properly. I can also send you one of the bundles if you want
Make position Vector3.zero, and that isn’t how you do storeobject, you make it a Fsm variable.
oh ok
gotcha
has anyone dealt with masks before? I'm trying to mask an image panel so it's only visible within a square, but changing the transform of the mask just changes the size of the image instead of masking it
yes, i've dealth with masks before
do you have some example code or a github link?
i have a screenshot, 1 sec
in the middle you see the selected gameobject, with a sprite mask (which masks whatever given a sprite as a template) to let the black spriterenderer be see-through.
that background plane has the mask interaction Visible Outside Mask then set
oh sorry, I meant purely through scripting
I need to confine an image I created within a square
why not make the image smaller in the first place? 😅
the idea is to make a square like this, with diagonal stripes. The best way I can see to do it is to make 10 or however many stripes horizontally in a square sqrt(2) times larger, rotate the base panel 45 degrees, and then mask it so you can't see the corners
ok, I'm trying this a completely different way with meshes. However, the color doesn't display correctly and I think it's because I don't have a material for it. How can I make a very simple material (just a solid color)?
what unity version does hk 1.4.3.2 use?
2017.4.10f1
@copper nacelle what are the features that you still want to add before release?
- some IL rewrites
- potentially a way to get mono module process
Mono module process?
And how would you rewrite il? Isn’t that the intermediate language that c# compiles to?
- change reflection helper api
- few more obsolete things to kill
- change some hook signatures
the design on some of them is questionable
Ok
So nothing that I can really help with
Don’t ask me why but I’m considering challenging myself to rewrite the modding api in cil
yea same
il seems interesting

even though it took me like 20 minutes to find how i could do that 'Assembly-CSharp' part
gg you can now implement unsafe
unsafe as in
unsafe {}
or as in "so many things will go wrong"?
System.Runtime.CompilerServices.Unsafe
Unsafe.As<TFrom, TTo> is just ldarg.0; ret;
still unsure if you mean that in a 'that is unnecessary' or in a 'that is actually good' way, but 👍
OnLoadLocal seems to be getting called on menu screen for me, what save game would that be loading ?
all of them
it loads the saves at startup for the previews
and I just think it's cool because you can do a lot in IL which you straight up can't represent in c#
so till player selects a save, localSettings should be ignored i guess
currently puzzled how i tell il that Initialize is to be override
wait, i have ildasm
i can just look at how its done
found hidebysig virtual instance, probably the way to go
probably good, because i don't see a single log of it
does SavegameLoadHook also work the same way ?
I don't think so
hm, it doesn't want to log for some reason
yes
currently looks like
.method public hidebysig virtual instance void Initialize() cil managed
{
ldarg.0
ldstr "Initializing"
call instance void ['Assembly-CSharp']Modding.Loggable::Log(string)
ldarg.0
ldstr "Initialized."
call instance void ['Assembly-CSharp']Modding.Loggable::Log(string)
ret
}
but i'm seeing things like this in dasm, which i think i need that this class can be recognized at all
make your class auto ansi beforefieldinit
Yeah your ctor is missing
you gotta call the base class constructor
nvm, that image is from the wrong piece of code (i hate 2 space indentation)
but i found the part from the actual class
.method public hidebysig specialname rtspecialname
instance void .ctor () cil managed
{
// Method begins at RVA 0x205c
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [Assembly-CSharp]Modding.Mod::.ctor()
IL_0006: nop
IL_0007: ret
} // end of method
?
that is from the nested class being referred to as
.class auto ansi serializable sealed nested private beforefieldinit '<>c'
extends [mscorlib]System.Object
serializable sealed nested 
gg
uh huh
i commented everything out, that it's base constructor & initialize and only the reference for the base class, resulted in 2 KB filesize, though i can try leaving out the initialize function
oh I thought you meant ≤
oh
@jolly oriole how do you get it to compile? I installed an extension but it still throws compiler errors
any ilproj
they suck, at least with an extension which allows for il it still somehow needs .cs files and that just sucks
what
with the ILSupport extension you still have fragments of c# generated IL in the resulting DLL, can't optimize it fully 😤
my mods menu seems to disappear now after quiting to main menu , and i dont see a clear stacktrace anywhere
😦
time to learn il
TIL that ilproj exists
hotreload feature when 
you could reload the default appdomain
and as some gameobjects are marked as dontdestroyonload, you would need to destroy every gameobject manually before reloading
but getting it is the difficult part
What does he mean by hotreload? That you can reload mods without restarting the game?
https://github.com/BepInEx/BepInEx.Debug#scriptengine
Is it possible to do something like this BepInEx plugin in HK
It seems to just keep loading new dlls in specific folder without having to unload dlls, so no need to care about AppDomain?
interesting module the appdomain has
nothing can go wrong
CannotUnloadAppDomainException: The default appdomain can not be unloaded. smh
yeah you can't do default
tbh i don't know what would happen if it did unload
we do a little unloading the entire clr
virgin System.Exit vs chad unload the default app domain
NotSupportedException: Specified method is not supported.
at System.Runtime.Remoting.RemotingServices.IsTransparentProxy (System.Object proxy)
at System.Runtime.Remoting.RemotingServices.Marshal (System.MarshalByRefObject Obj, System.String ObjURI, System.Type RequestedType)
at System.AppDomain.GetMarshalledDomainObjRef ()
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.AppDomain.InvokeInDomain (System.AppDomain domain, System.Reflection.MethodInfo method, System.Object obj, System.Object[] args)
at System.Runtime.Remoting.RemotingServices.GetDomainProxy (System.AppDomain domain)
at System.AppDomain.CreateDomain (System.String friendlyName, System.Security.Policy.Evidence securityInfo, System.AppDomainSetup info)
at System.AppDomain.CreateDomain (System.String friendlyName)
at Modding.ModLoader..cctor ()
Rethrow as TypeInitializationException: The type initializer for 'Modding.ModLoader' threw an exception.
at OnScreenDebugInfo.Awake ()
why
what if
What are you trying to do?
trynna add an AppDomain
Ah
Ah, a while ago somebody tried that and apparently it’s broken with unity
That was with 2017 not with 2020
Maybe there is a difference
Fair point
apparently people worked around that by having a custom mono version they use
The lengths we go through to mod a 3-4 year old game
i think i did something wrong
🥴
it apparently didn't like this
i just tried, didn't work
Pretty sure you have to like get the module
Which is where the platform dependent code comes in 
i have something
does wsl add a context menu 'open linux bash here'? if so, i have one of the two isntalled apparently
can i just open hk with wsl lol?
ok nvm
the wsl shell won't even open
oh yea, makes sense
i don't have a distribution for wsl
which one is good for testing
I just have arch
downloading ubuntu rn, may have minimal set up
unless i have to install steam/gog on that again
Enter new UNIX username: SFGrenade
adduser: Please enter a username matching the regular expression configured
via the NAME_REGEX[_SYSTEM] configuration variable. Use the `--force-badname'
option to relax this check or reconfigure NAME_REGEX.
fuck you ubuntu
ok, so my method gets the modules on both windows and ubuntu
unless starting the game from ubuntu wsl just redirected it directly to windows
Can't you... dual boot with linux
don't use caps

then it's windows
root@SFG-DESKTOP:/home# apt install steam
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package steam is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
steam-devices
E: Package 'steam' has no installation candidate
what
The following packages have unmet dependencies:
steam-installer : Depends: steam (= 1:1.0.0.61-2ubuntu3) but it is not installable
E: Unable to correct problems, you have held broken packages.
you can't make this shit up
sounds like this already solves some problems, like getting the module
I wouldn't trust that to be portable lmao
Yeah it isn't
EnsureState throws a platform not supported looking at the reference source
Looks like there's a unix equivalent
Important part really is dlsym
so.. turns out it's not my mod. the mods menu just does not appear if one does a quit to menu from a save and goes into options.
wsl2 doesn't want to make a xserver connection ;_;
vcxserver, turn off access control, DISPLAY=ip:0.0
lan ip
not 127.0.0.1 or anything
yea, i went through this https://www.shogan.co.uk/how-tos/wsl2-gui-x-server-using-vcxsrv/, which has that also in, and wsl2 apparently finds the display and tries to connect, that just doesn't go through apparently
PauseChamp
wsl2 is shit
it isn't
based
quickly made a user and steam is updating
I think if you do an internal import that might work out portably
Mildly fucked up
installing hk rn, i hope i can just copy the mapi from the mounted drive
ok, i think the x server doesn't want to handle hollow knight
This one fixes the mods menu being not available, after quit to menu, not a 100% on the approach but it works.
https://github.com/HollowKnight-Modding/HollowKnight.Modding/pull/52/
I'm trying to edit/use code from Rider in VS and getting a ridiculous number of errors-seems like all of the references are missing. Additionally, my VS is being weird and I can't add references. Anyone seen this before?
fixed it
this is a problem with TC yeeting the UIManager every s&q
so I added some stuff to make it work for mods that have custom menu creation and w/e
Yo thanks !
Hey guys! If you don’t hear back from me I have killed myself. I’m going to rewrite the mapi in il.
written by hand ```.assembly extern mscorlib {}
.assembly Test
{
.ver 1:0:1:0
}
.module test.exe
.method static void main() cil managed
{
.maxstack 2
.entrypoint
ldc.i4 4
call int32 Square(int32)
call void [mscorlib]System.Console::WriteLine (int32)
ret
}
.method static int32 Square(int32)
{
.maxstack 2
ldarg.0
dup
mul
ret
}vs compiled.class private auto ansi '<Module>'
{
}
.class private auto ansi abstract sealed beforefieldinit '<Program>$'
extends [System.Private.CoreLib]System.Object
{
.custom instance void [System.Private.CoreLib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
)
.method private hidebysig static
void '<Main>$' (
string[] args
) cil managed
{
.maxstack 8
.entrypoint
IL_0000: ret
}
.method assembly hidebysig static
void '<<Main>$>g__Main|0_0' () cil managed
{
.maxstack 8
IL_0000: ldc.i4.1
IL_0001: call int32 '<Program>$'::'<<Main>$>g__Square|0_1'(int32)
IL_0006: pop
IL_0007: ret
}
.method assembly hidebysig static
int32 '<<Main>$>g__Square|0_1' (
int32 x
) cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.0
IL_0002: mul
IL_0003: ret
}
}```
Why does the c# version contain so much jump markers? You only need them when you want to jump to somewhere. The method names are also wierd
Way to high maxstacks
Compilergenerated attributes
try to disassemble the il written by hand, probably also has those markers/position indicators
I used an online site
I’ll try later
I just find it funny how much bigger the c# compiler makes it
Wow. Il is very interesting. It can give some surprising insight. For example: the memory usage could be slightly reduced by making it inherit byte. This reduces it from 32 bits of data to just 8
remake the entire assembly-csharp in il 
That’s what I’m planning to do
That would probably reduce size usage by a lot.
And give slight (unnoticeable) performance improvements
I’m not sure if we can rewrite the patches in il. That might be a problem.
I’ll look into that
I’m stupid. I just realised that the c# code is compiled to il before being merged using modcommon. That should mean it’s possible
@copper nacelle why did you react with that emoji? What does it mean?
Also, make the logginglevel enum inherit byte
definition of premature optimization
Yeah. It’s not even needed. It really shouldn’t make a difference
yea, optimize things in c# before doing it in il, if the il part is needed at all after that
bro why the fuck
Honestly, I’m just going to try to write it in il to challenge myself. I’ll probably give up soon. Also, those small optimisations are just things I do to make a habit of writing optimised code.
@copper nacelle why does AssemblyTypeAttribute have an empty constructor with an argument? I don’t see the use in it.
I didn't write it idk
serena
For if any of you want to follow my process: https://github.com/mandar1jn/HollowKnight.Modding.IL
interesting
There is nothing in it yet. I forgot to push. I’ll do it later
Anyone knows why FSMViewer keeps crashing?
use the newest version
use the Avalonia one
Thanks
I might've taken the wrong thing, not sure
is it meant to have a hell lot of files floating around?
blame avalonia
or .net
and then run the exe in there
Whats avalonia?
yeah but it just copies it to the temp directory
that's true
so it just hides it being multiple files
you don't copy it anywhere just extract the zip and run the exe
You could always delete it and find out
most of it you do need though
Thanks for the tip 
it's a windows publish so most of the non windows dlls have already been stripped
Wait how do I move between two FSMs

yeah well the last fsm viewer tab support was an actual hack
please tell me you'll add that in sometimes in the future
Good kind or bad?
probably the cause of some tab related crashes lol
it can be done better but I can't code it right now
you can pr it
or that
nah, I have zero skill required whatsoever
you were in here three seconds ago
you can suffer a ping
no, i refuse to suffer
i'd watch
I’d watch for like the 10 mins I have free atm
Ah, I’d watch it then
ping me when you stream it
ok
I’ll watch if I have time. Ping me
remember that I said I was going to rewrite everything in IL? Yeah. Way too much work
shocking
Any idea why removing the third action on In Air caused the enemy who threw the projectile (sturdy fool) to freeze sometimes when I hit the projectile?
_control.FsmVariables.GetFsmGameObject("Pickaxe").Value.LocateMyFSM("collide_with_wall").RemoveAction("In Air", 3); });```
This is what I did to the fool
the fsm seen in the image is the projectile's collide_with_wall
Wait actually it doesn't seem to be when I hit the projectile
I can't tell what does cause it
Yeah alright this time I had zero interaction with it but it still froze in place
These two threw once and then both froze
I'm gonna try some stuff but if anyone has any idea how what I did caused this please tell me






