#archived-modding-development
1 messages ยท Page 36 of 1
I should probably change that hook to return Vector2? instead so that I can look for null instead of a zero vector
if it helps, here's what the "original version would look like
private void Dash()
{
this.AffectedByGravity(false);
this.ResetHardLandingTimer();
if (this.dash_timer > this.DASH_TIME)
{
this.FinishedDashing();
return;
}
float num;
if (this.playerData.equippedCharm_16 && this.cState.shadowDashing)
{
num = this.DASH_SPEED_SHARP;
}
else
{
num = this.DASH_SPEED;
}
if (this.dashingDown)
{
this.rb2d.velocity = new Vector2(0f, -num);
}
else if (this.cState.facingRight)
{
if (this.CheckForBump(CollisionSide.right))
{
this.rb2d.velocity = new Vector2(num, this.BUMP_VELOCITY_DASH);
}
else
{
this.rb2d.velocity = new Vector2(num, 0f);
}
}
else if (this.CheckForBump(CollisionSide.left))
{
this.rb2d.velocity = new Vector2(-num, this.BUMP_VELOCITY_DASH);
}
else
{
this.rb2d.velocity = new Vector2(-num, 0f);
}
this.dash_timer += Time.deltaTime;
}
minus discords indendation sucking
Quick sketch in the Discord message box, hopefully I didn't screw anything up:
private extern void orig_Dash();
private void Dash() {
// Check if we run our own dash code.
Vector2? vector = ModHooks.Instance.DashVelocityChange();
if (vector == null) {
// Run the original dash code.
orig_Dash();
return;
}
// Our own dash setup.
AffectedByGravity(false);
ResetHardLandingTimer();
if (dash_timer > DASH_TIME) {
FinishedDashing();
} else {
// Our own velocity.
rb2d.velocity = vector;
dash_timer += Time.deltaTime;
}
}
dat discord formatting
lemme fix this
discord go home you're drunk
That code is functionally different, though
It shouldn't be functionally different, though
The first two function calls in the vanilla function are later
Huh? They're not later
at the beginning, it checks if you're providing a replacement velocity
if you don't, it runs the original code
but it doesn't run this first
this.AffectedByGravity(false);
this.ResetHardLandingTimer();
if (this.dash_timer > this.DASH_TIME)
{
this.FinishedDashing();
return;
}
The replacement velocity might be reliant on changes done by the other functions, though
if you do, it does its own setup (the first few lines in the original code), then sets the velocit~
oh
so those may affect the result of DashVelocityChange? :/
AffectedByGravity changes gravityScale, which I could see being relevant
or they could prevent the rest of the function from running entirely due to the dash_timer > dash_time check
Not currently with the one mod that uses this hook
The original code still keeps its dash timer / time check; the hook just checks it if the original code doesn't run at all
but yeah, I didn't take the "setup" affecting the return value of any mod into account :/
With this I think you would get infinitely long dashes if you change the velocity
Huh? We'd still call FinishedDashing if dash_timer > DASH_TIME
Alright great master of GUI KDT, how would I go about rendering subtitles using one or a few lines of code in HeroController?
are you using my canvasutil
Nope, I was hoping I'd be able to handle everything by just adding several lines into a method like Attack()
well you can you'll just have to write out the functions one sec
Canvas is like a hundred lines to do anything
private extern void orig_Dash();
private void Dash() {
this.AffectedByGravity(false);
this.ResetHardLandingTimer();
if (this.dash_timer > this.DASH_TIME)
{
this.FinishedDashing();
return;
}
// Check if we run our own dash code.
Vector2? vector = ModHooks.Instance.DashVelocityChange();
if (vector == null) {
// Run the original dash code.
orig_Dash();
return;
}
rb2d.velocity = vector;
dash_timer += Time.deltaTime;
}
the question really is, would calling AffectedByGravity and ResetHardLandingTimer twice hurt anything?
cause if not, then this, I think, would do the same thing
I don't think it would do anything bad
this'd do pretty much the same thing except call the first 2 methods twice, yeah
looks good to me
still doesn't solve the save/load hooks, or the attack hook though, those are buried much deeper in the methods
LookForQueueInput would be tough too
yeah
hm, so I'll probably just implement [MonoModInject(Type, Method, ILOffset)] in MonoMod
with canvasutil it'd be like
CanvasUtil.createFonts();
GameObject c = CanvasUtil.createCanvas(RenderMode.ScreenSpaceOverlay, new Vector2(1920, 1080));
Text subtitle = CanvasUtil.createTextPanel(c, "subtitlehere", 24, TextAnchor.MiddleCenter, new Vector2(0, 50), new Vector2(0, 25), new Vector2(1, 0), new Vector2(0, 0), new Vector2(0.5f, 0.5f), true).GetComponent<Text>();
subtitle.text = "updated subtitles";
not using the util I don't think I can even fit it in discord @buoyant obsidian ill make a pastebin 
oh boy
The first question regarding a MonoModInject attribute would be: If providing multiple injections, does ILOffset point to the "original" offset or the shifted one?
hmm
original I'd think
could we do
[MonoModInject(Type, Method, ILOffset, ILSizeCheck)]
where ILSizeCheck lets us pass in what we know to be the total IL size?
i'd like to have a warning that is printed if the size of the function has changed (since that means they might have change the method between releases and we might need to adjust the injection offset)
so if I know that a method has a size of 120 IL instructions, i'd put 120 in ILSizeCheck. Then when monomod is run, if it finds that the IL length is now 144 instructions, it might pop up and say, "Warning - Method IL size has changed, method may have changed and Injection may not be valid anymore, check this method to ensure it is corect"
(or something)
cause it might still be fine, but it also could very well be not
on more than one occasion they've changed the methods for seemingly no reason ๐
It's also technically possible to not be fine with the same IL count
it'd probably be something like this @buoyant obsidian https://pastebin.com/FLC90uK3
But that's a lot less likely
true
not much for that though unless we can generate some sort of checksum on the method
That's only for 1920x1080p right?
and use that instead of count
what's that refer to
so if the resolution is 1280,720 everthing will be 66% the normal size
Oh I get it, thanks
can I even fit my comment on how this works in here
discord needs snippets like slack ๐
Slack is great but some important stuff is locked behind the paid version
agreed
Discord nitro is pretty much useless, which is nice
the search limits suuucccckkkkkk
"oh sorry, you hit 10k messages, your search function is now basically useless"
//sizeDelta is size of the difference of the anchors multiplied by screen size so
//the sizeDelta width is actually = (((anchorMax.x-anchorMin.x)*referenceWidth) + sizeDelta.x)*(actualWidth/referenceWidth)
//so assuming a streched horizontally rectTransform on a 1920 screen, this would be
//(((1-0)*referenceWidth)+sizeDelta.x)*(actualWidth/referenceWidth)
//(referenceWidth + sizeDelta.x)*(actualWidth/referenceWidth)
//(1920+sizeDelta.x)*(1920/1920)
//so if you wanted a 100pixel wide box in the center of the screen you'd do -1820, height as 1920+-1820 = 100
//and if you wanted a fullscreen wide box, its just 0 because 1920+0 = 1920
//the same applies for height
this is roughly how rectTransforms work @buoyant obsidian
sorry, was afk
unless we can generate some sort of checksum on the method
yes
Technically we can, but we need to be able to figure it out from outside MonoMod
Maybe just the .dll md5?
well thats always going to change between versions
(it'd take too much into account, but should work fine)
wouldn't really help narrow down if a function we hook has been changed and needs to be updated
Alright I'm free from class, let's get this to work\
So here we have the Stuff() method, where exactly would I be calling it?
I put mine in my api init function, you could call it anytime really
I guess it would make more sense to have a Stuff("subtitles") method somewhere in HeroController, then I could just call Stuff("Subtitle example") in scenes?
nah you'd only call this once
oh
I would say a small console application that I can run once that would dump the checksum of the functions we're doing these more complicated injections on
@bronze temple - (and no worries about being afk. i'm only hopping in and out since i'm working ๐ - US based so its the middle of my work day)
but then i can put the checksums into the source and if it changes in the future, i can just update the source
you want it to only happen once
oh, once once
where's a method I can steal that only loads once?
I dunno, you could just do
public static GameObject c;
public static Text textObj;
public void someFunc(){
if( c == null )
stuff();
//rest of someFunc()
}
errr, I'm not really understanding
well you're going to create a GameObject with the variable name c in stuff
and you want to store it anyway
so you can just check that c is null
UnityEngine.UI;
That's in its own dll so you might have to add a new reference
fairly certain the default assembly has a reference to it
so I don't think you should
what's a static variable in this scenario
why can't I just be lazy and not specify
oh wow, that's powerful
but you can only have one textObj ever
Yep
but in the case for a subtitle thats what you want anyway
renderMode isn't instantiated, where should I define it?
as a public static with the others?
psssh I'll stick to my haphazard mess of code
this isn't updating the subtitles what's wrong
did you remove the Text from before textObj
or else that is just setting a local variable
and not the actual one
how does one do DontDestroyOnLoad(c)
herocontroller isn't a monobehaviour right?
well then DontDestroyOnLoad(c) should just work
anywhere in particular?
So just beginning of stuff()
It's beautiful, thank you
now imagine instead of 2 lines of code of code you wanted to do
https://pastebin.com/raw/Qxf4Y4aT 
I see now the naivety of my ways
Now, how many thousand lines do I need to make the text fade out 10 seconds after being updated?
you want it to fade out after 10 seconds?
do
public void fadeOut(){
HeroController.textObj.CrossFadeAlpha(1,0,0.25f);//fade from 1 -> 0 alpha over .25 seconds
}
public void updateText(string text){
HeroController.textObj.text = text;
HeroController.textObj.CrossFadeAlpha(1,1,0);// fade to 1 in 0 seconds
Invoke(fadeOut, 10);
}
Invoke is a MonoBehaviour function so you'll have to
MonoBehaviour.Invoke(fadeOut, 10);
if you're not inheriting from MonoBehaviour;
CrossFadeAlpha takes alpha, duration, and ignore timescale as inputs
float, float, bool
it should take, alphaStart, alphaEnd, duations and ignore timescale
oh wait it doesnt
it just takes alphaEnd, duration, ignoreTimescale
then its
public void fadeOut(){
HeroController.textObj.CrossFadeAlpha(0,0.25f, false);//fade from 1 -> 0 alpha over .25 seconds
}
public void updateText(string text){
HeroController.textObj.text = text;
HeroController.textObj.CrossFadeAlpha(1,0,false);// fade to 1 in 0 seconds
Invoke(fadeOut, 10);
}
What's the 100% alpha value?
is there an easier way I could use rather than Invoke?
easier than a 1 line thing
is writing in c#. doesn't like methods
I don't like making new methods in mods I mean
Currently in Attack(), but it'll probably be called in SceneInit when it reads a certain scene
ie. when the scene is Radiance it will say "yo dawg so you finally came to fite yer pops"
your choice is either use Invoke or some thing like
float delay = 0f;
stuff(){
//....
HeroController.textObj.CrossFadeAlpha(1f,0f,false);
delay = 10f;
//....
}
public Update(){
if( delay > 0 ){
if( delay < Time.deltaTime ){
HeroController.textObj.CrossFadeAlpha(0f,0.25f,false);
delay = 0;
} else {
delay -= Time.deltaTime;
}
}
}
ah fuck, invoke it is
back again
@buoyant wasp What about a "context rule?"
It'd allow us to determine the offset programmatically
and I'd like to help with that - the rule for Dash would just check for ldfld equippedCharm_16 and give an offset based on that
that'd make life easier, it's basically what i'm doing right now. I don't have the code pushed to github, but basically in pseudo code i'm doing this:
instruction startAt = null
foreach instruction in instructions
if instruction == ldfld equippedcharm_16
startAt = instruction;
break
while (instructionsToAdd.Any())
ilProcessor.InsertAfter(startAt, instructionsToAdd[0])
startAt = instructionsToAdd[0]
instructionsToAdd.RemoveAt(0);
which, adding IL structions by hand is annoying
not so bad if it's a straight injection of a single thing, much more annoying in the dash example cause it totally changes the structure cause of adding the if/else
Probably my final question, how would I move the text up a few pixels
your rectangle explanation was too advanced for me
That's something I was worrying about when first thinking about injection: Manipulating code flow
Luckily it can be easily solved in the Dash example by relying on return
@buoyant obsidian rt.anchoredPosition = new Vector2( xOffset, yOffset );
but, let's say, wrapping something in a try - catch would require multiple injections: One to mark the beginning of the try section, one to mark the end of the try section
You can't split that into two methods, though
and there's minimal macro support in MonoMod, but... wait a second, we're actually kinda preserving code flow here

MMIL.Skip / MMIL.SkipUntil
brb
in a perfect world we'd be able to get the method body as csharp, modify it, and recompile it in the same context as the original method.
but i understand that is a whole new kettle of fish
cause if we could modify it as c#, then we could do regex/string replacements and it'd be vastly easier to maintain. (and easier for future developers to understand as IL code is, at least to me, pretty arcane compared to most stuff)
why the fuck does unity ship with this broken ass IDE
https://gfycat.com/HealthyWideIcelandichorse
LOL
I got to the end of boss rush again, and still can't select the radiance
did you kill all the other bosses?
@leaden hedge i assume VS or VSC isn't sufficient?
VS works fine
just unity auto loads stuff in mono develop
so if im testing stuff in unity I'll be using monodevelop
mono actually sucks massive dick too
at least, when you install it there is a box to check for Unity
like it'll crash when loading a new script
hell sometimes it'll crash when being unminimized or swapping tabs
i've never checked said box, but I have to assume it does something
not sure I use VS2013
Im pretty sure theres a way to change what unity opens csharp stuff with
i had 2013/2015/2017 all installed at work for a long time
until we finally got rid of the crap i needed 2013 for
alternatively, you could use VS Code if unity lets you change the editor. it's pretty nice for a lightweight alternative
it's what i did all of the overlay stuff in
it probably sees 2013 as 2015
because 2013 is so old
i mean VS 2013 is now 5 years old (pretty sure it came out in late 2012)
then why not just use msbuild?
you making the next glass soul mode? xD
cause loading VS to compile something is like using a tank to squash an egg
Next Glass Soul mode?
what do I even do, drag csproj onto the exe?
develop
because Unity ships with outdated versions of both 
msbuild.exe /p:Configuration=Release "project.csproj" > Output.txt
assuming msbuild is in your PATH
if it isn't, then you'd have to specify the whole path for it
i'll just make a bat for it
pretty much
it doesn't have enough information to do that
it has to know, at the very least, what configuration you want
and almost every c# project has 2 at the very least
Debug and Release
I use msbuild for continuous integration/testing at work ๐
(CoreCompile target) ->
CSC : error CS1617: Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default [C:\Users\Kristian\Desktop\desktop\Hollow Knight\mod tools\MOD STUFF\API MoreSaves\Source\MoreSaves.csproj]
0 Warning(s)
1 Error(s)
hmmm
yeah, you're csproj files are really weird, when i cloned the project from github i had to mess around with the structure a fair bit
it put the properties folder as a sibling to src/, when it should have been it's child
for example
thats me being lazy
you using the version of msbuild that comes with vs2013?
im using C:\Windows\Microsoft.NET\Framework\v4.0.30319
this is why Properties is a sibling of src
try these: https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15 < VS Build tools v15. probably works better
it should give you the current msbuild.exe. the one in v4.0.30319 is not what visual studio uses
it uses one that's in the VS folder itself
I move the project files into src, so I can just use the folder upload in github, rather than load up github desktop
@leaden hedge I feel like playing BossRush. Want me to do some bug/glitch-hunting while at it?
is this latest ver?
close enough
searched for posts by you with file, and that was the latest one I found
yeah theres an unuploaded version with some fixes
k
got it
the 3 major glitches atm are
dying to CG2 softlocks you
grimm1 occasionally doesn't spawn items
THK occasionally doesn't spawn items
memez
_gitgud
^implying people die to CG2
people got softlocked by being unable to kill watcher knights
so tbh I'd believe anything you told me
I mean, at least it's not mantis lords
because oh lordy how much salt I've seen for Mantis Lords on Steam Forums
also, honest question (cus I have no idea how these things work), but since TC is porting HK to Switch... How does that work? Is it not run in Unity anymore?
and it "runs well" now?
I ask this because if they, for some reason, had to recode some of HK to be Switch-compatible, maybe - just maybe - we could ask them to remove FSMs completely from the PC ver
I don't see that happening
you can literally just make unity build for whatever
only reason switch isn't there is I don't have the apis for it
๐ค
Something about a Unity update
Didn't the current patch have a lot of under the hood changes? Stuff like grass moved ever so slightly
it'd take weeks to remove it all
only small changes as far as I could tell, 753
and doing nothing else
same thing with non-TGT related changes on the TGT patch
they always change a few, seemingly random, things each patch
like the cursor thing in the latest patch
also, why not add NGG as a surprise bonus boss if you beat boss rush hitless?
lol
no one can beat NGG
whats the point 
wow I took days to make NGG
nail dmg = 1
lets just do that for every boss 
traitor lord sucks anyways
well make it not crash your game
fair enough
I'm not on payroll 
what if.... you fixed it for them
then held the build ransom
unless they hired you
I'll pay you a thousand geo
i'll pay you in 3 high fives
don't even think its something I can fix on my end
3 digital hugs
I could fix most of the things in the game from my end, but not the game randomly running out of memory when loading rooms
its not the memory its using
just fix the things!
...sounds about normal
such a poor pc, doesn't even have 900gb ram
clearly we need to get a system with 1tb of ram to play with
does it THK room too
I mean, at this day and age who doesn't have such a system?
Get new PC?
its probably the harddrive
infact
I'm like 99% sure it is
because when I run it in a seperate location for previous patches
it works fine
HDD in 2017 makes me cry the sad cry of my people
lul
@leaden hedge - You have that Canvas utility class hosted somewhere?
was gonna stick it in the API, if you think that makes sense. (if it's generic enough to use)
also, lol at the comments ๐
its pretty generic
its missing a few types like ImageMask
but it'll work for 99% of use cases
k
Can you upload the most recent "ExampleMod" zip you had? I wanted to go through and add examples for using save and global settings
or is it on your Git account?
thanks
I want to save an instance of an enemy when it spawns, how do I do that?
as in, TikTik spawns, I save the TikTik gameObject
playmakerunity2dproxy
do GameObject x = Instantiate(this.gameObject) in thats start function
if its a tiktik
OnCollisionEnter2D?
it has a start function
But there are no gameObjects in the start function
A gameObject's name is that thing you showed me earlier right?
Like Dreamshield is "Shield"
yes
ayy
so, first I'd add something to print out enemy object names when loading a scene that has them, then enter a scene that has a tiktik
this way you're sure you get the correct name
What's that?
Sadly not
I think this would allow me to move / copy platforms and stuff too
I know y'all already do that but I'm figuring it out on my own :P
Mapler90210 runs Aria of Sorrow, including a run of the Boss Rush by Dragondarch. Game #44 of the marathon. Run starts at 07:01. Post a comment and let me kn...
TikTiks are Climbers
see how it shows "Merman" on the bottom right corner when he hits a merman
Any way to respawn Gruz Mother?
Reload the room?
exit and re-enter
That's all?
if the variable is false yes
She's not back :(
@leaden hedge PlayMakerUnity2DProxy doesn't seem like it was finding the objects
Is there a directory or document with details about how to access the FSM?
there is one other option we could take with the functions we need to copy entirely to change, could always switch the source code to a private repository instead. not the hugest fan of that cause I'm very much in the "open" camp when possible, but it'd still make it easier that screwing with IL or manually editing the DLL.
is there a mod where i can equip every single charm?
You mean CHEATING?
theoretically?
i'm almost positive it's not theory
I posted a free charm thing here a while back
Just search from: seanpr has: file
Good luck
lol
ยฏ_(ใ)_/ยฏ
Man it's more annoying than anything
^
Half the charms suck
so much crap all over that does every little
i mean, there's a reason there is a button in boss rush to skip picking up the items because sometimes all 3 things it drops will cause more harm than good in the run
Deep focus, dashmaster, grimmchild DansGame
I'm just imaging having the shield, thorns, and glowing womb at the same time
And grimmchild
There would be no way to heal, for one
Unless Kingsoul gave more soul than glowing womb takes
But quick focus and deep focus would cancel each other out in terms of time
Well lucky you because you can have all 4 of those in vanilla
why heal? don't get hit ๐
Dude, Shield is so annoying for me
though right now, having those can totally screw you on fights like collector
I used it briefly, but same here
Actually, I never use steady body for the same reason
Because I'm used to correcting
I think quick focus alone is better than the combo
I hope we can add charm slots
I wanna do a 100 charm mod
But I'd need info about how to add custom charm graphics
We actually have all the pieces of something like that
Custom shiny pickups, custom game UI, fsm modding
Just need to figure out how to insert the custom UI into the inventory fsm as a new pane
Good luck, Lightbringer only has 12 unique ones
and some of them take over the roles of other charms
This actually looks fairly modular and not as awful as most of the fsm stuff in the game
@rain cedar is there a reason damageAmount = Modding.ModHooks.Instance.AfterTakeDamage(hazardType, damageAmount); is stuck before if (this.playerData.equippedCharm_5 && this.playerData.blockerHits > 0 && hazardType == 1 && this.cState.focusing && !flag) instead of just at the end of the routine?
guessing it's so that you can affect the outcome of some of the hazards?
and death
I don't think I placed that hook
hmm, wonder if thats one of the ones gradow had me put in....goes and looks
I don't get why that would even return anything if it's basically at the end
yeah, this was one gradow wanted for bonfire. I don't know the reasoning for it happening at that spot though.
What does Blackmoth do?
i think i'm gonna stick it at the end and just say that he'll need to adjust if there's some edge case for it, cause it adds unecessary complexity to handle add it
nail does nothing
dash does damage
or something
Sharp shadow mod, basically
i haven't played it, but it seems neat
only if you can make it so grimchild gets all the the abilities of the later grimm things
like fire pillars
and expanding fire orbs and stuff
and a free icepick to stab yourself with
@solemn rivet - Is there a way you could redo your thing in Bonfire to not need AfterTakeDamageHook and just use TakeDamageHook instead? Seems like you might be able to get away with that and it work well enough. It would greatly simplify the modification of that method.
as for making custom ui panes, I honestly think it'd be easier and much more extensible, to recode the entire thing in c#, the only parts of it that'd be annoying is the map / journal
and journal is pretty pointless and you could just keep the quickmap shortcut in for using the map
Could we ask TC nicely to lend us part of the source code?
@buoyant wasp I'll see what I can do about it
we have all the code
so, you're saying what we can't do is all FSM stuff?
yeah, theres no hidden code anywhere
and its not even that we couldnt' do it via fsm
just fsm is way more trouble than it's worth
what would they give us that we already don't have 
none of which they have

well they technically have a slightly nicer viewer
but they cant' legally give it to us because its not theirs 
hey guys
just wanted to ask but
what mods are there already fo HK ?
is there anything stable already or is everything still expiremental ?
Check the pinned google drive
That'll show you majority of the mods that have been made ๐
you can ask for clarification on what those mods do here, or simply read their respective readme
Charm Notch Mod, last updated oct 26
Randomizer, oct 28
Debug, oct 28
Nightmare God Grimm, oct 31
Boss Rush, nov 9
Blackmoth, nov 10
Player Data Tracker, nov 11
Glass Soul, nov 14
Lightbringer, nov 14
Bonfire, nov 14
Modding API, nov 14
any of these need updating?
stability wise. Randomizer is stable with a few minor issues. Bossrush is stable with a couple of intermittent major issues (though largely playable most of the time). Blackmoth is stable afaik, bonfire is stable(ish?), glass soul is stable, lightbringer is stable
I meant if the mod authors had updated these and I needed to update the drive folder
yeah, i was answering @cunning basalt ๐
you could always add this whilst we wait to add it too the api 
me
is there a readme?
its api, should work on any version
I think Lightbringer has been updated since the 14th
yep, nov 16
and is that a new mod pinned i see?
both formatted, divided, added, and uploading
@buoyant wasp @rain cedar https://github.com/KayDeeTee/hk-mod-inventory the vanilla ui isn't populated and its not "ported" to the actual game, but this works fairly well in unity ( for the basic inventory )
you just make a class that inherits from PaneHandler, add it to a gameobject and its all sorted out in terms of next pane previous pane and controls
you just have to create the PreInit,Init,onMove, getSprite,onSelect,onSubmit functions
only thing I think it needs to actually work for everything in game (which matters) is an animator for invItems which gives a callback, which is required to for the charm equip animation
do we need to add any hooks into the assembly to make it work?
it works entirely on its own, its not quite finished, I'm more posting it so people can look at it and see if theres anything obvious I missed, (excluding the animator) 
cool
before I spend the next day and a half porting the vanilla ui and charms to this
lol, so we'd be basically rewriting the game's inventory UI rather than just injecting new pages?
my only real concern is long term maintainability, but I'm guessing other than when they add new charms or new items, the game really hasn't changed much?
it really wouldn't be a masive pain to maintain
k. well, I can pop it in and test and see what happens, but I'm not sure i'd notice what might or might not be missing or wrong at this point. I know so little about the UI stuff that i might not be of much help. at least tonight my goal is to finalize the fully automated patching of Assembly-Csharp and do testing. Pretty much finished last night...i think. but it was also 2am so you know how that goes...
ah
oh, yeah i see now. k, makes sense
so, one thing we can do with this new patching approach
is replace functions in their entirety, exceptionally easily
so it'd be pretty trivial to replace the inventory stuff as long as the signatures/names/etc of the classes/methods matched whatever it is where replacing
its all fsm afaik
although super conviently
theres a function called canOpenInventory
you can just return false for 
right, but i mean, if there is just this one function that says "call the fsm to display inventory", we can replace that function with "call our new inventory code"
oh
it's literally as easy as
[MonoModReplace]
public void OpenInventory() {
Lookmah.MyNewCode();
}
just don't "fix" inventory falling, k? ๐
well you could do
CanOpenInventory(){
bool ret = false;
//whatever
if( ret == true )
OpenInv();
return false;
}
as for inventory dropping, hmmmm
honestly as long as it's not changing the middle of a function, it's drop dead easy, prepending, appending, and replacing are simple. injecting is doable, but annoying
so i imagine it should be fairly easy to get your stuff in
once it's ready
public bool CanOpenInventory()
{
return (!this.gm.isPaused && !this.controlReqlinquished && !this.cState.transitioning && !this.cState.hazardDeath && !this.cState.hazardRespawning && !this.playerData.disablePause && this.CanInput()) || this.playerData.atBench;
}
well this is CanOpenInventory
so
public bool CanOpenInventory()
{
bool ret = (!this.gm.isPaused && !this.controlReqlinquished && !this.cState.transitioning && !this.cState.hazardDeath && !this.cState.hazardRespawning && !this.playerData.disablePause && this.CanInput()) || this.playerData.atBench;
if( ret )
OpenModInventory();
return false;
}
yup
though I would probably do this
public extern bool orig_CanOpenInventory() {}
public bool CanOpenInventory() {
if (orig_CanOpenInventory())
OpenModInventory();
return false;
}
the patcher can auto rename the original version of a method
so i don't even have to care what was in it, it will rename it to orig_Method() and I can call that.
(which is why prefixing/appending stuff is so stupid easy)
the final result would have the publix extern statement removed and just replaced the renamed method, so it'd look "normal"
also relevant
if you were to add new charms
it'd make sense that every mod could "request" a charm
and then the api would give them out
didn't we determine it's just cause it doesn't change the timescale to 0?
or was that just a theory
well inv should do that, but thats not why you fall super fast and don't hard fall
ah
yeah, but that doesn't explain the hard landing not being hard does it?
but if you're in air, you get constant gravity acceleration
shrugs you cancel it with the closing animation of the inventory
yeah, it's just weird
its because your in the idle state
and you need to be in fall state for over x seconds
to hard fall
ah
the fall state is also what caps your movespeed
so as long as your modded inventory keeps you in the idle state, should just "work"
work being the operative term for "be broken the way we all love"
lol
well... that's....something
well it was because by my maths
right, sin goes from 0 -> 1 every 90 degrees
so If I multiplied the time by 90
i'd get one pulse a second
while i used to be quite good at algebra, that skill has withered over the years due to lack of use
(much like the 4 years of Japanese)
i wouldn't, i'd find someone who could. Remember, all my programming experience is in databases, web design, server software. I don't do UI generation, game design, or anything of the like. So outside of some basic algebra, i don't use much else for my job
though not looking forward to having to help my kid with common core high school math....
it's not that I don't think it's worthwhile. i do, but like all skills, if it's not something you practice often it fades in time
so....how does it work in the base game then?
lol
"KDT: I fixed your Inventory UI. "
though it would be amusing if someday some part of our mod work got pulled into the base game because it was such a fundamental improvement they couldn't not use it
hopefully moresaves ๐
rip discord
its back PogChamp
TC ddos'ing discord to keep the information about the spells being oddly aligned suppressed
lol
It's Slack trying to get their audience back
hey uhhh @buoyant obsidian is this intentional
aaand pausing crashed the game
there are like
30 lances spawning per second
probably more
silent divide quick slash dashmaster twin fangs nailmaster's passion
although restarting the game fixed it for some reason
oh it seems to scale with enemies killed ๐ค
although without that glitch nailmaster's passion seems terrible
it's still regular nailmaster's too
who needs nailmaster's glory with lances though
give the nailmaster a break he's gonna be laid off now that lances are the new thing
oh look, intellisense for the mod api
oh yeah you might want to update some of the strings in there 
hah, yeah
but still, intellisense for modders! ๐
well, for anything in the Modding namespace
I can't make it magically appear for the TC code
sadly
intellisense only works if there is a Assembly-CSharp.xml file
i'm not talking about just showing the method name and parameters
but also the stuff in <summary>
/// <summary>
/// Called by the game in PlayerData.SetBool
/// </summary>
/// <param name="target">Target Field Name</param>
/// <param name="val">Value to set</param>
that
gets stripped out at compile time
so when we would edit the assembly-csharp in dnspy, we wouldn't get to have that
it's why they used [HookInfo] (at least I'm assuming that's why @rain cedar used them)
Good lord setup new player data gets called a crap ton
TC Why......
It's literally just when a new PlayerData is made
Nice
i kind of wonder...hmm, i'm gonna do a stack trace and see what the offending method is
how do I summon explosions
I'm gonna try to steal the explosionPrefab from the Bullet class
oh, i think i see what's happening. hmm
Can't find explosion, I bet I have to use FSM stuffs
I wanna hurt enemies with it
that... Is significantly harder
weird. no idea what's constructing playerdata over and over and over again. For whatever reason the stack trace ends at the constructor
[FINE]:[API] - AfterNewPlayerData Invoked at Modding.ModHooks.AfterNewPlayerData(.PlayerData instance)
at PlayerData.SetupNewPlayerData()
at PlayerData..ctor()
meh, whatever
@rain cedar - was the purpose of the HookInfo attribute purely because we had no method to document what the hook was?
Yep
if we have everything in source and intellisense comments, is there a reason to keep it? (idc either way)
I suppose not
whistles
cool
what exactly this "this" ?
use the pins
@fair rampart go to https://drive.google.com/drive/folders/0B_b9PFqx_PR9X1ZrWGFxUGdydTg
direct URL is never gonna stay the same
and download the [1.2.2.1] one
okk
@copper nacelle
did it
sorry for slow progress
im dealing w/ something rn
what next
it's fine
extract the .zip
and take the Assembly-CSharp.dll
@fair rampart is your steam normal
or is it on D: or something
go to program files x86 or whatever
this is the folder
yea
go to hollow_knight_Data
then Managed
duplicate the assembly-csharp.dll already in there
then replace the current one with the one you just downloaded
the normal one
just duplicate and then replace the Assembly-CSharp.dll one
yes
the one right below mods
with no -firstpass added to it
now extract the zip
then go back two folders into the folder that hollow_knight_Data is in
and put the Randomizer folder in there
dat it?
ok
and copy the Mods folder in the zip into there
in the zip
go into hollow_knight_Data
into Managed
and take the mods folder in there
put what you want
if you want literally my world
it's 999999999
(suggested by Johnnyme๐ ฑoy)
but you can do anything
753?
694201337
You're not gonna get anything there
I got like 6 seeds there
should give him the seed from last night with the missing item at leg eater, or was that 2 nights ago. that was fun
is there any way to turn off the console popups w/debug mod?
They come up even when the debug mod overlay is disabled
I should probably just remove those entirely
They only come up when console is off
@timber gale I removed the stuff for that popup in this build
I think I'm finally gonna get around to trying to add rebindable keys now
ayy nice โค
thank you!
do the hp bars have to be bound to enemy console though > >
Actually there's a good reason for that one
Searching for enemies is an expensive process and can cause lag on worse computers
So having the enemy panel disabled is a good way of saying "Don't search for enemies anymore"
No enemy list means I can't put health bars on things
ahhhhh that makes loads of sense
Anyone have suggestions for how the key rebind UI should be handled?
Simplest way would just be to make the help panel have buttons for all the keys
The popups still seem to be appearing for me when I installed that dll
You sure you installed it correctly?
I completely deleted the object that renders that text
Shouldn't be possible for it to still show up
I dropped the new dll file in the mods folder. Let me try it again.
Yes, I'm still having the "Hazard respawn location" and "scene loaded" things pop up after the UI is disabled.
Alright, let me check
It's working for me
I'm not even sure it's possible to overwrite mods while the game is running, but just to be sure: You restarted your game, right?
Yes
If you've got multiple installations, maybe you're putting it in the wrong mods folder
possibly, I'll mess around a little bit and see what happens
Yup, wrong mods folder. Thanks for the help!
@buoyant wasp If I'm changing debug mod to add global settings, how would I access static members in it from outside the class? I am getting an error when I try to just do
DebugMod<IModSettings, IModSettings>.whatever
Probably because the IModSettings constructor is protected
I don't have a lot of experience working with generic classes
DebugMod.Instance.GlobalSettings
should work
The generic part only applies to the initial class definition (in this case, there can be generic methods, but that's neither here nor there)
I'm not trying to access that, though
I have static members I need to get at, those probably aren't going to be in the instance
Yeah, doesn't work
k, sec
I guess there's no downside for it to not be static
There's never a reason to have more than one of it but there's only ever going to be one DebugMod class anyway
you could probably do
public override void Initialize()
{
Log("Initializing Debug");
StaticGlobalSettings = GlobalSettings;
}
public static ExampleGlobalModSettings StaticGlobalSettings;
then you could do DebugMod.StaticGlobalSettings.ShowConsole = true;
or something
the only thing that's different about global settings is that you control when the settings are saved. (since savegame doesn't make sense). for that you'd do
DebugMod.Instance.SaveGlobalSettings();
The problem is I don't get how to access static members at all
This isn't really related to global settings
Neither of those works
is "refCamera" a static property/method/field?
refCamera is this:
public static CameraController refCamera
{
get
{
if (_refCamera == null) _refCamera = GameObject.Find("tk2dCamera").GetComponent<CameraController>();
return _refCamera;
}
set
{
}
}```
Just an example, anyway
what does your class declaration look like for DebugMod?
I just did the same as is in the API
public class DebugMod<T1, T2> : Mod<T1, T2> where T1 : IModSettings, new() where T2 : IModSettings, new()```
ah, no
I can get rid of the "new()" to fix this error, would that not break anything?
sec
public class SaveSettings : IModSettings {}
public class DebugModGlobalSettings :IModSettings {}
public class DebugMod : Mod<SaveSettings, DebugModGlobalSettings> {}
the generic says "I have a class, it has a save settings of type T and type T needs to be inheritable from IModSettings"
save for global
but
here's the advantage
when you look at DebugMod.GlobalSettings, you'll see it's of type DebugModGlobalSettings, not IModSettings, that means you have the ability to do something more than what IModsettings has inherently
it's basically a step beyond normal polymorphism
I see
now, You could just do nothing with DebugModGlobalSettings
but i wouldn't really suggest it
I'd make accessing the settings inside of it easier
Yeah, I'll add some stuff in there
if you look at bonfiremod on github
there is some sample
boilerplate
i wanna see if i can remove that boilerplate at some point
You could just add all public fields in the settings object to the dictionaries on save and the reverse on load for keys with matching variable names
Don't think there's really a better way to make it work without the copy/paste code on all the variables
I suppose if I cached the names that'd be fine. the game saves...alot, so i wouldn't want to reflect those multiple times
since reflection is relatively expensive
but that was my thought as well
but i've done reflection type caching before, so I have a handle on it, shouldn't be hard to implement
I've never seen this nameof function before but it looks really useful for this
it's something relatively new
it compiles to the same thing
but, it means that if you change the name
it is checked at compile time
Yeah
I don't think I can use it because my Visual Studio is so old
So I guess I'll just never be able to change these variable names without a huge hassle
haha, you could always upgrade for free ๐
but yeah, i think it was C# 6 or 7 they added that
Yeah, I suppose I could just download 2017
(if you don't know, the community version of vs 2017 has no cost for non-profit/non-business devs)
Gonna have to download this eventually to ever make changes to the API, anyway
Since I don't think I can use the => syntax in vs 2013 either
ouch, expression bodies are wonderful for simple stuff
Yeah, they're nice, but it's not like it's a huge pain to type out the little bit extra without it
Just a lot less compact
yeah, i don't mind the typing, i just find it cleaner to read for simple stuff
Oh, no wonder I couldn't figure out my login
I used a friend's email
I guess because I didn't want spam
haha
ms isn't bad about that
i might get 4 or 5 a year
also, 2017 has git baked in, (assuming you use something like pagent for you ssh key handling, you can push/pull right from vs)
Cool
I'll probably still use a command line because I'm used to it
But good to know the option is there
yeah, i've used command line, git extensions, and vs git. each has pros and cons
for simple stuff like commit and push and see what's changed and see the diffs, the VS one does well. if you want to do merges, i still prefer something else, like kdiff
Command line pros: You can do anything
Command line cons: You have to know how to do it
pretty much
cons2, since you can do anything, you can royally screw yourself easily
Haha yeah
I mean I'm not gonna accidentally type some shit like "git checkout ." ever
But the option is there
native bash in windows has really been nice
Has the rando been updated at all since last week?
No, but I might work on that after I finish with some debug stuff tonight
i'm so close to having the entire API buildable in 1 step
Oh cool VS 2017 tells me which using statements are unnecessary