#archived-modding-development

1 messages ยท Page 39 of 1

buoyant obsidian
#

Computer fixed :)

buoyant wasp
#

Super early prototype of the FSM viewer based on the original from @leaden hedge that allows for you to simply point it at a folder instead of having to manually edit each FSM's json file and load it manually. If you use the FSM viewer alot for lots of different files, this probably will be worth your time. If you rarely use it for a single FSM, KDT's original is faster probably.

Note that this is a UWP app which means the following:

  1. Windows 10 only. With At least the spring 2017 creators update.
  2. It's signed with a self-signed certificate. Trust it, or don't. (if not, can't use it, sorry)
  3. You might have to turn on sideloading of apps (I don't know, i can't test that)

to use, unzip and run Add-AppDevPackage.ps1. That will prompt you to trust the cert, and then install the app. Should then show up in your start menu as Hollow Knight FSM Viewer.

Here's the source if you want to see exactly what it does. (really other than adding the functionality to read the files from a folder, it's identical in every way to KDT's version)

#

PS: this is the first UWP app i've written, it probably sucks, and probably should never, ever be used as an example of how to properly write one. ever.

leaden hedge
#

If you rewrite it in c# you can use the assembly to actual generate correct function parameters

#

I guess you could manually dump that and use a different language

buoyant wasp
#

maybe, but honestly my biggest reason for this was that trying to go and fiddle with the json files when i'm trying to poke around in lots of files was tedious. I hate tedious. Honestly i don't even know how you did all the logic to determine how to draw the things in the right places. in general, the viewer's code only changed in the areas that handle loading the data

#

but all the SVG, logic, parsing, mouseover code is a direct copy

leaden hedge
#

Ah, I would have just added file drag and drop to bypass security issues but, I couldn't get it to work

buoyant wasp
#

yup, security is always the problem with browser based solutions

solemn rivet
#

Where the hell did I put the code for making relics worth 0 geo?

knotty grove
#

๐Ÿ˜‚

#

keep logs Kappa it will help in the future

solemn rivet
#

Yeah...

urban sedge
#

Hey Guys I came here from the speedrunning chat. Kinda new to this discord. Can someone explain modding to me in a private chat (Basically how do I set it up?)

solemn rivet
#

ffs, the code for that is in a remote part of the assembly

#

@urban sedge still need help?

urban sedge
#

no replies yet XD

#

i just wanna know how to do the boss rush mods

#

i dont really use mods at all

livid estuary
#

can anyone tell me how to install mods? i downloaded the boss rush file but i don't know what to do with it.

knotty grove
#

oh boi

#

I'll record a video

livid estuary
#

ok thanks!

knotty grove
#

it's uploading, gonna take like 15minutes internet is a piece of shit

livid estuary
#

i feel ya

knotty grove
#

btw, if anyone has a problem with me making this video from the modders, do let me know

young walrus
#

Also worth mentioning that the mods only work with the steam version

livid estuary
#

i have it

young walrus
#

I think API mods may work with GOG, but also may not

#

They're all intended for steam though

#

Installing mods is as simple as putting all the files from the downloaded zip into the folder where the game's exe is

#

Copy all, paste all.

#

Overwrite existing files

#

And for API based mods, you also have to install the "modding API" mod too

livid estuary
#

okay, i'll try it

young walrus
#

Don't open the folders inside the zip to get the individual files

#

The folders are set up so when you paste them, they'll combine with the game's folders and be put where they belong to work

livid estuary
#

alright, thanks

knotty grove
#

here's a video if you still can't get it to work

livid estuary
#

watching it right now

#

It worked, thanks!

knotty grove
#

np ๐Ÿ‘

buoyant obsidian
bright prawn
#

Is Randomizer 1.1.1.8 the latest version?

young walrus
#

Whatever is the most recent on the Google Drive is the most recent

bright prawn
#

A'right, thanks

#

that's where I looked

young walrus
#

Make sure you install the modding API too

#

And don't play on hard unless you're confident about speedrunning skips

bright prawn
#

I got that~ it looks like it works, except on the new game screen it says "Randomizer: Off" ?

young walrus
#

Click it

bright prawn
#

Oh, lel

young walrus
#

With your mouse

bright prawn
#

Ah, neat, I'll try it on easy then ;o

daring snow
#

@buoyant obsidian what are the changes for the latest update of Lightbringer?

buoyant obsidian
#

Radiant Jewel, Gathering Swarm, nail damage from upgrades, darkness, and fragile nightmare were all "balanced"

#

all in preparation for a new critical hit charm coming next patch

daring snow
#

Thanks for the info!

solemn rivet
#

wait what

#

oh

#

phew

#

I thought it was coming to vanilla

daring snow
#

I'll probably get back to speedrunning some Lightbringer at some point

ornate rivet
#

Thanks for increasing the view distance in the new update @buoyant obsidian

buoyant obsidian
#

No problem, it definitely needed some adjusting

stray mirage
#

the view distance is perfect for not being able to see the mantis lords hollowface

buoyant obsidian
#

Gathering Swarm :)

fair rampart
#

C O N S U M E D

stray mirage
#

one thing i like about the randomizer mod is that i can disable it

#

is there any way to do that with lightbringer?

buoyant obsidian
#

Sadly not, it'd be too much work since it's not an API mod

#

and the whole assets thing

stray mirage
#

if you removed everything from lightbringer, could you make a disable function?

buoyant obsidian
#
this.spell1Prefab.Spawn(this.transform.position + );
#

Somebody who knows how Vector3 works help me

#

I just wanna add .2f to the height

#
this.spell1Prefab.Spawn(this.transform.position + new Vector3(0f, 2f, 0f));
#

This worked

solemn rivet
#

Vector3(x,y,z) where x is width, y is height and z is depth

buoyant obsidian
#

Yep I figured it out

timber gale
#

Can you disable boss rush the same way?

knotty grove
#

who are you asking?>

#

if it's about the video, I say how to revert the changes at the end of the video

#

if you wanna keep modding api but remove boss rush you can just delete the boss rush dll

solemn rivet
#

what most people do is create a Disabled folder inside Mods and just move whatever you don't want to use there

young walrus
#

That only works for API mods

#

Lightbringer requires you to save the original Dll and exchange the two whenever you want to back vanilla

#

Either that or verifying files

solemn rivet
#

well, they were asking about disabling boss rush, so...

young walrus
#

Someone 10 lines before that was asking about Lightbringer

buoyant wasp
#

@knotty grove - Thanks for doing a video on this, I've been meaning to for a long time, just never had the time to do it when stuff was quiet around

#

Gonna pin it for folks ๐Ÿ˜ƒ

knotty grove
#

no problem, doing my part for the community ๐Ÿ˜„

trim nimbus
#

nice guide

#

now I have an infinite source of k0cc4's voice

knotty grove
trim nimbus
#

quick question cause im very lazy

knotty grove
#

"It comes with a readme, you can ignore that"

trim nimbus
#

does this version of boss rush include shop or you receive items upon killing bosses?

#

I love that quote

knotty grove
#

you get random drops, you pick 1/3

young walrus
#

Or 2

#

If you kill them hitless

trim nimbus
#

ahh

#

I see

knotty grove
#

OH that's why you get 2

#

lategame I just end up facetanking stuff ๐Ÿ˜‚

daring snow
#

Boss Rush speedruns when?

buoyant wasp
#

The biggest thing you'd have to add to be able to have that is the ability to select the seed that controls the drops

#

which it can't do atm

#

though there isn't a reason it couldn't i don't think

#

would have to ask @leaden hedge

knotty grove
#

tbh for the boss rush mod you could probably get a neat machine learning algo and teach it how to play

#

with some heuristics for item picks Kappa

#

would probably be easier (and more effective) to program a ruleset though

dapper folio
#

Charm Notch Mod, last updated oct 26
Randomizer, oct 28
Debug, oct 28
Nightmare God Grimm, oct 31
Boss Rush, nov 9
Player Data Tracker, nov 11
Glass Soul, nov 14
Modding API, nov 14
Lightbringer, nov 17
Scale Mod, nov 17
More Saves, nov 17
Bonfire, nov 22
Blackmoth, nov 22

what do i need to update?

hazy sentinel
#

lightbringer

dapper folio
#

updated, uploading

desert solstice
#

Hello, this is my first time using discord, so this might not be the right place to ask, but are there any mods that work on mac?

dapper folio
#

I think it depends on the mod?

solemn rivet
#

You can try the api

desert solstice
#

Huh, I'll try downloading that first then.

solemn rivet
#

The api is used as a Base for other mods

#

Try using that with the randomizer or debug

desert solstice
#

Yeah. It didn't work, unfortunately.

solemn rivet
#

did the game even run?

desert solstice
#

The game ran, but there was no indication that any mod had been run. It just played normally. Boss rush and lightbringer.

solemn rivet
#

okay

#

that seems to indicate you didn't install it properly

#

because of how the API is coded, I'm pretty sure it shouldn't even run if it wasn't compatible

desert solstice
#

Huh. I'm looking at /Users/*myUsername/Library/Application Support/Steam/steamapps/common/HollowKnight

#

In the folder I have the Hollow Knight application, as well as the hollow_knight_Data file from the google drive. I mean, is the api supposed to work on mac?

swift cairn
#

will we ever be able to add custom content?

timber gale
#

That's the endgame, and we're slowly moving towards that goal. Currently we have made some really cool advances (look at the boss rush or bonfire)

solemn rivet
#

on mac, you have to do further steps

#

there should be a HollowKnight.app

#

try to find an assembly-csharp.dll inside it, should be something like /data/content/managed/

#

or something

urban pewter
#

so for the randomizer mod, im reading he readme and I'm assuming its for HK version 1.1.1.8? Is this correct? and if so, how can I back date HK to that version?

#

@rain cedar @vale zenith

hollow pier
#

does bonfire just eliminate mask/vessel shards and nailsmith

solemn rivet
#

rando works for most recent version

#

and, no, bonfire does not to that

dapper folio
#

If there's no game version number and the mod zip has an API tag, then it works with whatever version of the API you're using

urban pewter
#

alrite cool, thx guys

desert solstice
#

Sorry, I was working on an essay ๐Ÿ˜ƒ I found the Assembly-CSharp.dll file. Should I change it in some way for a mac?

buoyant wasp
#

@desert solstice - Honestly, we don't know if the Mac version of the game will work with the modified Assembly-Csharp api. most likely, it flat out won't work. there is the possibility of making it work, but none of the modders (that i know of) have Mac's to compile and test against.

rain cedar
#

Actually I'm home for thanksgiving and my mom has a mac

#

I could test stuff out tomorrow

buoyant wasp
#

neat. though i'd be rather surprised if it worked.

knotty grove
#

getting c# to work on mac k0cc4Head

buoyant wasp
#

well, it does work, i mean, that's what HK is coded in

#

but it is compiled by mono

#

rather than msbuild

#

and the API stuff is now all built with a combination of Visual Studio and a Patching utility

knotty grove
#

well, either way, the same dll is very unlikely to work

buoyant wasp
#

agreed

ivory rapids
#

is any of the mods in the drive, a mod where i can play the whole white palace or path of pain again

knotty grove
#

not as far as I know, debug mod might be able to do it, but I'm not sure

ivory rapids
#

i know that im monstahler's speedrun of pop he got some text every time he entered a new area

#

sry for tagging but @wispy root could u answer this? is there a mod where i can play pop again

wispy root
#

Oh, that was the debug mode

#

If you want to do path of pain again you need a save file for it

ivory rapids
#

thank u

#

just one more question, how do i use this save file where do i put it and stuff :/

desert solstice
#

@buoyant wasp Yeah, I tried Boot Camp, Wine, and the mod files just wouldn't run no matter what. Thank you!

knotty grove
#

@ivory rapids %appdata%/../LocalLow/Team Cherry/Hollow Knight/

ivory rapids
#

Ill try this when i get home, ty :D

ornate rivet
#

cant get item when in shrink mode

buoyant obsidian
#

Oh my

#

I can't even think of a fix

ornate rivet
#

rip

hazy sentinel
#

also talking to divine says "give fragile strength charm?"

buoyant obsidian
#

RIP

ornate rivet
#

what does the blackmoth mod do?

hazy sentinel
#

dash attack

#

nail is 1 damage

#

start w/ dash/sharp shadow

ornate rivet
#

interesting, how difficult is it?

hazy sentinel
#

idk haven't tried it

ornate rivet
#

ok thanks

fair rampart
solemn rivet
#

I'm sorry blackmoth and bonfire have been kind of stuck in limbo

#

I'm having to deal with irl issues, so I don't have much time to spend on mods

buoyant wasp
#

@rain cedar - not sure why, but the most recent version of the API + Debug mod, the cheats and charms menu clicks do nothing (but the other 7 menus seem to work right)

rain cedar
#

I can't really look into that until I'm back on campus after the weekend

#

But I guess something being actually broken is good motivation

buoyant wasp
#

no worries. i knew you were traveling, mostly tagging you so you knew

buoyant wasp
#

@rain cedar - Here's the list of all the grubs locations + scene name + requirements (at least, as far as I can tell) for the rando logic.

ornate rivet
#

Does anyone here know a good basic tutorial that gives understanding for making genetic algorithms and neural networks for "AI"

buoyant wasp
#

"Basic tutorial" + "Genetic Algorithms and Neural Networks" seem to be contradictory terms ๐Ÿ˜‰

rain cedar
#

Since when are we seriously considering grubs for randomization?

buoyant wasp
#

we were talking about grubsong being viable (not elegy)

#

since it was only 10

#

at least, i thought we were

rain cedar
#

Ah right I see

ornate rivet
#

I meant a a tutorial that explains basic concept of code

rain cedar
#

The grub rewards, not the grubs themselves

buoyant wasp
#

right

#

shuffling the grubs would be cancer

rain cedar
#

The basic concept of code is just being good at logical thinking

ornate rivet
#

Basic concept of code for making genetic algorithms

#

I tried but I failed badly

hollow pier
#

elegy on the first grub

#

gg

buoyant wasp
#

In any case, I don't have any good tutorials on that subject nor can i recommend any. Those concepts interest me, but I've never had a need to do something with them.

#

not saying you won't find someone here with experience, but that's a pretty niche combination of fields :/

ornate rivet
#

welp whatever, maybe I'll think of a way to do it eventually

rain cedar
#

Firzen would be able to help but I doubt he'll want to

ornate rivet
#

why?

rain cedar
#

Because he doesn't like people

ornate rivet
#

oh ok

buoyant wasp
#

I would guess a good place to go would be univerisity research papers

#

since that's the most likely place outside of corporate stuff that you're likely to find it in use

ornate rivet
#

okay, I'll try that thanks

knotty grove
#

what do you mean "AI" k0cc4Head

#

don't use those for basic game AI

ornate rivet
#

wat

buoyant wasp
#

if he's talking about neural networks and genetic algorithm's i doubt he's talking about game AI

#

since the majority of game "AI" is nothing more than decision trees

ornate rivet
#

I was planning on making something "basic" at first like this:

weary oyster
#

yo is there a way to actually choose what gear you get and then repeat bosses in the boss rush mod? would be more useful for actual practice that way.

buoyant wasp
#

boss rush isn't a practice mod

#

if you want something like that, use debug mod

weary oyster
#

yea i figured

#

would just be more convenient than having to reset the room every time with the debug tool

#

walking out takes time and so on

#

so debug tool is the best we have for boss practice then?

buoyant wasp
#

yup

#

@brave viper - is there a log file for the livesplit plugin?

brave viper
#

the autosplitter will log info if you create a _HollowKnight.log file in your LiveSplit/ folder

buoyant wasp
#

hmm, bleh

#

is there something special you need to do to make it work with modded HK? I know runners do it, but if i launch a modded HK, instance, it lags live split like crazy if the autosplitter is enabled

brave viper
#

probably means the autosplitter doesnt work with the mod. the lag would most likely from it trying to find the pointer over and over

buoyant wasp
#

what's it looking for?

#

hmm, guess it's looking for several things. anyway to figure out which pointer it can't find?

brave viper
#

theres only one pointer, which it grabs everything else from

buoyant wasp
#

ah

#

how did you determine what the pointer should be? (worth seeing if i can figure out why it moved in the API version)

brave viper
#

using CE, using the mono tools, and going to probably GameManager.Awake() and grabbing the start of the function. been so long i dont know if thats the function i used or not

buoyant wasp
#

CE?

rain cedar
#

Cheat engine, probably

#

Great program

buoyant wasp
#

my guess is adding the orig_Method methods to the GameManager forced some of the functions to be offset from where they "normally" are

#

so will have to figure out where it moved them to

buoyant wasp
#

bleh, this is way over my head

hollow pier
#

@balmy gazelle

rustic fossil
#

How difficult would a health bar mod be?

rain cedar
#

Debug mod has health bars in it as an option

#

You're not the first to ask this so I might end up splitting that out to a standalone mod as well

rustic fossil
#

Heck, I bet I could do that with debug mod

knotty grove
#

fat HP bar on the bottom for bosses

#

easiest thing ever, just an additional drawgui

#

should be no harder than geo hp counter

rain cedar
#

How do you decide which enemies are bosses? And how do you deal with multiple enemy bosses like watchers?

#

Large hp bar is not as simple as that

knotty grove
#

doesn't have to be perfect

#

ie: if camera is not set to follow, make the last enemy hit show their hp bar

#

but that wouldn't work for large rooms though ie HK

#

alternatively it wouldn't be that hard to hardcode which enemy HP bars to show, since bosses come in limited quantities

rain cedar
#

It would also cause problems near room edges

#

Yeah, hard coding makes much more sense

knotty grove
#

as for watchers, I think just showing the last watcher hit is a pretty common practice

rain cedar
#

I think for watchers I would want a total hp bar as well as individual ones

#

Maybe that's too much, though

knotty grove
#

how about mantis lords? same thing?

rain cedar
#

Yeah, I suppose so

knotty grove
#

it kinda kills the point there, I would like to think that the 2 mantis lords were supposed to come in as a surprise after you think you're done

#

or for soul master, killing him once "oh fuck yeah I'm done" "NOPE"

rain cedar
#

If you're modding the game you're probably not on the first playthrough

knotty grove
#

if you look at it that way, much better to just show the last one hit

#

that's right, but you may or may not have missed content in your first playthrough

#

rushed playthrough -> oh how about I mod this game -> hp bar playthrough

#

a very unlikely case though

rain cedar
#

I guess so

knotty grove
#

still seems easier to just be last enemy hit

#

not sure if watchers spawn into the enemy list 2 by 2 or they all exist there not being able to take dmg

rain cedar
#

Not sure

knotty grove
#

Not the most useful of mods though

rain cedar
#

Guess step one is downloading hollow knight onto this shitty mac and getting the api to work

knotty grove
#

There is an additional element of anxiety caused by not knowing how many more hits it would take

#

Have you ever fiddled with a hackintosh btw?

rain cedar
#

Nope

#

Could you send me your assembly-csharp.dll? I'm kinda curious what difference there even is in the Mac one

knotty grove
#

I don't own a mac

rain cedar
#

Yeah, but I'm on one right now

#

I need the Windows dll

knotty grove
#

Oh, yeah

#

Im kinda in the wc right now, 2min sounds good?

rain cedar
#

Yeah, take your time

young walrus
#

You could just follow the methodology of say... Dark souls gargoyle fights for the watcher Knight HP bars

rain cedar
#

I haven't played that game in years so I don't really know what that means

young walrus
#

Hp bars show up for additional bosses whenever they become active and are stacked on top of each other at the bottom of the screen

rain cedar
#

Yeah that could work

young walrus
#

Not layered literally on top of each other

#

I think you know what I mac

#

Mean*

rain cedar
#

I get what you mean

#

I can't work on this until Monday anyway

#

It's apparently impossible to find a working .net decompiler for mac

#

Which, you know, makes a lot of sense

solemn rivet
#

sean, dunno how far you've gotten with the mac files

#

but from what I could tell from interactions with people playing on mac, it seems that the differences between the windows and mac assemblies is very subtle

#

like, to make a mac version of blackmoth, all I did was open the mac assemly and replace the exact same methods as the windows ver, and it worked perfectly

buoyant wasp
#

@brave viper - do you have some set of steps/tutorial to get the various pointers/locations of stuff in memory via CE?

#

i am not asking you to make the modding API version to work with livesplit, but I'm honestly lost on how your system works

brave viper
buoyant wasp
#

ah

#

ok

#

is there a way to export that list of bytes into the signature format? or did you just do it by hand?

brave viper
#

you can hit ctrl+c to copy them when selected

#

and then do a bit of modification

buoyant wasp
#

yeah

#

k

#

now what about the offsets for the methods. like uiManager?

brave viper
#

shouldnt change unless you modified those classes and added/removed fields

buoyant wasp
#

we added methods

brave viper
#

but you just use the mono dissector and look at fields

buoyant wasp
#

4 in GameManager, and 2 or 3 in PlayerData

#

i'll check to see if we did any fields

brave viper
#

i guess its possible depending on how you changed the dll that it rearanged the fileds automatically without you knowing

buoyant wasp
#

it's definitely possible. The new process doesn't mean that we edit the DLL by hand anymore. we compile a seperate DLL then use a tool to dynamically merge the contents of that DLL into the Assembly-CSharp dll and relink the changed methods. So instead of making 20 changes by hand, it's 1 step in Visual studio

#

well the awake signature definitely changed

#

even though we're not changing that method

#

this was added

buoyant wasp
#

@brave viper - Just put in 2 pull requests. 1 is for a fix that should allow it to work with both Vanilla and the Modding API. The other is some improvements to logging that i added while trying to figure out where it was failing. (the 2nd isn't required for the 1st, just something to consider)

#

actually, ignore the 2nd pull request, think i found a bug.

brave viper
#

there is an easier way to accomplish what you want. are the offsets for all the other fields the same?

buoyant wasp
#

as far as I can tell, yes. there is just those 6 alterations

#

4 additions to the signature, and 2 changes

#

i think

brave viper
buoyant wasp
#

ah, the version things don't matter anymore for normal?

#

cause that was my thought, but you had 5 different versions, so wasn't sure

brave viper
#

they were dead code i forgot to remove after so much had changed in HK

buoyant wasp
#

ah

#

then yeah, that'll probably work just fine

#

i can test it out, sec

#

yeah, that works

dense sable
#

does anybody know what button you have to press on keyboard to start up the debug menu mod?

rain cedar
#

F1

dense sable
#

thank you

#

doesnt seeeeem to work, ill see what else i might be able to get it working

buoyant wasp
#

if it doesn't show up as soon as you load a save, it isn't working

#

also, you can tell which of the API mods are loaded by looking in the upper left hand corner on the main menu or on the pause menu

raw river
#

what tools would one need if he were to mod a hollow knight

hazy sentinel
#

dnspy

#

UABE

young walrus
#

If you don't have the API installed, nothing will load. You need that MOD. It's the base for the other api mods

hazy sentinel
#

oh is this installing mods or making mods ๐Ÿค”

young walrus
#

Installing for quacker

#

2 different people

hazy sentinel
#

2 separate conversations in the same channel maggot

dense sable
#

idk what im doing wrong but when i download the debug mod it doesint even show up in the homescreen, am i not suposed to put the mod somewhere not the hollow knight steam apps common, and yes i do have the api for mods already downloaded

young walrus
#

Watch the video in pinned messages

#

Explains all you need

dense sable
#

already done

hazy sentinel
#

the API assembly dll replaces the vanilla HK one and the mod API file is in the Mods folder inside the Managed folder

dense sable
#

ive already downloaded other mods as well and they worked fine

young walrus
#

Did you download the correct API version?

#

If you have non API mods installed, you may have to delete everything and start over

dense sable
#

wait i know what i did, im stupid but, i put the game abck to normal so i did the verify files and so it must have deleted the modding api, sorry for wasting your time

young walrus
#

....well that'll do it

dense sable
#

ok yup i got it downloaded and working, im an idiot

young walrus
#

It happens

buoyant wasp
#

@raw river - As far as modding goes, tools wise, your #1 is dnspy, the unity tools can help (though i never use them)

#

that said, i suggest you try to use the modding API over directly editing the Assembly-CSharp

#

(the rest of the docs are heavily Work-in-progress, so YMMV there)

buoyant wasp
#

@rain cedar / @leaden hedge - Compiling list of what we "know" can be done using the modding API so when folks ask "what can we do", we have a place to just link to. Here's what i have atm:

* Change charm costs
* Change nail damage
* Change charm effects (to a certain degree)
* Change damage taken (to a certain degree)
* Change charm and item locations (randomizer)
* Change item counts (give/remove trinkets, trampass, wings, etc)
* Access and alter FSMs (Difficult and Depending on what your goal is, still not completely reliable in all situations)
* Save Data Specific to the mod inside of the save file
* Save Data specific to the mod, but not to the save file in a global settings file
* Change the behavior of dash (to a certain degree)
* Add custom text and menus on the screen (getting easier, though still not perfect, yet)
* And a bunch of stuff I'm sure I've forgotten or that we haven't yet discovered
hollow pier
#

can you alter dash so we can dash upwards

hazy sentinel
#

blackmoth mod

#

ez

hollow pier
#

o

#

i want my 360 mod

#

circle dash

#

circle nail

hazy sentinel
#

circle jump

hollow pier
#

circle square

#

circle crystal heart

#

fly into space

hazy sentinel
#

but you can already do that

surreal helm
#

so it says that the mod is installed

#

but I don't see it

#

how do i fix this

hazy sentinel
#

isn't that correct

#

just start the save

surreal helm
#

like

#

go to classic

#

and that's it

hazy sentinel
#

yes?

surreal helm
#

oh

#

well thanks

buoyant wasp
#

yeah, boss rush is just "if it's installed, start a game"

rose osprey
#

How do I install boss rush?

young walrus
#

Watch the video in the pinned messages

buoyant wasp
#

ugh, we really need to figure out how to fix the fade to white bug in bossrush

#

since if it happens, sometimes it never fixes itself. (like i just had it where it was perm white)

rain cedar
#

The white overlay is probably just a gameobject we can mess with

buoyant wasp
#

that'd be nice, cause I probably lose about 30% of my runs to it atm

late sphinx
#

that never happens to me

leaden hedge
#

You could probably just teleport somewhere after the boss dies using the teleport function

#

It'll skip the fade out / in

copper nacelle
#

is there documentation for the api? or am I just blind
edit: nvm was blind

fair rampart
#

lol

#

666]

solemn rivet
#

look for specific people if you want info on the api

#

seanpr, wyza, firzen, kdt...

copper nacelle
#

ayy

#

I did something

#

everything now does 1 more damage

fair rampart
#

nice

copper nacelle
#

aw fuck

#

it just makes everything do 2 damage

hollow pier
#

isnt that

#

1 more

copper nacelle
#

no

#

if NKG hits you it's still 2

#

:/

buoyant wasp
#

there are things that do 2 damage

hazy sentinel
#

nice

#

there are things that do 3 damage

buoyant wasp
#

I'd hook into the aftertakedamage hook

copper nacelle
#

I'm modifying the glass soul port

#

so i still don't know what I'm doing at all

#

oh wait found it

#

i did this wrong

#

I'm now invincible

hazy sentinel
#

difficulty slider mod when

copper nacelle
#

shit

#

I did player health = player health * (damage * 2)

#

it now heals you

hazy sentinel
#

this is a good idea

copper nacelle
#

yes

#

pacifist mod

fair rampart
#

lol

hazy sentinel
#

@solemn rivet i seem to recall Blackmoth changed Longnail/Mark of Pride/Quick Slash, etc. Should the text assets/textures be changed in any way? The assets aren't in the API .zip in the GDrive

rain cedar
#

That's not something currently supported in the api

copper nacelle
#

@rain cedar doesn't boss rush do stuff w/ assets?

rain cedar
#

No

#

What did you think it changed?

copper nacelle
#

not changing

#

It has the select screen and stuff

rain cedar
#

Adding new images is much easier than changing existing ones

copper nacelle
#

alright

jade lotus
#

can you good modding people help me dig up a couple of assets from the game?
namely: Elderbug sprites, Elderbug sounds and Primal Aspid sprites.
Also, is there a freecam/no ui mode?

leaden hedge
#

There's no clip / invis / no ui

#

Which would emulate a free cam

#

Unless you want HK too still be in frame

jade lotus
#

I need both options to full free cam and to run around with just no ui

leaden hedge
#

Yes you can toggle all of those independently in debug mod

#

I know, invis is backspace, not sure about no ui keybind

jade lotus
#

so I loaded it through mod installer, how do I make it work?

copper nacelle
#

does Debug Mod show up in the top left of the title screen

#

if it does then you should be able to just use the keybinds

jade lotus
#

it doesn't show up

copper nacelle
#

does the API show up in the top left

jade lotus
#

nothing there

copper nacelle
#

iirc the api shows up in the top left it installed

#

You could try installing it without the installer

#

you just replace assembly csharp in the Managed folder in hollow_knight_data

jade lotus
#

hmmm

#

is there another debug mod?

#

cause my game just crushes

young walrus
#

Don't use the MOD installer

#

Watch the video in pinned messages

#

Installing is easy

#

It goes over how to install the boss rush mod, but just replace boss rush with debug

#

It's the same process

#

MOD installer program does not work well

#

Especially for API mods

jade lotus
#

I mean I did that, I replaced the dll

#

and the game crushes before title screen

young walrus
#

Replaced it with the API one?

#

Did you download the proper version?

#

And I'm assuming you're on windows/steam

#

If not, it won't work

jade lotus
#

give me the proper version then

#

I just followed the link in pinned

young walrus
#

Yeah. There's like 4 API mod downloads

#

Need to download the one that matches the games patch you're using

#

(which should be 1.2.2.1)

jade lotus
#

damn

#

okay, got it, did it, it works

copper nacelle
#

nice

#

Shouldn't the API reference stuff be pinned?

jade lotus
#

Why can't I see any character sprites with Unity Studio? Are they hidden somewhere?

hazy sentinel
#

no?

buoyant obsidian
#

They're named atlas0

#

texture2D files

#

found in resources.assets

hazy sentinel
jade lotus
#

just what I needed!

hollow pier
#

beautiful

jade lotus
#

wait... you can TAKE ELDERBUG'S SCALP OFF?

hazy sentinel
#

no

#

old sprites

jade lotus
#

holy shit, a... Littlebug?

#

how cute is that

jade lotus
#

ok, now, ho do you open those .fsb files?....

#

I've thrown three "fsbextractors" at them with no results

#

are they protected by russian government?

buoyant obsidian
#

I've never heard of an .fsb file

jade lotus
#

all game audio is in .fsb files

#

I need dem elderbug sounds

buoyant wasp
#

@copper nacelle - the API reference stuff isn't pinned yet because it's not really done

#

What's out there for documentation is like...a week old and there is a ton of placeholder/wip pages

leaden hedge
#

doesn't the UABE have a plugin

#

same as texture2D -> dds / png

buoyant wasp
#

RE: mod installer, imo if it doesn't work right, maybe we should just unpin it

buoyant obsidian
#

Unity Studio can export all AudioClip files to .wav, @jade lotus

leaden hedge
#

honestly using UABE is a massive pain

buoyant obsidian
#

You're telling me

leaden hedge
#

easier just to dump the files from the greatest unity deserializer, unity hollowface

copper nacelle
#

@buoyant wasp alright

leaden hedge
#

api is pretty much self documenting

#

just looks through all the hooks, and the HookInfo attribute

#

and 99% of the time you should be able to figure out what it does

buoyant wasp
#

don't even need the hookinfo attribute anymore

#

intellisense is in there now

#

do note that the version in the drive is not the same version that's in github, github is significantly ahead of the drive because we were doing alot of experimental stuff to build it. I'm pretty sure the last version i posted was 1.2.2.1-18. I'm not ready to put it on the drive yet because there is a bug in Debug mod that I want sean to look at first to make sure it's not the API causing it.

jade lotus
#

how do you make US export them in wav tho?

buoyant obsidian
jade lotus
#

I must have some old version then...

buoyant obsidian
copper nacelle
#

how do you set spell damage with the api

leaden hedge
#

you don't

copper nacelle
#

:/

rain cedar
#

That doesn't mean you can't do it, he's just being a smart ass because you worded the question wrong

#

You have to modify the fsm for the spells directly

copper nacelle
#

:/ @leaden hedge

leaden hedge
#

you have to get a reference to the gameobject

#

using the onCollider hook

#

it doesn't work for fireball well

copper nacelle
#

cool

leaden hedge
#

I dunno how well the code I got wyza to test works

#

iirc it had similar issues to the oncollider way

copper nacelle
#

is the fsm way different than using the onCollider hook?

rain cedar
#

I don't know the specifics but whatever game object you get would have an fsm on it with some int for the damage

#

So no

leaden hedge
#

the oncollider hook gets the object that has the fsm

#

editting the fsm is always the same, its just the method of getting the object that was different

#

fireballs are broken because they are pooled but also not pooled

#

so the events that capture them desync I think

copper nacelle
#

alright

rain cedar
#

This would be ridiculously inefficient but you could make a small box around the player and constantly check collision on it to find fireballs right as they cast and change the damage then

#

It would work but don't do that

leaden hedge
#

I was thinking you could just hook a function in health_manager_enemy

#

which would work for all damage sources in one hook

rain cedar
#

Assuming you want to change all damage

leaden hedge
#

well you'd be able to get the previous damage amount

#

which would tell you what it was

rain cedar
#

Assuming no other mod changes damage amounts

copper nacelle
#

could you check collision post FocusCostHandler?

#

because spells use focus

buoyant wasp
#

here's the problem with fireball, when you first load, there is a number of them that don't exist in the pool that they normally sit in. There are 4 of them usually, so the first 4 casts sometimes use the "vanilla" versions, and then most casts (but not all) after that use your modified versions from the creation hook

leaden hedge
#

what if you empty the pooled objects list

#

or atleast everything that matches the fireball prefab

buoyant wasp
#

as far as a i can tell, the initial ones aren't in the same pool

leaden hedge
#

nice code

buoyant wasp
#

i can't figure out where they are but i did this and it still didn't work:

#

which works wonderfully for all the new ones. If we can just find the base ones, we'd be set ๐Ÿ˜ƒ

copper nacelle
#

I halved damage on the nail

#

but it now takes 8 hits to kill the aspid hunters

buoyant wasp
#

isn't nail damage an int?

copper nacelle
#

yeah

buoyant wasp
#

so 5/2 = 3?

copper nacelle
#

but that should be 5 hits

#

it's taking 8 rn

hazy sentinel
#

5/2=2 duh

ornate rivet
#

I thought c# rounded down

leaden hedge
#

you could try PlayMaker.Actions.GetEventSender

buoyant wasp
#

ah, yeah if it rounds down

#

8 makes sense

ornate rivet
#

Java rounds down

buoyant wasp
#

forgot c# did that

copper nacelle
#

alright

#

that's fine then

leaden hedge
#

that action I've only ever seen at the start of Get Damager Parameters

#

so If you just returned the gameObject there, you could probably do all damage sources

buoyant wasp
#

@copper nacelle, I'd try having Debug mod installed, since it would report the values for stuff like that i think

copper nacelle
#

I'll do that

buoyant wasp
#

it just reads from the playerdata for alot of it afaik

#

so if you modify playerdata, it should report it correctly

hollow pier
#

mfw modding is the most active channel

ornate rivet
#

discussion is active in bursts

buoyant wasp
#

oh, and i guess announcements ๐Ÿ˜‰

leaden hedge
#

I only go into discussion and help to shitpost about charms

ornate rivet
#

but we discuss some pretty intellectual stuff in #hk-discussion
you are missing out on so much

leaden hedge
#

people get really mad when I call their shit charms shit

copper nacelle
#

intellectual
"no u"

hollow pier
#

your charm is shit

ornate rivet
#

I use compass and geo gathering charm for every boss

#

most op charm set

hollow pier
#

^

#

only casuals switch them out

copper nacelle
#

casuals challenge seekers

buoyant wasp
#

re playmakerfsm.actions, where is that at? not seeing it in dnspy

leaden hedge
#

its in another namespace

#

HutongGames.PlayMaker.Actions

buoyant wasp
#

ah

#

ugh, worst thing about FSMs. You can't do a "what uses this" on the classes

#

cause it will say "sorry nothing uses this"

leaden hedge
#

well nothing does use that, yet hollowface

#

not until it gets loaded into the game

buoyant wasp
#

so you're thinking adding a hook before base.Finish()?

leaden hedge
#

I guess you could look through the save_fsm folder for the string GetEventSender

#

but ye

#

try just before that

buoyant wasp
#

worth a shot

leaden hedge
#

worst case is lots of stuff uses it and it lags

buoyant wasp
#

i'll add logging in there to find out how often it's called to see what we get

#

actually, for most of the hooks i have a low level logging on them, there are a few that don't like oncollidercreate because good lord that gets called alot

leaden hedge
#

ye but it doesn't get called often atleast

#

also, not sure if it'd be necessary but you could send both event source and target so, this.sentByGameObject.Value and base.Fsm.GameObject

buoyant wasp
#

oh, neat, apparently dnspy loads XML comments if they exist in the directory

buoyant wasp
#

well, progress

#

fireball is right now

#

quake's basic damage works too

#

the secondary "flare" that shoots out and up left/right does damage still

copper nacelle
#

what am I doing wrong
HellMod.cs(16,39): error CS1061: 'ModHooks' does not contain a definition for 'SoulGainHandler' and no extension method 'SoulGainHandler' accepting a first argument of type 'ModHooks' could be found (are you missing a using directive or an assembly reference?) [D:\home\Downloads\GlassSoulMod-master\GlassSoulMod-master\GlassSoulsMod\HellMod.csproj]

#

besides everything

buoyant wasp
#

you're trying to access the handler

#

you need to access the hook

#

the handler really needs to become internal at some point, since you're never supposed to use it directly

#

so, use ModHooks.Instance.SoulGainHook

#

@leaden hedge - Thoughts on where I'd find the secondary damage for quake to be in the fsms?

leaden hedge
#

its called HitL / HitR

#

different FSM

buoyant wasp
#

hmm, darn, changing those already, hmm

leaden hedge
#

are you using the action?

buoyant wasp
#

yeah, state.Actions[0] and state.Actions[2] (well i'm generating those indexes on the fly, but the result is the same)

leaden hedge
#

I mean the for the hook

buoyant wasp
#
 SetFsmInt baseDamage = (SetFsmInt)state.Actions[action.NormalDamageIndex];
                    baseDamage.setValue = 0;
                    SetFsmInt shamanDamage = (SetFsmInt)state.Actions[action.ShamanDamageIndex];
                    shamanDamage.setValue = 0;
                    playMakerFSM.SetState("Set Damage");
#

oh, the GetEventSender? yes

leaden hedge
#

you can probably just manually set the variables

#

highly doubt it'll internally update after collision

buoyant wasp
#

which fsm is that?

leaden hedge
#

health_manager_enemy, Get Damager Paramaters state

buoyant wasp
#

ah

#

Isn't setting the damage values via the setstate already manually setting them?

leaden hedge
#

dive might have additional conditionals in that function

#

to reset the damage

#

because it hits twice

buoyant wasp
#

wunderbar, i'll look through it and see if i can find it

leaden hedge
#

although I think if you just do
gameObject.locateFsm("damages_enemy").GetFsmInt("damageDealt").Value = 0

#

in that hook

#

it should work

buoyant wasp
#

so instead of all of the set damage stuff we've been doing, replace all of it with just that 1 line?

#

or only for hit L / hit R?

leaden hedge
#

might aswell do it for everything

buoyant wasp
#

k

copper nacelle
#

is there any way to change maxMP without screwing up the save's maxMP permanently?

leaden hedge
#

theres an on save hook

#

you could set max mp back to 99

buoyant wasp
#

and an on load hook ๐Ÿ˜ƒ

copper nacelle
#

does maxMP not change with additional soul vessels?

leaden hedge
#

no

#

theres another variable for vessels iirc

copper nacelle
#

cool

leaden hedge
#

MPReserve and MPReserveMax

buoyant wasp
#

hmm, so for damageDealt, do i still need to go through the states like we were doing for set damage?

leaden hedge
#

shouldn't need to

buoyant wasp
#

cause GetFsmInt isn't a method

leaden hedge
#

oh

#

its gameObject.locateFsm("damages_enemy").GetFsmVariables.GetFsmInt("damageDealt").Value = 0

buoyant wasp
#

must be some extension i'm missing

leaden hedge
#

oh its not GetFsmVariables

buoyant wasp
#

because gameobject doesn't have a method called locatefsm

leaden hedge
#

its just FsmVariables

#

oh

#

its LocateFsm(gameObject, "damages_enemy")

buoyant wasp
#

well, good news, that works. just need to only make it happen for spells now

#

you happen to know what the FSM name(s) for the wraiths is?

leaden hedge
#

Hit U iirc

buoyant wasp
#

looks like it

copper nacelle
#

how is MPReserveMax set? how much is 1 vessel thingy worth

buoyant wasp
#

33.33 i think

#

or 33

#

i know normally it's enough to heal 1 mask

#

and you can get 3 masks from the base soul amount

copper nacelle
#

cool

#

do you know what the soul vessel amount is called?

buoyant wasp
#

huzzah, spell damage settings work now

copper nacelle
#

nice

#

do you know what the soul vessel amount is called?

buoyant wasp
#

1.2.2.1-19 (BETA) - Adds OnGetEventSenderHook to allow for interception of spells and attacks to alter their FSMs.

#

as far as the amount goes

#

might be MPReserveMax?

copper nacelle
#

that's amount

#

trying to reset it afterwards

buoyant wasp
#

do you mean the main soul vessel (the one you start with?)

#

or the value each of the sub ones you get?

#

or the sum total between the 4

copper nacelle
#

i think I've got the main soul vessel reset stuff done

#

and I can change the tiny ones

#

but I can't figure out how to reset the tiny ones

#

it would be PlayerData.instance.MPReserveMax = (#ofvessels) * 33

#

but I can't find #ofvessels

buoyant wasp
#

what's in vesselFragments if you have them?

#

might be that

#

like (PlayerData.instance.vesselFragements / 3) * 33

#

not sure what's in that variable

copper nacelle
#

hm

copper nacelle
#

wait I'm dumb

#

I can just do this

#
            if (PlayerData.instance.MPReserveMax == 33) {
                Player.instance.MPReserveMax = 99
            } else if (PlayerData.instance.MPReserveMax == 22) {
                Player.instance.MPReserveMax = 66
            } else if (PlayerData.instance.MPReserveMax == 11) {
                Player.instance.MPReserveMax = 33
            }
#

wait how would I hook on to OnSavegameSave

#

+= gets HellMod.cs(17,13): error CS1656: Cannot assign to 'OnSavegameSave' because it is a 'method group' [D:\home\Downloads\GlassSoulMod-master\GlassSoulMod-master\GlassSoulsMod\HellMod.csproj]

#

which is what I've been doing for attackhook, takehealthhook, and soulgainhook

buoyant wasp
#

all the hooks end in hook

copper nacelle
#

crap

buoyant wasp
#

so

#

SavegameSaveHook

copper nacelle
#

cool

buoyant wasp
#

the OnSavegameSave is what is called by the game itself, it has to be public because it happens in a different namespace

copper nacelle
#

alright

#

wait what the heck

#

I've got a

public int OnSave(int id) {
#

and it returns id

#

but it "has the wrong return type"

buoyant wasp
#

because OnSavegameSave is return type void

#

so the SavegameSaveHook is also return void

copper nacelle
#

oh whoops

#

thanks

buoyant wasp
#

some events expect a returned value, some don't. the ones that do often require a return because you're modifying the object being passed in

copper nacelle
#

ohh

#

ok

buoyant wasp
#

there is another save hook that you can use that might be "better"

#

BeforeSavegameSaveHook

#

that one gives you access to the PlayerData instance that is going to be serialized

copper nacelle
#

cool

#

I'll use that

leaden hedge
#

oh did my hook idea work

#

cool

buoyant wasp
#

i'm pretty sure that changing values in that version of SaveGameData.PlayerData is not the same as PlayerData.Instance, so changing the former shouldn't affect that latter, but i'm not 100%

#

and yes, @leaden hedge - just had to filter out attacks

copper nacelle
#

alright

fluid berry
#

hey

copper nacelle
#

I'm getting a no overload for 'OnSave' matches delegate 'BeforeSavegameSaveHandler'

leaden hedge
#

then the function prototype doesn't match

#

if you're using visual studio, you can auto create stub functions

#

with the correct paramters and return type

buoyant wasp
#

yup, it's nice

copper nacelle
#

oh whoops

#

I got VS Code instead of VS

#

also if I use BeforeSavegameSaveHook, PlayerData still works correctly, right?

buoyant wasp
#

it has a paramater called SaveGameData which has a property of playerdata

copper nacelle
#

so I would do SaveGameData.PlayerData.instance.MPReserveMax?

buoyant wasp
#

pretty sure you won't need instance

copper nacelle
#

alright

#

'SaveGameData' does not contain a definition for 'PlayerData' wot

buoyant wasp
#

also I'd really suggest VS 2017 Community edition. i love VS code, but for .net development VS is vastly better

copper nacelle
#

I'll go get that

buoyant wasp
#

but yeah with full VS you can do something like

    Modding.Instance.ModHooks.SetPlayerBoolHook +=

then hit tab twice i think, and it'll generate a stub method with the right signature

copper nacelle
#

oh that's cool af

#

is full VS paid or something?

buoyant wasp
#

sorry, full is the wrong word

#

i meant versus using vs code

copper nacelle
#

the file explorer is now the solution explorer

buoyant wasp
#

the community version of VS basically has the same features as proffession and enterprise minus a few things like larger unit testing support and team foundation server support. otherwise it's the same. the license for community is more restrictive (in that it's not intended to be used by companies making more than 1m$/year), but for the stuff we're doing here, it's totally cool

#

basically, yes ๐Ÿ˜ƒ

copper nacelle
#

cool

buoyant wasp
#

far better than the old days where the "web edition" of VS had like 1/4 of the features as the professional version, shutter

copper nacelle
#

also shutter

rain cedar
#

Capitalization

copper nacelle
#

oh whoops

leaden hedge
#

not only that

#

you should be doing data.playerData

copper nacelle
#

ohh

#

I tried doing that with PlayerData and it gave twice the errors

#

so I thought that would be wrong

#

but now it fixes everything

rain cedar
#

What are you trying to do here? I doubt the save hook is even a good place for it

copper nacelle
#

I'm changing the maxMP to be 1/3 of it's original value

#

but I want to restore it at the end

rain cedar
#

End of what?

copper nacelle
#

like when you quit to menu/close the save

#

so that if you get rid of the mod the MP & MPReserve aren't screwed up

rain cedar
#

This will be much easier with the get int hook

#

Whatever that's actually called

copper nacelle
#

so I would change it on getInt?

#

and that would leave the original value

rain cedar
#

Yes that doesn't actually change anything in PlayerData

#

It just makes the game think there's something different in it

copper nacelle
#

oh cool

#

so would I use the hook and then only change it if the intName is maxMP?

rain cedar
#

If it's asking for maxMP you would return maxMP / 3

copper nacelle
#

cool

rain cedar
#

Alternatively if that doesn't work or you want the soul thingy to still fill you can instead triple all soul reductions

copper nacelle
#

I've already got soul gain reduced by 1/2

#

I'm trying to prevent large amounts of getting soul beforehand --> flukenest

rain cedar
#

I see

#

You could add a spell cooldown

#

Force the spell control fsm into idle if it ever leaves it during this

buoyant wasp
#

also, if you're trying to figure out what methods an object has for example, you just start typing, eg:

copper nacelle
#

oh cool

#

how do I do the thingy where you create the stub method

#

found it

buoyant wasp
#

cool

copper nacelle
#

what would the intName be?

#

I used GetPlayerIntHook

#

and it says maxMP does not exist

buoyant wasp
#

what's your method look like?

copper nacelle
#
        private int OnInt(string intName)
        {
            if (intName == MP)
            {
            }
        }
#

and it's from the GetPlayerIntHook

rain cedar
#

You're missing quotes

#

Also not sure MP is the right name

copper nacelle
#

it's maxMP, need to change it

buoyant wasp
#
        private int OnInt(string intName)
        {
            if (intName == "maxMP")
            {
            }
        }
copper nacelle
#

oh it's a string, I'm dumb

#

thanks

#

why does it not like single quotes?

buoyant wasp
#

single quotes are char's in c#

copper nacelle
#

oh, cool

buoyant wasp
#

which confused the heck out of me when i first started after having dealt with MS SQL server where single quotes were for strings and double quotes weren't

copper nacelle
#

oh wtf

#

that's weird

#

also

#

VS >>> VS Code

buoyant wasp
#

vs code is really great. but VS was designed explicitely for .net development

#

well, all the releases in the last 10 years anyway

copper nacelle
#

what do I do if it's not maxMP? do I return something like PlayerData.instance.intName?

rain cedar
#

Use GetIntInternal

buoyant wasp
#

PlayerData.instance.GetIntInternal(intName)

rain cedar
#

Thanks

copper nacelle
#

cool, thanks!

rain cedar
#

On mobile so it's a huge pain to type things swype doesn't recognize as words

buoyant wasp
#

yeah, i figured you hadn't made it back yet

#

or weren't at your pc

copper nacelle
#

what do I use instead of ModLog now?

buoyant wasp
#

Log

#

assuming you've inherited from :Mod

#

There are 6 logging methods baked in

#

Log, LogDebug, LogInfo, LogFine, LogWarn, LogError

rain cedar
#

There's also the logger in the ModHooks, right?

#

Or is that gone now?

buoyant wasp
#

it's still there

#

but

copper nacelle
#

I was using Modding.ModHooks.ModLog but that's gonna be deprecated

buoyant wasp
#

the ones you get from Mod, prefixes everything with the Mod's name automatically

rain cedar
#

Yeah

buoyant wasp
#

so yeah, just do

Log("Hi I'm a log message at the 'Info' Level");
copper nacelle
#

cool

buoyant wasp
#

if you look in your save folder for HK, there should be a file called "ModdingApi.GlobalSettings.json"

#

there is a logging level value in there where 0 is the firehose level of logging and 5 is the "only show errors level"

#

i think i default it to 1, which is Debug and above

rain cedar
#

It would be cool to also have an option like Log("message", LogLevel.INFO)

copper nacelle
#

I broke SOUL collection :/

#
        public int OnSoulGain(int num)
        {
            Log("Hell: On Soul Gain");
            num = num / 2;
            return num;
        }
#

I think it's this one

rain cedar
#

Honestly it would take like 5 minutes, I can just add that myself in a couple hours

buoyant wasp
#

it's 95% done already, technically. it's just private inside the logger class atm.

        private void Log(string message, LogLevel level)
        {
            if (_logLevel <= level)
                WriteToFile("[" + level.ToString().ToUpper() + "]:" + message + Environment.NewLine);
        }
#

cause that's how the various methods work

#
public void LogFine(string message) => Log(message, LogLevel.Fine);
rain cedar
#

Oh, I see

buoyant wasp
#

so it'd just be switching that to public and adding an overload to the Mod class so that it's accessible there

#

@copper nacelle I'd log the num too to see what it was before and after your change, see if if you're accidentally rounding down to 0

#

also, you don't need to do "Hell:". it'll prefix the line with "[HellMod]" for you

rain cedar
#

I don't see how 11 / 2 could round to 0

copper nacelle
#

I think it might be the OnInt one

#

because I now remember that I tested the OnSoulGain

buoyant wasp
#

other than modlog, you can also look in Hollow_knight_data/output_log

rain cedar
#

Either that or the log somehow breaks it

copper nacelle
#

it's onInt

#

I commented it out and soul collection lives again

buoyant wasp
#

if an exception is thrown, it will end up in the output_log often. (i suppose we could wrap all the hook calls in try/catch and write the errors to the modlog instead of the output log)

rain cedar
#

Yeah, I thought about that a while ago but it seems like a lot of typing for little effect

#

And it would look messy as fuck

buoyant wasp
#

yeah, it just moves the error from A to B, without doing anything else

#

and as long as you "know" to look in both logs

copper nacelle
#

got rid of "Hell :"

buoyant wasp
#

yeah, 56, look in the output log for an exception, good chance it will help

copper nacelle
#

alright

#

I got
DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.

#

and a bunch of FSM not preprocessed errors

rain cedar
#

Where are you calling that?

buoyant wasp
#

the fsm errors are sadly normal

copper nacelle
#

nowhere afaik

#

@buoyant wasp lol

buoyant wasp
#

i've thought on occasion about going and removing that error

#

but i can't be bothered

#

it's their broken stuff

#

post your output_log and modlog por favor

copper nacelle
#

and this is onInt:

        private int OnInt(string intName)
        {
            Log("OnInt");
            if (intName == "maxMP")
            {
                return PlayerData.instance.maxMP = PlayerData.instance.maxMP * (1 / 3);
            }
            else
            {
                return PlayerData.instance.GetIntInternal(intName);
            }
        }
#

wait shit

rain cedar
#

Oh, don't set it in the return statement

buoyant wasp
#

just return it

copper nacelle
#

you just return a value, right

#

alright

buoyant wasp
#

so it'd be this:

        private int OnInt(string intName)
        {
            Log("OnInt");
            if (intName == "maxMP")
            {
                return (PlayerData.instance.maxMP * 1f) / 3f;
            }
            return PlayerData.instance.GetIntInternal(intName);
        }
#

or

#

actually

rain cedar
#

Integer division

#

That's gonna round to 0

leaden hedge
#

do 1.0f / 3.0f

copper nacelle
#

alright

leaden hedge
#

also the else is completely pointless

buoyant wasp
#

i think that's better

leaden hedge
#

needs more tertiary operators

#
        private int OnInt(string intName)
        {
            Log("OnInt");
            return  (intName == "maxMP") ? (PlayerData.instance.maxMP * 1f) / 3f : PlayerData.instance.GetIntInternal(intName);
        }
buoyant wasp
#

or that ๐Ÿ˜ƒ

rain cedar
#

That doesn't look horrible at all

copper nacelle
#

@leaden hedge without the else it gives not all code paths return a value

#

oh wait :

leaden hedge
#

they do though

buoyant wasp
#
        private int OnInt(string intName)
        {
            Log("OnInt");
            return  (intName == "maxMP") 
                ? (PlayerData.instance.maxMP * 1f) / 3f 
                : PlayerData.instance.GetIntInternal(intName);
        }
copper nacelle
#

also the 1f thing is complaining about cannot implicitly convert type float to int

#

is it just int(expression)

leaden hedge
#

no (int)expression

rain cedar
#

Just divide by 3

#

Instead of times a third

copper nacelle
#

alright

leaden hedge
#

we can make this even better

#
        private int OnInt(string intName)
        {
            Log("OnInt");
            return  (intName == "maxMP") ? 33 : PlayerData.instance.GetIntInternal(intName);
        }
buoyant wasp
#

lol

leaden hedge
#

because maxMp is always 99

rain cedar
#

But what about when it's 66?

buoyant wasp
#

sure, be all logical

leaden hedge
#

soul limited ๐Ÿค”

buoyant wasp
#

oh,

#

when you're dead

#

it's capped at 66

#

unless there is another mechanism that caps

leaden hedge
#
    private int OnInt(string intName)
        {
            Log("OnInt");
            return  (intName == "maxMP") ? PlayerData.instance.soulLimited ? 22 :  33 : PlayerData.instance.GetIntInternal(intName);
        }
buoyant wasp
#

lol

copper nacelle
#

I'm just gonna keep the divided by 3

leaden hedge
#

looks good

#

one line = faster

rain cedar
#

Nested tertiary is the most disgusting thing I've ever seen

copper nacelle
#

how do I add MPMaxReserve or whatever to nested tertiary

#

the c# version confuses me

buoyant wasp
#

nested nested tertiaries!

leaden hedge
#

I wouldn't lol

#
        private int OnInt(string intName)
        {
            Log("OnInt");
            return  (intName == "maxMP") ? PlayerData.instance.soulLimited ? 22 :  33 : (intName == "MPMaxReserve") ? PlayerData.instance.MPMaxReserve / 3 : PlayerData.instance.GetIntInternal(intName);
        }
buoyant wasp
#
private int OnInt(string intName)
{
    Log("OnInt");
    switch(intName) {
        case "maxMP":
            return PlayerData.instance.maxMP / 3;
        case "MPMaxReserve":
            return PlayerData.instance.MPMaxReserve /3;
        default:
            return PlayerData.instance.GetIntInternal(intName);
    }
}
copper nacelle
#

my eyes

leaden hedge
#

switch DansGame

#

nothing more tertiary operators won't solve

buoyant wasp
#

discord formatting

copper nacelle
#

break becomes "unreachable code"

leaden hedge
#

because it is

buoyant wasp
#

oh

#

right

#

derp

copper nacelle
#

also

#

MPReserveMax

buoyant wasp
#

i just copied your thing ๐Ÿ˜›

rain cedar
#

I feel like the default behaviour of switches is wrong

copper nacelle
#

I just noticed when I was typing and it correct me

rain cedar
#

Should need a continue sometimes, not a break almost all the time

copper nacelle
#

so:

        private int OnInt(string intName)
        {
            Log("OnInt");
            switch(intName)
            {
                case "maxMP":
                    return PlayerData.instance.maxMP / 3;
                case "MPReserveMax":
                    return PlayerData.instance.MPReserveMax;
                default:
                    return PlayerData.instance.GetIntInternal(intName);
            }
        }
#

right

buoyant wasp
#

well, i'd assume you want to modify the reservemax

copper nacelle
#

whoops

#

success!

#

MP only got to 35

buoyant wasp
#

@rain cedar in regards to switch logic....yeah, I can see that, but they probably just followed the c++ standards in order to help ease developers

copper nacelle
#

well apparently the MP went above 33

#

but you can't use the stuff that goes above 33

#

ยฏ_(ใƒ„)_/ยฏ

leaden hedge
#

spooky

buoyant wasp
#

you'd probably need to change your soul gain

#

to check to see if the amount of soul you'd be gaining is higher than the maxmp

leaden hedge
#

doesnt soul add use set int

buoyant wasp
#

need to look

copper nacelle
#

can I use the SoulGain thing from HeroController

#

oh wait no

#

how much MP is focus?

buoyant wasp
#

so, this is what is called when soul gain is done

#
    public void AddMPCharge(int amount)
    {
        if (this.MPCharge + amount > this.maxMP)
        {
            if (this.MPReserve < this.MPReserveMax)
            {
                this.MPReserve += amount - (this.maxMP - this.MPCharge);
                if (this.MPReserve > this.MPReserveMax)
                {
                    this.MPReserve = this.MPReserveMax;
                }
            }
            this.MPCharge = this.maxMP;
        }
        else
        {
            this.MPCharge += amount;
        }
    }
#

focus is 33

#

i think

copper nacelle
#

according to the wiki that's right

leaden hedge
#

oh nice, it doesn't use setint

#

and yes spells are 33

copper nacelle
#

but I can heal and have a little bit more with my code