#archived-modding-development
1 messages ยท Page 39 of 1
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:
- Windows 10 only. With At least the spring 2017 creators update.
- It's signed with a self-signed certificate. Trust it, or don't. (if not, can't use it, sorry)
- 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.
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
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
Ah, I would have just added file drag and drop to bypass security issues but, I couldn't get it to work
Where the hell did I put the code for making relics worth 0 geo?
Yeah...
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?)
ffs, the code for that is in a remote part of the assembly
@urban sedge still need help?
no replies yet XD
i just wanna know how to do the boss rush mods
i dont really use mods at all
can anyone tell me how to install mods? i downloaded the boss rush file but i don't know what to do with it.
ok thanks!
it's uploading, gonna take like 15minutes internet is a piece of shit
i feel ya
btw, if anyone has a problem with me making this video from the modders, do let me know
Also worth mentioning that the mods only work with the steam version
i have it
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
okay, i'll try it
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
alright, thanks
All the credit for making the modding API and the Boss Rush mod itself goes to Seanpr, Firzen, Wyza and KDT. If you have any further questions, feel free to ...
here's a video if you still can't get it to work
np ๐
http://www.moddb.com/mods/hollow-knight-lightbringer/downloads
Lightbringer balancing update.
Browse Hollow Knight: Lightbringer mod for Hollow Knight files to download full releases, installer, sdk, patches, mods, demos, and media.
Is Randomizer 1.1.1.8 the latest version?
Whatever is the most recent on the Google Drive is the most recent
Make sure you install the modding API too
And don't play on hard unless you're confident about speedrunning skips
I got that~ it looks like it works, except on the new game screen it says "Randomizer: Off" ?
Click it
Oh, lel
With your mouse
Ah, neat, I'll try it on easy then ;o
@buoyant obsidian what are the changes for the latest update of Lightbringer?
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
Thanks for the info!
I'll probably get back to speedrunning some Lightbringer at some point
Thanks for increasing the view distance in the new update @buoyant obsidian
No problem, it definitely needed some adjusting
the view distance is perfect for not being able to see the mantis lords 
Gathering Swarm :)
C O N S U M E D
one thing i like about the randomizer mod is that i can disable it
is there any way to do that with lightbringer?
Sadly not, it'd be too much work since it's not an API mod
and the whole assets thing
if you removed everything from lightbringer, could you make a disable function?
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
Vector3(x,y,z) where x is width, y is height and z is depth
Yep I figured it out
Can you disable boss rush the same way?
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
what most people do is create a Disabled folder inside Mods and just move whatever you don't want to use there
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
well, they were asking about disabling boss rush, so...
Someone 10 lines before that was asking about Lightbringer
@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 ๐
no problem, doing my part for the community ๐

quick question cause im very lazy
"It comes with a readme, you can ignore that"
does this version of boss rush include shop or you receive items upon killing bosses?
I love that quote
you get random drops, you pick 1/3
Boss Rush speedruns when?
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
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
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?
lightbringer
updated, uploading
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?
I think it depends on the mod?
You can try the api
Huh, I'll try downloading that first then.
The api is used as a Base for other mods
Try using that with the randomizer or debug
Yeah. It didn't work, unfortunately.
did the game even run?
The game ran, but there was no indication that any mod had been run. It just played normally. Boss rush and lightbringer.
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
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?
will we ever be able to add custom content?
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)
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
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
does bonfire just eliminate mask/vessel shards and nailsmith
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
alrite cool, thx guys
Sorry, I was working on an essay ๐ I found the Assembly-CSharp.dll file. Should I change it in some way for a mac?
@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.
Actually I'm home for thanksgiving and my mom has a mac
I could test stuff out tomorrow
neat. though i'd be rather surprised if it worked.
getting c# to work on mac 
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
well, either way, the same dll is very unlikely to work
agreed
is any of the mods in the drive, a mod where i can play the whole white palace or path of pain again
not as far as I know, debug mod might be able to do it, but I'm not sure
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
Oh, that was the debug mode
If you want to do path of pain again you need a save file for it
This is a pre White Palace save, you can use this one
thank u
just one more question, how do i use this save file where do i put it and stuff :/
@buoyant wasp Yeah, I tried Boot Camp, Wine, and the mod files just wouldn't run no matter what. Thank you!
@ivory rapids %appdata%/../LocalLow/Team Cherry/Hollow Knight/
Ill try this when i get home, ty :D
rip
RIP
what does the blackmoth mod do?
interesting, how difficult is it?
idk haven't tried it
ok thanks

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
@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)
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
no worries. i knew you were traveling, mostly tagging you so you knew
@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.
Does anyone here know a good basic tutorial that gives understanding for making genetic algorithms and neural networks for "AI"
"Basic tutorial" + "Genetic Algorithms and Neural Networks" seem to be contradictory terms ๐
Since when are we seriously considering grubs for randomization?
we were talking about grubsong being viable (not elegy)
since it was only 10
at least, i thought we were
Ah right I see
I meant a a tutorial that explains basic concept of code
The grub rewards, not the grubs themselves
The basic concept of code is just being good at logical thinking
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 :/
welp whatever, maybe I'll think of a way to do it eventually
Firzen would be able to help but I doubt he'll want to
why?
Because he doesn't like people
oh ok
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
okay, I'll try that thanks
wat
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
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.
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?
the autosplitter will log info if you create a _HollowKnight.log file in your LiveSplit/ folder
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
probably means the autosplitter doesnt work with the mod. the lag would most likely from it trying to find the pointer over and over
what's it looking for?
hmm, guess it's looking for several things. anyway to figure out which pointer it can't find?
theres only one pointer, which it grabs everything else from
ah
how did you determine what the pointer should be? (worth seeing if i can figure out why it moved in the API version)
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
CE?
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
bleh, this is way over my head
@balmy gazelle
How difficult would a health bar mod be?
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
Heck, I bet I could do that with debug mod
fat HP bar on the bottom for bosses
easiest thing ever, just an additional drawgui
should be no harder than geo hp counter
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
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
as for watchers, I think just showing the last watcher hit is a pretty common practice
I think for watchers I would want a total hp bar as well as individual ones
Maybe that's too much, though
how about mantis lords? same thing?
Yeah, I suppose so
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"
If you're modding the game you're probably not on the first playthrough
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
I guess so
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
Not sure
Not the most useful of mods though
Guess step one is downloading hollow knight onto this shitty mac and getting the api to work
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?
Nope
Could you send me your assembly-csharp.dll? I'm kinda curious what difference there even is in the Mac one
I don't own a mac
Yeah, take your time
You could just follow the methodology of say... Dark souls gargoyle fights for the watcher Knight HP bars
I haven't played that game in years so I don't really know what that means
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
Yeah that could work
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
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
@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
ah
ok
is there a way to export that list of bytes into the signature format? or did you just do it by hand?
shouldnt change unless you modified those classes and added/removed fields
we added methods
but you just use the mono dissector and look at fields
i guess its possible depending on how you changed the dll that it rearanged the fileds automatically without you knowing
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
@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.
there is an easier way to accomplish what you want. are the offsets for all the other fields the same?
as far as I can tell, yes. there is just those 6 alterations
4 additions to the signature, and 2 changes
i think
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
they were dead code i forgot to remove after so much had changed in HK
ah
then yeah, that'll probably work just fine
i can test it out, sec
yeah, that works
does anybody know what button you have to press on keyboard to start up the debug menu mod?
F1
thank you
doesnt seeeeem to work, ill see what else i might be able to get it working
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
what tools would one need if he were to mod a hollow knight
If you don't have the API installed, nothing will load. You need that MOD. It's the base for the other api mods
oh is this installing mods or making mods ๐ค
2 separate conversations in the same channel 
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
already done
the API assembly dll replaces the vanilla HK one and the mod API file is in the Mods folder inside the Managed folder
ive already downloaded other mods as well and they worked fine
Did you download the correct API version?
If you have non API mods installed, you may have to delete everything and start over
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
....well that'll do it
ok yup i got it downloaded and working, im an idiot
It happens
@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
https://github.com/seanpr96/HollowKnight.Modding/tree/master/ExampleMods here are a few samples to get you started, but you can also look at the list on the front page of this page https://seanpr96.github.io/HollowKnight.Modding/ which has a bunch of mods that use the API
(the rest of the docs are heavily Work-in-progress, so YMMV there)
@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
can you alter dash so we can dash upwards
circle jump
but you can already do that
yes?
yeah, boss rush is just "if it's installed, start a game"
How do I install boss rush?
Watch the video in the pinned messages
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)
The white overlay is probably just a gameobject we can mess with
that'd be nice, cause I probably lose about 30% of my runs to it atm
that never happens to me
You could probably just teleport somewhere after the boss dies using the teleport function
It'll skip the fade out / in
nice
there are things that do 2 damage
I'd hook into the aftertakedamage hook
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
difficulty slider mod when
this is a good idea
lol
@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
That's not something currently supported in the api
@rain cedar doesn't boss rush do stuff w/ assets?
Adding new images is much easier than changing existing ones
alright
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?
There's no clip / invis / no ui
Which would emulate a free cam
Unless you want HK too still be in frame
I need both options to full free cam and to run around with just no ui
Yes you can toggle all of those independently in debug mod
I know, invis is backspace, not sure about no ui keybind
so I loaded it through mod installer, how do I make it work?
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
it doesn't show up
does the API show up in the top left
nothing there
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
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
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
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)
Why can't I see any character sprites with Unity Studio? Are they hidden somewhere?
no?
just what I needed!
beautiful
wait... you can TAKE ELDERBUG'S SCALP OFF?
no
old sprites
Dive into the mind of a bug! What secrets lay within, waiting to be uncovered. What dangers will be overcome? What treasures will be discovered? Find out in ...
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?
I've never heard of an .fsb file
@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
RE: mod installer, imo if it doesn't work right, maybe we should just unpin it
Unity Studio can export all AudioClip files to .wav, @jade lotus
honestly using UABE is a massive pain
You're telling me
easier just to dump the files from the greatest unity deserializer, unity 
@buoyant wasp alright
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
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.
how do you make US export them in wav tho?
I must have some old version then...
how do you set spell damage with the api
you don't
:/
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
:/ @leaden hedge
you have to get a reference to the gameobject
using the onCollider hook
it doesn't work for fireball well
cool
I dunno how well the code I got wyza to test works
iirc it had similar issues to the oncollider way
is the fsm way different than using the onCollider hook?
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
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
alright
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
I was thinking you could just hook a function in health_manager_enemy
which would work for all damage sources in one hook
Assuming you want to change all damage
well you'd be able to get the previous damage amount
which would tell you what it was
Assuming no other mod changes damage amounts
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
what if you empty the pooled objects list
or atleast everything that matches the fireball prefab
as far as a i can tell, the initial ones aren't in the same pool
nice code
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 ๐
isn't nail damage an int?
yeah
so 5/2 = 3?
5/2=2 duh
I thought c# rounded down
you could try PlayMaker.Actions.GetEventSender
Java rounds down
forgot c# did that
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
@copper nacelle, I'd try having Debug mod installed, since it would report the values for stuff like that i think
I'll do that
it just reads from the playerdata for alot of it afaik
so if you modify playerdata, it should report it correctly
mfw modding is the most active channel
discussion is active in bursts
I have all the channels muted other than #archived-modding-development and #speedrunning (and children)
oh, and i guess announcements ๐
I only go into discussion and help to shitpost about charms
but we discuss some pretty intellectual stuff in #hk-discussion
you are missing out on so much
people get really mad when I call their shit charms shit
intellectual
"no u"
your charm is shit
casuals challenge seekers
re playmakerfsm.actions, where is that at? not seeing it in dnspy
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"
so you're thinking adding a hook before base.Finish()?
I guess you could look through the save_fsm folder for the string GetEventSender
but ye
try just before that
worth a shot
worst case is lots of stuff uses it and it lags
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
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
oh, neat, apparently dnspy loads XML comments if they exist in the directory
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
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
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?
hmm, darn, changing those already, hmm
are you using the action?
yeah, state.Actions[0] and state.Actions[2] (well i'm generating those indexes on the fly, but the result is the same)
I mean the for the hook
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
you can probably just manually set the variables
highly doubt it'll internally update after collision
which fsm is that?
health_manager_enemy, Get Damager Paramaters state
dive might have additional conditionals in that function
to reset the damage
because it hits twice
wunderbar, i'll look through it and see if i can find it
although I think if you just do
gameObject.locateFsm("damages_enemy").GetFsmInt("damageDealt").Value = 0
in that hook
it should work
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?
might aswell do it for everything
k
is there any way to change maxMP without screwing up the save's maxMP permanently?
and an on load hook ๐
does maxMP not change with additional soul vessels?
cool
MPReserve and MPReserveMax
hmm, so for damageDealt, do i still need to go through the states like we were doing for set damage?
shouldn't need to
cause GetFsmInt isn't a method
oh
its gameObject.locateFsm("damages_enemy").GetFsmVariables.GetFsmInt("damageDealt").Value = 0
must be some extension i'm missing
oh its not GetFsmVariables
because gameobject doesn't have a method called locatefsm
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?
Hit U iirc
looks like it
how is MPReserveMax set? how much is 1 vessel thingy worth
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
huzzah, spell damage settings work now
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?
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
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
what's in vesselFragments if you have them?
might be that
like (PlayerData.instance.vesselFragements / 3) * 33
not sure what's in that variable
hm
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
all the hooks end in hook
crap
cool
the OnSavegameSave is what is called by the game itself, it has to be public because it happens in a different namespace
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"
because OnSavegameSave is return type void
so the SavegameSaveHook is also return void
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
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
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
alright
hey
I'm getting a no overload for 'OnSave' matches delegate 'BeforeSavegameSaveHandler'
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
yup, it's nice
oh whoops
I got VS Code instead of VS
also if I use BeforeSavegameSaveHook, PlayerData still works correctly, right?
it has a paramater called SaveGameData which has a property of playerdata
so I would do SaveGameData.PlayerData.instance.MPReserveMax?
pretty sure you won't need instance
also I'd really suggest VS 2017 Community edition. i love VS code, but for .net development VS is vastly better
I'll go get that
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
the file explorer is now the solution explorer
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 ๐
cool
far better than the old days where the "web edition" of VS had like 1/4 of the features as the professional version, shutter
Capitalization
oh whoops
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
What are you trying to do here? I doubt the save hook is even a good place for it
I'm changing the maxMP to be 1/3 of it's original value
but I want to restore it at the end
End of what?
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
Yes that doesn't actually change anything in PlayerData
It just makes the game think there's something different in it
If it's asking for maxMP you would return maxMP / 3
cool
Alternatively if that doesn't work or you want the soul thingy to still fill you can instead triple all soul reductions
I've already got soul gain reduced by 1/2
I'm trying to prevent large amounts of getting soul beforehand --> flukenest
I see
You could add a spell cooldown
Force the spell control fsm into idle if it ever leaves it during this
also, if you're trying to figure out what methods an object has for example, you just start typing, eg:
cool
what would the intName be?
I used GetPlayerIntHook
and it says maxMP does not exist
private int OnInt(string intName)
{
if (intName == MP)
{
}
}
and it's from the GetPlayerIntHook
it's maxMP, need to change it
private int OnInt(string intName)
{
if (intName == "maxMP")
{
}
}
single quotes are char's in c#
oh, cool
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
vs code is really great. but VS was designed explicitely for .net development
well, all the releases in the last 10 years anyway
what do I do if it's not maxMP? do I return something like PlayerData.instance.intName?
Use GetIntInternal
PlayerData.instance.GetIntInternal(intName)
Thanks
cool, thanks!
On mobile so it's a huge pain to type things swype doesn't recognize as words
what do I use instead of ModLog now?
Log
assuming you've inherited from :Mod
There are 6 logging methods baked in
Log, LogDebug, LogInfo, LogFine, LogWarn, LogError
I was using Modding.ModHooks.ModLog but that's gonna be deprecated
the ones you get from Mod, prefixes everything with the Mod's name automatically
Yeah
so yeah, just do
Log("Hi I'm a log message at the 'Info' Level");
cool
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
It would be cool to also have an option like Log("message", LogLevel.INFO)
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
Honestly it would take like 5 minutes, I can just add that myself in a couple hours
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);
Oh, I see
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
I don't see how 11 / 2 could round to 0
I think it might be the OnInt one
because I now remember that I tested the OnSoulGain
other than modlog, you can also look in Hollow_knight_data/output_log
Either that or the log somehow breaks it
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)
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
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
got rid of "Hell :"
yeah, 56, look in the output log for an exception, good chance it will help
alright
I got
DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.
and a bunch of FSM not preprocessed errors
Where are you calling that?
the fsm errors are sadly normal
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
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
Oh, don't set it in the return statement
just return it
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
do 1.0f / 3.0f
alright
also the else is completely pointless
i think that's better
needs more tertiary operators
private int OnInt(string intName)
{
Log("OnInt");
return (intName == "maxMP") ? (PlayerData.instance.maxMP * 1f) / 3f : PlayerData.instance.GetIntInternal(intName);
}
or that ๐
That doesn't look horrible at all
@leaden hedge without the else it gives not all code paths return a value
oh wait :
they do though
private int OnInt(string intName)
{
Log("OnInt");
return (intName == "maxMP")
? (PlayerData.instance.maxMP * 1f) / 3f
: PlayerData.instance.GetIntInternal(intName);
}
also the 1f thing is complaining about cannot implicitly convert type float to int
is it just int(expression)
no (int)expression
alright
we can make this even better
private int OnInt(string intName)
{
Log("OnInt");
return (intName == "maxMP") ? 33 : PlayerData.instance.GetIntInternal(intName);
}
lol
because maxMp is always 99
But what about when it's 66?
sure, be all logical
soul limited ๐ค
oh,
when you're dead
it's capped at 66
unless there is another mechanism that caps
private int OnInt(string intName)
{
Log("OnInt");
return (intName == "maxMP") ? PlayerData.instance.soulLimited ? 22 : 33 : PlayerData.instance.GetIntInternal(intName);
}
lol
I'm just gonna keep the divided by 3
Nested tertiary is the most disgusting thing I've ever seen
how do I add MPMaxReserve or whatever to nested tertiary
the c# version confuses me
nested nested tertiaries!
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);
}
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);
}
}
my eyes
discord formatting
break becomes "unreachable code"
because it is
i just copied your thing ๐
I feel like the default behaviour of switches is wrong
I just noticed when I was typing and it correct me
Should need a continue sometimes, not a break almost all the time
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
well, i'd assume you want to modify the reservemax
@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
well apparently the MP went above 33
but you can't use the stuff that goes above 33
ยฏ_(ใ)_/ยฏ
spooky
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
doesnt soul add use set int
need to look
can I use the SoulGain thing from HeroController
oh wait no
how much MP is focus?
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
according to the wiki that's right
but I can heal and have a little bit more with my code
