#archived-modding-development
1 messages · Page 97 of 1
...why?...
¯_(ツ)_/¯
Is your 2nd mod on the Github?
yes but no binaries yet
you can build it yourself but I wanna test it for the next hour roundabout
and then I wanna get it on the drive if it's good enough
but yeah I'm very intent on getting my source code on the internet ASAP so people can use it as quickly as possible, but building my own binaries I'm more lazy about because I'd have to write patchnotes
also I have to update infinite grimm as well (I mean make an updated binary)
so people can get the dank integration between the two mods
from my second most recent release @copper nacelle
lol
and that corner case https://github.com/natis1/infinitegrimm/issues/25
idk what caused it and idk how I fixed it
but I'm pretty sure I fixed it
lul
but yeah you had to fight grimm with grimmchild, return, refight grimm, do such an amount of damage that the damage message changes, and then die and then it happens
it happened about 40% of the time
but I fought grimm 10 times that way and it didn't happen after changing some code so I think I fixed it based on that
uhhh PlayerData.instance.CalculateNotchesUsed does NOTHING
when called in reset
ModHooks.Instance.GetPlayerIntHook
no?
aa
getplayerint breaks it
but uhh
if you're just setting it
it should work fine
got them both past half health
wait what's not happening tho
it's not setting them as overcharmed even though, with the extra cost, they should be
does the charm show up w/ the cost in the inventory?
oh crap I can't test anymore because I fixed my build
what
brb let me do 4k damage to IG hardmode
wake up at 5pm
sleep
Now
back to asking stupid amounts of idiotic questions
can I get a few example mods that store things?
I wanna try figuring out how it works
yeah example mod 2 saves data in the local save file
and example mod 3 saves data in a json config file that users can edit
this one?
why isn't what working?
hm
try unequipping everything
and then equipping Deep Focus, Hive Blood and then GrimmChild
that's the problem you unequip and reequip it works
but not just by default
I'm saying screw it and making the player overcharmed on all upgrades
so whenever you get an upgrade and the charm cost goes up it assumes you had a full set and overcharms you
if you beat NKG you don't get overcharmed right after that, but after you unequip and re-equip the charm?
yes
so you can get max upgrade and it only uses 2 notches
so long as you never take it off
That's probably some notch storage thing or something that you can't really fix
you know what's stupid. if you set ITogglableMod it means you can toggle if the mod is on or not while in game
like not just in the menu
but in game
and there's no way I can write something to let my mod be dynamically turned off while in game, but I want it to be turnoffable while in the menu
you can probably (read definitely just not sure how much of a pain in the ass it'll be) find your mods toggle button in the menu and set it to disabled during gameplay
pretty sure unity has a built in disabled property for ui components that let you just disable interactions
however finding it may be difficult and you may just need to check the text on all the buttons
idc, it mostly exists so players have a way to reset the charm cost easilly and also to disable it without uninstalling if they don't like it for whatever reason
if players are using it in game they should expect stuff to break, it might not when grimmchild isn't equipped but idk
it's probable that if grimmchild is on that the grimmballs will break until they remove and readd it
Alright I am really feeling this mod. Although it certainly has some bugs I don't know about so please help me test it if you can!
You don't need infinite grimm for it but it is designed to be used with it. You do need modcommon
wtf steam stop crashing on me im triyng to tst a mod
I had such a good run too
but when steam crashes it brings the game with it
that reminded me, I was playing randomizer yesterday and got to the part where you normally get the dream nail and then the game froze
Not my problem
The game just does that there
Assuming by "froze" you mean you were stuck falling in the cutscene, not that it actually froze
If it actually froze that's not normal
But it isn't my problem
I had a storage bug in my mod and I fixed it anyway which I guess makes me better than TC
I read the sign and it said dreamer locations added to map and stuff. Then when the knight turned around it froze when they were facing left
right*
So it wasn't this one, then? https://www.twitch.tv/videos/138285467
That's the one that just happens sometimes without mods
I know why that happens but I don't know how to fix it
The soft lock is probably related
For future reference if you have dream nail already enter the room from the right side before interacting
The way the game handles boss scenes (Xero) messes with the stuff I do
alright, I'll try, thank you
Alright I spent about 2 hours testing my second mod and I'm feeling pretty good about publishing it as a DLL on github. ~~https://github.com/natis1/grimmchildupgrades/releases/tag/0.1.0~~
If you find any bugs please let me know though.
@compact sedge what does it do?
It makes grimmchild stronger. Here's a full description https://github.com/natis1/grimmchildupgrades/blob/master/README.md
hmmm... Lack of precise info. How many notches it will cost?
the lack of precise info is intentional for now because its strength, cost, speed, damage, fireball size, etc. are all dependant on its level. Without Infinite grimm its level is set to maximum, and these values are quite high (viewable and configurable in the config file). With it its level is set based on the damage you have done to infinite grimm.
But since you asked here's the complete list:
maxAttackSpeedMult = 2.0f;
maxRangeMult = 2.0f;
maxBallMoveSpeed = 1.5f;
maxBallSize = 2.0f;
maxDamage = 35;
notchesCost = 6;
max values are the values set at the maximum level
at non-maximum levels these values are fractions of this
it's really strong
at 6 notches it's definitely slightly overpowered
try it out
in the arena, against zote, wherever
oh right you do need to beat NKG first
or it doesn't apply
or it shouldn't apply
if it does that's a bug
oh it probably was applying without beating NKG, but I am fixing that right now
I'm still stuck on the mod installation bit
so i've got the mod api in place
but I dunno what to do now
Oh, Boss Rush?
I don't think it's up to date
for the latest version of HK
but it used to let you fight all the bosses, giving you a small rest after each one
So, the API should be in Steam>Steamapps>common>Hollow Knight>HollowKnight_data>Managed
look at the thing on top
I made a separate Folder for the API
you replace the Assembly-CSharp.dll with the API one
then make a Folder called "Mods"
and install whatever mod you want there
after that make sure that the .dll file of the mod is in there
so i just copy and paste the whole source folder in there?
Well
I'd suggest getting things from here
I think the latest version should be the one
what are some mods that you recommend?
Oh
I'm usually in for a challenging fight
so, my favorites are Mantis Gods and InfiniteGrimm
do they respawn the boss or do you have to go there again?
Mantis Gods makes the fight against the mantis lords much harder - basically an end game fight
(Infinite Grimm respawns Boss, Mantis Gods is still semi-WIP)
InfiniteGrimm makes it so that you can endlessly refight NKG once you have defeated him and gotten Grimmchild Lv. 4
The fight gets increasingly difficult tho
and Grimm never dies
after you die it tells you how much Damage you've done
Oh
this one made The Gruzz mother a tough boss - constantly spawning baby Gruzzflies and taking like a gabjillion hits to kill
But I have never actually played it myself
This one, along with (IIRC) Scale Mod, LightBringer, Glass Soul, Nightmare Mod Grimm aren't for the latest version
rip
I can understand since it was just updated
but if you really want to play them
you can try downgrading your game back to 1.2.whatever
haha it's fine
i'll just put hollow knight on hold for a bit
Until guns and glory comes out
yeah
like, you replaced the Assembly-CSharp
I did?
now you just need to make a "Mods" Folder in which to put the Mod
I think that's the latest version of the Debug Mod
this should be the Assembly-CSharp
also, @copper nacelle, once you beat them you can't really respawn them or escape....
oh i see
so i see you like hollow knight
yeah
Until G&G comes out I'm mainly playing mods
testing if I can help out with something
So, Glass Soul
tbh i'd watch that
I wouldn't mind trying to
but I don't know if I'll have the time to do it
because
Finals
Is the randomizer mod updated for the latest version?
I don't know, sorry
rip me
I respawned the mantis lords but i saved in the treasure room and now the door wont open
Well
Mantis gods look great
You have the thing open, right?
on the menu at the top Right there should be a cheats thing
And in there, there should be a NoClip
And in there, there should be a NoClip
activate it
and walk through the doo
r
and then turn it off
Hey guys! i have one question .
I want to install a mod, but i haven't finished the actual vanilla hollow knight, so what are your advices? should i do it or not or does it affect my saved data? 
most mods affect save data once you open a save
honestly dont imo, you should finish whatever vanilla stuff you have first
so i'd finish the game first tbh
k, thanks
56, did you see?
yeah
I finally managed to beat the Mantis Gods

think i've got an idea on how to fix the transition now
haha yes
should i change the particle colors
or remove them
or no
wdym
Always fight them
I said that after beating them entering the room again is a lock
You can't get out
And you can't fight them
So, make them "spawn" the moment you enter the room so you can always refight them qhen you travel there
And yeah, put the Black Egg Temple particles there
Leave them removed?
yea
You still have a hogh chance to be hit by the boomerang
And Boomerangs, as we already said make thing harder
Talking about boomerangs
Did you remove them from the 2nd fight?
Why?
still dodgable
uhh
now when you go into the room it doesn't take you into a black screen where the pause screen is invisible
instead it just drops you into the arena
and you fall kinda like the gpz fight
any 56 polishing mods
yes
wtf
Cool
why are particles effort
Does the boss rush mod still work?
it doesn't work on lifeblood but you can downpatch to 1.2.2.1 if you want to use it
Cool, thanks

Are particles gard to mive from 1 room to another
I feel like a huge noob right now, but I can't seem to downpatch. :/
are you using the speedrunning.com guide
🏃

Eh which one? Which Friday?
what year is this?
Oh you mean seminar/conference thingy?
yes
It went fine. Lots of Ukrainian people, and there was also this, like, guys who is the best of his field attending the conference
So I was pretty nervous
But it all went smoothly
And I even chatted some with that guy
He be nice
Very cool
He's like 70+ I think
He and his wife were the cutest couple. We went out for drinks after the first day of talks
He drinks like a champ
And I drink like a chimp, whatever that means

He even gave me some pointers for future reference
All in all, a great experience
Except for the fact that I was like 20 minutes late for my flight home
But it all worked out
And now I'm very much glad that I don't have any other presentations/talks/seminars to attend to until December
So I can go back to being the good ol' lazy Gradow
lol

I'm happy it went well
so
back to asking stupid amount of questions in order to make an attempt at making a mod
So, I'm supposed to store the size of the Nail, before resizing the stored thing and then applying it to the original
uhh
yeah except you don't resize the stored thing
you resize the original using the stored thing's value
Then what do I resize?
so like
if you had attack damage as an example
you'd store it into a var
and then you set nail damage using that variable
so like
I change to damage of the Variable and then?
int x = PlayerData.instance.nailDamage;
PlayerData.instance.nailDamage = x * PlayerData.instance.health;
as an example
except you would only set x once
at the beginning of the game
before changing it
is there some example mod I can look at
this?
yeah that's an example mod
is it a good example for what I'm trying to do tho
yes
so, is the private int _tempNailDamage; thing the thing?
yeah that's the var they use to store nail damage
as a bit later on there's this
_tempNailDamage = PlayerData.instance.nailDamage;
which sets it to be the same as the Nail Damage
yeah
the way they do is they change nail damage back to that variable right after the attack
so it doesn't stack
vector3 iirc
You have to get the nail's transform localscale iirc
iirc sean said you don't need to use transform
oh so thats where the escape key is

so
private int modLength;
modLength = HeroController.Instance.slashComponent.Scale
if PlayerData.instance.equippedCharm_18
HeroController.Instance.slashComponent.Scale...
wait...
I got confused mid way
Yeah
so....? I can't just get it?
Refer to code I sent you earlier to get that
Like earlier this week
HeroController.Instance.GetType().GetField("slashComponent", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(HeroController.Instance)
or whatever
^
I'm still not completely understanding how this works and what specifically it does
lemme google the BindingFlags thing
you're getting the type so you can do a get field on it
which gets a fieldinfo
specifying bindingflags lets you get private variables
and stuff
and then you're doing get value (of that field) for the object HeroController.Instance
the fact that it's private makes things a bit more confusing for me
here is the FieldInfo thing I have
FieldInfo fi = typeof(MyClass).GetField("myInt", BindingFlags.NonPublic | BindingFlags.Instance); int x = fi.GetValue(InstanceOfMyClass);
if( modLength == null ) modLength = fi.GetValue(HeroController.Instance) nailLength = modLength * multiplier;
and I have this a bit further down
FieldInfo fi = typeof(HeroController).GetField("slashComponent", BindingFlags.NonPublic | BindingFlags.Instance); GameObject = fi.GetValue(HeroController.Instance);
Why is it private... TnT
because it wants to be
instead of GameObject whatever = fi.GetValue(HeroController.Instance);
pretty sure it should be
NailSlash x = (NailSlash) fi.GetValue(HeroController.Instance);
cause myInt should be slashComponent
So, this
FieldInfo fi = typeof(HeroController).GetField("slashComponent", BindingFlags.NonPublic | BindingFlags.Instance); NailSlash x = (NailSlash) fi.GetValue(HeroController.Instance);
?
(Brb, gotta dinner)
Where do I do the x.scale and stuff? On a separate thing where I set ModLength or somewhere in there?
with the Nailslash x thing
FieldInfo fi = typeof(HeroController).GetField("slashComponent", BindingFlags.NonPublic | BindingFlags.Instance); NailSlash x = (NailSlash) fi.GetValue(HeroController.Instance);
modLength = ... ?
Oh
on a side note thing
Nail Damage isn't private, right?
Good
this one should be easier then\
the Meat of this thing should be something like this
private int RageNailDamage
then
if (PlayerData.instance.equippedCharm_6 )
then
PlayerData.instance.nailDamage = PlayerData.instance.nailDamage + 3*(PlayerData.instance.maxHealth - PlayerData.instance.health);
and then
PlayerData.instance.nailDamage = RageNailDamage
wait
this will stack tho
need to set it to be active only during attacks
you could do
PlayerData.instance.nailDamage = (5 + 4 * PlayerData.instance.nailSmithUpgrades) + 3*(PlayerData.instance.maxHealth - PlayerData.instance.health)
could do that
that's a hook
So, this?
if (PlayerData.instance.equippedCharm_6 )
{
PlayerData.instance.nailDamage = (5 + 4 * PlayerData.instance.nailSmithUpgrades) + 3*(PlayerData.instance.maxHealth - PlayerData.instance.health)
}
i think that'd work
That was... easy
Now how do I make it a mod
Gradow said
I use I make a... Class Library thing in Visual Studio
Why do I have the feeling that this part will take me much longer than the actual making of the... mod thing itself
¯_(ツ)_/¯
let me just open a mod or two so I can see what other things I need to steal
mods tend to start with a
using BlahBlah
using BlahBlah
using
you can just clone example mod and change the name tbh
wdym
The red lines at the edge
fsm
is it a
Health=1
activate stuff = true
@solemn rivet
Help
How do I activate the rage things of FoTF
waity
is his Berserk mod on GitHub?
Found it
now I just have to
understand which part is the one I need to take from them

there's furyVignette
there's also
if (furyParticle != null)
furyParticle.GetComponent<ParticleSystem>().Play();
Well, code got confusing really quickly
I guess I can live without the special effects
so, nameSpace is the thing in the corner?
?
namespace BerserkMod
is this the thing that appears in the corner?
where installed Mods are
Let's see what I can clean up from the thing at the start of the example mod
there's always
namespace Mod
{
public class Something : Mod
....
}
I don't need these
private int _hitCounter;
private int _tempNailDamage;
but theu are in a thing
that the ExampleMod says is about Save Specific things
so, maybe I'll do this
private int NailUpgrades
up there
and then, in the if Thing I'll do
NailUpgrades = PlayerData.instance.nailSmithUpgrades
and finally
PlayerData.instance.nailDamage = (5 + 4 * NailUpgrades) + 3*(PlayerData.instance.maxHealth - PlayerData.instance.health)
there's some internal static thing
What does it do?
I don't need the OnAttack and OnAfterAttack things
in the mod
as of now
I delett them
Program's complaining that PlayerData.instance doesn't exist anywhere
do I just leave it like this?
did you add a reference to assembly-csharp
no idea
what do you mean when?
what you see on the screen
is about a bit more than what I understand
when should your code be called
uhm
is this the
public void OnAttack(AttackDirection dir) thing from the Example mod?
yes
(although, I am an idiot most of the time so it doesn't really maatter)
Will doing the same with OnAttack work the same way?
wdym
public void OnAttack(AttackDirection dir)
{
if (PlayerData.instance.equippedCharm_6 )
BlahBlah
}
I want it to be compatible with other mods
wouldn't it be getplayerint cause you're changing attack damage?
i mean for checking if charms are equipped
o
just generally anything getting data from playerdata should use the GetX functions
um
also what are you trying to do
Well
changing nail damage as the player loses and gains health
make, once FoTF is equipped to boost damage based on lost Health
for each lost mask you get 3 extra damage
well for boosting damage you can just do that on takedamage or gainhealth hook
same with enabling or disabling effects
This is... quite a lot for one day
Can you go over the Bool thing in a bit more detail?
please
as of now, the code thing looks like this
public void OnAttack(AttackDirection dir)
{
if (PlayerData.instance.equippedCharm_6)
{
NailUpgrades = PlayerData.instance.nailSmithUpgrades
PlayerData.instance.nailDamage = (5 + 4 * NailUpgrades) + 5 * (PlayerData.instance.maxHealth - PlayerData.instance.health)
}
}
private void OnAfterAttack(AttackDirection dir)
{
PlayerData.instance.nailDamage = 5 + 4 * NailUpgrades
}
why are you doing NailUpgrades = PlayerData.instance.nailSmithUpgrades
Because
I found it less confusing
(also, there was this private int thing at the top and I didn't want to leave it empty)
should just be something like to change damage
HealthChanged(){
HeroController.Instance.slashComponent.GetComponent<DamagesEnemy>().damageDealt = (5 + 4 * NailUpgrades) + 5 * (PlayerData.instance.maxHealth - PlayerData.instance.health);
HeroController.Instance.slashComponent.fury = true;
}
also the vignette is controlled by an fsm, you can probably just set it to enabled/disabled as you want
and the slashComponent.fury does? Is it the red sword?
yes
Ok
oh its DamagesEnemies
GetComponent<DamagesEnemies>
now I paste that over the PlayerData.instance.nailDamage = (5 + 4 * NailUpgrades) + 5 * (PlayerData.instance.maxHealth - PlayerData.instance.health)?
this could probably colour stuff red as you lose hp
hp= Mathf.Lerp(PlayerData.instance.health / (PlayerData.instance.maxHealth*1.0f), 0, 1);
HeroController.Instance.slashComponent.GetComponent<SpriteRenderer>.color = new Color( 1, hp, hp, 1);
also no I already said you don't need to check everytime you attack
just when you gain or lose hp
And the GetPlayerDataBool thing? what do I do with it?
what do you mean
Where do I put it
(I sound like a retard)
it just gets a bool from PlayerData
euh from the mod list can you explain wat is the unending dreams, charming and charm notch (ok this one i know wat it will do but how much does it add?)
did you read the readmes
where
You want Mantis Gods
haha yes
nah for now i got randomizer, player tracking and debug
Ok, so I replace PlayerData.Instance.nailDamage with...
Ok, I'm gonna go to sleep. Hopefully I'll have figured it out by the morning
@rain cedar add rancid eggs to the Randomizer table 
rip i cant use the mod installer since well i downloaded hollow on a usb key and keeps giving me error messages....
wow nice giving the error messages
steam for windows lets you do that?
@leaden hedge
yeah
weird. seems silly to put a game on a usb stick ¯_(ツ)_/¯
But you said it won't with other mods?
it'd break
you don't actually set the variables
you simply tell stuff what it is when it asks for it
What mod would change those very basic ones?
i have several games on a usb stick
mainly stuff I play at other peoples house
fighting games mostly
I have HK on a couple cuz I had to bring it to GDQ
hell mod
well it would
Yeah, Hell mod
you can set your load order of your mod to be later so it overrides the other mod's values. I think
Hell mod and fandomizer would break it
fandomizer
Phone keyboard
although randomizer wouldn't affect it even if I did use the correct values
fandomizer, when you click on a public discord server you don't know which game it's for
lol
its no effort to do it correct anyway
instead of setting nailDamage, just have a hook on GetPlayerDataBool that returns the correct nail damage
^ because setting nail damage means you have to edit your save after uninstalling
which reminds me I have to fix that
I may or may not be too tired to understand
GetPlayerDataInt("string") has a hook
if "string" is "nailDamage"
you can return x;
oops
its not a bool its an int
GetPlayerDataInt("nailDamage")
well thats what the game would be doing
theres a hook
just find the hook in Modding
autocomplete the delegate
just auto make the delegate with vs
the hook returns an int which is the new value
and takes a string and int
string is target var
int is its current value
Modding.Instance.GetPlayerIntHook += GetInt;
public int GetInt(int value, string varName){
if( varName == "nailDamage" )
return value*2;
return value;
}
this doubles your damage
regardless of any other mods installed
so silly question but does:
PlayerData.Instance.variable give me the variable after it gets modified by any hooks, or is it the real variable?
thats the "real" one
how do I get the modified one
So
In order for it to work the way it works now
I replace the return value*2
With
return value + 5*(MaxHealth - Health)
And to make it only work when FotF (charm_6) is equipped I replace the thing with that?
Wait, it'll scale?
you can just return value if !PlayerData.Instance.GetBool("equippedCharm_6")
no it won't scale
which kinda sucks
ternary
as you could get 27 damage nail 0 on hell mod
what
if it went after hell mod
I mean, you are supposed to get 5 damage for each lost health
5, 10, 15, 20
And not
5, 5+10, 5+10+15
o
ok so at 9 max hp
you'd get +40 damage
which is alot
for a start
and for something like hell mod which halfs damage, order would matter
iirc i just changed it to return 2.5
i mean
2 and then 3 and then 2 and stuff
because everyone was doing it old nail anyways
effectively 2.5
I mean if you hit one enemy and then another repeatedly one will take 3 dmg every time and the other 2 dmg
unless you used random for it
actually uhhh does CalculateNotchesUsed bypass GetPlayerIntHook?
yes
I did it the "proper" way and now things are wrong
is there an override for that I don't want to mess with people's saves
no thx

is there even a way to set notches used manually without reflection?
yes tc are shitposters
tfw they meme us harder than any human could do if they tried
just by existing
fairly certain Count Charms isn't used for the charm menu anyway
unless its CallMethodProper 🤔
CalculateNotchesUsed is not, like called ever in game afaik because... ummm... charm storage is like totally a thing iirc.
or at least it's not called often enough that you could avoid it in a speedrun
If I'm setting stuff in the save I'm gonna just set the charm cost.
but charm storage works because overcharm and deequipping are desync'd
and tell people to disable my mod to fix their game
wtf
the frame you unequip something overcharm is false, but charm isn't disabled until it reaches its slot in the menu
desynced or not desynced the fact that you can do charm storage and it doesn't get fixed automatically means the game isn't running CalculateNotchesUsed()
a function that would fix it.
well it wouldnt
oh right I forgot it doesn't actually cause overcharm if you are using too many notches
nvm
thanks tc
its probably getting called by CallMethodProper
in the action that unequips / equips charms at the end
but overcharm is calculated manually at the beginning
for some reason
but when you unequip a charm but lie to the game to say that charm is equipped you can unequip it many times and have negative notches used
which means they aren't calling that function
because if they did you'd be able to unequip it many times but it wouldn't reduce the notches used
and with those negative notches used you can put on as many charms as you want
just hook it and find out ez
I'd mostly care if I was a speedrunner, I'm just confused at the function's existance if it doesn't seem to be used where it makes sense
meme
GetPlayerDataInt(NULL,PlayerData Var Name,Notch Cost)
IntOperator(Notch Cost,4294967295,2,Notch Cost,FALSE)
PlayerDataIntAdd(NULL,charmSlotsFilled,Notch Cost)
420iq
Log("You will never see this")
wtf
no ur right
1 removes overcharm
2 waits for it to return to its slot
3 unequips the charm
don't think its used for anything important
the charm menu just uses GetPlayerDataInt
huh
i think it's called on unequipping
cause iirc when i set dreamshield's notch cost w/ getplayerdataint
it worked fine when you equipped it
but unequipping left a notch used
until you reopened the menu
https://github.com/natis1/grimmchildupgrades/blob/master/stats.md @steep sail I took your suggestion yesterday and made a chart detailing all the info as precise as I can.
hey anyone here know how to get the number of notches that the person has used
like if there's a variable for that anywhere
(without just iterating over all the charms)
Have the PlayerDataTracker mod been updated for Randomizer Mod 2.0?
you dont need that mod unless you're using the on screen overlay
AA: Have you tried running CharmUpdate() after checking for Overcharm?
also, afaik, the game just iterates over every charm
Here's my plan
as a hook for ModHooks.Instance.CharmUpdateHook
I believe it actually fixes a bug in vanilla HK
because it would stop you from infinite unequipping charms for infinite slots
did you see this method
public void RefreshOvercharm()
{
if (this.playerData.charmSlotsFilled > this.playerData.charmSlots)
{
this.playerData.overcharmed = true;
}
else
{
this.playerData.overcharmed = false;
}
}```
in the GameManager class
no I'm rewriting functions that don't use GetInt or GetBool to make them use those things
oh, gotcha
basically the gist is I don't want my mod ruining save files
by setting the cost of a charm
and forcing the user to either run it with my mod disabled in the modconfig
or to edit the save file manually
got it
Can you not do try and catch in the Initialize function?
I have this:
but the mod fails to load without printing that error
yeah
when it's not found
how do you try to find a variable
reflection
it's public tho
ok
but reflection isnt for private stuff
reflection is for finding stuff on classes not defined in your dll / assembly
just so happens its very good at accessing private members 
idk the exact syntax, will this work? ( (int) this.GetType().GetField("infinitegrimm.InfiniteGlobalVars.versionInt").GetValue(null) >= 300)
yes it does
but god is it gross
that's what I had to do in earlier versions of blackmoth to make it backwards compatible
jk that doesn't work
uh even if it's loaded I get the null reference exception
you can do .GetField("infinitegrimm.InfiniteGlobalVars.versionInt")?
why are you doing this.GetType
oh instead of just GetType?
tbh I have no idea how reflection works
well this.GetType returns the current class
Type.GetType("namespace.class").GetField("variable")
don't you need the qualified assembly name
foreach( Assembly asm in AppDomain.GetAssemblies() ){
foreach( Type t in asm.GetTypes(){
if(t.Name == "class")
return t;
}
}
probably b/c that didn't work
Type.GetType("TypeName,DllName") imo
Type.GetType("infiniteGrimm.InfiniteGlobalVars,infinitegrimm");
i think
would work
not get field
yw
(int)Type.GetType("infinitegrimm.InfiniteGlobalVars, infinitegrimm").GetField("versionInt").GetValue(null)
to be precise
I need that mod on screen overlay.I stream HK Randomizer Mod everyday on Bilibili.😂
I tested Randomizer Mod 2.0 yesterday.Then I plan to start streaming Randomizer Mod 2.0 today.
Hey can someone who has access to the google drive update my mod for me. I just released a new version.
updated
thanks
Good Morning
is there a mod with the if PlayerData.Instance.GetBool("equippedCharm_6")
I'm trying to understand how to fit it in the other Bool thing
the one KDT sent, this:
Modding.Instance.GetPlayerIntHook += GetInt;
public int GetInt(int value, string varName){
if( varName == "nailDamage" )
return value + 5*(PlayerData.instance.maxHealth - PlayerData.instance.health);
return value;
}
...Bools are a new concept for me
if (boolName == "equippedCharm_6" ) {
return whatever;
}
return bool;
Modding.Instance.GetPlayerBoolHook += GetBool;
is the equipped charm a PlayerData.Instance?
if PlayerData.Instance.GetBool("equippedCharm_6")
?
yes
Also, the return thing should be?
charms aren't playerdata.instance(s)
regardless of if you actually have it
bigthink
string+int?
yes notchesUsed is my favorite PlayerData instance
if PlayerData.Instance.GetBool("equippedCharm_6")
string + int implicitly turns the int into a string
oh
ik a little bit of c++, some haskell, and a decent amount of c#, python, js, and java
I know nothing
UnityScript?
eww js
doesn't c++ have implicits 🤔
I think it's bad code
does return true work?
where
if your function returns a bool
then what do you not do
imo explicits just make code more verbose 90% of the time
^
not precisely
when you've got something like
Int.Parse((float)x/(float)y)*(float)z)
sure glad I can just do int i = (x/(float)y)*z
if (boolName == "equippedCharm_6" ) {
return true;
}
return bool;
and then I put the other code, the one that changes attack on the second thing
or do I make the return bool to be true or false and the whatever to be the attack thing
if you put other code after that it won't run 🤔
Mhmm
because return ends the current function
so, return bool is the true/false thing? Because there needs to be a true/false thing somewhere
what
how do I get this to work TnT
yes return bool is the bool that it reads
or in that if statement
whatever you return
so, if the charm is equipped return bool should be true
also redundancy btw
but you are using this code to modify that behavior
right?
lay it on me what are you trying to do folding
I'm trying to make it so that whenever FoTF (charm_6) is equipped, attack is boosted based on amount of lost health
KDT said that this should be the part about damage based on lost health
Modding.Instance.GetPlayerIntHook += GetInt;
public int GetInt(int value, string varName){
if( varName == "nailDamage" )
return value + 5*(PlayerData.instance.maxHealth - PlayerData.instance.health);
return value;
}
But this makes it a bit more confusing for me
all this does is make the game think fotf is permanently equipped
if (boolName == "equippedCharm_6" ) {
return true;
}
return bool;
so, I'll try and make what I have for now work and then start changing it
if (boolName == "equippedCharm_6" ) {
return TheDamageThing;
}
return true;
?
Ok
you can't return a number
hook into the 2 functions that get called when you change health
PlayerData.Instance.GetInt("nailDamage")
HeroController.Instance.slashComponent.GetComponent<DamagesEnemies>().damageDealt = nailDamage
Ok so here's what you want to do. First check if it's equipped
literally just put:
PlayerData.instance.GetBool("equippedCharm_6");
And if that bool is true, then set the damage. the damage can be set
using what KDT said
will it work the way I'm trying to make it now?
i have no idea what you're trying to do
afaik you're making the game always think you don't have fotf equipped
thats not even related to the problem
so probably not
trying to fit the Damage thing, that you said should theoretically work into a "if charm_6 is equipped" thing
will this work PlayerData.instance.equippedCharm_6?
Ok, first, will this do the thing I want and set damage to increase based on amount of lost health (without stacking)?
Modding.Instance.GetPlayerIntHook += GetInt;
public int GetInt(int value, string varName){
if( varName == "nailDamage" )
return value + 5*(PlayerData.instance.maxHealth - PlayerData.instance.health);
return value;
}
I think you need to try to understand what the things you're posting do
And why they do it
Not just ask if it's what you want
public Mod(){
Modding.ModHooks.Instance.TakeDamageHook += UpdateNail;
Modding.ModHooks.Instance.BeforeAddHealthHook+= UpdateNail;
Modding.ModHooks.Instance.GetIntHook += nailDamageOverride;
}
public int nailDamageOverride(int value, string varName){
if(varName == "nailDamage" && PlayerData.Instance.equippedCharm_6){
return value + 5*(PlayerData.instance.maxHealth - PlayerData.instance.health);;
}
return value;
}
public int UpdateNail(int amount){
int nailDamage = PlayerData.Instance.GetInt("nailDamage");
HeroController.Instance.slashComponent.GetComponent<DamagesEnemies>().damageDealt = nailDamage;
return amount;
}
@rain cedar I understand that, I was trying to make it function only when Fury is equipped
Well what KDT posted is that
Except it doesn't change damage
It's just the framework
should when you get hit
Oh wait yeah I see that in nailDamageOverride
only on lb though, I guess you could SetInt and call the fsm event
But that's not actually gonna affect damage
int nailDamage = PlayerData.Instance.GetInt("nailDamage");
HeroController.Instance.slashComponent.GetComponent<DamagesEnemies>().damageDealt = nailDamage;
these 2 should
afaik
because when the game looked for it when it loads the game
you overrode it 🤔
BIG THINK
oof
you only need the UpdateNail because he wants it to update as his health changes
I would just update damage on swing tbh
I don't trust that to work
Something else will probably update damage after it runs
just do it everyframe 


