#archived-modding-development

1 messages · Page 97 of 1

compact sedge
#

for the charms themselves

#

they're scattered all over the place

#

somewhat in fsms somewhat it game logic

flat forum
#

...why?...

compact sedge
#

¯_(ツ)_/¯

flat forum
#

Is your 2nd mod on the Github?

compact sedge
#

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

copper nacelle
#

just write

#

various fixes/changes

compact sedge
#

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

copper nacelle
#

lol

compact sedge
#

idk what caused it and idk how I fixed it

#

but I'm pretty sure I fixed it

copper nacelle
#

lul

compact sedge
#

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

copper nacelle
#

r u using the onint thingy

#

the intget hook

compact sedge
#

I'm doing on activeSceneChanged

#

running PlayerData.instance.CalculateNotchesUsed

copper nacelle
#

boi

#

are you using the onint hook tho

#

to set charm costs

compact sedge
#

what hook

#

I have CharmUpdateHook

#

that's about it

copper nacelle
#

ModHooks.Instance.GetPlayerIntHook

compact sedge
#

no?

copper nacelle
#

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

compact sedge
#

it's not setting them as overcharmed even though, with the extra cost, they should be

copper nacelle
#

does the charm show up w/ the cost in the inventory?

compact sedge
#

oh crap I can't test anymore because I fixed my build

copper nacelle
#

what

compact sedge
#

brb let me do 4k damage to IG hardmode

copper nacelle
#

aaa

#

i gotta sleep

#

2am

compact sedge
#

wtf

#

u up this late

hollow pier
#

wake up at 5pm

flat forum
#

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

compact sedge
#

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

flat forum
#

this one?

compact sedge
#

yeah

flat forum
#

why isn't what working?

compact sedge
#

count the notches

#

2 + 5 + 2 + 3 = 12

#

but I have 11 in the notches section

flat forum
#

hm

#

try unequipping everything

#

and then equipping Deep Focus, Hive Blood and then GrimmChild

compact sedge
#

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

flat forum
#

Wait

#

So

compact sedge
#

so whenever you get an upgrade and the charm cost goes up it assumes you had a full set and overcharms you

flat forum
#

if you beat NKG you don't get overcharmed right after that, but after you unequip and re-equip the charm?

compact sedge
#

yes

#

so you can get max upgrade and it only uses 2 notches

#

so long as you never take it off

flat forum
#

That's probably some notch storage thing or something that you can't really fix

compact sedge
#

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

leaden hedge
#

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

compact sedge
#

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

torn fulcrum
#

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

rain cedar
#

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

leaden hedge
#

you can't just steal my phrase

#

you'll hear from my lawyers

rain cedar
#

But it isn't my problem

compact sedge
#

I had a storage bug in my mod and I fixed it anyway which I guess makes me better than TC

torn fulcrum
#

ye I know it isn't

#

it might have to do with me getting the dream nail earlier

rain cedar
#

Oh that might actually be my problem then

#

How did the freeze look?

torn fulcrum
#

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*

rain cedar
#

That's the one that just happens sometimes without mods

torn fulcrum
#

nah

#

another thing is that the light wall thing didn't appear

rain cedar
#

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

torn fulcrum
#

alright, I'll try, thank you

compact sedge
steep sail
#

@compact sedge what does it do?

compact sedge
steep sail
#

hmmm... Lack of precise info. How many notches it will cost?

compact sedge
#

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

steep sail
#

Wow...

#

6

#

6 notches

compact sedge
#

it's really strong

steep sail
#

But not for 6 notches

#

4-5

compact sedge
#

at 6 notches it's definitely slightly overpowered

#

try it out

#

in the arena, against zote, wherever

steep sail
#

After NKG)

#

Only after NKG

compact sedge
#

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

flat forum
#

Finally

#

took me long enough

acoustic ibex
#

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

flat forum
#

mhm

#

So

#

Lemme show you how I've done things

acoustic ibex
#

btw what does the boss rush mod do

#

okay ty

flat forum
#

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

acoustic ibex
#

oh that's a fun mod

#

this is the one i'm trying to install

flat forum
#

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

acoustic ibex
#

so i just copy and paste the whole source folder in there?

flat forum
#

Well

#

I'd suggest getting things from here

#

I think the latest version should be the one

acoustic ibex
#

oh wow

#

thanks

flat forum
#

If not

#

I'll see which one I have and try sending it

acoustic ibex
#

what are some mods that you recommend?

flat forum
#

Oh

#

I'm usually in for a challenging fight

#

so, my favorites are Mantis Gods and InfiniteGrimm

acoustic ibex
#

do they respawn the boss or do you have to go there again?

flat forum
#

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

acoustic ibex
#

lol

#

that sounds

#

pretty intense

#

hardcore*

flat forum
#

yeah

#

but it's pretty fun too

#

my record was like

#

lemme check

#

11227 damage

acoustic ibex
#

lol wow

#

what's the empress muzznik mod

flat forum
#

Oh

acoustic ibex
#

I couldn't even get past grimm

#

like

#

normal grimm

#

so that's pretty impressive

flat forum
#

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

acoustic ibex
#

rip

flat forum
#

NGG was for the latest Grimm Troupe version I think

#

and the others are older

acoustic ibex
#

I can understand since it was just updated

flat forum
#

but if you really want to play them

#

you can try downgrading your game back to 1.2.whatever

acoustic ibex
#

haha it's fine

#

i'll just put hollow knight on hold for a bit

#

Until guns and glory comes out

flat forum
#

Well, Debug Mod should be easy todownload

#

you have the API, right?

acoustic ibex
#

yeah

flat forum
#

like, you replaced the Assembly-CSharp

acoustic ibex
#

I did?

flat forum
#

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....

acoustic ibex
#

oh i see

flat forum
#

These are for the Maker of that Mod

#

The 2 files are for you

#

=P

acoustic ibex
#

Oh yeah it got installed

#

ty

flat forum
#

=D

#

No Problem

acoustic ibex
#

so i see you like hollow knight

flat forum
#

yeah

#

Until G&G comes out I'm mainly playing mods

#

testing if I can help out with something

acoustic ibex
#

maybe you can do like a whole no-hit playthrough or something

#

except fast tracked

flat forum
#

So, Glass Soul

acoustic ibex
#

tbh i'd watch that

flat forum
#

I wouldn't mind trying to

#

but I don't know if I'll have the time to do it

#

because

#

Finals

cursive bone
#

Is the randomizer mod updated for the latest version?

flat forum
#

I don't know, sorry

acoustic ibex
#

rip me

#

I respawned the mantis lords but i saved in the treasure room and now the door wont open

flat forum
#

Well

weak lodge
#

Mantis gods look great

flat forum
#

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

fair rampart
#

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? noot

copper nacelle
#

most mods affect save data once you open a save

floral furnace
#

honestly dont imo, you should finish whatever vanilla stuff you have first

copper nacelle
#

so i'd finish the game first tbh

fair rampart
#

k, thanks

flat forum
#

56, did you see?

copper nacelle
#

yeah

flat forum
#

I finally managed to beat the Mantis Gods

copper nacelle
#

think i've got an idea on how to fix the transition now

#

should i change the particle colors

#

or remove them

#

or no

flat forum
#

Put the Black Egg temple ones

#

Also, make them instantly respawn

#

So you can...

copper nacelle
#

wdym

flat forum
#

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

copper nacelle
#

okay

#

should i readd the spikes

#

or no

flat forum
#

Leave them removed?

copper nacelle
#

yea

flat forum
#

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?

copper nacelle
#

no

#

i think they're fine in the second fight as it is

#

maybe a bit slower

flat forum
#

Why?

copper nacelle
#

still dodgable

flat forum
#

Hmmm

#

Yes but...

#

Uhh
Ummmmm

Ok

copper nacelle
#

well on the bright side transitions work now

#

exactly as i intended too

flat forum
#

?

#

How did they work before?

#

What did you intend and what was off?

copper nacelle
#

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

hazy sentinel
#

any 56 polishing mods

copper nacelle
#

yes

hazy sentinel
#

wtf

flat forum
#

Cool

copper nacelle
#

why are particles effort

karmic jungle
#

Does the boss rush mod still work?

copper nacelle
#

it doesn't work on lifeblood but you can downpatch to 1.2.2.1 if you want to use it

karmic jungle
#

Cool, thanks

sterile valley
copper nacelle
flat forum
#

Are particles gard to mive from 1 room to another

karmic jungle
#

I feel like a huge noob right now, but I can't seem to downpatch. :/

copper nacelle
solemn rivet
#

^

#

56 is 56x quicker than me

copper nacelle
#

🏃

solemn rivet
flat forum
#

Hey Gradow

#

How did the thing go

#

The one on Friday

solemn rivet
#

Eh which one? Which Friday?

#

elderbug what year is this?

#

Oh you mean seminar/conference thingy?

copper nacelle
#

yes

solemn rivet
#

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

copper nacelle
solemn rivet
#

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

copper nacelle
#

lol

solemn rivet
#

So, 8/8 gr8

#

And thanks for asking and caring btw

#

You guys have all been great

copper nacelle
flat forum
#

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

copper nacelle
#

uhh

#

yeah except you don't resize the stored thing

#

you resize the original using the stored thing's value

flat forum
#

Then what do I resize?

copper nacelle
#

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

flat forum
#

I change to damage of the Variable and then?

copper nacelle
#

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

flat forum
#

is there some example mod I can look at

#

this?

copper nacelle
#

yeah that's an example mod

flat forum
#

is it a good example for what I'm trying to do tho

copper nacelle
#

yes

flat forum
#

so, is the private int _tempNailDamage; thing the thing?

copper nacelle
#

yeah that's the var they use to store nail damage

flat forum
#

as a bit later on there's this
_tempNailDamage = PlayerData.instance.nailDamage;

#

which sets it to be the same as the Nail Damage

copper nacelle
#

yeah

#

the way they do is they change nail damage back to that variable right after the attack

#

so it doesn't stack

flat forum
#

So, to store Nail Size I can do the same

#

what is the Nail Size?

#

is it like a...

copper nacelle
#

vector3 iirc

flat forum
#

HeroController.Instance.

#

slashComponent?

solemn rivet
#

You have to get the nail's transform localscale iirc

copper nacelle
#

iirc sean said you don't need to use transform

solemn rivet
#

Oh

#

Dunno then

copper nacelle
#

just slashComponent.scale

#

i think

flat forum
#

is there a slashComponent.Scale ot something?

#

Oh

#

Ok

solemn rivet
#

Oh

#

I stand corrected

supple sigil
#

oh so thats where the escape key is

copper nacelle
flat forum
#

so

private int modLength;
modLength = HeroController.Instance.slashComponent.Scale
if PlayerData.instance.equippedCharm_18
HeroController.Instance.slashComponent.Scale...

wait...

#

I got confused mid way

copper nacelle
#

slashComponent is private

#

iirc

solemn rivet
#

Yeah

flat forum
#

so....? I can't just get it?

solemn rivet
#

Refer to code I sent you earlier to get that

flat forum
#

Oh

#

the FieldInfo thing?

solemn rivet
#

Like earlier this week

copper nacelle
#

HeroController.Instance.GetType().GetField("slashComponent", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(HeroController.Instance)

#

or whatever

solemn rivet
#

^

flat forum
#

I'm still not completely understanding how this works and what specifically it does

#

lemme google the BindingFlags thing

copper nacelle
#

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

flat forum
#

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

copper nacelle
#

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

flat forum
#

So, this

FieldInfo fi = typeof(HeroController).GetField("slashComponent", BindingFlags.NonPublic | BindingFlags.Instance); NailSlash x = (NailSlash) fi.GetValue(HeroController.Instance);

#

?

#

(Brb, gotta dinner)

copper nacelle
#

yes

#

then you can do x.scale and stuff

flat forum
#

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

copper nacelle
#

you could do

flat forum
#

ModHooks.Instance.AttackHook += OnAttack; ?

#

what's this?

copper nacelle
#

PlayerData.instance.nailDamage = (5 + 4 * PlayerData.instance.nailSmithUpgrades) + 3*(PlayerData.instance.maxHealth - PlayerData.instance.health)

#

could do that

#

that's a hook

flat forum
#

So, this?

if (PlayerData.instance.equippedCharm_6 )
{
PlayerData.instance.nailDamage = (5 + 4 * PlayerData.instance.nailSmithUpgrades) + 3*(PlayerData.instance.maxHealth - PlayerData.instance.health)
}
copper nacelle
#

i think that'd work

flat forum
#

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

copper nacelle
#

¯_(ツ)_/¯

flat forum
#

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

copper nacelle
#

you can just clone example mod and change the name tbh

flat forum
#

Oh

#

another thing

#

how does the Rage effect of FoTF activate?

copper nacelle
#

wdym

flat forum
#

The red lines at the edge

copper nacelle
#

fsm

flat forum
#

is it a
Health=1
activate stuff = true

copper nacelle
#

idk

#

ask gradow

flat forum
#

@solemn rivet
Help
How do I activate the rage things of FoTF

#

waity

#

is his Berserk mod on GitHub?

copper nacelle
#

yes

#

ayugradow/berserkmod

#

iirc

flat forum
#

Found it

#

now I just have to

#

understand which part is the one I need to take from them

copper nacelle
flat forum
#

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?

copper nacelle
#

?

flat forum
#

namespace BerserkMod

#

is this the thing that appears in the corner?

#

where installed Mods are

copper nacelle
#

that's class name

#

iirc

flat forum
#

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?

copper nacelle
#

did you add a reference to assembly-csharp

flat forum
#

Oh

#

Oops

#

still not happy about "maxhealth"

copper nacelle
#

white theme

#

boi wtf are you doing

flat forum
#

no idea

copper nacelle
#

that's not in a method

#

when is it getting called

flat forum
#

what do you mean when?

#

what you see on the screen

#

is about a bit more than what I understand

copper nacelle
#

when should your code be called

flat forum
#

uhm

#

is this the
public void OnAttack(AttackDirection dir) thing from the Example mod?

copper nacelle
#

yes

flat forum
#

Oh

#

Ok

#

um

#

I'm an idiot for not looking at this more carefully

copper nacelle
flat forum
#

(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?

copper nacelle
#

wdym

flat forum
#

public void OnAttack(AttackDirection dir)
{
if (PlayerData.instance.equippedCharm_6 )
BlahBlah
}

leaden hedge
#

do GetPlayerDataBool

#

unless you want your mod to be incompatible with other mods

flat forum
#

I want it to be compatible with other mods

copper nacelle
#

wouldn't it be getplayerint cause you're changing attack damage?

leaden hedge
#

i mean for checking if charms are equipped

copper nacelle
#

o

leaden hedge
#

just generally anything getting data from playerdata should use the GetX functions

flat forum
#

um

leaden hedge
#

also what are you trying to do

flat forum
#

Well

copper nacelle
#

changing nail damage as the player loses and gains health

flat forum
#

make, once FoTF is equipped to boost damage based on lost Health

#

for each lost mask you get 3 extra damage

leaden hedge
#

well for boosting damage you can just do that on takedamage or gainhealth hook

#

same with enabling or disabling effects

flat forum
#

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
        }
copper nacelle
#

why are you doing NailUpgrades = PlayerData.instance.nailSmithUpgrades

flat forum
#

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)

leaden hedge
#

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

flat forum
#

and the slashComponent.fury does? Is it the red sword?

leaden hedge
#

yes

flat forum
#

Ok

leaden hedge
#

oh its DamagesEnemies

flat forum
#

GetComponent<DamagesEnemies>

leaden hedge
#

yes

#

if you wanted to try and do something else instead of .fury = true

flat forum
#

now I paste that over the PlayerData.instance.nailDamage = (5 + 4 * NailUpgrades) + 5 * (PlayerData.instance.maxHealth - PlayerData.instance.health)?

leaden hedge
#

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

flat forum
#

And the GetPlayerDataBool thing? what do I do with it?

leaden hedge
#

what do you mean

flat forum
#

Where do I put it

leaden hedge
#

where xxx is a bool

flat forum
#

(I sound like a retard)

leaden hedge
#

it just gets a bool from PlayerData

wind mesa
#

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?)

copper nacelle
#

did you read the readmes

wind mesa
#

where

copper nacelle
#

in the mods

#

the zips

wind mesa
#

oh no i havent downloaded them

#

just checking wich one i want

flat forum
#

You want Mantis Gods

copper nacelle
#

haha yes

wind mesa
#

nah for now i got randomizer, player tracking and debug

flat forum
#

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

solid wagon
#

@rain cedar add rancid eggs to the Randomizer table zote

wind mesa
#

rip i cant use the mod installer since well i downloaded hollow on a usb key and keeps giving me error messages....

copper nacelle
#

wow nice giving the error messages

flat forum
#

Wait

#

Why wouldn't the mod be usable the way it is now?

compact sedge
#

steam for windows lets you do that?

flat forum
#

@leaden hedge

copper nacelle
#

yeah

leaden hedge
#

it'd work

#

but if any mod changed any values you change correct

compact sedge
#

weird. seems silly to put a game on a usb stick ¯_(ツ)_/¯

flat forum
#

But you said it won't with other mods?

leaden hedge
#

it'd break

flat forum
#

Hm

#

Well

leaden hedge
#

you don't actually set the variables

#

you simply tell stuff what it is when it asks for it

flat forum
#

What mod would change those very basic ones?

young walrus
#

Unless you're taking it from a friend...

#

#piracy

leaden hedge
#

i have several games on a usb stick

#

mainly stuff I play at other peoples house

#

fighting games mostly

young walrus
#

I have HK on a couple cuz I had to bring it to GDQ

copper nacelle
#

I've got terraria on a usb

#

not much else tho

leaden hedge
#

what do you mean, what mod would change those very basic ones?

#

yours for a start

copper nacelle
#

hell mod

flat forum
#

"but if any mod changed any values you change

it'd break"

#

So

#

Oh

leaden hedge
#

well it would

flat forum
#

Yeah, Hell mod

leaden hedge
#

look at randomizer and boss rush

#

boss rush doesn't use them

#

so it breaks rando

compact sedge
#

you can set your load order of your mod to be later so it overrides the other mod's values. I think

flat forum
#

Hell mod and fandomizer would break it

copper nacelle
#

fandomizer

flat forum
#

Phone keyboard

leaden hedge
#

although randomizer wouldn't affect it even if I did use the correct values

compact sedge
#

fandomizer, when you click on a public discord server you don't know which game it's for

flat forum
#

lol

leaden hedge
#

its no effort to do it correct anyway

#

instead of setting nailDamage, just have a hook on GetPlayerDataBool that returns the correct nail damage

compact sedge
#

^ because setting nail damage means you have to edit your save after uninstalling

#

which reminds me I have to fix that

flat forum
#

I may or may not be too tired to understand

leaden hedge
#

GetPlayerDataInt("string") has a hook

#

if "string" is "nailDamage"

#

you can return x;

#

oops

#

its not a bool its an int

flat forum
#

GetPlayerDataInt("nailDamage")

leaden hedge
#

well thats what the game would be doing

#

theres a hook

#

just find the hook in Modding

#

autocomplete the delegate

flat forum
#

= something?

#

test

#

Ok

leaden hedge
#

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

compact sedge
#

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?

leaden hedge
#

thats the "real" one

compact sedge
#

how do I get the modified one

leaden hedge
#

you can also do

#

GetIntInternal

#

just do PlayerData.Instance.GetInt("varName");

flat forum
#

So

#

In order for it to work the way it works now
I replace the return value*2
With
return value + 5*(MaxHealth - Health)

leaden hedge
#

yes

#

although imo i'd scale the 5 with value

flat forum
#

And to make it only work when FotF (charm_6) is equipped I replace the thing with that?

#

Wait, it'll scale?

leaden hedge
#

you can just return value if !PlayerData.Instance.GetBool("equippedCharm_6")

#

no it won't scale

#

which kinda sucks

copper nacelle
#

ternary

leaden hedge
#

as you could get 27 damage nail 0 on hell mod

copper nacelle
#

what

leaden hedge
#

if it went after hell mod

flat forum
#

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

copper nacelle
#

o

leaden hedge
#

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

flat forum
#

Well

#

I'll be tweaking later

#

Maybe x4 for now

copper nacelle
#

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

compact sedge
#

oh I was gonna say

#

2.5 damage never did make sense to me

copper nacelle
#

effectively 2.5

compact sedge
#

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?

copper nacelle
#

yes

compact sedge
#

I did it the "proper" way and now things are wrong

copper nacelle
#

yes

#

tc very nice

compact sedge
#

is there an override for that I don't want to mess with people's saves

copper nacelle
compact sedge
#

no thx

copper nacelle
compact sedge
#

is there even a way to set notches used manually without reflection?

copper nacelle
#

it's public

#

🤔

leaden hedge
#

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 🤔

compact sedge
#

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

leaden hedge
#

well you can just set notchesFilled

#

in the save and it works

copper nacelle
#

and it's public

#

dungo

compact sedge
#

If I'm setting stuff in the save I'm gonna just set the charm cost.

leaden hedge
#

but charm storage works because overcharm and deequipping are desync'd

compact sedge
#

and tell people to disable my mod to fix their game

copper nacelle
#

wtf

leaden hedge
#

the frame you unequip something overcharm is false, but charm isn't disabled until it reaches its slot in the menu

compact sedge
#

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.

leaden hedge
#

well it wouldnt

compact sedge
#

oh right I forgot it doesn't actually cause overcharm if you are using too many notches

#

nvm

#

thanks tc

leaden hedge
#

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

compact sedge
#

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

copper nacelle
#

just hook it and find out ez

compact sedge
#

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

copper nacelle
leaden hedge
#
GetPlayerDataInt(NULL,PlayerData Var Name,Notch Cost)
IntOperator(Notch Cost,4294967295,2,Notch Cost,FALSE)
PlayerDataIntAdd(NULL,charmSlotsFilled,Notch Cost)
#

420iq

compact sedge
#

Log("You will never see this")

copper nacelle
#

wtf

leaden hedge
#

but like I said

#

overcharm glitch is different

compact sedge
#

no ur right

copper nacelle
#

haha ur a dungo

#

it was called

leaden hedge
#

1 removes overcharm
2 waits for it to return to its slot
3 unequips the charm

copper nacelle
leaden hedge
#

why this is like this

#

is 420iq

copper nacelle
#

because tc

#

function gets called tho

leaden hedge
#

don't think its used for anything important

#

the charm menu just uses GetPlayerDataInt

copper nacelle
#

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

compact sedge
compact sedge
#

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)

lucid pond
#

Have the PlayerDataTracker mod been updated for Randomizer Mod 2.0?

young walrus
#

you dont need that mod unless you're using the on screen overlay

solemn rivet
#

AA: Have you tried running CharmUpdate() after checking for Overcharm?

#

also, afaik, the game just iterates over every charm

compact sedge
#

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

solemn rivet
#

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

compact sedge
#

no I'm rewriting functions that don't use GetInt or GetBool to make them use those things

solemn rivet
#

oh, gotcha

compact sedge
#

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

solemn rivet
#

got it

compact sedge
#

Can you not do try and catch in the Initialize function?

#

but the mod fails to load without printing that error

copper nacelle
#

yeah

compact sedge
#

when it's not found

copper nacelle
#

that won't work

#

that's an assembly load error

#

iirc

compact sedge
#

how do you try to find a variable

leaden hedge
#

reflection

copper nacelle
#

reflection

#

ree

compact sedge
#

it's public tho

leaden hedge
#

ok

copper nacelle
#

doesn't matter

#

reflection

leaden hedge
#

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 hollowface

compact sedge
#

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

solemn rivet
#

that's what I had to do in earlier versions of blackmoth to make it backwards compatible

compact sedge
#

jk that doesn't work

rain cedar
#

You're casting null to int if the other mod isn't loaded

#

Check that it isn't null

compact sedge
#

uh even if it's loaded I get the null reference exception

copper nacelle
#

you can do .GetField("infinitegrimm.InfiniteGlobalVars.versionInt")?

compact sedge
#

do I need the namespace

#

and if so do I need the function as well

leaden hedge
#

why are you doing this.GetType

compact sedge
#

oh instead of just GetType?

copper nacelle
#

type.gettype

#

iirc

compact sedge
#

tbh I have no idea how reflection works

leaden hedge
#

well this.GetType returns the current class

#

Type.GetType("namespace.class").GetField("variable")

copper nacelle
#

don't you need the qualified assembly name

leaden hedge
#
foreach( Assembly asm in AppDomain.GetAssemblies() ){
    foreach( Type t in asm.GetTypes(){
        if(t.Name == "class")
            return t;
    }
}
compact sedge
#

probably b/c that didn't work

copper nacelle
#

Type.GetType("TypeName,DllName") imo

#

Type.GetType("infiniteGrimm.InfiniteGlobalVars,infinitegrimm");

#

i think

#

would work

compact sedge
#

not get field

copper nacelle
#

no you get field of the type

#

wait

#

:ech:

compact sedge
#

that works

#

thanks 56

copper nacelle
#

yw

compact sedge
#

(int)Type.GetType("infinitegrimm.InfiniteGlobalVars, infinitegrimm").GetField("versionInt").GetValue(null)

#

to be precise

lucid pond
#

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.

compact sedge
copper nacelle
#

updated

compact sedge
#

thanks

flat forum
#

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

compact sedge
#
if (boolName == "equippedCharm_6" ) {
    return whatever;
}
return bool;
#

Modding.Instance.GetPlayerBoolHook += GetBool;

flat forum
#

is the equipped charm a PlayerData.Instance?

#

if PlayerData.Instance.GetBool("equippedCharm_6")

#

?

compact sedge
#

yes

flat forum
#

Also, the return thing should be?

compact sedge
#

that's if you wanna trick the game

#

into thinking if you have it or not

copper nacelle
#

charms aren't playerdata.instance(s)

compact sedge
#

regardless of if you actually have it

copper nacelle
#

wtf

#

equipped charm is a instance var which is a bool that's on playerdata

compact sedge
steep sail
#

string+int?

copper nacelle
#

yes notchesUsed is my favorite PlayerData instance

flat forum
#

if PlayerData.Instance.GetBool("equippedCharm_6")

copper nacelle
#

string + int implicitly turns the int into a string

steep sail
#

oh

flat forum
#

what do I put in the return below it?

#

the "return whatever" thing

steep sail
#

didn`t know about this

#

Basically, I`m C++ and Pascal coder

#

Not C#

copper nacelle
#

ik a little bit of c++, some haskell, and a decent amount of c#, python, js, and java

flat forum
#

I know nothing

steep sail
#

UnityScript?

copper nacelle
#

idk that

#

basically js tho iirc

compact sedge
#

eww js

leaden hedge
#

doesn't c++ have implicits 🤔

compact sedge
#

yes

#

c++ 11 and on or 14 and on

#

forgot which one added it

#

I never do implicits

copper nacelle
#

why

#

wtf

compact sedge
#

I think it's bad code

flat forum
#

does return true work?

copper nacelle
#

where

leaden hedge
#

if your function returns a bool

compact sedge
#

oh wait no I do do implicits

#

and they're older they're from like c++idk

copper nacelle
#

then what do you not do

leaden hedge
#

imo explicits just make code more verbose 90% of the time

copper nacelle
#

^

compact sedge
#

verbose code is good code

#

easier to read and debug

leaden hedge
#

not precisely

copper nacelle
#

java.lang.System.out.println("no");

#

or whatever it is

leaden hedge
#

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

flat forum
#
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

leaden hedge
#

if you put other code after that it won't run 🤔

flat forum
#

Mhmm

leaden hedge
#

because return ends the current function

flat forum
#

so, return bool is the true/false thing? Because there needs to be a true/false thing somewhere

leaden hedge
#

what

flat forum
#

how do I get this to work TnT

compact sedge
#

yes return bool is the bool that it reads

#

or in that if statement

#

whatever you return

flat forum
#

so, if the charm is equipped return bool should be true

compact sedge
#

if that's true then it reads it as true

#

that's what will normally happen

leaden hedge
#

also redundancy btw

compact sedge
#

but you are using this code to modify that behavior

#

right?

#

lay it on me what are you trying to do folding

flat forum
#

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;
}
leaden hedge
#

i've already told you to use the ontakedamage/heal hooks

#

to update naildamage

flat forum
#

But this makes it a bit more confusing for me

leaden hedge
#

all this does is make the game think fotf is permanently equipped

if (boolName == "equippedCharm_6" ) {
    return true;
}
return bool;
flat forum
#

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;

?

leaden hedge
#

what

#

no

flat forum
#

Ok

leaden hedge
#

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

compact sedge
#

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

flat forum
#

will it work the way I'm trying to make it now?

leaden hedge
#

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

flat forum
#

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;
}
rain cedar
#

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

flat forum
#

I'm trying to, sorry...

#

that one should find what nail damage is

rain cedar
#

That one adds a scaled value to nail damage

#

Regardless of fury

leaden hedge
#
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;
}
flat forum
#

@rain cedar I understand that, I was trying to make it function only when Fury is equipped

rain cedar
#

Well what KDT posted is that

#

Except it doesn't change damage

#

It's just the framework

leaden hedge
#

should when you get hit

rain cedar
#

Oh wait yeah I see that in nailDamageOverride

leaden hedge
#

only on lb though, I guess you could SetInt and call the fsm event

rain cedar
#

But that's not actually gonna affect damage

leaden hedge
#
    int nailDamage = PlayerData.Instance.GetInt("nailDamage");
    HeroController.Instance.slashComponent.GetComponent<DamagesEnemies>().damageDealt = nailDamage;
#

these 2 should

#

afaik

copper nacelle
#

i was doing it w/out the fsm event in hell mod and it was working

#

idk why

leaden hedge
#

because when the game looked for it when it loads the game

#

you overrode it 🤔

#

BIG THINK

copper nacelle
#

oof

leaden hedge
#

you only need the UpdateNail because he wants it to update as his health changes

rain cedar
#

I would just update damage on swing tbh

#

I don't trust that to work

#

Something else will probably update damage after it runs

leaden hedge
#

just do it everyframe hollowface

rain cedar
#

That wouldn't be that bad if the game was made well

#

But it uses reflection to get values

#

And doesn't cache them