#archived-modding-development
1 messages · Page 503 of 1
I found a collision bug just above the hive (and sorry I'm using google translate)
sorry i didn't know how to report it to the devlopper and i thought there might be one in this channel
there is information on what to do in #hk-announcements
did, now works
custom json.net and added charmiconlist method that monomod yeeted
failed to load pog
[ERROR]:[API] - Error: System.NullReferenceException
[ERROR]:[API] - at (wrapper managed-to-native) UnityEngine.Object.DontDestroyOnLoad(UnityEngine.Object)
yes
tot spoilers
anyway the real issue is hkworldedit
unity editor apparently can't read packed atlases or something
F
and crashes if you select tk2d sprites
the monomod thing seems like it'd be fucked
everything else worked seamlessly though lol
are we switching to bepinex?
i also know why tot crashes, 2017.4.10 assetbundle
like we already have 2020.2 now running all my tools, but that's because I read fields by string, not by actual fields
utinyripper is going to be much more difficult since everything is manually named
not very easy to upgrade like assetstools' are
rewriting the entire utiny ripper time?
and the modding api is also currently only sort of working, because i don't know if/what other methods have the 0 rva
well you wouldn't rewrite everything
at most you would entirely replace the class reading and leave everything else as is
i'll take this as working
i changed nothing in dnspy, the charmicon thing i made in the api, is pushed on the repo
but i can still dnail midair
just tested
gives me a lengthy error message
another 0 rva thing
Suffering
I'll just ask jade
Patching in the methods which disintegrate doesn't seem like the move
Oh
It doesn't do that
It kills the method
Violently
That's why my game doesn't boot
damn
Yeah some of the branches go to null
I'll take a closer look whenever I finish my homework
SlashHitHook in the modding api tells you what your slash is colliding with. Since c-dash can destroy grass, and so can spells, I want to trigger whenever any kind of hit happens. I'm trying tro figure out how to get the target from HitInstanceHook, but can't.
Is that possible?
What's 56? (I am very new to modding, sorry if this is an obvious question)
You can also hook Grass.Hit and related methods specific to grass components
That'd be fine, my code already finds all the grass in the room when the room loads. Would that involve using dnspy/editing-the-binaries though? The Grass class doesn't have a Hit field according to my intellisense, but I might just be missing a reference.
On.Grass.Hit, On.GrassCut.OnTriggerEnter2D, possibly a few others depending on how consistent the game is.
The On namespace contains hooks for almost every method in the assembly, public or private
Holy wow, that is an extremely useful tip. Thank you so much.
Can't imagine some combination of these triggers will be insufficient, I'll smash at it now and see what I need to listen to to catch all the grass destruction 🙂
Did you find the exact version they use for uitoolkit then?
56 is "hk", they just changed their nickname to that
Thank you!
did you try dmcaing them
I was thinking you could just download different preview versions until you find a dll with a hash that matches or sometihng
yes you can check what shaders are in a game, but you can't really make the shader code readable
hey nesquack i have a question
ok
so in supersprite extractor thing u made, whenever i try to edit the skins, the new skins just overlaps the og one. is it possible to get rid of the og skin layer instead of overlapping it?
you can for a particular file, but there's shaders in lots of different files
I can just make a script real quick to dump all shader names
what do you mean by this? when you edit, all sprites are put on an empty image and grabbed from the folder, nothing comes from the original spritesheet.
so if there's any sprites you don't want just delete the files
odd. i might be using an older version?
I think it's been the same way the whole time
like are you saying when you edit a sprite, it puts the old sprite under the new sprite?
yeah but it only happens when i edit a specific collection instead of all
ok I'll check in a bit
oh that repo has all versions
is it something that someone manually does or is it automated
so when you install the package it just replaces stock UIElementsModule with the new one from the preview package?
I just built stock 2020.2.2f1 and the assemblies were almost identical
i.e. no preview package
right, I thought you said they did have a version of uitoolkit, my bad
so it should just work replacing all the dlls from a uitoolkit build but it isn't?
all asset data/bundles get scripts by dll filename so if the dll is there it shouldn't have problems
are those classes in the UIElementsModule dll for sure?
or whatever dll you copied
so you did or didn't copy them when this error happened
I know there's an internal list of dlls in the game files but I don't think it's usually ever used
guess you'll have to build the shaders into a bundle
I scanned all shader assets and printed their names
in globalgamemanagers/.assets, level, resources.assets and sharedassets files
you posted this earlier https://github.com/needle-mirror/com.unity.ui/tree/master/Shaders
so just put those in a project and build the bundle, then load it and it should find the shaders
in globalgamemanagers
in globalgamemanagers.assets
in resources.assets
Text/Sprite
in level0
in sharedassets0.assets
Skybox/Procedural
Hidden/UIE-Runtime
Text/Mobile/Distance Field SSD
Hidden/UIE-AtlasBlit
Hidden/UIE-RuntimeWorld
looks like maybe bundles got updated
assetstudio says 5 assets failed to load
let me update and see if they're there
yeah it always does that
yes those shaders are in there
idk, you would have to go find how they're referenced
ok Shader.Find
this file concerns me though https://github.com/needle-mirror/com.unity.ui/blob/master/Core/Renderer/UIRShaders.cs
it might be trying to read from a different name because the package isn't "loaded"
I have no idea
For Reference: Shader.Find API does not work with shaders loaded from AssetBundles.
don't know how outdated that is but if still true then oof
well you have two bad options
a. patch the game files to add your shader to the listing
b. change uitoolkit's code to read from a bundle instead
c. ask the devs to add uitoolkit lol
the easiest would be a but it would break every time the game updated
b would be much harder and would break every time uitoolkit updated
c is super easy but lol
big brain just include the asset patcher in the mod
actually hek what am I saying just runtime patch it
load an asset bundle and load it from there
wdym too slow
what is a mono patch
I don't think harmony is all that slow, even then shader loading happens on the native side
Yeah harmony still isn't that slow, especially when it's not in a loop or anything
But whatever use what works
they are on assets/ui toolkit/panelsettings.asset, but the names of the shaders are the same as I posted earlier
there's no other path on it
ok that works too ig
ofc
it's assetbundle.loadasset
can you not grab the panelsettings asset
then get the shader refs from there
this is the same bundle you sent me?
I'll look later
You should be able to load it
@marble hollow https://github.com/nesrak1/sseadv/releases/
oo
all the code was there I just forgot to enable a flag
does the line in the docs GameObject aspid = Instantiate(Aspid.preloadedGO["Aspid"]); require a reference? because otherwise Aspid doesnt exist.
or a using statement that visual studio doesnt suggest?
aspid is a static class someone else made
because thats not really a relevant part of the code
there was probably a section prior that explained how to preload
i mean isnt it all relevant
no
class names aren't really relevant
where even is it on the docs
oh i see
this explains how preloaded objects work
where would i find the paths to the gameobjects?
scene dumps
k
so if i were trying to access a gruzzer, would it be
public override List<(string, string)> GetPreloadNames()
{
return new List<(string, string)>
{
("Crossroads_07", "Uninfected Parent/Fly 1")
};
}
or
public override List<(string, string)> GetPreloadNames()
{
return new List<(string, string)>
{
("Crossroads_07", "Crossroads_07/Uninfected Parent/Fly 1")
};
}
im getting this information from the scenes.rar file that is pinned, in Crossroads_07.txt
Uninfected Parent\Fly 1
\--Component: Transform
\--GameObject layer: 11
\--GameObject tag: Untagged
\--More garbage...
The former
What do the various fields in RectData mean? I don't usually think of a rect having a min or max.
are they fields or are they get properties?
i have no idea what RectData is, but for Rects, the various properties also change other stuff: https://docs.unity3d.com/ScriptReference/Rect.html
@jolly oriole it's part of the modding API. Here's the definition: https://github.com/seresharp/HollowKnight.Modding/blob/069d7359f624a7ddf99b5c1cd0f7761b4149665c/Assembly-CSharp/CanvasUtil.cs#L529
Min/max are two opposite corners of the rectangle
Oh I see, minimum position of the two positions defining the rectangle, and maximum position.
Thank you!
rect and rectdata are the same thing
rectdata is just boilerplate for making rects without needing to make it line by line
isnt ui toolkit like miles behind in features compared to canvas
:modders:
excuse me what
:modders:
base..ctor(); is supposed to call the constructor for the base class, but iirc dnspy has a panic attack when it sees it, as it reads it as another method
an alternative is to do public BossSequence() : base(), which shouldn't be flagged by dnspy
I think i know why my 1.5 api doesnt quite work correctly
Can only test in like an hour though
i know exactly why it doesn't work correctly
32 bit or something else?
null br
The alternative you offered is likely what it was before compilation and decompilation. Decompilers don't always understand constructor calls, especially since they're actually called .ctor after compiling.
afaik : base() is also implied
Idk what that is short for, but doesn't sound too ez to fix
(or as far as i googled because i'm still new to c#
)
brfalse.s leads to a null which causes ilmerge to kill the method (extern) leading to zero rva
or if you don't ilmerge it just crashes immediately
feelsokayman
ilrepack throwing on a null is incredibly reasonable knowing this information
Yes, I think we're saying the same thing anyway, haha.
But is it fixable?
i mean if you fix the br null then yeah
i am still of the opinion that this is the optimal opportunity to not have a 20mb assembly
but the br has to be fixed either way
Ill research that once i'm at my pc
it's from the prepatcher
Ill research that once i'm at my pc

pogtamer immensely disturbs me
agreed
Am I reading this correctly that if hasXunFlower is true and givenEmilitiaFlower is false, then the FSM tries to call "FLOWER" which... doesn't exist?
yeah
:)
I wonder how often that happens... 😦
Ive never seen such an advanced pm action
Yeah
is that a "ported" mapi or a new one?
ported
pog, but ig it would really be good to check what can be trimmed from the api
i am going to abuse this optimal opportunity
i mean, people do need to compile mods again thanks to .net 4
don't you worry
suffering
lmk if i can help
should
cool
doesn't matter
yep, is pushed
alright
i'm going to commit onto the repo which has the loading actually fixed fwiw
if you mean https://github.com/SFGrenade/TemporaryHkBetaModdingApi, i can add you as collaborator, or do you mean on the main mapi repo?
ah ok
btw, i did send the dm, so on release we might be able to use normal json.net
The files for it aren’t in dnspy, but I guess you can change it. Better to do it with a mod though
how?
Look at how other mods change the text
where
GitHub
Also you should probably actually make a mod since with how many screenshots you posted, you seem to be doing a lot
thx
i will try
now
i download a mod like eldergod
then i open it in visual studio?
ok?
You don’t really open dll files
just search for the name of the mod on github, most if not all of us upload source code
i tried saerching hollo knight but i get this
try just searching hollow knight and click the c# text under languages to the left
have you tried scrolling down
if you have debug installed the api is installed anyways
bullsh8
Shocking
generally would recommend buying the game before trying to use the large amount of free content the community provides to people who paid for the game
yo
pog
got actual debug info working
should've done this a long time ago
still very happy
is that for 1432 or 1.5?
neat
gaming
this is w/out merges too
so the assembly is actually usable in dnspy
very convenient
did you just add the other dlls in the managed folder or how are those referenced?
managed
pog
Do you have System.Runtime.Serialization in your Managed folder?
idk if i put that there or they actually have it now
was already there
which is why i also removed it from the ilmerge thing
makes sense
I have a problem I'm stumped on
I basically want Hive Knight to have different DNail dialogue when stunned
So, this is my related code
In Awake()
In my LanguageGet()
And in Start()
For some reason, it seems to only work the first time I DNail him while staggered; every time after that without quitting the game displays the three normal dialogues
Any ideas?
let me quickly rename steam things to 1432
@jolly jungle have you tried logging what the key is?
you could try adding both times to the control fsm, with the stun recover staying the same, but change the stun to the Stun Start state of _control
doing some logs now
yeah, I thought of trying that next
thanks 
Alright
So, uh
Kinda funny
Basically, I didn't clean up well after me
And every time the fight ends, the script lingers around, I guess
And that resulted in this
yeah
so does this update mean we get to use a version of C# that isn't from the dark ages?
What do ya'll usually do to share the mods you make? I have one in some reasonable state of done-ness that I think would be fun to share
oh? how does that work, when 2017 runs .net 3.5
I imagine they probably meant .NET version. 3.5 is a doozy
also yeah, i would like the api features, not just the syntax
I think I found the GDrive folder (https://drive.google.com/drive/folders/0B_b9PFqx_PR9Um9MeFZMV21oWGs) but I didn't see any mention of how to add things to it
but i'm still curious about the c# 9 thing
Do you mean there's an XML file on GitHub I should open up a pull request for?
If you put <LangVersion>9</LangVersion> in your .csproj file you can use a lot of C#9 features
ye
any C#9 features that don't require runtime changes
4.0 will be a relief hah
yeah it's on ayugradow/modinstaller
yeah definitely
Ty!
yeah
and as far as the gdrive goes you just ask and someone puts it in or can add you
or you do the sfgrenade and pr another link with your mod hosted somewhere else (e.g. github)
or also some other mods too big for gdrive
yeah
angle self hosts
it's just for the sake of having them together
Which was more of a big deal when there wasn't an installer
I just asked for permission to edit the GDrive (I think)... I used the "ask owner to share" feature, which I've never even seen before
Oh, maybe that's easier, it's already on github
btw 56, chance you send me the 1.5 mapi you made to port mods or do you want to refactor more first?
I could send it but I do plan on killing more stuff
then have fun :D
iirc the generic version was for specifying settings types, right?
was there any benefit other than not having to cast the setter value?
no
can type getfields detect fields from derived types if given the specific instance?
if you have like base obj = derived
obj.GetType() will give you the type for derived
poggers, gonna use that for reflection based save setting field detection
I think you might be able to use covariant return types for the property now too
Which makes it even more pointless
although i'm currently thinking for 1432, as 1.5 is still beta
I want to say that covariant return types don't work for properties but maybe I did it wrong last time I tried
it's strange that it's not allowed
wait a sec, i can just use _saveSettings
watch me add an abstract generic mod derived class to not worry about generic mods lol

@jolly oriole what
about the comment, the replace, the enum name or what?
all of the above
the comment: not made by me
the replace: never worked with mono before, seemed fitting
the enum name: copied from vanilla
to make LanguageSupport possible, as it's otherwise a real spaghetti conversion between different enums & ints
yes
just remove the fat and it will work
let it lie on ice for a while, language is fucked in the game
but if you want insight:
MenuLanguageSetting.RefreshAvailableLanguages() gets either TestingLanguages[] or SupportedLanguages[] and casts to SupportedLanguages[] (not too bad, as those are duplicates of each other).
an entry gets cast into LanguageCode in MenuLanguageSetting.UpdateLanguageSetting() to switch language (so no custom thing possible as entry "34" (string) is not equal to whatever is in LanguageCode)
this gets converted to string in Language.SwitchLanguage(LanguageCode code) to check of the language is available
hm apparently it should work according to ms docs
you can cast int to enum even if there's no member
but not the string representation of that int
and apparently it's not in .net 4
i have to write my own thing sadge
can't be worse than changing json.net
🥴
probs just a function that tryparses the string to int then to languagecode, but i'll see
Enum.TryParse?
doesn't parse the string "34" to the numerical enum value 34
or: only does so in .net 5 and netstandard 2.1
hm, tryparse apparently works in .net 4
for whatever reason it's different in features from parse
so ig you can throw the language enums out
:frogchamp:
though please not in the 1432 version
i ain't touching 1432
froggers
wait a sec, i could technically send tc the changes to the language thing, so it maybe doesn't have to be changed in a mod or something lol
but nah, tc wouldn't use that, is it literally only benefits modders and maybe even sacrifices a bit performance
gotta say, doing Unity UI through code when I didn't fully understand Unity UI was a bad idea lul
taking an existing game UI and modifying it like that, even more so
but it's done, thank god
good ol' refactoring
you can do breaking changes as much as you want so long as it doesnt break my mods
if your mods aren't doing terrible things they will be okish
good thing I'm not smart enough to do terrible things
i mean Mod<A, B> is pretty easy
or SerializableDictionary
or BoolValues, IntValues, etc
magic words
uh huh
yeah, if ya got the opportunity to take breaking changes you might as well go all the way with 'em lul
beta version update again?(about 11 MB)
what's the changes
ok i found it on announcements
nvm
There are a lot of points in hk
you can find a map of most of the points here https://scripterswar.com/hollowknight/map-sketch
Interactive map for the game Hollow Knight. Includes Godmaster DLC.
i mean, unity is partially written in c++, so i guess transforms weren't difficult to debug, as they're used pretty much everywhere
can't wait for the 1.5 patch to release while we have no api ready and people flocking in #archived-modding-help to ask why mods aren't working
Can't we start working on it now?
who says that the final version is the same as the current betas?
Ah, I guess
Hm
How fast can it be fixed once it's released?
Also, what will this mean for my own mods
at best: it's very similar, that only small changes are needed to what 56 already has
at worst: it's entirely different
definetly: recompile mods thanks to .net4 / netstandard2
Will I need to change anything, or will the changes to the api, ah, "bridge" between the old mods and the new game version? Is that the word?
Not sure
the api gets some fat trimmed
that won't need too much work though, right?
depending on what unique stuff you do in mods, that could be the case, but if it's just a fsm change using unity's scenechanged hook it should only require recompile
just reference the new dlls instead of old ones and you should be good to go (while not forgetting to change framework version in project settings to 4)
Aight, wonderful
Nah, nothing really special, not even loading an asset or anything
So should I wait for the change before releasing it?
i mean, we don't know when it's releasing, so you can release your mod right now and just update once 1.5 is out
Cool
is it possible to swap out an audioclip in a mod's initialized(), as opposed to tracking down where the audioclip gets played?
afaik no
dang 😦
could you explain
like if you want to change audioclip of something in the main menu, then doing it in initialize() works, otherwise you'd have to wait for a scene to load that has the go in it to change the audioclip
oh gotcha
im trying to disable the sound that plays when the knight lands, but thats not handled in heroaudiocontroller so im gonna have to track down where that gets played
assuming its an fsm thing
1 sc
if you want to just mute all landing sounds:
On.HardLandEffect.OnEnable += OnHardLandEffectOnEnable;
On.SoftLandEffect.OnEnable += OnSoftLandEffectOnEnable;
in those hooks, you get the Hard-/SoftLandEffect monobehaviour, which you can use to get audio on the go the effect is attached to
though let me check first if there is audio on the effects GOs
TIL hard landing sound is easier to deactiate
Knight GO -> Sounds GO -> HardLanding GO -> set volume to 0 probably
Knight GO -> Sounds GO -> Landing GO -> set volume to 0 probably
@empty ridge
so you can hook HeroController.Start or awake and do that
makes sense
didn't see this ping until now, weird
again I'm guessing Shader.Find uses the hardcoded list in globalgamemanagers which isn't something you can patch at runtime so this is probably the best way
are you trying that in 1432 or 1.5?
well, ig either way it's possible to have mod be constructed very early after game start, in which one could load assetbundles with shaders, should definetly be before the first Shader.Find
so muting hardlanding worked perfectly, muting landing did nothing... idk private void HeroController_Start(On.HeroController.orig_Start orig, HeroController self) { AudioSource hardland = self.transform.Find("Sounds/HardLanding").GetComponent<AudioSource>(); hardland.volume = 0; AudioSource land = self.transform.Find("Sounds/Landing").GetComponent<AudioSource>(); land.volume = 0; Log("swapped sound files!"); orig(self); }
they seem identical lol
may be that it get's set to volume 1 if an actual landing occurs? idk how tc coded it
i'll poke around a little more
i'll search too
its hard cause its not like a class that you can search for in dnSpy
It looks like in the softlanding play effect, it randomizes the pitch before playing
HeroAudioController.PlaySound -> case HeroSounds.SOFT_LANDING
yea, but it doesn't touch volume
and i hooked that method to just return immediately
in Initialize(), if you can find the GO Soft Land Effect, set the volume of its AudioSource to 0
there's also one there
hm, idk then, never tried to add custom shaders
though maybe the source code of asciicamera can help
yea, just saw that it does apply manually
Hmm, the other thing I found is the SoftLandEffect class, which plays the audio clips directly
apparently I'm blind as you've already pointed that out lul
wdym
don't want to deal with that, i'll just delete and reclone my repo
🥴
it's faster
you can reset soft like 5 commits back then reset hard then pull
now i know what's wrong, i did 2 other commits in my main mapi repo for no reason
so apparently the last bit i added to the hook worked because it was throwing an exception
i can figure it out but thought that was hilarious
lol
I used asset creator to create a ScriptMapper and it successfully loads by unity (somehow lol) but as I expected, the game only uses the one loaded from globalgamemanagers for Shader.Find and I'm pretty sure it does that at startup before any scripts can execute
Shader.Find is using globalgamemanagers' scriptmapper asset which is a lookup table of where to find shaders by their name
so I just verified that giving unity another shader list wouldn't work
unity loaded the shaders from the list but Shader.Find still didn't work
asset creator let's you make assets that don't have c# classes, like ScriptMapper for example
afaik you can't initialize one in c#
there's always ways to patch around the engine but that means you have to go into native code
but other than that, the code is probably like
var file = loadFile("globalgamemanagers")
this.globalTable = file.getScriptManager()
...
this.globalTable.find("blah blah")
so the only way to fix that would be to modify global table's memory or hook the function that loads it in the first place
in any case, too much work
either patch globalgamemanagers or deal with the patch on shader.find
Can someone merge this?
i can merge it but i won't build it
I'll build it but what do I do after that
why are you talking to yourself
Hoo knows
did you build it
No, I’m lazy
@ lazy
this possibly has something to do with threaded reflection
isn't dnspy repo gone? so you can't get any more mono debug dlls
doesn't have unity 2020.2
it's probably not even hard to do manually
you know, since there's a giant section on it
I have compiled versions before on my laptop
I can try later
here's hoping it still works
what exactly is the TLS issue with the old modding-api and github anyway? Is it something like Unity 2017 just refusing to run even external dlls/libraries that does use TLS 1.2, or is it that youd rather avoid bundling external stuff like that with the api?
modding api tls issue?
yea, the old modding-api (the one used for 1221 currently) had a github version helper thingy that depended on TLS 1.0/1.1 for establishing a safe connection to github to check for current versions of mods being up-to-date or not, but github removed even optional TLS 1.0/1.1 support, so now it can't connect and throws errors + tells everyone every mod is outdated pm
Sounds like something @deep wave fixed in a fork. They enabled TLS1.2 as a security protocol for the ServicePointManager. I believe that solves the problem, although I may be full of it
I think that was a different issue related to the ModInstaller and just windows (7?) not supporting TLS1.2 out of the box, but in the modding-api case its ran with/by the game so its ran by Unity2017 rather than as its own external program
Ah, sorry, I misread you saying modding-api as ModInstaller.
could also just strip that functionality completely out if @deep wave does her job and completely overhauls the modinstaller to work for downpatched versions as well so lazy omfg 😤 🙏
Windows 7 had it supported it just needs to be told to use it. Hence adding it to the enum in ServicePointManager.SecurityProtocol.
Http/WebClient follow suit based on that.
Oh, I didn't make this, I'm looking for a solution to fixing it, and for that I want to know exactly why it wasn't fixed already etc 
I looked around for the code that does the update check in moddingapi and I couldn't find much (just searching through github though). If you knew where it was I could look to offer an opinion but there isn't much more I can do atm.
I think this is the one, actually, so its just commented out but still there 
https://github.com/seresharp/HollowKnight.Modding/blob/4d356a37d7133623fbb3b4066cebb8988e65490d/Assembly-CSharp/GithubVersionHelper.cs#L35
yea, that was what I was thinking, but I wanted to ask if anyone had already tried and had it not work
why must you call me out like this 
Bc I love u, jamie:3
I want to overhaul the old githubversion checker in the old 1221 api so that it works again, if possible, so I asked if anyone had tried to fix it before
(it's also in the current cp version, just commented out)
uh huh...
about the installer tho
I think back when I was first making it, we discussed about adding support for multiple installs
but people seems to not be too keen on it back then
because "people who are running multiple installs don't really need the installer"
specially because older patches didn't have any working mods back then
I think 1221 had an api that doubled as debug
it's still just 1221 and like the 2 1028 mods
yeah
I mean, if you guys wanna do that overhaul, be my guest
but I doubt it's worth the effort
1221 has like 3 mods people actually use too
oh
ax1uwide3
debug, hitboxes, custom knight?
I mean 1221 has the real api it's just that nobody is going to maintain mods for that
Another big part of why there aren't more mods is because it's harder to find resources for those versions
and because they're ancient
Moth mentioned porting benchwarp, but tuples effort
that ain't effort
I think another reason why was because adding support for older versions might accidentally add support for pirated versions
you add 1 file to the mods folder
Nah, the effort being bc they're in one and not the other, from what I read back then
yeah like I said
Put tuples in mod folder
Ref tuples in mod folder
Build against 1221 api
Profit
Literally impossible :o
by impossible do you mean free
yes
because 1432 doesn't have native tuples either
Yes, and I know 
They're just ilmerge'd in because me and serena found them convenient
1432 is also ancient though :v

time to bring crossroads back :)
That was a meme cerpin. The respawn method is very different on 1221, so even with an api with monomod hooks it would have to be rewritten.
I do still blame 56's refactoring which added 200 tuples though. I'm pretty sure number of errors in visual studio == difficulty of fixing the code is the way it works, after all
better than 200 * 5 duplicated lines
It really was awful
ah, imagine memeing in a public server like that D:
Alright
It's time
How do I get my mod onto the installer
If I happen to not have a github (or, well, I technically do, but I have no idea how to use it so, not yet)
- upload a zip (containing the mod and a readme) somewhere (e.g. the gdrive)
- make a pullrequest (PR for short) to https://github.com/Ayugradow/ModInstaller (requires github) that adds lines for your mod to be downloadable
2.1. Requires: Name, Short Description, File name (dll) and the SHA1 value of that file (per file), link to ZIP, dependency list
2.2. you could also get somebody else to do it for you
e.g. the gdrive
The? A specific one?
just said that as an example, but i meant the google drive with all the mods on it
So yes a specific one
technically you could upload it wherever you want (i use github releases)
Lemme make the zip first, then I'll see
you could just DM me the zip then
Any specific name the zip needs?
As in, the ZIP's name won't influence anything, right?
yes
It's all the .dll
Thanks
Readme file in all caps, lowercase, or title?
The file's name
i think it's not strict, but i'd name it Readme.something
personally i just markdown files, so it would be Readme.md
text, but fancy
looks like this https://github.com/TTacco/Hollow-Point/blob/master/README.md
got languagesupport working on newest 1.5 mapi
nice
nice
and i didn't even need tryparse lmao
yooo that really is fancy
How do I make one?
Wait so I use the same text formatting, save as .md, and it comes out fancy?
depending on what you use to look at it, github displays it fancy, but in notepad it looks like the raw link
Ah
yea
Can't touch it 
then dm me the zip
Sure thing
https://github.com/Ayugradow/ModInstaller/pull/55 merge please, thanks
Anyone have a solution for UnityEngine.UI not being referenced properly ("The type or namespace name 'Text' could not be found")? I'm definitely using UnityEngine.UI, vs is just not accepting it. I feel like I've solved this problem before, but from Unity's side, and long enough ago that I don't remember how I did it.
Oh wait I might know that one actually. Do you need the text rendering module?
Also referenced in the project, so it shouldn't be that.
👍 that's all I've got
are you refing UnityEngine.UI and UnityEngine
Yup
did you maybe accidentally set an alias for the referenced .dll?
alias is set to global only
it'll be UnityEngine.UI, not UIModule
is there a UnityEngine.UI.dll somewhere I just can't find? I see a UIElementsModule and a UIModule
should be in the folder with all the others
hmmmmm, new question is "why doesn't my unity install have that", but i don't think that's a question for y'all
The former.
why are you refing unity dlls for a mod
like unity dlls in a unity folder
you just ref the game ones
it happens
@dark wigeon not to be a bother but fwiw level308 -> Acid Box -> damages_enemies crashes the avalonia viewer if you try and open it
that's true
I'm about to 💤 so see you in 13 hours
alright
beta too?
yeah beta release 2
no hk beta
ok it was trying to read arrays but arrays aren't supported
Not exactly a mod, but I made this skin in Photoshop. https://drive.google.com/file/d/131ikS91yddw_Vq3sx25IgHi5Qhp2u5lL/view?usp=sharing
Sorry it's not a mod, idk where else to put it
cool
Thx!
I think it'd fit best in modding discussions, but otherwise that looks surprisingly good 👀
guys can u give me gun mod pls
try going to the right channel then maybe
hello guys, I'm going to try something very basic, but I don't know anything about programming... I've open the code of a mod and I just want to change a name inside for my personal usage (because I play the game in French, so just wanted to translate the boss name to fit more in the game), I've find what I have to change, I've modified it, but cannot save it. Is their a simple way to just make a simple edit onto the files packed into a dll ? I don't ask for programming help, just for knowing if it's actually doable for a beginner to save the changes made to the dll
(sorry if it's the bad channel to ask that)
If you edit it in dnspy or ilspy it’s easy to do, but if you do anything more, I suggest making/editing a mod in a c# ide such as Microsoft visual studio(community version is free) since dnspy and ilspy editing becomes hard fast(at least in my experience)
okay thanks guys, I'll try it!


what are you doing bro
obv nothing bad
top 10 anime lies
i couldn't help myself 
Modding API source:
https://github.com/seresharp/HollowKnight.Modding
please don't kill me, i just avoid code duplication
the most egregious thing is that TSave is the first type parameter but listed second in the constraints
absolutely unusable
that's true
the generic version means you have to specify a save setting type though
terrible
and you can't have two generic versions with one param so you can't say only save/global easily
i named them according to what to expect of them
was it intended that your Type variables don't have underscores?
stole the style from 56's hellmod
oh wait yea, you didn't use the types
then i have no idea why i left the type types without underscores
nice
that's one of those small things that would bother me the most lul
but it's easy to edit
why are they protected
so you can use your settings
the override returns a base class so you need access to the backing field
though you could make the argument for a public property or something
yeah i see it now and no protected is def better than public
protected is good enough, and if people ever want to derive from another mod's mod class i have lost all faith
🥴
i mean yeah
seal your mod classes for the hot devirtualization
sealed public < public sealed
god dammit
[DEBUG]:[API] - Trying to instantiate mod: SFCore.DontLet56SeeThis.FullSettingsMod`2[TSave,TGlobal]
[ERROR]:[API] - Error: System.MemberAccessException: Cannot create an instance of SFCore.DontLet56SeeThis.FullSettingsMod`2[TSave,TGlobal] because Type.ContainsGenericParameters is true.
it's abstract for a reason.
so either i pr it to the mapi (which you prob wouldn't like 56) or i copy paste the code into files
ig i'll adjust the api to not try to instantiate abstract classes
o my god, did tc change the fucking fsm of the control of the world map
I gotta say it instantiating abstract classes seems like something that should be fixed
hol up are there grenades here
yes
i have no idea how additionalmaps worked, gives me one exception after another with 1.5
I do the weirdest stuff and then end up just deleting it after
should ifnull not just return Some
probably; I'm not experienced with functional programming and I scrapped that as soon as I realized I was once more doing more than I needed to, hah
understandable
Does the ModConsole print all Modding.Logger.Log statements to itself?
no
Okay, thanks. I'll look at its source, assuming the repo is on GH, and see how to plop text in there. Unless someone wants to give me the answer. 
logger.log will just go to the normal console window
you can get text by like returning a string or something in a function you call
Saves
Windows File Paths: (Assumes Default Steam Install Path, Adjust accordingly for DRM Free or Non-Standard Steam Path)
Game Files: C:\Program Files (x86)\Steam\steamapps\common\Hollow Knight\``` ** ** Mac File Paths: ```Save Files: ~/Library/Application Support/unity.Team Cherry.Hollow Knight/ Game Files: ~/Library/Application Support/Steam/steamapps/common/Hollow Knight/hollow_knight.app/``` ** ** Linux File Paths: ```Save Files: ~/.config/unity3d/Team Cherry/Hollow Knight/ Game Files: ~/.local/share/Steam/steamapps/common/Hollow Knight/```
Is it presently possible to attach a debugger to HK to more easily debug mods? Apologies if this is a basic question, I'm very new to HK/Unity modding.
Since dnSpy was archived it's a little harder because their github doesn't have the debugging .dlls anymore but I want to say someone around here has a link to one that works with HK - I don't have it myself though.
Unfortunate. I wonder what happened to cause that. Okay, well, thanks for the answer! I'll muddle through.
I'm going to make a new one tomorrow
That'll be great to have
it 'works'
as in it works if you use exactly 0 on hooks and none of your mods use on hooks
otherwise it violently crashes the game
🙂
Why does that crash
at least last i tried it crashed
on 1432
you can get line numbers if you use an mdb or a portable pdb though for exceptions
not a debugger but it's a start
You mean using a mod's pdb or is there a special Unity HK pdb somewhere?
mod pdb
just set the debugtype to portable
portable works on 1.5 at least
i only tried mdb on 1.4
via mono's pdb2mdb
The pdb doesn't seem to be working for me unless I'm missing something obvious
portable yeah?
yup
might be 1.5 then
gonna download Unity 2017 real quick and see if I can use pdb2mdb for it
pdb2mdb works for 1.4.3.2 pretty sure
might need the debug unity runner idr
you just take the exe off unity
very easy
debug exe/unityplayer
if it doesn't work w/out those
you find a different way to get debugging on 2020.2?
Does anyone know how to get a game object to be a child of an existing game object and still render? I want to attach something to a game object without having to update its position every frame.
When I try the obvious thing and set my game object's transform.parent to the target instead of a canvas, it doesn't get rendered anymore.
nah i haven't tried proper debugging
Try SetParent with the worldPositionStays bool set to false
also make sure that what you're attaching to is active
Still nothing rendered. Here's the code I'm running if you're down to look (it's being run for every enemy at the moment): https://gist.github.com/itsjohncs/2a4df334aa3acce411c71e6753f8c1d8
I'll try a spriterenderer now, thank you. It works with a canvas as a parent. Here's my working version that does that (and it doesn't move with the object): https://gist.github.com/itsjohncs/a265531d0766692151e8509671549ef9
Hmm, it might be because an Image is a UI element and UI elements have to have a canvas parent - I don't suppose you can parent the canvas itself to the gameobject?
I don't think I tried that, I will if my spriterenderer poking doesn't work out... still trying things with SpriteRenderer to see if that'll work
I suppose alternatively you could have a big screenspace canvas and have images for each object that update with a world position to screen position method
Yeah, I think that's what hollow point does (was poking around in there earlier hoping that they figured this out). I could certainly get that working. It just feels kinda cludgy... like this should work afaik
I think SpriteRenderer works in a similar way to Image so hopefully it works
it does seem a lot cleaner that way
Yeah I noticed that SpriteRenderer can just be given a color too, so I don't have to generate my own sprite like I was... I want this to work...
Not getting anywhere yet though, still just not rendering anything
Setting the canvas object's parent to the target didn't work either 😦
Imma give up for now but please anyone ping me if you've got other ideas. I'd love to figure out how to do this cleanly.
well, I made a plane I guess
all hail the magical mono dll
is this for debugging
yes
sick
ver nice
I really only uploaded this here to send it from my laptop to my pc
but you can try it too
2020 messed up a bunch of stuff in the repo so I have no idea how stable that is ^
nvm it just instantly crashes
rip
I was able to use a plane to achieve a similar effect - not sure how well this would work in your use case
position's probably off - I edited the values while in-game
Ooo very rad! Thank you! I'm betting I can interrogate the primitve object to see what's special about it to see what I was missing too.
It uses a MeshRenderer as it's a 3D object which is why I'm a little iffy on that
then again, the Knight also uses a MeshRenderer (which might be why the SpriteRenderer doesn't work? not entirely certain)
The enemies I was atcching too also seemed to use meshrenderers
I wish I'd ever used unity before. So many mysteries.
Though I guess it does make it all new and interesting too 😅
that's a tk2d thing
I should say: I wish I'd ever used anything I'm poking at before then.
why the fuck does SendEventByName not find my custom event anymore?
how many fsm utils are there?
yep v4 mbe vs2017 and tried to get the code as close to the dll build date as I could like the instructions say
I don't know why it would be so off
sure
because it's possible that nearly none of them work anymore with hk 1.5
thanks to FsmTransitions apparently not using the string toState anymore, but toFsmState instead
from my testing at least
does qol have its own fsm thing?
is use the property
hm
any backing field
unless your playmaker version is somehow different idk why there would be differences
incredible
I'll check closer after I eat
Maybe I just didn't test anything relying on it lmao
lol
Aight
So there's a problem I don't know how to approach
I'm assuming it's caused because of differences between PCs
So I was watching crankytemplar's vid on buzzbo, and it seems that the spikes came out much more frequently than when I played
For example, the spiral spikes, that happen during the glob and bees, go around three times in the vid, while only once when I play it
I think it's cuz of the messy way I spawned them
Which is having a coroutine always active, checking a boolean every point something of a second, and spawning spikes if yes
boolean controlled by attacks, of course
So, if anyone can give a better way that won't lead to this inconsistency, and is also probably better in general, please, please tell
initially that sounds like an issue of not using deltaTime but I dunno if you have a github or anything to look at
Pretty simply, seems to spawn at different rates between different pcs
The spikes, that is
In your game settings, make sure you have both vsync and the frame cap off
Hm
I think I did turn them both off a while ago
Or maybe I turned frame cap on, actually
I'll need to check
Thanks
yes I'm already using that
giving it the right commit is part of the build process, I can't skip that
btw 56, it really is "just" the tofsmstate thing that broke the entirety of additionalmaps
amazing
this is for 2020.2?
weird how big yours is. I even tried vs2019 to be sure and nothing really changed
yes I fixed the submodule thing
but mines way smaller than the original
maybe not way
any assertions while building?
yep, had the atomic ops problem tko
I also had a problem with dnspy's generator asserting on the patched code
oh lol
I think the atomic ops problem came when I didn't build in release x64
Refactoring is one of those things that's annoying in the moment but oh so satisfying when you're done
idea for mapi: ingame mod reloading, a button somewhere that mods completely unload and scene 0 is loaded, to reinitialize mod loading
can probably look at how to manage such a thing after monday
I recall dot net core 3.0 made it easier to do that, but I don’t think it’s still possible under .net standard 2.0
Unless appdomains
Suffering
Reloading assemblies with appdomains is nearly impossible, don't try it.
We suffered that problem with TShock for Terraria and just never accomplished it.
Legendary. I assume this allows attachment via dnSpy? Or does any debugger work out? Also, do you have a ko.fi or something similar? That's good effort, worth buying you a cup of coffee.
if it's like 2019 it will crash
It very well might, but I recognize effort that is above my head. I'm not the brightest bulb with some things. 
yeah I was getting that exception too but I didn't want to break anything by commenting anything out
I'm running into some weird assembly loading issues with mod development. I'm pretty sure it's due to my ignorance here. Is it reasonable to reference Newtonsoft.Json.dll in a mod? It seems to lead to dependency loading hell, at least Unity isn't grabbing what it needs from the GAC. Is there a preferred JSON de/serialization alternative?
i mean if you want json.net for something yeah
if you're doing 1.5 dev
it's in assembly-csharp in 1.4
the alternative is unity's jsonutility which is kinda garbage
Well, I'm punching myself in the gut with what I'm doing, maybe. I'm referencing a general purpose library (for networking purposes) which references json.net. I absolutely do not want to reference assembly-csharp nor unity in this general purpose library.
Since 1.4 has json.net in the assembly, I'm going to assume unity can resolve the types and I've been dumdum for putting the dll in the folder. It's at least worth a shot, I guess. 😩
Okay, just posting since it seems appropriate to share the solution. I took a note out of SereCore's book and edited the mod I'm touching to resolve newtonsoft references to the game assembly, thus resolving the types.
Does anybody know where the SereCore GitHub is? (Assuming there is one)
I think it’s here https://github.com/seresharp/HollowKnight.SereCore
well gradow is Brazilian and he is god so clearly Pedrito is a follower

is there even a single good way to set dependencies without having to screw up your csproj anyway 
kinda true
Put them in a DLL folder in the solution. DO NOT check in the DLLs. Then any new dev can copy their own DLLs into the folder and they auto-reference
Then you don't have to mess around with proj files more than the one time to reference the ones in the folder
yea, this is also the way modding api does it
I have them in a folder like one subdir back
relative paths wooo
Just gotta be sure anyone loading the project is aware to set up the folders too. (If you used a path outside of the solution entirely.)

