#archived-modding-development
1 messages ยท Page 135 of 1
discord please
Woah there! The owner of Hollow Knight has requested that Discord block any messages our mostly-accurate robo-hamsters deem to be explicit. Seems like you found one, so your message has not been sent. Please be nice.
cornywoker is nsfw
stay woke
Wow I can't post it either
?
paste the cornywoker image
:cornywoker:
The image you dungo
The image
the actual image
lol

idk
It's explicit
it's nsfw
invert the colors for real img
I wonder if you post dicks that aren't flesh colored if discord is like meh whatever
hey sean how banned would I be if I put shitmothst on the drive
7
out of?
7
the ritual
why the hell is
in my frequently used?
meirl

my new launcher comes with a python interpreter
sudo apt-get install afnix algol68g aplus-fsf aspectc++ aspectj \ asymptote ats2-lang bash bc bf bison bsdgames bsh clisp clojure cmake \ cmake coffeescript dafny dc ecere-dev elixir emacs25 erlang f2c fish \ flex fp-compiler fsharp g++ gap gawk gcc gdb gdc \ generator-scripting-language genius gforth gfortran ghc ghostscript \ gnat gnu-smalltalk gnuplot gobjc golang gpt gri groff groovy guile-2.0 \ gzip haxe icont iconx intercal iverilog jasmin-sable jq ksh libgd-dev \ libpng-dev lisaac livescript llvm lua5.3 m4 make maxima minizinc mlton \ mono-devel mono-mcs mono-vbnc nasm neko nickle nim node-typescript \ nodejs ocaml octave open-cobol openjdk-8-jdk pakcs pari-gp parser3-cgi \ perl php-cli pike8.0 python r-base rakudo ratfor rc regina-rexx ruby \ ruby-mustache rustc scala scilab sed slsh spin squirrel3 swi-prolog \ tcl tcsh valac vim xsltproc yabasic yorick zoem zsh
from the usage guide
good lord
brainfuck, blc8, and befunge all in a row
also yeah that's a great command
i like the arch one better
I couldn't get it working on arch tbh
because some of the aur installers for the obscure languages were broken
oof
but that was like 2 years ago
it has lolcode
wtf
and piet
ah shit
i erased my saves for most of my games
rain world somehow survived
hk did not
vinny's chat wants a meat mod...
is that a dumb inside joke probably?
what's a meat mod
meat is a vinesauce meme
so yes
p much lol
on the bright side it was only locallow that died
had local and roaming on my d drive
this is meat
but it's cute
objectively false
well i've got most stuff reinstalled that i actually care about

with rider, discord, firefox, my launcher, and steam open
@opal hearth don't post that again in here please
ooo
alright, fair.
It wasn't even that bad though
ยฏ_(ใ)_/ยฏ
This game has mods?
No
no
this discord has mods
Yes it does
Our current mods are nth, Mystery, Conrad and Jonny
All of them are nice but I cannot confirm this for Conrad because I have only seen him speak once
he does bot stuff behind the scenes
Hmm i didn't understand any of that
in that case, there definitely aren't mods for this game
just
you asked if this game has mods despite you chatting in a channel entirely dedicated to it
those are the mods, regulating the Discord
HK itself also has a few good mods
like Blackmoth
and Lightbringer
we memed it up since mods are also moderators
it's
not that hard to grasp
...or is it?
VSauce theme plays
Woah mods are moderators for short ๐ค
hey, vsauce! corny, here.
๐ธ
I love rectangles
Best shape
I'm gonna make a mod that turns everything into rectangles
New ModInstaller won`t break my computer? Or better to use Crossroads?
Cause I have my Unity bullethell project and a ton of other things
I don't see why it would break anything
copy 300 copies of shitmodst to all folders
I need kreygasm
shitmodst physical release when
shitmodthst
it's a moth with shitmodst and shitmodst coded into the dna
dungosthmothst
this already works. Any suggestions on the wording of the message?
cancelar
sim
not you too ptkyr
eu tambem
can you just make the buttons say proceed/retry/quit
it should say
press sim to proceded.
press Nฤo to retry.
press Cancelar to abort and quit.
press proceed to proceed
press retry to retry
press abort to abort
how's this
great
you could probably even get rid of the second line of text
just say Unable to download mod list.
done
also, I'll go back to github for hosting the binary
what about the source code
on both
stackoverflow game a real nifty class that lets me change the text of the message boxes to whatever I want
pretty cool
Ok which mods are up to date atm
I tried to download bonfire mod but it didn't do anything
oh right
meirl
can anyone explain why this is happening in the Player.log:
NullReferenceException: Object reference not set to an instance of an object
at redwing.greymoth..ctor () [0x00000] in <filename unknown>:0
UnityEngine.GameObject:Internal_AddComponentWithType(Type)
UnityEngine.GameObject:AddComponent(Type)
UnityEngine.GameObject:AddComponent()
redwing.Redwing:addComponent()
when I run
GameManager.instance.gameObject.AddComponent<greymoth>();
greymoth is still added
At greymoth constructor
So look there
Since you probably don't actually have one of those check the MonoBehaviour one to see what could be breaking
I don't have a constructor no
I assume greymoth is a monobehaviour
yes
public extern MonoBehaviour();
nice ctor unity
anyway nothing breaks
but it's just a weird error in Player.log
Do you have any variables declared like this?
public x = y;
That compiles to a constructor
ohhh
I bet it breaks on
private readonly float dashCooldownTime = HeroController.instance.DASH_COOLDOWN_CH;
well
since he's adding the component to HeroController.instance itself, it shouldn't break
because it's already instanced at that point
yeah that fixed it
anyway I guess I'll update two of my mods on the drive since I fixed some stuff in them and then start working on my component
cool fixes are live
the infinite intelligence rider just generated this 4000 IQ code for me:
return errorCode != 0 ? errorCode : 0;
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
big brain
I think we can optimize that
short i = 0;
while(i != errorCode)
i++;
return (int)(i == 0 ? 0 : i);
i hope your error codes can't be negative
or else we are going to be waiting for a long time 
well not for a result but for the correct one 
we'd have to make it a != instead of <
but yeah
a byte would be even more optimal
but we might run into issues if we need more than 255 errors
Right we're not counting 0
I assume 0 would be no error
fixed the code
its perfect now
the only way to optimize it further would be to do
switch(errorCode){
case 0: return 0;
case 1: return 1;
//etc
}
Do you need an explicit cast for short -> int? I would expect only the other way around
apparently short does have an implicit to int
aswell as long, float, double and decimal
Makes sense
is caching fsms and fsm states in a dictionary faster than than using Fsm.GetState and FSMUtility.LocateFSM?
I wanna say yes but possibly no because IIRC dictionaries aren't that fast
I guess if I wanted to meme I could do int.TryParse((i == 0 ? 0 : i).toString());
sorry for once I'm working on code that isn't mine and I'm worried about writing shit code
dictionaries shouldn't be that slow
Dictionaries are slow if you use ContainsKey instead of TryGetValue
neither should LocateFSM tho
locateFSM is just a list iirc
why is ContainsKey slower than TryGetValue
oh it actually generates a list when you use it
Because ContainsKey runs pretty much the same thing as TryGetValue
But doesn't return the value
static FSMUtility()
{
FSMUtility.fsmListPool = new List<List<PlayMakerFSM>>();
}
yes my favourite type of list
a list of lists
oh so something like
if (!cachedFSMStates.TryGetValue(stateName, out FsmState outVal))
{
cachedFSMStates[stateName] = myFSM.Fsm.GetState(stateName);
}
else
{
return outVal;
}
return cachedFSMStates[stateName];
is faster than
if (!cachedFSMStates.ContainsKey(stateName))
{
cachedFSMStates[stateName] = myFSM.Fsm.GetState(stateName);
}
return cachedFSMStates[stateName];
then?
wait I could optimize the first one more
public bool TryGetValue(TKey key, out TValue value)
{
int num = this.FindEntry(key);
if (num >= 0)
{
value = this.entries[num].value;
return true;
}
value = default(TValue);
return false;
}
public bool ContainsKey(TKey key)
{
return this.FindEntry(key) >= 0;
}```
FsmState outVal;
if (cachedFSMStates.TryGetValue(stateName, out outVal)) return outVal;
outVal = _getOrCacheFSM(fsmName).Fsm.GetState(stateName);
cachedFSMStates[stateName] = outVal
return outVal;
imo x.TryGetValue(u, out z) ? z : x[u] = fsm.getstuff()
what's the O of accessing an arbitrary part of a dictionary?
both insertion and search should be O(1) for hashtables
which is what csharp dicts are
Very large dictionaries can be less efficient because of hash overlap
That's not really relevant ever though
hold up how small are the hashes that they can overlap
if they do does it return the wrong value
They've got an array for each hash
and then it just actually iterates over the list to check for the one that actually matches
which if its just one item is obviously correct
It looks like they do a check on the item's key even if its the only one
So that's a bit of redundancy
man they could just use 64 bit hashes and not have to deal with the list
that'd also increase the size of the table
and it'd still have hash collision
itd just be even more unlikely
you'd need on the order of millions of elements to get hash collision at the rate of hundreds of elements for a regular sized table and it wouldn't be any slower on 99% of machines.
It only takes two to collide if you're really unlucky
and you only need like 2,000,000,000 elements for a normal 32bit hash to collide
regular amount of items I'm putting into my hashtables
ok so lets see.
the collision rate for X elements is approximately
1 - e ^ ( - x^2 / (size of hash * 2)) according to wikipedia
let me get out python real quick
actually https://www.gnu.org/software/gperf/ 
you'd expect a 70% chance of having 1 collision with 100k elements with effectively randomly picked and evenly distributed hashes with a 32 bit size.
with 64 bit
that drops to 2.7 * 10 ^-10
It looks like C# dictionaries actually do break if there's a collision
100 million elements in a 64 bit table still only gives you a 0.000271 chance of collision
for (int i = this.buckets[num2]; i >= 0; i = this.entries[i].next)
{
if (this.entries[i].hashCode == num && this.comparer.Equals(this.entries[i].key, key))
{
if (add)
{
ThrowHelper.ThrowArgumentException(ExceptionResource.Argument_AddingDuplicate);
}
this.entries[i].value = value;
this.version++;
return;
}
num3++;
}```
that's about 0.027% I think
you have a 0% chance, if you have a fixed list when you make your dict
good to know
I dunno if csharp actually uses a perfect hash in this case
but yeah now I know to use gperf
you'd probably have to tell it to do so
thanks for telling me about it
idc I am probably having 30 elements max
maybe a little bit more
It's randomizing its hash maker if there's over 100 elements
but if for whatever reason you did want to hash max_int elements
I definitely don't have the ram for that
Maybe instead of RAM disk you can go the other way and turn a hard drive into the world's slowest RAM
...swap space?
I'm talking about actually tricking your OS into thinking a hard drive is RAM so you can run a program that uses a dictionary with billions of elements
you could just write a program that reads and writes to files ๐ค
as far as userland programs are concerned
swap is ram
like you can explicitly check to tell them apart but by default stuff will just run without caring if it's on either
executing commands from swap
would require some serious hardware hackery
like telling your cpu to read instructions from swap space
and write data to swap space
but sure nothing's stopping you
no I meant directly
like cpu ignores ram completely
might require some silly rewiring to get that working
Anyway uh... does ModCommon have some version of PlayMakerFSMExtensions?
I need to get an action of a certain type from an FsmState
does fsmutil have a getstate
yes
can I runtime detour my entire harddrive in linux 
big meme
next one will be FSmUtil
ok so why the fuck is FsmUtil named FsmUtil when FsmUtility and FSMUtility already existed
why
what else would you call it
FSMUtility2

I guess you could have made it just extension methods
as its just a bunch of static functions
I made it extension methods
oh it is cool
added another class in the file which is just a bunch of extensions that do the FsmUtil functions
ok 56 what's the clean way to have one function call another one with a default arg
dunq
void F1(int meme=0) { stuff }
cant you just do optionals
yeah
public f1(int x = 0){
}
public f0{
f1();
}
imo public f0() => f1();
imo Func<void, int> fX = f0() => f1();
ugh dumb optionals are way cleaner
me gettin memed on again
sorry kinda struggling on getting some meme math working
I don't really like optionals though
you can do
public f1() : this(0){
}
public f1(int x){
}
public f0{
f1();
}
although I dunno if that works with functions
perfect
although you can probably do : f1(0)
what's the : thing
calls another function
o
its used in ctors to call a basic one
weird I've never tried it on non-constructors, assumed it'd work lol
apparently not
should I be throwing exceptions when stuff goes wrong?
like for example:
Wait waitState = _getOrCacheFSMWait(inputData.FSMStateName, inputData.FSMName);
if (waitState == null)
{
throw new System.ArgumentNullException("No Wait Action found in the FSM " + inputData.FSMName + " with state " + inputData.FSMStateName);
}
or should I just silently fail
or should I do errors another way
Probably if the error is because the coder has done something wrong it's good to throw
Otherwise nah
I'm not your teacher you don't have to write me an essay
ok
so here's the errors that can happen right now as far as I'm aware:
-
the modder is trying to access a nonexistent FSM, nonexistent FSM state, or an FSM state without a wait. Or they're trying to access a nonexistent animation clip
-
the gameobject that the class is on lacks a tk2dSpriteAnimator / HealthManager, and the user hasn't manually set these fields to... say a separate gameobject which does have such components
-
the modder's numbers will set the animation speed to <= 0, or wait time to infinity or <= 0.
I'm thinking exception on all 3, what do you think?
Makes sense to me
public void Start()
{
Stamina.curStamina = 100;
StartCoroutine(InitializeFSM());
}
private IEnumerator InitializeFSM()
{
while (GameManager.instance == null || HeroController.instance == null)
{
yield return null;
}
StartFSMBullShit();
}
public void StartFSMBullShit()
{
HeroController.instance.spellControl.AddAction("Fireball 1", new CallMethod
{
behaviour = GameManager.instance.GetComponent<StaminaUI>(),
methodName = "OnFireball",
parameters = new FsmVar[0],
everyFrame = false
});
}
public void OnFireball()
{
Stamina.curStamina -= 30;
}
ey Angle this doesnt seem to work for some reason, could it be cuz of the wrong State name?
can you put a log in OnFireball
Also put a try catch around StartFSMBullShit
It's being run from a coroutine so it'll silently die if something is wrong
not quite Player.log
should have
the exception
right?
well whatever Player.log is called on windows
Probably
you could check that file. although I gotta say having both Player.log and ModLog.txt in the same folder is super nice
Log doesn't show up unless it crashes as far as I'm aware
aight ill try those
Player.log for me is like dnspy for y'all
just saying
actually it's not actually that useful but it is one of my more used tools
in my toolkit of like 5 tools that I actively use for debugging
public void StartFSMBullShit()
{
try
{
HeroController.instance.spellControl.AddAction("Fireball 1", new CallMethod
{
behaviour = GameManager.instance.GetComponent<StaminaUI>(),
methodName = "OnCast",
parameters = new FsmVar[0],
everyFrame = false
});
Modding.Logger.Log("Initialization is successful");
}
catch
{
Modding.Logger.Log("Error initializing");
}
}
public void OnCast()
{
Stamina.curStamina -= 30;
Modding.Logger.Log("CASTING");
}
I seem to be getting "Initialization is succesful" on start of the save, but using vengeful doesnt trigger the "CASTING"
yeah tahts what im thinking
or another thing
but no im not using shade soul
yeah ill check maybe the state name is wrong
I haven't looked into the spell FSM too much unfortunately
ok
theres a statename called "Fireball Antic" used it and casting now reduces my stamina
well now you can put like whatever code you want in OnCast
have fun
and try not to break stuff too much
me? not breaking stuff? you know thats impossible right
has KDT updated his hk mod tutorial?
last time it was committed to was June 25th
yea I saw
Do the example mods work (https://github.com/seanpr96/HollowKnight.Modding/tree/master/ExampleMods)?
When I build them and use them in the game, after restarting, it sets damage to 0
is there a recommended mod I should look at if I am trying to learn?
Is there a multiplayer mod?
that dosnt count
and thats the first thing that comes up when u google hk multiplayer
so no
didn't AA say they wanted to make a local multiplayer-esque thing at some point in the future
yeah but that was also not a true multiplayer
it would be similar to what dream shield co-op does
but with gchild
ok then, no Multiplayer for HK
Ok
it's possible
but you'd have to rewrite the collision detection systems, trigger systems, player control systems.... etc etc etc
so it's basically a game re-write
just make the 2 be able to touch each other
?
so, no changes to collision detection systems regarding them
big think
trigger systems work whenever one gets to the trigger and the other gets teleported to it
yeah. simple in theory. but making that happen.... not easy
adding a completely new player character is a huge undertaking in itself
with a new enemy
that pixelated girl with a sword that dealt 2 damage
enemy โ pc
^
^
you don't have to deal with input handling for a new enemy
or camera
or inventory
or anything
just ai and movement, basically
Lightbringer is currently 100% functional through the mod installer right?
Yup
How do you stop the player from attacking, I thought it was this:
HeroController.instance.cState.attacking = false
uhh
ik what I did was probably super stupid, just tell me pls
Was what I said that stupid?
I am honestly not sure, ask someone who actually knows how to code
Not much
but it looks logical
Just force CanAttack to return false
^
ok thanks
or just set one of the vars it checks
cause iirc it's some really long thing like return x && y && z && !adfa && huafhdsksadf && adksjfhakdjsf && !hkadsjfhaksdf
shouldn't it just be HeroController.instance.canAttack?
because that doesnt exist
but canFocus and etc. exist
there's even a canBackDash ffs
this right?
ok thank you

that's kind of confusing
@flat forum If I do multiplayer it will be local only because I have no idea how to do networking and it's far beyond my skill level. If I do multiplayer the idea was gonna be like how the multiplayer is in super mario galaxy where one player is from the perspective of the camera (and uses the mouse to aim and shoot attacks) and the other controls the player. It's still a huge if though and if I do do it it will probably not be for a long while.
and definitely if you want multiplayer I highly recommend not waiting for me. do it yourself... it will give me more code to steal
if you want to change a method, would you use override?
what method
monomod hooks
monomod hooks is a way to do it... assuming canfocus is done in a method and not a fsm state
did you know you don't need the 8mb dll
did you know you don't need the 8mb dll
you just need the 50kb runtimedetour dll
and you can make detours yourself
it's like new Detour(oldMethodInfo, newMethodInfo)
iirc
modcommon should just use a runtimedetour dll imo
thanks btw
Anyway if it's done in an fsm state IDK the best way to do it but you could
- remove the check
- add a custom method to that fsm state
- have that method set the fsm state based on the result of that check
so like in that method you could have something like:
if (meme > 50) {
fsm.SetState("focus");
meme -= 50;
}
else {
fsm.SetState("init");
}```
ok thank you
someone should port debug and all of its features to 1.0.2.8 just for me so i can route low nail swings % easier 
/s if that wasn't obvious
but if sean or someone could add noclip to the mini-debug he made that would be greatly appreciated
I don't know if that's available anywhere or if only he has it
it's in the cheats section
Wow nice reading comprehension
reading what?
hey could you add the ability to spawn any arbitrary enemy into debug mod?
Not you, Krythom
I saw this awesome video from the worlds greatest youtuber
Sure sounds great to have another mod that runs out of memory all the time
add arbitrary enemy button but every time you press it it loads every single level
Could actually do it in a not terrible way
shh
Load only the single level that enemy is in
there's one problem with loading arbitrary levels like that
it can mess with the current level
although maybe there's an easy solution to that problem idk
Easy I'll just cache the entire game state and refresh it
but like for example loading dirtmouth while in dirtmouth for some reason would super mess up the camera while in dirtmouth which was a bug in infinite grimm for a while
and that's just loading the current level I couldn't imagine loading a different level
I just logged all the components on the knight
What a mistake
128 FSM
Ok I logged twice on accident but 64 is still bad
Is there any save file right before NKG Grimm
I want to fight him again
preferably with max masks + nail and charms
or is there a mod that lets you fight NKG again
from KDT: 105% save file before nkg
got it but how do I use it on a mac?
I know where to add save files and stuff but are Mac and windows save files the same
I don't want to screw anything with the game
You can't screw up your other saves by loading saves
you change the name to the slot you want it to take up
so user1 to user4 with their respective slots
I am having conflict, I wanna play the boss rush mod but Id have to down grade my game and Im too lazy for that shit
my attention span is too short to learn how to fix a mod\

to downpatch your game it's one drag and drop and one console command
it's
not that hard to do
nah dude way too much inteligence required, I am very low IQ bean
Guess you're waiting for GnG
๐ ฑoi
b๐ ฑi
๐ ฑ๐ ฑi
b๐ ฑ๐ ฑ
๐ ฑ ๐ ฑ ๐ ฑ
tfw u write 300 lines of fairly weird untested code and for a few brief moments there's the slight chance it actually works
It never works. If it works something is wrong
actually... the problem is actually testing it
time to put it on grimm or something
it's beautiful code... if it's functional
but testing if it's functional is gonna take me like 30 minutes to set something up

if I did everything right this should be all you need to speed up attacks
"NullReferenceException: Object reference not set to an instance of an object at ModCommon.CustomEnemy._getOrCacheFSMWait (System.String stateName, System.String fsmName, Int32 waitIndex) [0x00000] in <filename unknown>:0 at ModCommon.CustomEnemy.AddWaitData (WaitData inputData) [0x00000] in <filename unknown>:0 at infinitegrimm.infinite_grimm_modern.Reset (Scene from, Scene to) [0x00000] in <filename unknown>:0 "
worth a shot tho
oh it gets better... apparently in 1.3.3.7 Grimm's fsm was changed in the tent so my custom conversation text no longer works
he just says "oh it was you who called us"
and then disappears as normal
so I guess the fsm is the same but either the text name or the sheet name is different
I know what you're thinking
and this is actually a really shitty spot to use reflection
since I can just add my strings to the dictionary multiple times
oh I know why
private void Start()
isn't run when the object is constructed.
right?
when is that function run
@compact sedge
well it actually worked this time but...
NullReferenceException: No Wait Action found on the FSM Control in state Slash Antic
but
wai
/waj/
no offense but.. does GetAction actually work?
I've never tried it before
uh yeah
well that doesn't mean anything
and it didn't work
the index
the index of the object
so I have to know which order the things are in
beforehand?
yes
I mean if you want you could get firstordefault of actions filtered by is
any way to get the FIRST action of a certain type in a state of a certain name not knowing its position?
boi that's what I just said
ok help me out here what do I put for the code
foreach(FsmStateAction action in FsmState.Actions){
if( action.Name == name )
return action
๐ค
although I think you need to do TypeOf(action)
is there any existing code to get it?
like this?
outVal = (Wait) myState.Actions.FirstOrDefault(wait => wait is Wait);
yes
if there's no wait will it set it to null
because that's what I want, or at least expect
nah I'm throwing the exception in a different class that's public
ok so it failed to throw an exception. what do I do about this?
"TypeLoadException: Could not load type 'System.IO.InvalidDataException' from assembly 'ModCommon'."
I'll just rename it to "Exception"
CustomEnemy is almost done (yes renaming it to "Exception" actually fixed it, guess Unity doesn't have all the exceptions in it)!
then I just have to make InfiniteEnemy which literally just extends CustomEnemy and adds infiniteness. Also gotta add stun control support.
besides your FsmUtil not working the way I thought it did, it works pretty well for being 300 lines of weird code.
anyway... let's just say making custom enemies is gonna get really easy
well customizing existing enemies
making custom enemies is still gonna be hard
I just added a bunch of stuff to kdt's fsm util
and made some stuff linq cause linq is god
so you literally just used rider auto refactor then
yes
mostly
removed a few logs so it'd actually do it
And then made everything extensions
and added some functions like copy state
and get action<t>
and removeanim
and insert action
why does it want to replace a tail recursive call with a while loop
a while loop that will be run, at maximum, twice because of the way I designed the "recursive" call
ok I decided not to do stuns because the way I had stuns done in IG relied on a player hook and I don't wanna do that for a component on a game object

there's no nonsense way to do stuns as a component of a gameobject and StunController already exists
oh
wait
lol
nvm stuncontroller is actually a meme
edit the stun fsm
//TODO: add a hook for when a health manager takes a hit, for now just poll the difference in hp
//the side effect of this is that things that damage enemies but aren't player hits may cause stuns depending on the value of ignoreDamageDeltaUnder
private void Update()
{
if( healthManager.hp != previousHP && healthManager.hp < previousHP )
{
int damage = previousHP - healthManager.hp;
if( damage >= ignoreDamageDeltaUnder )
OnHit( damage );
}
previousHP = healthManager.hp;
}
nice stun controller
here's the thing
the only good workaround I found for this
was hooking HitInstance
and that's lame
no u
no but like
Add a call method to the fsm
wait
not the worst idea in the world
but
probably better served by a different component
having 1 do everything component is kinda silly imo
so if class A extends class B and both implement function X, A will override B's function, right?
like if I have this:
public class InfiniteEnemy : CustomEnemySpeed
{
private void Update()
{
//code a
}
}
public class CustomEnemySpeed : MonoBehavior
{
private void Update()
{
//code b
}
}```
only code a runs in a InfiniteEnemy, right?
I think it depends
static void Main(string[] args)
{
B test = new B();
test.func();
(test as A).func();
((A)test).func();
Console.ReadLine();
}
class A
{
public void func()
{
Console.WriteLine("Running in A");
}
}
class B : A
{
public void func()
{
Console.WriteLine("Running in B");
}
}```
unity tho runs it without casting it
[INFO]:meme A running
[INFO]:meme A running
[INFO]:meme A running
[INFO]:meme A running
[INFO]:meme A running
I had A : B
Unity probably runs it as the super base class MonoBehaviour
I should've tested that too but you already did
ok protected is cool
Yeah good keyword
It's weird that all the component functions just work through magic
Like it's not an override, you just put the functions in
Doesn't seem like good design
yeah
I don't like that they can call the orig function through casting
but
if they do that then they're a dungo who deserves every weird undefined behavior they get
what if
public new void SetEnemyMaxHealth(int health)
{
throw new Exception("Unable to set maximum health on an infinite enemy... silly");
}```
does that override the original
that new keyword
Yeah that does, I think
I can test it
Nope same behaviour in my test code, just got rid of a warning
uhhh
Ok "new" on a function is just syntactical sugar to show you meant to hide the inherited member
It doesn't do shit
tbh everything in c# is syntactical sugar
on the plus side it's easy to use but some days it feels like I'm on training wheels.
Well yeah it's pretty clearly meant to be a beginner language
What with all the behind the scenes stuff it just does for you
well considering it's inspired by Java it's trying to be a beginner language that you can get stuck writing for 30 years if you're not careful.
Idk about Java but C# you at least have options to go past the usual allowed stuff
it is mildly useful tho to be able to call the orig
if (active)
{
throw new Exception("Unable to set maximum health on an infinite enemy... silly");
}
else
{
CustomEnemySpeed a = (CustomEnemySpeed) this;
a.SetEnemyMaxHealth(health);
}
cuz I can do this I guess
probably
If you declare it as virtual in the base class you can instead do base.Whatever(stuff)
That's the "clean" way to do it
Assuming Unity will still recognize virtual functions
Actually you can probably use base regardless
I've just never thought about using it outside of overrides
I can't assign it in the constructor tho
so
also it's a "prohibited modifier"
virtual
Weird
I think the cops are coming for me
wtf
It's not getting mad at me for using inheritance on Update
isn't that like
the opposite of how polymorphism is supposed to work
or would A notA = new B();
notA.func() say B
Looks like with overrides it always calls the highest up one yeah
It even says cast is redundant
Wow it's straight up impossible to call the base function I think
static void Main(string[] args)
{
B test = new B();
MethodInfo aFunc = typeof(A).GetMethod("func", BindingFlags.Public | BindingFlags.Instance);
aFunc.Invoke(test, new object[0]);
Console.ReadLine();
}
class A
{
public virtual void func()
{
Console.WriteLine("A");
}
}
class B : A
{
public override void func()
{
Console.WriteLine("B");
}
}```
this is why I use new and not override and virtual
found something on calling the base function
// Get MethodInfo of the base method
var methodInfo = typeof(A).GetMethod("Print", BindingFlags.Instance | BindingFlags.Public);
// Create DynamicMethod based on the methodInfo
var dynamicMethod = new DynamicMethod("BasePrint", methodInfo.ReturnType, new[] { methodInfo.DeclaringType }, methodInfo.DeclaringType);
// Create ILGenerator for the dynamic method
var il = dynamicMethod.GetILGenerator();
// Emit argument with index 0 - DeclaringType
il.Emit(OpCodes.Ldarg_0);
// Emit method call
il.EmitCall(OpCodes.Call, methodInfo, null);
// Emit method return value
il.Emit(OpCodes.Ret);
// Invoke method with target...
var b = new B();
dynamicMethod.Invoke(null, new object[] {b});
// ... or create a delegate and invoke method without target
var action = dynamicMethod.CreateDelegate(typeof(Action)) as Action;
action.Invoke();
Note that it'll work only for parameterless method. If you want to call method with parameters you'll have to put their types into the array with the DeclaringType and later emit all of them. Also you'll have to create delegate of type Action<parameterTypes or Func<returnType, parameterTypes> if the method returns something.
ok i found a less stupid way to do it
The real question is why you're wasting time on this
idk
using System;
class MainClass
{
public static void Main (string[] args)
{
A a = new B();
var ptr = typeof(A).GetMethod("Print").MethodHandle.GetFunctionPointer();
Action baseMethod = (Action)Activator.CreateInstance(typeof(Action), a, ptr);
baseMethod();
}
}
class A
{
public virtual void Print()
{
Console.WriteLine("hello");
}
}
class B : A
{
public override void Print()
{
Console.WriteLine("goodbye");
}
}
My main question is why your method names are capitalized
cause c#
That's the standard
you can replace Action w/ Action<types,to,pass,in> for void functions and Func<return, types, to pass, in> and it works fine
which is neat
idk why i spent that much time on that
also T x = is useless and i should just return immediately
cool
I hope this PR gets accepted... and starts a new glorious wave of custom difficulty boss mods by making building them so easy that anyone can do it.
I'm rewriting infinite grimm for it. but the hard part is the old way I did danceSpeed and animation speed means redoing a lot of math to ensure new infinite grimm is equally balanced to old infinite grimm.
documentation for it will be coming after it gets accepted. or not at all if it's rejected
(if it's rejected I'm still gonna use it internally for all my mods though)
Thanks kerr :)
Infinite Grimm but infinite cornywokest
AA I'll take a look a the pr later today
But it's probably for the best is 56 or Sean do it, cause it seems like they were helping you along, so they know what to look for
you know if you really want to call the base function
you could probably runtime detour it 
KDT's meme power is high these days
is there a way to update the soul meter's ui?
what do you mean?
if I change it's value, it doesn't change how much soul is in the soul meter
well
how filled up it is
it's probably an event that you need to send
ok
care to try using mpChargeSpa and setting a negative value?
HeroController.instance.AddMPChargeSpa(int);
public void AddMPChargeSpa(int amount)
{
int mpreserve = this.playerData.MPReserve;
this.playerData.AddMPCharge(amount);
this.gm.soulOrb_fsm.SendEvent("MP GAIN SPA");
if (this.playerData.MPReserve != mpreserve)
{
this.gm.soulVessel_fsm.SendEvent("MP RESERVE UP");
}
}```
ok thankee
thanks gradow but kerr was so kind as to accept it last night for me :)
Oh cool!
now I just gotta write some documentation for it

Ok that's pretty neat
couldn't you technically "steal" some of these fire sprites for your mod?
tbh I'm down for adding real sprites to redwing cp1 if you wish to make any
just wanted to let you know
but I have no real art skills so I can't make any of my own
yo wait is there a sprite sheet for the knight somewhere?
Yeah
yes
yeah that'd be nice
sure
probably dive
this is dash if hollow knight was a top down flash game
did you bump the version
yes
0.0.5
also
added a version int
so you can just read that instead of comparing strings
darn
which also means that you can change the version without the public version changing
I missed a this in the extensions class
for the invokemethod
I'll just bump it again
what
why
let's just make 0.0.5 add both invokemethod and customenemyspeed
since I'm pretty sure my thing has your changes
too late now, jerk /s
but
that seems objectively more useful than needing to know the index beforehand, like why would you even use an external getting function if you already know where it is.
doing a big meme

is a thing where you get the nth occurance of a particular action in a state. so like the first or second setvelocity2d from the state "meme"
where n is 0 indexed ofc
I'll do that too
also because lost kin spawns 8 balloons and then sets the velocity of all of them
lost kin spawns 1 balloon after dying

wow ok, well I much prefer the code I wrote for velocity setting 8 flying objects.
(just a really long meme switch)

I'm trying to set up an autohotkey to bind my xbox1 x button to x on keyboard but I can't figure out what autohotkey wants me to call the x button
On the controller?
yeah
switch to keyboard
no thanks
maybe JOYX
I beat PoP sub5 with keyboard
but did you beat it sub 4
didn't have the patience
proof KB+M is best
you didn't use a controller*
Proof 56 is stupidly good at many things
Krythom have you tried the key history
These are the keyboard keys, mouse buttons, and joystick buttons that can be used to create hotkeys and macros.
it's in special keys
shows you what buttons you've pressed
should show your controller buttons
it's probably like joy(1-32)
mod where equipping Deep Focus is actually useful because it has the Laser effect from Redwing, but pink
I wanna take away the pillar effect when you're not at full health... unless you have deep focus on
cuz right now deep focus is especially shitty in redwing
like even shittier than in vanilla
make it make the Pillar
t h i c c
ok so apparently its joy3 but it only works while autohotkey is in focus
anyone know why?
send whole script imo
also do you have native controller input on or the key bound in anything else (like HK)
#InstallKeybdHook
JOY3::x
thats whole script
I don't think anything else would be messing with it but idk
try it without the keybdhook
nah

still isn't working
oof
ok
Hi, I'm new here, and I wnat some help to copy one save, for precaution
is in on top of this chat?
I'm really sorry, but I couldn't understand
@weary rune open explorer
click the little bar at the top and it'll let you type in it
erase what's in there and paste
%APPDATA%\..\LocalLow\Team Cherry\Hollow Knight\
and that has all your saves in it
user{1-4}.dat
just copy paste them somewhere
wow what'd you found
die
wtf
I've enjoyed it better than short time I had Arch
rip
shhhhhhhh bb
๐
ฑ 

