#archived-modding-development
1 messages ยท Page 163 of 1
Ah, yep
I'd still like to find a way to get infinite health with the binding on
put health = 11 in the take damage function
guys if i put x = y am i setting x to equal y but then if i do y = x i'm setting y to equal x or is that not how it works?
x = y sets x to whatever y was
yes
nice
what it doesn't do, that I thought at first when I was starting out coding is do an algebra problem.
not a pointer
I seriously thought for a few minutes that x = x + 1 would break logic
nice
lol
ok cool
if you have x = y = new Object();
and x.homosexual = true;
y.homosexual will be mutated
but x = new asfasfd(); won't make y a new asdfasdf
good example
Why is y gay
tbh what I don't like about c# is it's not clear what is and isn't a pointer.
I mean the answer is all non-primatives are pointers
but it feels weird. I like my c++ where nothing's a pointer unless I tell it it's a pointer
Okay what
So I set invincibility to true
And apparently it doesn't work
But the invincibility bug works fine....?
what invin bug?
At a certain point in the dream gate warp animation, the game makes you invincible to all damage and hazards
And stops you from picking up geo
yes
If you interrupt the animation correctly, you can retain invincibility until you exit a dream or dream warp
Also, what's an ALADAR
And apparently there's something called MUMCAT?
yeah ik about dgate storage
The type or namespace name 'rb2d' could not be found, what do
those are known names
TC has bad naming policies
Anyway, dreamgate storage works fine for the Pantheons, but straight up setting yourself to be invincible does nothing?
it probably does something, but the invincibility state is changed quite frequently
yes
e.g. when you leave the bench
the source code is available?
no
no
no
no
how do you mod it then?
no
decompiled
Wait, Gradow
you dont
why is it claled modding?
we're this channel's mods
Are you sure? Because there are only 2 ways to end invincibility from dreamgate storage
Or is that a different kind?
it's the same
no it's the same thing iirc
but that's storage
where can I find the source code of the game to mod it myself?
storage makes the game think you're in a state when you're not, basically
so it's as if the game thinks you're in the bench while you're not
Ye
but doing things that would make you leave the bench (eg jumping etc.) break that storage
anyone?
it's not publicly available watermelon
Just seems odd that you can keep invuln until you properly go through the animation (or exit a dream) but you lose it if you alter the code
Okay, found a way around the binding
everything you do, every frame, the game runs multiple checks to see, amongst other things, if you should or not be invincible
Ah, and storage just keeps reading that as true
yup
But altering the code just sets it for 1 instance
exactly
Setting "isInvincible" and "invinciTest" to true along with capping out all my health related things let me get past the binding
I'm not invincible
But I now take lifeblood damage instead of regular
ยฏ_(ใ)_/ยฏ
GameObject.GetComponent<T>() is a method which is not valid in the given context
you set the code to invincible - the game checks "he's invincible" but then it checks "should he be?" and if the answer is "no", then it takes that from you
All right
can someone tell me how to mod hollow knight?>
listen to 56
where can I find the tools and documentation
use dnspy to open it
yeah
@tranquil glen stop capitalizing gameObject
you can 1) use dnspy to decompile and alter the game's code directly or 2) write your own libraries to be loaded with the api
what are pins?
wait should it be "gameobject"
๐ this is a pin
i thought gameObject was the player
๐
nah i didn't tho
or you're doing it in a static method
public/private/internal static hhhhhhh
big think
I just put it in sean's ModCheats thing
.GetComponent<type>()
forgot the ()
gameObject.GetComponent<RigidBody2D>().position.x
oh i put them after the position x whoops
?
did gameObject.GetComponent<Rigidbody2D>.position.y() instead of gameObject.GetComponent<Rigidbody2D>().position.y
o
I found the most useful functions in modcommon
they're unused by modcommon
i mean i could see *= x or something for a transform
Also they were using vector component index (so v[0] = value instead of v.x)which is obsolete in the version of unity that HK is using which is the only reason I even found them in the first place.
nice
i could see multiply position or subtract position or something but those seem like
utterly useless
idk
nice
are the rooms "scenes"
yes
and are they just numbers?
how do i get that?
GameManager.instance.sceneName
actually GameManager.instance.GetSceneNameString(); is better
which is just
which removes preload/boss stuff
hey 56 can you send the hook patch to modding api or should I do it?
more like did I fuck up the formatting in that file by mistake
GameManager does not contain a definition for GetBaseSceneName
nope, sean's and my post build events thing just have shittons of whitespace for some reason. well if you wanna fix that too be my guest.
to be tbh thank you for formatting that file finally
k cool now it works through different rooms as well
nice
not enough folders called avenginganglewrong for how many times I'm wrong
you should make 2 or 3 million more
wait no the loadzones are gone
after i left the room and teleported back in i can't leave
@compact sedge did you eat monomod or did my commit
understandable have a nice day
oh it has a specific version
echREE
gonna go compile a new monomod
thank
krythom did your char die
should i not be using GameManager.instance.LoadScene?
GameManager.instance.BeginSceneTransiton(new somethingsomething
example
why is github's light code scheme actually good
but the thing is GameManager does not contain a definition for BeginSceneTransition
why
why what
give dll
agony
ChangeToScene?
GameManager.instance.ChangeToScene(target, entryGate, pause);
pause can just be 0f
or something
wait
fuck
ahhhhhhh
gdi
thank you krythom
np
fuck
is there a pattern to the naming of entrygates?
top1/left1/right1/bot1
what would happen if i tried to do left1 on a scene that didn't have it?
what does LoadScene even do anyway?
load the scene
but why no loadzones
There any boss health bar mod or somesuch?
Oh well
@tranquil glen h
probably need the hero controller leaving scene thing
for loadzones to trigger
my bet is if the entrygate isn't found it probably puts you at 0,0 or something
or dies
yeah or that
ik i've done it but i don't remember what happened
but like you can call scene switches manually
yeah
and those don't have any entry gate or maybe they have as a gate whatever the last one you entered was
@tranquil glen just set the entryGateName to ""
see what happens
that or you can patch lifeblood's world navigation in
which is god btw
wait did they fix gm world nav
they didn't
ree

lemme try building with this api and if it works i'll submit the pr
uhhhh
finna connect to resharper host forever
i don't even have the new stuff refed
it's just

thank
and if that doesn't work I'm out of ideas
worked
all my refs died
but it worked
this is what i was talking about btw
except there's one where it fixes all
yeah I found that
really love the new reffing 5 unity dlls
more like 50 unity dlls
worked
with the new assembly
no .NET errors or anything

hooks doing .net 4 is fixed
by the mscorbuild ref ig
wait no
this has the old one reffed
haha no
oh how would i center the camera on the knight
FollowCamera
somewhere
why is everything async callback hell now
oh ok
annoying
idk but I think I got all the async stuff working because nobody had any problems loading save files with the modding api I built back when the gog version was the only version of GM ยฏ_(ใ)_/ยฏ
mostly by stealing that code you gave me
yeah but unencrypted saves hhhhh
oh fuck u right
not a large change tho
wait why did it rewrite the code from: Platform.Current.ReadSaveSlot(saveSlot, bytes => { data = bytes; });
do you have c# 7 disabled?
you decompiled the modding api?
yeah

does the original do it differently to be tbh
idk how the original does it I just recognize the code I wrote 3 hours ago.
even if it looks slightly different
wut why would it?
callbacks are async
so if the save loading took 5 years
you'd try and read an empty bytes array
ohshit maybe it does fail and I didn't notice
this is why async is nice
no callback hell
you can just await the function
and not get race conditions
I had no idea how do I do that?
have the callback return idk
my loaddat function is going to be dead
ech
anyways just going to write my code wrong for a sec
yeah it builds
submitting pr
ok so I can't await a void so I'm not actually srue what to do
if there's no async then callbacks are not async
huh
so if I load a save off a floppy disk it should fail?
so can you see how the base game does it
since the code in that thing is "flat out copied from the game's decompiled source" according to the comment
that's why you can get nested callbacks
which is ech
is my code nsfw
Platform.Current.ReadSaveSlot(saveSlot, delegate(byte[] fileBytes)
{
bool obj;
try
{
bool flag = this.gameConfig.useSaveEncryption && !Platform.Current.IsFileSystemProtected;
string json;
if (flag)
{
BinaryFormatter binaryFormatter = new BinaryFormatter();
MemoryStream serializationStream = new MemoryStream(fileBytes);
string encryptedString = (string)binaryFormatter.Deserialize(serializationStream);
json = Encryption.Decrypt(encryptedString);
}
else
{
json = Encoding.UTF8.GetString(fileBytes);
}
SaveGameData saveGameData = JsonUtility.FromJson<SaveGameData>(json);
PlayerData instance = saveGameData.playerData;
SceneData instance2 = saveGameData.sceneData;
PlayerData.instance = instance;
this.playerData = instance;
SceneData.instance = instance2;
this.sceneData = instance2;
this.profileID = saveSlot;
this.inputHandler.RefreshPlayerData();
obj = true;
}
catch (Exception ex)
{
Debug.LogFormat("Error loading save file for slot {0}: {1}", new object[]
{
saveSlot,
ex
});
obj = false;
}
if (callback != null)
{
callback(obj);
}
});
i guess loaddat will have to have a callback
eeeeeech
so what do I do add a busy loop?
cool if you wanna send that too I'd greatly appreciate it
private static void LoadDat(GameManager gm, int saveSlot, Action<string> callback)
{
if (gm.gameConfig.useSaveEncryption && !Platform.Current.IsFileSystemProtected)
{
BinaryFormatter binaryFormatter = new BinaryFormatter();
Platform.Current.ReadSaveSlot(saveSlot, bytes =>
{
MemoryStream serializationStream = new MemoryStream(bytes);
callback(Encryption.Decrypt((string) binaryFormatter.Deserialize(serializationStream)));
});
}
Platform.Current.ReadSaveSlot(saveSlot, bytes =>
{
callback(Encoding.UTF8.GetString(bytes));
});
}
this just gets a string tho
still rewriting the load a bit
ok so i'm going to probably make a local function
i think
Petition to rename modding api from
Seanpr, Firzen, & Wyza - Modding API
to
Seanpr, Firzen, 56, & Wyza - Modding API
tbh if you listed everyone that even did the tiniest amount of work on the modding api it would probably be everyone whose ever made a HK mod at this point.
why not just 753 and friends - Modding API

everyone knows 753 runs the modding scene
my name has the most numbers out of any of the modders, it should be obvious
wrong
oh shit
but i don't want to use excessive amounts of monomod hooks when i can just not
to be tbh I just want it to work
oh i've got it
yeet
i make a local func called w/in the callback
ez
async without await
is agony
use vsync with vwait
vsync is illegal
but is it vllegal
yes
this is literally just File.ReadAllBytes on desktop
eeeeeeeeeech
rewriting code to be consistent
is illegal
tbh this is what it would look like if I wrote it.
while ( data.length != lastLength) {
lastLength = data.length;
Math.Solve( Matrix.randomMatrix(100, 100), Vector.randomVector(100) );
}```
eeeeeeeech
this is why I'm letting you write the code
ok will do
also nearly finished unencrypted saves again
there any new mods yet?
no
first new mod will be woke mod stay tuned
why the capitalizatioN
@compact sedge whomst
mason what do the numbers mean
does any of this look bad
pushed it
@compact sedge is this u https://github.com/natis1/HollowKnight.Modding/pull/1
also if you wanna see callback stuff i updated qol https://github.com/5FiftySix6/HollowKnight.QoL/blob/master/UnencryptedSaves.cs
@compact sedge wtf
your loadgame thing is like
wrong params
i don't think it'll ever even get called
that's why it didn't break
probably
brak
ur mum brak
oof
Hitless panths doesn't do anything. There were plans for it but they got scrapped.
@solemn rivet
I guess some code for it is left over
why is getsavestatsforslot bad too
re
does anyone have a vanilla lb assembly
nvm found one
death
sorry 56 was ordering a pizza. I'll figure out save stuff in an hour or so
what kinda pizza
ok
I was eating pizza that I ordered. but if you're gonna do it I would love that because I'm a lazy asshole that just wants to start working on his arcade mod
everything is dead
fml
there are more callback things
do you ever want to die
right when you sent that message
i wish i either had pizza or was dead
what was broken for more saves
pretty much 99% of the time tbh
same
it didn't work
thanks
np
iirc tc put some extra stuff in save checks, so if it thought it was out of bounds it just failed
but it's in GameManager
hhhhhhhhhhh
oh namespaces and assemblies
i'm dumb
they removed getsavefilename
which wasn't being used in lb anyway
apparently
I love switches
salt and sanctuary dev irl
The true crime is java
thoughts on
I don't like it
rip
java has passable gui stuff built in
We can individually make stuff public if it's super useful
But idk it just seems bad to make everything public
I don't know if he ever fixed the MonoModPublic attribute but if not it's super easy to make your own
alright
@rain cedar I've attempted to fix it, and it worked for me.
do you have a bot that pings you every time someone says the word MonoMod?
Making everything public is risky, but it's an option I had to add for someone else in the past
@compact sedge I wish ๐
Unfortunately selfbots are banned on Discord
if I say MonoMod 3 times in front of a mirror I suspect you will appear
@ MonoMod should be possible now
Anything else I missed that you need fixed / added in MonoMod, while I'm here?
what the fuck
patching this class breaks a dll which isn't even c#
thanks hk
moresaves now half works i think
nope nvm
patching any platform breaks UnityPlayer.dll
good dll
@ wilbo#2948 why does unityplayer.dll suck
runtime detouring it might actually be easier
disgusting
my file manager has outputfinal from HollowKnight.Modding pinned
'mild'
even tho i pinned the other one
idk why
also gradow shut
i love deleting a file with code that i wanted but wasn't able to use cause i was copy pasting the wrong dll
really makes me want to die
so uh what's the difference between doing MonoMod Assembly-CSharp and doing the hookgen?
and does the former still let me do hooks and if so how?
Technical question: how long is an ingame 'tick,' I want to work out how long it takes to kill Grimm with defenders crest and I'd like a dps value
uh the g ame runs at variable framerate and some stuff is updated in variable way but all the physics and stuff is 1/50th of a second... mostly
defenders crest is my favorite physics item
anyway I'm asking because your pr for ModCommon used HookGen but your one for the API doesn't.
oh
If it were 50* per second it would be 100dps
effort
send saving fix pr?
eecch
more saves tho
lemme try and fix it for like 10 more min
wow nice uimanager doesn't exist so neither do the hooks
wonderful
huh the new hooks assembly is barely too big to upload to discord
it compresses to 2.2MB as a zip without any special settings
does it tho
so uh is Update for monobehaviors run every frame or in a fixed update?
important question I guess and probably one I should know the answer to
Update is called every frame, if the MonoBehaviour is enabled.
thx
moresaves might not be working now cause it has old refs
wonderful
wtf
it didn't monomodreplace
Now taking bets on how long until 0x0ade shows up
tbh they must be asleep or they would have said something
rebuilding and hoping it went away did not work
oh my god rider has spellcheck now
to be tbh you have no idea how much I needed spellcheck in my life
I did turn it off for comments because they aren't being compiled into the binary so nobody will see them unless they read my source code and nobody reads my source code for fear of eye cancer
Do you have a MonoModPatch attribute on the class?
Looks like the thing from the journal entry for interacting with the you statue
i was asking in discussion and someone was saying there is no other place in the code so its fake
no I donโt have a monomod patch attribute on the class
there would be either an item prompt, some dialogue or an image showing what you got (such as when you pick up an upgrade)
The cutscene you may get at chance when dream nailing Godseeker?
we know there's no item prompt or dialogue by checking the language files
we only need to check if there's any new pick up animations
So its just a chance @thorn comet
Yeah it happens by chance when dream nailing godseeker
Who sent you that pic?
it was in discussion before i went to bed
didnt get a chance to see what it really was
Wait simo there's just a random chance when trying to enter godhome you'll just be sent some garbage place and lose time?
Or do you mean something else?
Because that's fucking stupid
lol if you could do this inside godhome could you use it to escape godhome in that one new gamemode?

Yeah a random chance when entering Godhome
omg
wow nice
Thats dumb af
that's awful
do you need any charms or beat any panths?
Whats the chance?
maybe you need to have gotten to the void statue first?
or could it happen the first time
Hm cant remember off the top of my head
menderbug chance
I think its always possible
smh
graig why
also, thanks for the reply about the no-hits panths
that was bothering me
i saw someone say you may need Dream Wielder equipped
I think TC decided it was too much. I would have put it in though lol
oh so no hit panths were a thing at one point?
Early on
were there any big bonuses for it or it didnt get that far?
Is my understanding of the situation anyway
It was just gonna give the golden thing the all bindings does now, I think?
monstah will do it
I got to sly once, that's my best run on panth5.
oh yeah, there's monstah
It takes so long tho haha
y don't u do it ptk
i havent even done p5 normal
persona 5
I was hearing that someone else had already done it, but I dunno...
also havent done persona 5
scrub
Yeah I have heard it's been done already
well
But when I ask for proof... There is none
but it takes 8 days at least so that isnt possible
which I also did
First one to do it with a video, that'll be hype
It was someone in discussion just saying stuff as far as I've heard
so if cheating counts, me and veru did it two days ago


Make sure the gold works
gradow and veru
rip
Tc had a cheat where everything dies in one hit
wow are tc casuals
tbh my biggest disappoint with this is how underused Land of Storms is
Still in the code?
such an interesting area
It like sets their HP to zero when you hit with anything
mick there's a cheat function in the code iirc
It might still be in the code. Wouldn't surprise me heh
Yeah. So we could maybe activate it with glitches ya?
๐
uhh not likely mick
I mean yeah. Not likely.
Imagine that though haha
But hey, it's in there
unless you did some SMW arbitrary code execution shenanigans
yeah
Command line arguments
There is some cool cheats too, but debug mod does a lot of them too
no way you're getting that by glitching
The only other case for enabling cheats is Debug.IsDebugBuild
you can possibly achieve some glitched state with similar effects, but...
So hope they release a debug build I guess
like, you can maybe glitch the hitInstance of the nail to always do absurd amounts of damage, or something
so it bypasses the 13 limit
like when veru accidentally set his geo to max int
Wait what
and proceeded to break bonfire with it
Howd he do that
Ia there a vid of it?
Rip
iirc what actually happened was that he got like 999 levels on each stat on bonfire
and refunded those
so he had infinite geo
Lol
I think there was a video of that
found it
it was a room dupe Kry
Due to a room duplication glitch, I now have far too many levels in Gradow's Bonfire Mod (found here: https://github.com/Ayugradow/bonfire-mod). What ensues ...
found a strange audio bug to do with the volume settings
some stuff ignores volume settings
im just getting some loud noises when I break grass if my volumes are all set to 5, if they are all on 8 for example it doesnt happen
same with grass
In game sliders don't work
But he said grass
For some things
oh
Wtf you mean "same with grass"?
Lol
ok ModHooks.Instance.AfterSavegameLoadHook doesn't work on GM I don't think
fix
idk how
Good
ok so the sliders just arent working properly? and keeping sound too high?
Put them all at 10 and use your system volume slider
ok, just never noticed it before the dlc and had never changed my volume so thought it may have been new
Nah. Been an issue since release
happy to report the new game hook still works
Oh, the bonefire mod. Does it work on the new update?
no
๐ ฑonefire
welp this means ALL my mods are broken on GM because of this one hook being broken
๐ ฑ 1โฃ ๐ฅ
guys does anyone know how to make a mod for the godmaster update?
I mean does anyone is a vague question, maybe someone at TC does
also all the mods that worked before gm won't work anymore
or at least like 90%
cause unityengine
debug mod works w/ recompiling
does api exist
make it exist twice as much thanks
ok
also I guess I'm gonna keep the api on my github now cuz why not
enemyhpbars works tbh
damn, i never actually tried bonefire, i thought that this was a ood time to do...
I tested it on gog-early
w/out recompiling?
cause moresaves died cause it couldn't ref monobehaviour i think
๐๐ฅ
strange
well moresaves is fucked anyways
they changed a bunch of stuff w/ saves
might've fixed it tho
ok i have no idea why this isn't actually hooking
fantastic
Do it better

๐
nice
But I said that and you said it wasn't the problem
woah it actually shows that now
Also while you're doing all the api fixes can you change the api version to 45 or more? Or heck change it to 56 for memes.
actually don't do that because it can only be 56 once.
so make it 56 for a really good version

Change it back to 2
yeah moresaves works now i think
56.2
56.56
ok so the moresaves ui is fucked
but it's still functional
i'd call that a success
that's an improvement over the opposite I'd say
@leaden hedge the api fixes it now
.
also moresaves' ui died
cause they changed save slot showing
@compact sedge https://github.com/natis1/HollowKnight.Modding/pull/2
is this u
*save name hook
awesome thanks
why does the ui manager like
never exist
api still breaks radiant fights
:ech:
i think it just instakills you in a radiant fight'
lemme fix it
is this the smartest code alive
get 10000 hp
easy radiant
tbh infinite grimm onehit code:
private static int oneHitKill(ref int hazardtype, int i)
{
return 999;
}
HeroController.instance.Die();
return 0; better cmm
therefore radiant NKG is 10 times stronger than infinite grimm one hit mode.
now you can carefree melody infinite grimm
smh
wait you can carefree melody radiants
why
carefree melody radiant nkg
you can't carefree melody infinite grimm dungo because you can't do infinite grimm if you have carefree melody.
unless you're a dirty cheater
save edit
if you're gonna cheat then there's literally nothing I can do to stop you from breaking infinite grimm.
you could save edit your health to be 1200000
make infinite grimm an option in the pantheon when
nope
why
banishment people don't deserve it.
but also like IG hardmode has death walls and they added those to the vanilla game by making the sides places you can fall off.
for the NKG fight
just make it load the original scene in the menu option
ez
also wrong
the falling off is better than walls
if you get cornered you can just
jump off and djump and then shade dash back in
oh true
but also yeah that's how I'd do it is load the original scene so I don't need to rewrite my amazingly awful anti-lag code.
but is the gm scene naturally less laggy
stay woke
i'm gonna add lost lord and mantis gods to the pantheon cause it's so convenient
it's wonderful
I'll add it eventually I guess but combo mod is my number one priority.
can u don't
I won't use CP2 to beat panth 5
:cornywokest:
also uh IDK how the flowers work
but I wanna make it so you can give the radiance a flower
the normal radiance
not absolute
so I'm making 3 endings, two of which are pretty similar (just like my first 3 endings). Fixing the really weird dash invulnerability storage that greymoth has that triggers about once every 8 hours and I have no idea why. adding particle systems to every fire attack and making the napalm particle system look better. And reading through every bit of GM lore.
oh and testing to see if my redwing binding code actually works
in theory it makes you very weak with all the bindings
well compared to normal
not lifeblood
but seems like good ideas for hooks since you're the new modding api maintainer who refuses to let me do any of the work.
ur too slow
more like I can't code for shit
What OnTakenDamage is from the API not the vanilla game
holy shit there is
yes that's literally what i took the picture of
is HK getting its own modding api built into vanilla?
and asked when tf it got added

@solemn rivet this is what was scrapped ig
there's one for all bindings no hit too
also i'm surprised this is in code
nice for once
ech
I don't blame them for removing that. I remember talking with dl about balancing IG to compensate for stutters and other things and I came to the conclusion that when it comes to endurance gauntlets, making individual hits less punishing but harder to avoid was generally better design.
wtf
this is why qol was being weird
i bet
reeeeeeee
they're actually using events
and have some actual code
this is nice
ok well I'm going to sleep. Send more PRs I guess and if you find any bugs with the api that you're too lazy to fix let me know and I'll try to look into them.
ok I'll take a shower and if no PRs when I get back then I'll accept them tomorrow.
I take slow showers
so take your time to make it look nice
