#archived-modding-development
1 messages · Page 37 of 1
public static string GetCallerName([CallerMemberName] string name = null) => name;
public bool EnemiesPanelVisible
{
get => BoolValues.ContainsKey(GetCallerName()) ? BoolValues[GetCallerName()] : true;
set
{
if (BoolValues.ContainsKey(GetCallerName()))
BoolValues[GetCallerName()] = value;
else
BoolValues.Add(GetCallerName(), value);
}
}```
Went ahead and made this stuff even more easy to copy/paste than it already was
oh, that's clever, nice
Get and set both call that function twice, though
No idea how expensive that is
Maybe I should cache it
Or just grab it once, I mean
Not really caching it
get { string caller = GetCallerName(); return BoolValues.ContainsKey(caller) ? BoolValues[caller] : true; }
?
maybe
Ah ok I found the answer to how it works
CallerMemberName just gets compiled to a hard coded name
So it shouldn't be expensive at all
Might as well just keep it as is
cool
This is actually a really good answer here: https://stackoverflow.com/questions/16053079/does-callermembernameattribute-use-reflection
I think that's the first time I've seen someone show the IL code for something
yeah, i've not seen that on SO before, but that's a really good way to explain it
i wonder then...hmmm
if I added say, GetString([CallerMemberName] name = null);
public string MySetting { get => GetString(); set => SetString(value);}
Oh that's smart, I can make this way more compact
yeah, but i'm thinking i add this to the ModSettingsDictionary class so that it's just baked into the IModSettings class, then you don't have to even worry about it.
There is a downside to this, though
You can't nearly as easily set default values for everything
actually, that's trival too
just change it to this
public string GetString(string defaultValue, [CallerMemberName] name = null) {
return StringValues.ContainsKey[name] ? StringValues[name] : defaultValue;
}
public string MySetting { get => GetString("Hi"); set => SetString(value);}
hmm, callermembername is .net 4.5, guess we'll find out soon enough if a mod compiled under 4.5 will work on HK
Ah yeah guess I should check that before continuing too far
Works fine
Oh awesome the UnityEngine.KeyCode enum has stuff for controllers too
Woo not having to do extra work for controller support
if you pull up your dll with dnspy, what does the GetString function you added look like decompiled?
oh, derp, i need to look at something that uses it, not the function itself
Hang on
It's just completely replaced the CallerMemberName with hard coded strings
{
get
{
return this.GetValue(true, "EnemiesPanelVisible");
}
set
{
this.SetValue(value, "EnemiesPanelVisible");
}
}```
yeah, i'm just checking to make sure this "hack" of 3.5 works. I can't compile the API in 4.5 because Assembly-CSharp is 2.x. So i have to output in a compatible version, however, turns out, if you add the attribute
to the assembly
the compiler will still use it
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Parameter)]
public class CallerMemberNameAttribute : Attribute
{
}
}
just had to add that
Weird that that works but whatever
and it behaves just like it should, (strings get replaced like your example)
yeah, you don't want to accidentally try to use some 4.5 nicety only to find out it doesn't exist. Maybe we'll get lucky and when they do the hornet DLC or something they'll upgrade unity to something newer
If you're adding that to the API though I think I'll just wait for you to have a release of that before switching so we don't end up with a duplicate attribute definition
Compiler seems to have also changed all the stuff like this
(int)Keycode.F1
into just numbers
Hopefully nobody has to modify this in dnspy ever
yeah, enums are just ints in discuise
yup
The only thing I'm not sure of on this is if I should bother trying to get proper controller button names from the keycodes
I mean seeing that your bind for the help menu is "Joystick1Button6" is obviously useless
But I also have no idea how to get proper names
i wonder how kdt did it for moresaves
There's also the problem that half the stuff on controllers isn't even buttons
yeah
Alright I think I figured out a solution to one of those problems at least
if (GameManager.instance.inputHandler.activeGamepadType == GlobalEnums.GamepadType.XBOX_360)
note that the ps4 one i think registers as "generic controller"
maybe...
or wireless controller, something
Joystick connected ("Wireless Controller").
though honestly
as long as the buttons are in the same place it doesn't matter
Yeah
I think I need to make my own key enum for the controller stuff because of triggers and stuff
Maybe I need to save strings instead of ints for the keys, I dunno
Modding API 1.2.2.1-13 (ALPHA) - Most functionality is still unchanged, however the new helpers have been added to IModSettings. Also this is now built in 1 step with only 1 minor edit in dnspy required after build (which I think is fixable with a change to MonoMod, we'll see what the author says). Also, now should give intellisense comments on all the stuff in the hooks in VS out of the box.
Sounds neat
Do I just stick the XML in the game folder for intellisense stuff to work?
yeah, it just needs to be in the same place as the dll. VS always looks for "AssemblyName.xml" if its "AssemblyName.dll"
sometimes VS intellisense won't auto update, in which case deleting the .vs folder in your solution and restarting VS will clear the cache and have it rescan
obviously it only works for stuff that we add (since it's based off of the /// stuff), but it's better than nothing 😃
ah, yeah
VS 2017 makes some really dumb suggestions
you can change your preference, but it actually will make suggestions in both directions I think
so if it's currently an expression body, it will suggest block body, and if its a block body, it'll suggest an expression body
You're right, it does
@buoyant wasp Dash just does the animation in place with this API
No mods hooking it
Ah here's your problem
You changed the Dash function to look for null instead of Vector2.zero
But that's still being returned from the hook
ah
so just need to change the hook to do
return _DashVectorHook?.Invoke();
my plan once things are all stable is to make a mod who's entire purpose is to have every single hook in it so that it's easy to test all of them quickly
Funny thing is that in this case having dash hooked would have fixed it
Oh nice, that looks really cool
it's generated by docfx, it needs some cleaning up and whatnot, but it's designed to work on something like github.io
so it builds it based on the source/xmldocs/etc + whatever other static content you want to serve up
also, dang just realized how late it is
at some point i should see what happens if i try to run this single build process on the gog version of the game
or the *nix version
hello i have decided to try a mod
does it automatically enter my game or do i have to do something
blackmoth
Did you finish that tutorial thing Wyza?
On installing mods?
finishing requres starting, but no, not yet. this weekend, i promise
Was that even you that said they were going to do it? Lol
yup
Lol. K good. I'm not mistaken
just currently obsessed with the API for some reason 😃
ok
:P
goodnight stranger
throws Wyza under bus and runs away
oh nose
@rotund karma depends on the mod. the blackmoth one is probably drag and drop
from there anyway
it's literally a zip file, that you unzip and copy the contents of which into your games installation folder. It will overwrite some files, and your game will be modded
oh ok
that said, blackmoth from moddb is pretty out of date
I'd suggest looking at the pinned messages in this channel
it has a link to a google drive that has alot of mods including that one
you'll want to:
alrighty
- Go into the "Modding API" folder and download that and unzip its contents into the game's directory. (for your game's version)
ok
- Go download the blackmoth mod from the drive and do the same
alrighty
that's it, fire up the game, and if everything went well, you'll see in teh upper left hand corner the versions of the mods installed
you can beat the radiance and say you beat it with no damage
winning while cheating isn't winning
it is if no one knows you cheated
But you just told literally everyone here you're cheating
im not actually downloading it
yeah, no, i'm too tired and grumpy to really have a non-pissy answer to that kind of argument
You should sleep soon
i have decided to get a boss rush mod instead of blackmoth
You can use both
yeah but im getting boss rush first
indeed, afaik, they have no incompatabilities 😉
anyhow, i'm off, much progress made today. i see the light at the end of the tunnel. it might be a train
nevermind i cant do the boss rush mod im using a later version
See, this is exactly why I removed version numbers from randomizer and debug
It'll work fine still
im trying the scale mod now
since i run 1.2.2.1
smallboi
i wanna beat up every single boss in the game no
now
i already beat it so you cant say its cheating i already know what happens
hey hows it going
@buoyant wasp Global settings are saving here
Missing a \\
Global settings are also not getting loaded properly
I really don't get what's going wrong here
After closing the game the global settings file has the right stuff
This doesn't break anything
SaveGlobalSettings();
GlobalSettings = null;
LoadGlobalSettings();```
And yet if I relaunch the game the settings file is empty again
Nice
got super lucky
not really super lucky
but like
sup lucky
super without the last 2 letters
i just beat hornet in a fast time
@rain cedar hello can you please explain your debug mod
and is it available for 1.2.2.1
alright thanks
SaveGlobalSettings();
GlobalSettings = null;
LoadGlobalSettings();```
wh
Globalsettings is weakly typed?
what happens if you exclude each line and keep the other two?
What do you mean by that?
Exclude each line but keep 2?
Also GlobalSettings is this:
public TGlobalSettings GlobalSettings
{
get
{
TGlobalSettings result;
if ((result = this._globalSettings) == null)
{
result = (this._globalSettings = System.Activator.CreateInstance<TGlobalSettings>());
}
return result;
}
set
{
this._globalSettings = value;
}
}```
private TGlobalSettings _globalSettings;```
oh you want to save the keybinds into the json file
Keybinds and some other stuff, yeah
but every time you do load() the file empties itself?
No, the file only empties itself on game load
It's fine after closing the game and after loading while it's running
you running any other mod?
Nah
seanpr which folder are you talking about in the readme
when you download it there's a readme in the zip 😄
I dunno man, it's been like a month since I wrote that
Probably the game install folder
Try reading the bit before that
Ok then what's the problem?
Well now it'll ask to overwrite even if you do it wrong again
Since you already copied the stuff in
Only the api will always ask about overwriting
If by that you mean something you can type commands in, that doesn't exist
If you just mean the debug output console it's F4
Or F3
oh ok
I can't remember
by loading while it's running you mean, if the user makes changes while the game is live, as long as the game stays live the changes stay and the file remains updated
same for close
but if the user opens the game the file clears
I mean I can arbitrarily call load during gameplay and it doesn't clear the file
you have load() running as part of the init process when the game starts?
what happens if you, say, put a time delay on it
The mods are loaded well after the game has fully loaded, anyway
It's some time around when the main menu loads
The problem is probably with the API, though
Just not sure what it is or I would fix it
get
{
TGlobalSettings result;
if ((result = this._globalSettings) == null)
{
result = (this._globalSettings = System.Activator.CreateInstance<TGlobalSettings>());
}
return result;
}
What about it?
i'm trying to figure this out
so when you do load() it presumably runs this part of the code
Nah, load is this
public void LoadGlobalSettings()
{
bool flag = !System.IO.File.Exists(this._globalSettingsFilename);
if (!flag)
{
base.Log("Loading Global Settings");
using (System.IO.FileStream fileStream = System.IO.File.OpenRead(this._globalSettingsFilename))
{
using (System.IO.StreamReader streamReader = new System.IO.StreamReader(fileStream))
{
string json = streamReader.ReadToEnd();
this._globalSettings = JsonUtility.FromJson<TGlobalSettings>(json);
}
}
}
}```
double negatives
Yeah, I'm assuming that's a result of this having been put through a compiler and a decompiler
I'd give you better code but wyza hasn't pushed this to the github yet
This is API stuff
i honestly cannot get this debug mod to work
im probably like retarded or something
You installed the mod API, right?
What?
That's not the mod api
what the fuck
Read the file name
[api]
Meaning it's a mod that uses the api
Same google drive folder
it can't be the function's fault then cause all it does is read, it looks like
what happens if you, say, comment out the write function? what happens if you uninstall the API?
like you have a functioning file and you /* out SaveGlobalSettings() in the API
does the file still get wiped?
The only time I'm calling save is game quit
I don't think the file gets wiped immediately on game load, just no settings are loaded
So it's wiped when I save on game quit
You're right, I don't actually see that
So it's failing the check for the file existing somehow
well you can always put another line outside the if
that way you can tell if it's the filecheck fail or the function not getting called
I can't, actually
Something wyza has done makes dnspy fail to compile literally any change to the dll
!
And he hasn't pushed these changes to github
can you not do System.IO.File.Exists(this._globalSettingsFilename); in your mod
like base.log(System.IO.File.Exists(this._globalSettingsFilename));
when you do load() at any arbitrary time does it successfully load the stuff in the file into memory?
if it does then i think it has to do with the specific time you call load(), maybe. like try a 10 second delay, then load() and see if that works
I don't ever call load though
public override void Initialize()
{
this.LoadGlobalSettings();
base.Initialize();
}```
base.Initialize() is the entry point for my code
I just added my own call to LoadGlobalSettings immediately in Initialize and it worked, so I guess that doesn't do what it's supposed to
Or maybe I'm just misinterpreting this completely
I think the problem is actually in the mod loader code
It's checking for Mod and Mod<T>, but not Mod<T1, T2>
So I guess instances of Mod<T1, T2> are being initialized as Mod<T>
Meaning the full stack of inherited Initialize functions don't run
I could also be completely wrong here, though
I have basically no experience with class inheritance
i was supposed to learn it properly in my A level class but i kinda forgot about it after the exam because i'm not really a good programmer at heart
read: trash
hello
are there any hotkeys for debug mode?
I installed it but nothing and the readme doesn't tell me what to do with it?
did you install the API as per the readme?
I'm pretty sure I did
so the folder
DebugMod should be in Hollow Knight folder
or HK/HKdata/Managed/Mods
oh
I'm also on
1.1.1.8
mmm... there might be an old copy of the mod/api kicking around
unless you're talking about mod version
oh right
I already installed the modding API on a different version
so it completely slipped my mind this time round
let's see if that works
I can't load my save???
whaaaa
ah
well
when you go to the drive for debug mod
on the right there's a bar
click Activity, scroll down, there's a 1.1.1.8 mod vsn
try that and see if it works
as always back up your save first
I don't see anything like that
I don't even have a bar to the right
nevermind found it
ok it works.
thank
@rain cedar same thing was happening with mod-specific saves before. They would work fine up until closing and reloading the game, at which point they would reset
Wyza had fixed that, dunno how
@buoyant wasp this is how moresaves gets the icons and input states
InputHandler ih = gm.inputHandler;
if ( lastSkinType != uim.uiButtonSkins.GetButtonSkinFor(ih.inputActions.paneLeft).skinType )
{
MoreSaves.rectLeft.sizeDelta = MoreSaves.rectRight.sizeDelta = uim.uiButtonSkins.GetButtonSkinFor(ih.inputActions.paneLeft).skinType == ButtonSkinType.SQUARE ? buttonKeyboardSquareSize : buttonShoulderSize;
MoreSaves.imageLeft.sprite = uim.uiButtonSkins.GetButtonSkinFor(ih.inputActions.paneLeft).sprite;
MoreSaves.imageRight.sprite = uim.uiButtonSkins.GetButtonSkinFor(ih.inputActions.paneRight).sprite;
MoreSaves.textLeft.text = uim.uiButtonSkins.GetButtonSkinFor(ih.inputActions.paneLeft).symbol;
MoreSaves.textRight.text = uim.uiButtonSkins.GetButtonSkinFor(ih.inputActions.paneRight).symbol;
lastSkinType = uim.uiButtonSkins.GetButtonSkinFor(ih.inputActions.paneLeft).skinType;
}
if (ih.inputActions.paneRight.WasPressed ) //key was pressed
and if you added a new PlayerActionSet to the modding namespace you could probably do (although I haven't tested it at all)
//this would happen in game init
string keybinds = loadKeyBindsFromFile(fileName);
ModHooks.ModActions.Load(keybinds);
//this would happen on mod init
if( !ModHooks.ModActions.Contains("A Press") ){
PlayerAction pa = new PlayerAction("A Press", ModHooks.ModActions);
pa.AddBinding( new KeyBindingSource(Key.A) );
pa.AddBinding( new DeviceBindingSource(InputControlType.Action1) );
}
//update loop
if (ModHooks.ModActions.GetPlayerActionByName("A Press").WasPressed)
ModHooks.Logger.Log("A was pressed");
//on quit or save
keybinds = ModHooks.ModActionsSave();
saveKeyBindsToFile(keybinds, fileName);
@buoyant obsidian Is the max completion percentage for lightbringer not 106% on CP? I only got to 99% and I'm pretty sure I got everything done
do the 7 dream warriors not add a percent b/c they respawn?
That should be patched after lowercase fangs patch
ok
so how do you install the mod?
i downloaded boss rush but i'm not really sure about how to continue
okay
first you need to download and install the modding api
it's in the google drive as well
to install it, just drag and drop whatever is inside the .zip in the root folder of your hollow knight installation
also, I don't know if this is common knowledge or not, but it seems the Modding API is not platform-specific
I'm playing boss rush on drm-free ver as we speak
@solemn rivet bonfire mod API version on the GDrive is formatted incorrectly
the mod dll is inside a folder named Mod instead of Mods
unless that still works for the api and I'm being dumb 🤔
do the levels save
from 1.2.2.1-7 onwards, yeah
hey uhh @solemn rivet
i have a hunch this isn't intentional
what is this like the 5th bonfire mod break i've done
I had the same thing I think when i messed around for a bit
where is my credits mention 
infinite swing speed balanced/10
well at least steady body has a use now
how in the hell can you button mash so fast?
also, yeah, that's a bug
but that a porting bug
You can do it on controller too. you just gotta get thicc thumbs
i use my middle finger for attack

that was supposed to be hollowface but it still works

pogo timing? more like spam attack
my middle/index fingers are probably the easiest for me to spam with
Thumbs for me
man you really notice the knockback when you swing infinitely fast
hitting fool eaters doesn't knock you back for example
imo a mod that makes holding down attack spam attack instead of nail arts would be nice, then have another button for nail arts
try this
excuse me why would i unbreak the game
because I'm nice and haven't implemented anti-cheese for you
or you keep forgetting to 🤔
no
it's simple
I simply count how many relics there are and that give's me a limit to free levels
and I add a conditional check for free levelling that checks how many free levels you got versus how many there are
and if you try adding more than there should be, it does nothing
it's easy
but I'm lazy
yo i counted the relics, there are: 999 wanderer's journals, 999999 hallownest seals, 9999999999 king's idols, and 9999999999999 arcane eggs
and I figure if you really want to break the game, then, by all means, do
also, I'm gona remove relics as free levels on a later patch
they make the game SOOOO much easier
there's like a red ring and small flames
yeah, that's intended
"it does?"
if (this.crit)
{
pd.nailDamage = ls.CritDamage(Settings.DexterityStat, pd.nailDamage);
PlayMakerFSM.BroadcastEvent("UPDATE NAIL DAMAGE");
spriteFlash.FlashGrimmflame();
}```
should the grimmflame effect trigger every hit?
before TGT I had created my very own spriteFlash, but since TGT added a few new ones, I decided I'd just use one of them
well, it triggers when you crit - that's why you flash red
yeah but why is there the red flash when you parry
but I didn't know it interacted with parries
when does that happen in grimm/NKG fight 
dunno
try critting while pogoing
for science
I'm thinking that it has a different interaction for each kind of attack type
what
the game is so much better with those bugs
also crit slashing while getting hit plays the crit parry animation too
there's like a 70% chance I'll parry an attack while spamming
knockback from hitting an enemy stops your dash
what do you mean? With sharp shadow?
no like normal dash
if you're dashing and slash an enemy the dash stops
so you can dash like
half a player width
steady body acquired
so apparently you can parry contact damage
and that's why the flames pop up when you get hit
you also don't take damage
even though the sound plays
no
I looked here
that's another API issue
those flames are from the "hit resistance"
it's somehow getting activated - except it doesn't get activated
also, it stopped working completely
the hit-resistance, that is
the new api is still experimental
I'm trying to see if I can fix it
also, can you please send me your version of the mod?
I wanna take a look at something
thanks!
hmm
If I want the Lightbringer mod, do I need the launcher?
no
alrighty
Manual instal or patch? and which of the most recent versions? one of them says DRM free
Moddb has the latest version of Lightbringer
Google Hollow Knight Lightbringer mod
drm free is for gog/humble
@buoyant wasp getting this while testing Bonfire on newest APIcsharp Unable to move save game to backup file: System.IO.IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path: at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x00000] in <filename unknown>:0 at GameManager.SaveGame (Int32 saveSlot) [0x00000] in <filename unknown>:0
alright so do I put the mod in manually or is it automatically forwarded to where it needs to be?
yeah, newest API broke a lot of things
jeeze, i got to sleep and come back to 100 million messages
does anyone know if I need the API for Lightbringer?
lightbringer is not an api mod, no
where do I put it in the files?
in fact, lightbringer basically uninstalls the api mod
you install it just like every other mod i believe, pretty sure it's just a folder you drop into the HK install folder
the what
is your game from steam?
oh
idk then, would have to ask @buoyant obsidian if there is a mac version
because the dll's are different between PC and Mac
wyza, there were a few issues with the new api ver
so I guess I delete the Lightpringer.zip
I took a look at the way TakeDamageHook is set up and how you redefined the TakeDamage method and, theoretically, moving the hook from AfterTakeDamageHook to TakeDamageHook should work
afaik, the slashing issues were my fault
I accidentally set it so your slash speed increases everytime you swing your nail
ah, cool
ok, so
oh, i see what happened
i was gonna handle the take damage thing differently and forgot
oh
still, I have no idea how it doesn't work
also, it works on GOG version
so that's good
the API, I mean
so other than take damage and global settings, anything else broken?
dashing is broken?
oh, right, yes,
sean found that, i fixed it, just hadn't posted it
what
as far as the savegame backup file thing goes
i'm pretty sure that's a bug in the base game. cause the api isn't changing that part of the behavior
i'll see if i can fix it since i'm rewriting the method anyway to put in the stuff
what about no healing 🤔
hmm
i'll look
lol
that video is great
is healing broken in all mods or just bonfire?
no idea
restarting the game didn't fix it
i could try uninstalling bonfire w/ api still on if you want
Has anyone made a mod that allows you to get your OC ingame yet?
OC?
original content
ok, so it works without bonfire, so lemme load up bonfire
no one has done it not because it can't be done
but
because it's such a royal pain in the butt to do
though we're making progress on some things
inventory is going to become fully moddable soon™
hmm, nope, healing works fine in bonfire too. at least on the version of the API i'm running
lemme package this up and you can try it with the newest version
Is there a way to easily replace textures?
So if you wanted to just replace the MC textures you could get your character in game?
spritesheets, yes, but it's manual. (and the sheet is randomly reorganized every time a new release comes out). I think @leaden hedge said you could define a new spritesheet and replace the call to that instead
the easy way is called replacing every sprite by hand
753 was hand changing it for every lightbringer release
which sucks
as far as level assets, idk we've tried that
you'd have to create a spritesheet, and create animations which match the original ones in length and no. frames
level assets would be way easier to change because they're generally not animated
Modding API 1.2.2.1-14 (ALPHA). Fixes the save game backup error message (though I am pretty sure this is a vanilla bug). Fixes dashing being broken if you have a hook on dash. Fixes The TakeDamage hook so bonfire resilience should work.
@solemn rivet - btw, we added some helpers in the newest version for the settings which should reduce alot of that boilerplate you had for handling settings.
instead of
public int StrengthStat
{
get => IntValues.ContainsKey(nameof(StrengthStat)) ? IntValues[nameof(StrengthStat)] : 1;
set
{
if (IntValues.ContainsKey(nameof(StrengthStat)))
IntValues[nameof(StrengthStat)] = value;
else
IntValues.Add(nameof(StrengthStat), value);
}
}
you can do
public int StrengthStat { get => GetInt(1); set => SetInt(value); }
where the 1 above is the default value to return if StrengthStat had never been set
healing's still broken
what version of bonfire are you on?
uhh the one in the drive
k
maybe INT -> focus cost messed something up
could be that
i also don't get the extra masks from resilience stat anymore
in bonfire there's code that changes the StartMPDrain method
maybe that's not working on the newest API?
RES is at 5 but i don't get the 4 lifeblood HP when i rest 
what do i need to do to make that take affect, cause at least starting out, i can go get hit, then heal and it works, so i'm guessing i have to put a point into something?
bonfire mod is trying to kill me
also i got to lurien without dream nail kms
my int is at 21 but ok
can you send me the save file?
danke
or...Спасибо ? (based on name/flag)
(i just asked google, so, if it's wrong, or you're not russian, then i apologize)
yeah, but with complicated languages (like english/russian/japanese) I've seen alot of weird stuff over the years
Lol
Also with languages that have endings like latin it's sometimes impossible for one word translations to be entirely accurate
Worst thing is, when someone corrects a word/sentence in google translate but corrects it with accent-specific words
nope
oh
what version of the mod are you using?
because mine seems to stay even after I leave the bench
drive version
also geo cost to level up resets to 50 sometimes
for me it's resetting everytime
but I also believe it's an API issue, because it was working perfectly on older versions of the API
you using the version of the API i just posted?
yes
yup no
so
one thing i've noticed is that you have some inconsistencies in your naming
@solemn rivet
public int FocusCost() => (int)((float)ls.FocusCost(Settings.IntelligenceStat) / 33f);
so that says it uses the intelligence stat
but ls says
public int FocusCost(int totalWsdm) => (int)Math.Round(34.0 * Math.Exp(-0.01 * ((double)totalWsdm + 1.0)));
so it's using the int stat
but you seem to think it's wisdom 😉
i don't think that's the root cause
eh
cause it works out the same
yeah
https://gfycat.com/ClutteredNiftyAmericanblackvulture its coming along 
charms should be almost no grunt work though
as its in a neat grid, and theres no conditionals
unlike the inventory
what's wrong?
go here
Console.WriteLine((int)((float)(int)Math.Round(34.0 * Math.Exp(-0.01 * ((double)21 + 1.0))) / 33f));
run that
you'll see why 😉
casting back and forth between int/float/double is causing you to end up with a focus cost modifier of 0
yeah...
can i be lead breaker now
that whole operation should add up to 33
but it's getting 27
and hence Round(27/33)=0
i'm not really sure why the API has the focus cost handler as an int
ROUND(34*EXP(-0.01*(B4+1))) in excel it works fine
the focus cost in the game is a float
so....
i think i'm gonna chant it to that
it'll break mods that use it, though i think bonfire is literally the only one
wait - 21?
I can change it to float
makes WAY more sense
(float)Math.Round(34.0 * Math.Exp(-0.01 * ((double)21 + 1.0)))/33f```now returns 0.81...
well, that's better
so yay
i think i might have messed up blue health
can you change your nail tier with the debug tool?
its like the only thing i cant find
ah, yes, i know why blue health is broken
it lives!
k, fixed blue health and updated the focus hook to float, now fixing global settings
@solemn rivet oh yea you can change the nail dmg with those, the nail still stays at the same tier though 🤔
4
alright thanks
k, am back
Modding API 1.2.2.1-15(BETA) - Fixes blue health not being calculated right with the hook. Changes the focus hook to float from int. Fixes auto loading of global settings on the Mod class instantiation.
there's no mod to replay specific bosses right?
you can use debug for that
@solemn rivet any documentation on that?
there's a pretty nifty readme
it's also fairly straightforward
Pause->Bosses->click boss you want to respawn->exit/enter room->profit
also, I may ask Sean that later, but why is there no cursor when the overlay is active? Or even an option for that?
just so you don't need to pause
it's cause of how the game handles cursors when not in pause mode
you mean the constant check for isPaused?
you could override that with the hook though
oh, i guess you can't
nvm, i'm dumb, you can
wait, we have overriden that with bonfire, have we not?
i couldn't remember if the pause check
was before or after the hook
it's after
so I don't see why you couldn't have it show even when the game is playing
also, iirc you changed the InputHandler.OnGUI() method to behave as it used to (instead of locking the cursor)
kdt said the old way is depreciated, so at some point we might have to do something else, but for now, it still works 
oh
there should be an equivalent which doesn't lock the cursor, I assume
anyway
I'll ask Sean later
there isn't
there are 3 options
Locked, Constrained, None
Constrained sort of does what the old one did
in that you can move around within the game
but you can't leave the window
that... Sucks
None hides it
oh
so, why is None bad?
cause even when you pause, it's still hidden, you have to go back and override visible again (which is depreciated). they need a 4th state
basically it removed the ability to have an unconstrained visible cursor
i can't begin to fathom why
no, those are the 3 cursor options, period
yup
but in any case, your idea for debug mod is doable i think. it'd just be up to him to code it
I mean, it's not entirely needed
it makes actual sense to only change things on pause
but, on the other hand, it's not bad either to have the option to change things on the fly
so, @rain cedar , what do you think about this?
(This being an option to show the cursor in debug mode when the game is not paused)
since we digressed like 30 lines there
heh, fair point
but yeah, not necessarily as the default, but to add that option, like a "show cursor" key
@leaden hedge your canvasutil changed at all with all your work in inventory replacement?
yes
heh, k, i'm just gonna wait to put it in the API until you're done fiddling with this project
KDT - the hero we need and maybe deserve
okay, gonna test bonfire with newest api
okay, gonna test bonfire with newest api
healing still doesn't work 🤔
Wyza, so csharp public int StrengthStat { get => GetInt(1); set => SetInt(value); } means that if not set, StrengthStat will be set to 1, correct?
correct (on the strength thing)
got it
it works for string/float/bool too
even with v-15?
blue HP is working for me now
cause i tested blue masks on the save i got from Verulean and they showed up
ye
maybe I didn't replace steam's assembly.dll
k, so the dll you just posted does have the level issue, which is interesting because the drive folder version does not have that issue
oh, it works now
yeah
what's weird is that I changed a lot of stuff
but I didn't touch the if for showing the GUI
also i think enemy HP scaling is broken
well, i gotta head out for an hour or so, but if you haven't solved it before i get back i will take a look
it is, verulean, by the same reason the geo per level is broken
at Modding.ModHooks.OnFocusCost () [0x00000] in <filename unknown>:0
at HeroController.StartMPDrain (Single time) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
at HutongGames.PlayMaker.Actions.CallMethodProper.DoMethodCall () [0x00000] in <filename unknown>:0```eh
ok, the issue is with the PlayerData.atBench
I started a new save and the level up screen simply does not show at all
I've confirmed that the issue is with atBench
does Sly's spritesheet actually have proof that we were meant to fight him
no
ok good
I think I got it
eh
maybe the issue is getting the PlayerData reference?
because I can't even add levels, even though I have more than enough geo
okay
I changed all PlayerData.instance.atBench (including the cursor hook) for HeroController.instance.cState.nearBench, and everything works
okay, I give up
when you fire up the game, what version of the API does it show?
@solemn rivet
where are you seeing that error?
and you changed your hook call to use the float right?
yup
I've pushed my most up-to-date version to git, if you wanna take a look
seems like anything at all related to atBench is not working for me
the thing is
focus worked fine for me
it seems that atBench is not working and the hit resistance is also not working
aside from that, everything seems fine
yeah, something odd with atBench, it's always true
wut
😮
I only just thought of printing out atBench
wait
the new api adds an orig_SetupNewPlayerData iirc
and SetupNewPlayerData sets atBench = false
so maybe... Something wrong with that hook?
even if it was, it should update when you leave a bench
also, when starting a new file the level up screen would not show when sitting at a bench
so I assume in that case atBench was always false
all the orig_SetupNewPlayerData does is let me rename the original. (basically it's a cheap way to prefix or append calls to modhooks without having to rewrite the function
but there definitely is something odd there
hmm, gonna try something
I know
my guess is that somehow the call from the new SetupNPD to the original one isn't working, or something
dunno. I found it curious how often that method was being called, but i just fired up a completely vanilla install and it's called a ton there too
when i looked into it last night, the weird thing was was that the constructor's stack trace just ended at ctor
it didn't say what constructed it
you messing with FSMs at all in your mod?
i figured out how to get a more complete stack trace
and this is what i found
SetupNewPlayerData() PlayerData:SetupNewPlayerData()
PlayerData:.ctor()
UnityEngine.Object:INTERNAL_CALL_Internal_InstantiateSingle(Object, Vector3&, Quaternion&)
UnityEngine.Object:Internal_InstantiateSingle(Object, Vector3, Quaternion)
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
HutongGames.PlayMaker.Actions.CreateObject:OnEnter()
HutongGames.PlayMaker.FsmState:ActivateActions(Int32)
HutongGames.PlayMaker.FsmState:OnEnter()
HutongGames.PlayMaker.Fsm:EnterState(FsmState)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState)
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:UpdateState(FsmState)
HutongGames.PlayMaker.Fsm:Update()
PlayMakerFSM:Update()
and i see that. ALOT
@rain cedar the debug mods health bars and auto scan are helpful for trial of the fool thanks
dont worry im not using anything else this is my good save
Wyza: only in two instances - calculating spell damage and looking for inventory
yeah, i'm looking through it now. i think i have the bench thing figured out...maybe
it's amazing this game runs at all, i swear
the setup new player data hook is basically useless for now
or...hmmm
i think i have an idea on how to "fix" it
Oh?
so, for reasons I can't begin to explain
anytime FSM has certain things set
it goes an constructs a new PlayerData
but it doesn't do it using PlayerData.Instance
so, i'm going to make a delegate that is only assigned when the instance property is used to create the instance
when FSM goes and creates this random playerdata that is never used, it won't subscribe to that event
but when the new game/load game runs, it will
it's stupid, but, not much for it. otherwise we get that thing where the hook is called 20 times
nope, for now i'm just going to have to mark this as obsolete. it's just called too often. if TC ever fixes it so the FSM's don't instantiate 20 instances of player data, then...something
@solemn rivet - how do i test hit resistence?
like, how should it work?
nvm, figured it out. just had to change a few things.
1.2.2.1-17 (BETA) - Fixes a bug FocusCostHook. Obsoletes SetupNewPlayerData. It just doesn't work right at the moment.
@rain cedar - dunno if you saw, but I'm pretty sure i have global settings properly saving/loading now (and in the right directory)
Thanks
Hi.
hello
Howdy
what is a mod
It's a modification to the game you can install that changes some aspect of it
for example, the Glass Soul mod makes it so you die in one hit
What is a mod? A miserable little pile of code!
Here's the first game I ever made for anyone who wants to try it out
it's a fairly challenging platformer with some puzzle elements
and it'll piss you off
753 more like 75 shill
come on man you act like you don't like random .exe's
@rain cedar or @leaden hedge - Should the ExampleMod Projects be part of the API repository? (not the distrobuted API, but the git repo)
i think yes....so i'm gonna do it 😛
https://github.com/seanpr96/HollowKnight.Modding/tree/master/ExampleMods - It's a start. Also if you're a API modder, you might want to look at the pre-build and post-build steps in the example mods. They automatically will take the build dll, your readme, build out the folder structure we use on gdrive and zip it.
in general, you should be able to copy/paste the steps out of the example mod into your mod and it "just work" though if you need help with it, let me know. If you aren't familiar with msbuild steps, some of it can be a little arcane
I think, at this point, the only thing really left is hopefully getting the monomod bug fixed that requires the 1 small manual step after the API is built. Fleshing out the documentation a bit better (and theming the pages better). And that's nearly it. once @leaden hedge is done with giving us the glorious helpers for UI stuff we'll add that. but at this point I think the API can finally calm down some. I've done a rando run on the current version and it works as far as i can tell. still need to do a bossrush run or 2.
@leaden hedge - Another thing on bossrush. It'd be nice if the pause screen was drawn over the boss selection grid rather than under it (if thats even possible)
probably not
Oh well. It gets annoying if the mod gets fucked because if that happens you have to alt+f4 instead of quitting to menu
yeah, but my guess is that there isn't a layer between the pause menu and the game that can be easily injected into
canvases just get drawn in the order they are created
and I'm sure you can use the menu from memory
yeah, you can pause then press down twice
between that and figuring out how to fix dream fades and/or boss drops. i'd take the latter 
hey evreybody, I wanted to try out the randomizer mod for hollow knight. I just have a few questions about it
What do you want to know?
Will it delete my files I played in the normal game?
I'm like 99% sure no, just start a new file and enjoy.
If you're scared you can back up your save files which is always a good idea, but you probably don't need to
you dont
yeah, what I want to do is keep 3 normal files, and then have one for the randomizer, then when I'm done with randomizer go back to my other 3
after deactivating the mod of course
you select if you want to play randomizer
Yeah just download randomizer now
when you make a save
oooohhhhh
also moresaves lets you have multiple pages
that's awesome, thanks
so you can have more than 4
I'm at the google drive that has all the mods and I can't find moresaves. Is it not there?
oh nevermind there it is haha
@leaden hedge thanks for making such great mods for players to enjoy. I've been having a ton of fun with Boss Rush and moresaves sounds really efficient.
@КDT thanks for making such great mods for players to enjoy. I've been having a ton of fun with NGG and Player Data Tracker sounds really efficient.
atKDT thanks for making such great telling me how to do confusing stuff in code
how many save slots are added
infinite
effectively
dank
you'd be limited by windows limits
technically theres a cap due to hdd space and the size of ints
i'm pretty sure there is a smaller limit to the number of files between that and an int
moresaves windows mod when
I dunno what the upper limit is, and I really don't feel like making 8b saves to find out
on a per folder basis?
well I could still technically get 8.5b saves 
I'd actually have to code something to get that to work if someone got close
though with more saves, we really need to find a way to label them
if you can put an array of loaded mods into SaveGameData or whatever its called
I can probably put text up when you select them
i can do that
let me actually look at dnspy one second
I'd love to have the option to name them too. (I can easily add that as well)
hmm, returning it as part of SaveStats
which reads from SaveGameData
its just what actually gets returned
well UIManager.slotOne.saveStats exists
its private but nothing a bit of reflection won't solve 
well, the big thing is that you need to have savestats have the values we want in them right?
so you need the dictionary
of mods
(and i think their version#)
yeah, technically you could just put them in the save, and I could parse
but that'd be slower than just putting them into savestats when its parsed by the save select anyway
as for labels: can replace the region text i.e. BLACK EGG or DIRTMOUTH
and instead of listing all mods installed, could just have a few icons
❗ = missing mods
❓ = different mod versions
🇻 = vanilla save
✅ = matching mods
then instead of listing them all, just list the error on hover
well, lets see if this blows up....
I'm not 100% sure what y'all are trying to do but you can use the ghostcoins variable in playerData if you want a variable to define what your save file is for
ex: 122145 ghostcoins would be mod 45 on 1.2.2.1 or something
api has stuff to save additional stuff into saves
oh
ignore me than :P
wasn't sure if you could put stuff in saves without hurting vanilla
I mean I figured out how to add stuff to the save way before the api
Modding API 1.2.2.1-18 (BETA) - Adds updated functionality for SaveStats.
[MonoModPatch("global::SaveStats")]
public class SaveStats : global::SaveStats
{
public Dictionary<string, string> LoadedMods { get; set; }
public string Name { get; set; }
}
@leaden hedge
@leaden hedge will you be updating boss rush to 1.2.2.1
it already works on 1.2.2.1
heck, it wasn't even written until 1.2.2.1
there was an old boss rush
by another modder
oh
thank you for this information
1.1.4.9 best version
