#archived-modding-development
1 messages · Page 508 of 1
public class CHESaveSettings : ModSettings
{
///public bool charm1new = true;
// Better charms, insert default values here
public List<bool> gotCharms = new List<bool>() { true, true, true, true };
public List<bool> newCharms = new List<bool>() { false, false, false, false };
public List<bool> equippedCharms = new List<bool>() { false, false, false, false };
public List<int> charmCosts = new List<int>() { 1, 1, 1, 1 };
}
The CHESaveSettings class(assuming it’s copied from the charm helper example)
Ok
Hmm
Everything looks right
Are there any errors in the modlog
[ERROR]:[API] - Error: System.NullReferenceException: Object reference not set to an instance of an object
[ERROR]:[API] - at TransHK.TransMod.Initialize () [0x00000] in <filename unknown>:0
[ERROR]:[API] - at Modding.Mod.Initialize (System.Collections.Generic.Dictionary`2 preloadedObjects) [0x00000] in <filename unknown>:0
[ERROR]:[API] - at Modding.ModLoader.LoadMod (IMod mod, Boolean updateModText, Boolean changeSettings, System.Collections.Generic.Dictionary`2 preloadedObjects) [0x00000] in <filename unknown>:0
[ERROR]:[API] - at Modding.ModLoader+<LoadMods>d__9.MoveNext () [0x00000] in <filename unknown>:0
[ERROR]:[UNITY] - NullReferenceException: Object reference not set to an instance of an object
[ERROR]:[UNITY] - ActionButtonIconBase.GetButtonIcon (HeroActionButton actionButton)
[ERROR]:[UNITY] - ActionButtonIconBase.RefreshButtonIcon ()
[ERROR]:[UNITY] - ActionButtonIconBase.OnEnable ()
[ERROR]:[UNITY] - ActionButtonIcon.OnEnable ()
[ERROR]:[UNITY] - UnityEngine.GameObject:SetActive(Boolean)
[ERROR]:[UNITY] - GameCameras:StartScene()
[ERROR]:[UNITY] - GameCameras:SceneInit()
[ERROR]:[UNITY] - GameManager:BeginScene()
[ERROR]:[UNITY] - <BeginSceneTransitionRoutine>c__AnonStorey13:<>m__3()
[ERROR]:[UNITY] - <BeginRoutine>c__Iterator0:MoveNext()
[ERROR]:[UNITY] - UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
[ERROR]:[UNITY] -
thats all thats relevant
Can you show the entire initialize method
public override void Initialize()
{
Log("Initializing");
Instance = this;
charmHelper = new CharmHelper();
charmHelper.customCharms = 4;
charmHelper.customSprites = new Sprite[] { ts.Get(TextureStrings.Charm1), new Sprite(), new Sprite(), new Sprite() };
/*/
charmHelper = new CharmHelper();
charmHelper.customCharms = 4;
charmHelper.customSprites = new Sprite[] { ts.Get(TextureStrings.Charm1), ts.Get(TextureStrings.QuickestFocusKey), ts.Get(TextureStrings.DeeperFocusKey), ts.Get(TextureStrings.DeepestFocusKey) };
**/
initCallbacks();
Log("Initialized");
}
``` (sorry for the mess)
What is ts
public void MoreHealing()
{
ts = new TextureStrings();
}
Are you sure that ts isn’t null when calling it’s Get method?
It doesn’t look like it’s set anywhere in initialize
public class CharmHelperExample : Mod<CHESaveSettings, CHEGlobalSettings>
{
//public string Charmname1 = "Lifeblood Crystal";
internal static CharmHelperExample Instance;
private string[] charmNames = { "Lifeblood Crystal", "CHARM_2 lol", "CHARM_3", "CHARM_4" };
private string[] charmDescs = { "A charm full of potent lifeblood crystals, gathered in the peaks.", "CHARM_2 desc lol", "CHARM_3 desc lol", "CHARM_4 desc lol" };
public CharmHelper charmHelper { get; private set; }
public TextureStrings ts { get; private set; }
///public CharmHelper ch { get; private set; }
public void MoreHealing()
{
ts = new TextureStrings();
}
public override void Initialize()
{
Log("Initializing");
Instance = this;
charmHelper = new CharmHelper();
charmHelper.customCharms = 4;
charmHelper.customSprites = new Sprite[] { ts.Get(TextureStrings.Charm1), new Sprite(), new Sprite(), new Sprite() };
/*/
charmHelper = new CharmHelper();
charmHelper.customCharms = 4;
charmHelper.customSprites = new Sprite[] { ts.Get(TextureStrings.Charm1), ts.Get(TextureStrings.QuickestFocusKey), ts.Get(TextureStrings.DeeperFocusKey), ts.Get(TextureStrings.DeepestFocusKey) };
**/
initCallbacks();
Log("Initialized");
}
oh it needs to be in initialize?
When are you calling the MoreHealing method
Well it needs to either occur in initialize before using it, or before initialize
i will look at the thing i copied
Also I don’t see why you can’t just initialize it where you define it
Which would solve the issue
yeah
ok that fixed it, but its at lightlevel 0
why is it so dull
i only made it blue
and its dark
futher it seems to work
Where can I find the variable to change carefree melody's chances?
those are hardcoded
ah damn.
afaik in HeroController.TakeDamage
ok so how do i make my charms pickup-abble
sooooo, back to the multiple enemy re-texture, how do i tell the game to use 1 texture for thk and a different texture for an enemy
you talked about the dictionary thing you gave me
but that only contains the name
huh
not even live 
<@&283547423706447872> posting to several channels w/ offline twitch channel ig
fucks sake

thanks orang 
what does GetCurrentSpriteDef do?
Huh
Gets the current sprite definition the tk2d sprite is displaying
I think either 1 you should make a dictionary<string, texture> and use the texture corresponding to enemy names or 2 you should make a switch when setting the texture depending on the enemy name
I think so
Define a
public Dictionary<string, Texture> EnemyTextures = new Dictionary<string, Texture>();
somewhere
ok what do i fill in?
?
i just place it there and then
private IEnumerator SetSprite(Scene arg1)
{
Log("Setting sprites");
var boss = arg1.Find(Bossscene[arg1.name]);
boss.GetComponent<tk2dSprite>().GetCurrentSpriteDef().material.mainTexture = _tex;
//.GetComponent<tk2dSprite>().GetCurrentSpriteDef().material.mainTexture = this._tex;
yield return null;
}
``` ?
private IEnumerator SetSprite(Scene arg1)
{
Log("Setting sprites");
var boss = arg1.Find(Bossscene[arg1.name]);
boss.GetComponent<tk2dSprite>().GetCurrentSpriteDef().material.mainTexture = EnemyTextures[boss.name];
yield return null;
}
You’ll need to change the EnemyTextures part depending on where you define EnemyTextures
Or if you changed the name
No
I meant the part in this code
wdym with "change the EnemyTextures part"
what do i need to change it to
Well idk, I said it depends on if you changed where you define EnemyTextures, and if you changed the name of it
i defined it in the class
public class TransMod : Mod
{
public Dictionary<string, Texture> EnemyTextures = new Dictionary<string, Texture>();
}
nope
Assembly asm = Assembly.GetExecutingAssembly();
foreach (string res in asm.GetManifestResourceNames())
{
Log("GetManifestRescourceNames");
using (Stream s = asm.GetManifestResourceStream(res))
{
if (s == null) continue;
byte[] buffer = new byte[s.Length];
s.Read(buffer, 0, buffer.Length);
_tex = new Texture2D(2, 2);
_tex.LoadImage(buffer, true);
}
}
brb
Now this probably isn’t the best way, but add after calling the LoadImage method
if (res.Contains(“png file name for thk”))
EnemyTextures.Add(“Hollow Knight Boss”, _tex);
else if(res.Contains(“png name for something else”)
EnemyTextures.Add(“Name of this enemy”, _tex);
else if(res.Contains(“yet another png name for an enemy”)
EnemyTextures.Add(“another enemy name”, _tex);
And so on
back
at png file name for thk do i need to add the .png
prob yes
bruh why does moble have different ""
87 errors
and you forgot 2 )'s
lets see how bad this goes
ehm
shat
all the textures are dark
what did i do wrong
anyone know?
- its named different
- its the same but black maybe its changed it code
however
idk
so when i add something to my project it becomes terribly dark
did i do something wrong??
Everything is black boxes or the sprites are black?
Screenshot?
yeah but in-game they are also dark
Hmm
Try replacing the dark file with a non dark file, and don’t open the file in vs? Tmk vs can edit images
sadly i gtg now
i never opened it
before using in-game
and the file provided (light) is the same as vs uses
bye
You just showed me it open in vs
Idk then
I know my particular requirements are a little out of the ordinary, but I'd still appreciate some input from y'all. Reminder: I have a mod referencing LibraryA which uses Newtonsoft. LIbraryA should not, and can not, depend on Assembly-CSharp. It must remain game agnostic. With this in mind, it seems to me my best options are: 1.) Unbundle Newtonsoft from ModdingAPI and put the DLL in the Managed folder; or 2.) Bundle my own Newtonsoft into LIbraryA.
I was hoping for some insight from you fine folks as to why Newtonsoft was bundled into ModdingAPI to begin with. If it was to solve a specific problem that would make sense. If it's just to provide modder's convenience then I'd be willing to put up the work to de-couple those and PR the change. (As well as test a few popular mods to make sure nothing broke, although this may be moot with 1.5 around the corner.)
I don't want to crash into an ecosystem and start demanding it conform to me, so RFC is open. Thanks in advance.
!! Okay, that works perfectly fine for me. Thanks for the update @copper nacelle!
Is there anything I need to do to enable building the Modding.API solution with C# 9? VS insists it can't update the language version due to the solution being fx4.7.2.
Might just need to update VS... Trying that.
shouldn't be anything afaik
Yeah, just needed to update VS so it recognized C# 9. That's how out of date I was. :/
The next issue to present itself is the lack of a Deconstruct() on KeyValuePair<>. Which makes sense as that method doesn't exist in 4.7.2. How have you managed to build this? 😅
net standard 2
VS disagrees but that's my problem. I'm giving it a break for tonight, thanks for your help
do you have the reference?
It's bundled in 1.5's managed folder
So it's not going to work at all without that
Which reference? netstandard.dll?
Yeah
That and mscorlib I think are the ones
I don't remember which one had deconstruct
I didn't have it before, but that did it.
I was wondering how you got netstandard2 stuff without a reference or targeting netstandard haha.
Got it compiling. Your help is super appreciated. 
np
Hi, I'm experimenting with FSM and have this error:
TypeLoadException: Could not load type 'System.Func`1' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
It's related to inserting a coroutine into a state. Commenting out the line (not the method) and it does fine.
PlayMakerFSM control = ...;
control.CopyState("Foo", "Bar");
IEnumerator routine() {
Log("...");
yield break;
}
// Error occurs here.
control.InsertCoroutine("Bar", 0, routine);
I'm targeting net35. Am I missing a reference or something?
Edit 2021-04-03: Add this to your csproj: <PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" />
https://www.nuget.org/packages/jnm2.ReferenceAssemblies.net35
your mscorlib ref looks like net4 ngl
That's what I thought, but <TargetFramework>net35</TargetFramework>
To be sure, I added a reference to mscorlib.dll in HK's Managed directory, which is 2.0.0.0. Still the same error
What DLL am I looking for when it comes to the output of the Modding.API sln? It seems like the output Assembly-CSharp-patched.dll is supposed to be packed with Assembly-CSharp.mm.dll but I don't think that's happening. I don't see a post-build to do the pack. Maybe I'm misunderstanding, but either way I'm not seeing a DLL with the Modding namespace popping out except for Assembly-CSharp.mm.dll.
Are you referencing anything else that might then reference the higher framework level?
I'm only referencing Unity DLLs, and ModCommon
build in release
or get the dll called MONOMODDED_Assembly-CSharp
Release makes a zip and moves the dll to an output folder
That DLL didn't exist in the debug out but does in the release out. 🤔
Probably me messing something up, it's my first assumption. But I calls it as I sees it.
Although the release build pushes me further so thanks!
Looks like SerializableStringDictionary (and associates) were removed in ModdingAPI for 1.5. Is there a suggested alternative?
Dictionary
Okay, didn't want to assume since I'm not 100% on how the saving works. Thanks a ton.
That sounds like my cursed .net install issue with the 1221api right off the bat 
Hey, in what extent does the API let you mess with things ? Is it possible to add rooms ?
Basically everything and anything
Some is just more complex than others
You have the documentation?
Wait I did? 
Anyways
If you have them then you're all set to go
Good luck!
Also yeah I did now that I think about it

https://www.youtube.com/watch?v=nSQEPAU__U0 it's possible to add rooms
how come there was never any ""big"" hollow knight mods released ?
Oh you did this ?? That's so cool 😮
because all of them are in development
I see
is there a way to make my (custom) charm pickupable?
Instantiate a pickupable item preload and edit the fsm to either 1. Make it a charm and change the charm number to your custom charm, or 2. Just change the charm number. Might also need to change some sprites if it doesn’t take from the charm sprite list
is there a version of EventRegister.SendEvent("UPDATE BLUE HEALTH"); but for normal masks?
use herocontroller's sethealth
There isn't a sethealth. there's only addhealth and takehealth
i did addhealth but it only take effect after i take damage
Currently I'm doingcs USceneManager.activeSceneChanged += SceneChanged;
then cs GameObject.Find(CurrentBoss).AddComponent<BossNerf>();
and in BossNerf I do the adding in the private void Start() cs HeroController.instance.TakeHealth(EasierAscended.DoDamage);
might want to wait a frame
i wrote yield return new WaitForSeconds(3.0f); in SceneChanged function (before GameObject.Find(CurrentBoss).AddComponent<BossNerf>();)
Wdym?
Also, how do you force the player to go into a specific Scene when the scene changes
GameManager has a BeginSceneTransition you can hook on to
Thank you
What are you making mulhima?
I'm making a mod that makes Ascended Bosses in HoG have same health and damage as p5
you can just hook takedamage and halve it in the scene instead of taking health
I'm doing this so i can remove health as soon as the player enters the boss scene (an example of using this would be to practice with fury)
ah ok
but i have absutely no idea if it works flawlessly with newest 1432 mapi
Thank you
hm lemme look at the docs for fsm's first
how do i Instantiate a pickupable item preload
You preload an object(look in the apidocs), then instantiate it when the scene you want it in loads
instantiate it?
Look it up, this is in unity’s docs
you mean this right? https://radiance.host/apidocs/ModdingAPI.html#initialize
but what paths are they in
i think they mean this
https://docs.unity3d.com/ScriptReference/Object.Instantiate.html
lets look
how do i give it the place then?
is there an option for it in debug?
public static Object Instantiate(Object original, Vector3 position, bool instantiateInWorldSpace); i'll need to do this right
no
sry lemme cahnge it
that
Feature request for future ModInstaller/ModInstaller2 updates:
- A button to to "Open Mods Folder"
There seems to be a fair number of people who struggle with getting to their mods folder, or who accidentally go to a different one that what the installer is seeing/using; in MI2s case, there also isn't Manual Install nor does the Installer add manually installed mods to its list. This would not only help with those (and thus troubleshooting), but also just serve as a convenience for people that don't have a shortcut to the folder already saved.
(Edit: I can delete this from here and repost in #modding-discussion if you want. I wasn't sure which place to put it if it pertained to the installer-itself)
Idc but it prob better fits in disc not sure tho
sounds like a good idea tbh
idk how easy these are to make, but could also be an alternative to a ton of pushbuttons
I was thinking a hamburger menu in a sidebar
also an option
this is just a tabcontrol in windows forms (for modinstaller1)
idk, i only did qt
hello hey its me again thats probably a really dumb question but what is this drive they referring to
Mods
Google Drive with Mods - https://drive.google.com/drive/u/0/folders/1lnjtSYMfRe1LyA_qSq2CoXKI6NRm_I-e
Installer - https://radiance.host/mods/ModInstaller.exe
Mod Summaries - https://docs.google.com/document/d/1cz5tcggpGofrBcM90XyTkMWjMelDHzugvQM6HpB13Ew
But
The installer gets it for you
Have you got mods in your game?
If so, the ModdingApi is installed
Well it’s probably best to install first
So just get an installer(either the one linked above or one in #archived-modding-help pins if it doesn’t work)
will the installer back up my og assembly dll or should i do it manually first
Doesn’t matter
You can always reinstall it or verify the integrity of the files
But it should back it up
alright
i dont have time to fix but in case nobody's aware, modinstaller1 has been throwing this for a lot of people recently, could be a modlinks issue with the great un-windowsing
@solemn rivet fix ur shit. kthx. 
i hope no one needs the (probably unnecessary) pd.betaEnd call in HeroAnimationController.Update()
i am a clown help
Why
Is anyone here familiar with the codebase of CustomKnight? And if so, does anyone know why it takes a bit of time to swap skins? Is it an artificial delay or does texture swapping actually take that long?
Loading textures from files I think
i made a pr to remove that call, as it's probably unnecessary
Good thing I don’t use it
i am not a clown anymore :)
u can't make me
gottem
tbh, that started happening after 56 removed the windows thing from modlinks
so you can blame 56
are you sure about that
Blame 56
i love remembering stuff the right way
the error description mentions something that 56 and angle worked on
Huh
so it's not my fault
Here, we see the exact point it fails
So some mod has a dependency that doesn’t exist
Maybe the ModdingApi has been misspelled?
which file is that in?
modmanager.cs probably
https://github.com/ricardosouzag/ModInstaller/blob/4c52d213bf0f846692cc3bdbec4963aa0159551f/ModInstaller/ModManager.cs#L739 modding api is not even in that check
why does it even check for dependencies on launch 🥴
damn, i didn't remove the modcommon dependency from sfcore in the modlinks
checked by hand, no mod should actually break
Pog, already found a problem
Not all places were renamed to Modding API
Works for me now
There
Idk if it’s “the” fix, but it worked for me
Hey I've started reading the docs but there are things I'm still in the blur with, i have some questions.
In place should I be loading the asset bundles, my initialize?
what is the proper way to load an instance of an enemy into the game?
if I create a custom scene for a new room, how do I put enemies in it? should I do it just by placing the prefab in the unity scene or should I go through code ?
Sorry if those are dumb questions
gottem
- i do it in initialize, but you may want to load it at another point, if the assetbundles are really massive (looking at pale court)
- preload it using the preloadnames thing, then instantiate it once you know it has to exist (i once did it in a
UnityEngine.SceneManagement.SceneManager.OnActiveSceneChangedhook) - i do that by having a custom script in an assembly specifically for the unity editor, where i specify the enemy i want to place (from a self-managed set of preloaded enemies)
:o thank you
that brings me another small question, how do I preload an enemy that is not from one of my assets bundles, but one that is from the real game
dont worry i do that a lot too and they are still friendly lol
😅
Btw is this channel strictly about code or is it mod dev in general (i.e. sprites, audio assets)
oh nice
here's a song i made that i will (probably?) use if I make the mod i wanna do
nice
ty :)
you think so ?
what do you think would make you say that, what in the song doesn't feel ambient
I see
Thank you ! ❤️
I'm taking notes
lol
@jolly oriole why do you hate betaend
it clogs the boolget call
🤔
or getbool or whatever
i'd have to check more intensly, but it looks like it is only checked in HeroAnimationController, and the only things setting it to true are some methods with betaEnd in their name, so maybe it's in one or two pfsms (though in theory it is unused as of hk 1.0.2.8 or whatever the first release was)
Huh
maybe he just wanted to be pull request 69
I wasn’t in the GitHub
what
im bad at github
https://stackoverflow.com/a/7244456 what i do to not merge from original into my fork
this isn't even merging from the original
this is merging some commit from like two years ago
oh yeah
snapshot? what are you trying?
profiling
lol, just ask tc for the source code and profile in unity
i'm sure that'll go well
gaming
damn, i would've never guessed that a graphical programming language made on top of c# is slower than the code of the unityengine
🤔
btw, is that the vanilla one or mapi?
vanilla
neat
i'd like to note the fsm stuff takes more than the entirety of all of the coroutine movenexts
🙂
likely because the coroutine stuff is by unity, therefore backed by managed (or unmanaged?) code, not c# scripts
coroutines are just c# generators
hm
though i do wonder how that profiling looks for the mapi, with all the playerdata stuff changed i suspect it may be somewhere near the front
@feral surgemCherry
This is why you should remove fsms
nice ping
Right away sir
thank you
see yusuf, they did respond
can you give us the unity project while you're at it
No, fuck you
typical
lol
the initial minute-ish has some modding api stuff where it loads dlls/generates methods/etc
aside from that though
sick one
could wait some delta or something for this though tbh
hey
any idea for a mod code reference where i could see custom enemies
admittedly i do not know much hollow knights mods
ah yeah sorry that might not be clear

y'know how looking at other mods' code is good to get started and understand stuff when you started and dont know much
so basically what we already expected
Ah, you want to see how to make a custom enemy?
can you do that for previous builds
yeah 😅
Or modify a boss?
where there were substantially more fsms
custom enemy preferably
Create an new enemy or modify?
i tried previous builds a bit and it didn't go great but i can give it another shot
new
it just didn't recognize the process
maybe it's a .net thing?
that one tutorial in the documentation is quite correct but i like crossing sources
especially i'd like to see if someone made an enemy without using the uuuh modcommon
Only the example adds one tmk. You’d have to make a go with the animations in unity and all the code for it’s ai, then put it in the game with assetbundling, then add a healthmanager and some other components and set them up right
Just use ModCommon, not a big deal to use it
To my knowledge
you spin me right round
New hk room spin
what that
that spinning
nice spin
ghost and the will of the wisps: wellspring of pain
is it possible to create a static camera, or is fixed to the player wherever he goes?
Yes to both
has anyone done a mod where you can move the knight and not have the camera follow you?
I don’t think so, but it should be easy
how? i wish i could make a it toggle on/off , but i have no idea where to search for it, or how to make the proper mod
I’d guess either 1. Setting the camera’s position to the same thing every frame or 2. Stop the camera from following anything
Also you might want to edit some more stuff because tmk the little light around the knight farther out looks like a black square
Are there modding tutorials for beginners?
Also if you haven’t, I suggest downloading and playing a few mods
Also don’t manually install the ModdingApi or build it yourself, you don’t need to
Just use one of the mod installers
i did use some mods, but its this camera thing i'm looking for
Ok
Can anyone link me the github page of the latest Hollow Knight Modding API that the new mod installer exe uses?
it's a little lost in commit history but https://github.com/HollowKnight-Modding/HollowKnight.Modding
the current state of the repo is in renovation for 1.5
there's a tag
Thanks, ^ Is that one different?
Or same as the one in the mod installer?
that is my fork it is outdated now
hello hi me again
new dumb question
what do i do to know the exact names of the objects i want to preload from a scene
you check a scene dump or the fsm viewer or whatever
use either <#archived-modding-development message> or an alternative method of looking up gameobjects (hkworldedit2 for example)
ive tried using fsm viewer but apparently im quite dumb at understanding name
😅
i am not very clever i think
check the scene dump it's probably a child
or spawned off something if not a child
then go into the linked gameobject dump and search for lost kin in the specific scene, probably is under other gameobjects and may or may not look like
("Dream_03_Infected_Knight", "Boss Scene/Lost Kin")
or something similar
what does the modlog say when preloading it?
hm
i now have my custom enemy existing but
i put it on enemies layer
i make it move changing its velocity
and hes getting through walls
no clue why
should i not move it by changing its rb velocity ?
or is it something else that i probalby forgot to do
if you're actually instantiating/preloading lost kin, you don't need to change layer
though enemies should collide with terrain
i was loading lost kin only to use its health and infected effect components
thats what they did in the uuh enemy tutorial from the docs
so i did the same for now
i mean, it should not phase through the wall
unless either the part with the hitbox doesn't care if it's at a wall or if the layers don't interact with each other
the hitbox works to hit my character and i can hit the enemy i have no clue why walls arent colliding to it
put another, non trigger collider beneath it
oooh
the non trigger collider adds nothing, still getting through walls and ground :/
then i sadly have no idea
Are you possibly forgetting to build the mod?
Is there a way to rip sound from the game? I'm messing around with an extraction software but I can't seem to find the raw grub noises
AssetStudio is pretty good
thanks! I will look into it ^_^
Sweet, found what I was looking for!
cool
Utiny ripper
They are also pinned in the lore resources from the mossbag server
snail emoji
mega snail emoji
🐌
Lol
🐌
Hey, new person here. Thinking about a weird extension mod I want to maybe make, is there any documentation on how the HK autosplitter works?
I want to maybe coopt some of its functionality, but I need to know how exactly it accesses events
awesome
what programming language do I need to know to make mods for HK?
how do I make the grub appear properly in front of the pillar?
can you change its z axis
@vocal spire hey where can i find Vasi ive read that frogcore uses it as dependency
Mod installer
alright
you mean, like transform.position.z?
yup
that worked - set its z to be the same as the jar itself
though now it shows up in front of the jar
make the grub z value slightly greater than the jars one
what's weird is according to scene dumps they have exactly the same z
(both 0)
how would I change that? (my unity knowledge is limited)
I came up with another solution: make the jar have a lower z than the grub instead of the other way round
👍
however this still happens (even if I lower the grub and jar's Z a bit)
nvm that was just me forgetting there was another copy of the code elsewhere
i dont understand shit about preloading
what mods use preloading?
so i can steal it and try to understand it
not everything
on this one page
i know what the docs are
preloading is explained
im not new to modding :)
yeah but i find it easier if i had an example
thx
so, it used like:
("thing that needs to be placed", preloadedObjects["the scene its placed in"]["what it replaces??"]);
```?
What did you just type
idk
You have somehow combined the code in GetPreloads and Initialize
im tryin to translate
preloadedGO.Add("hornet", preloadedObjects["GG_Hornet_2"]["Boss Holder/Hornet Boss 2"]);
in initialize
Where did you get this from? It looks like you started with something found in GetPreloads, but combined the latter part with the initialize code
no what i wrote is something else lol
So you don’t need to do the adding stuff
not?
Basically PreloadedGo is a Dictionary<string, GameObjrct>
People tend to use dictionaries if they have multiple preloads
“hornet” can be whatever, but the other part corresponds to stuff you put in GetPreloads
Instead of doing this though, you could just set a GameObject variable instead to keep the reference
if i dont use it then what do i need to have in PreLoadObjects(orsmth)
oh
now i need to find a scenename
lets go debug mod
ok so when i have the scenename what do i fill in at "Boss Holder/Hornet Boss 2"?
the object i want to place?
and the path to that object
how do i know the path
hey guys how can i help
i have years of c# experience but i never modded on hollow knight
so i can't really tell you, sorry
with the onbject dumps from the pins or using another way, like looking at it with hkwe2
is there any way i can learn?
perfect
and theres this
does it take a lot to learn?
idk i started 2 days ago lol
no
🕺
are there many new incorporated methods, or is it more intuitive
wdym
yup
we are not good at c#
oh ok
oh yes
who is we
i'm just going to read all the documentation
me
its not complete unfortunately but still pretty useful to get started
yakko warner?
and all the others that are looking at this and are bad at coding
also looks more like tutorials than documentation itself
alright
Hello
hey
Back from a haircut
nice
i have 4 years of c# experience so i hope it doesn't get too hard
cool how was it
You can get the path to a object by using the scene dumps in the pins
Yes
yeah sfgrenade told me
yes?
No
what's the post counterpart of On.GameManager.BeginSceneTransitionRoutine ?
umm alright then
you just do stuff after yielding the orig call
I’d use UnityEngine.SceneManagent.SceneManager.ActiveSceneChanged I think
Oh
Yee this fun
that works too yeah
does anyone know a scene with a charm pickup
gonna do it 56's way cause this is awesome
oh grubfather
Grimm_Divine
oh yeah
i have no clue if the scene is called like that btw
dont matter
its exactly called like that lol
so this thing is huge
where are the paths
oh yeah im stupid
Use ctrl + f to find the name of the object you want(probably something like “Shiny”)
Then screenshot and I’ll show you what to copy
hm yea, but i think i'll stick with the divine room, as that is probably way faster to load than tutorial_01
bruh
poo
its called poo
poo heart poo streangth...
do i need to show more?
Just copy the part that says Charm Holder\Poo Heart
Use that for other objects in the future too
everything?
Just the line that says that
oh ok
i actually preload the charm holder, so i can make the fling thing from an edited fsm lol
lol
but if it's static you can just preload the poo heart thing
Also you might need to replace the \ with a / forgot
oh ok
do i do something with this?
var fsm = gameObject.LocateMyFsm("FSM name here");
fsm.AddFsmState("New empty state name");
fsm.AddTransition("from state", "event name", "to state"); // the state has to exist first
fsm.AddGlobalTransition("global event name", "to state"); // the state has to exist first
fsm.ChangeTransition("from state", "event name", "new to state"); // the state has to exist first
fsm.GetState("FSM state name here"); // returns a state, if you ever need it
fsm.CopyState("original state name", "name of new copied state"); // returns copied state
fsm.GetAction<ActionType>("FSM state name here", 0); // returns action instance
fsm.AddAction("FSM state name here", new FsmStateAction());
fsm.InsertAction("FSM state name here", new FsmStateAction(), 0);
fsm.RemoveAction("FSM state name here", 0);
fsm.AddFloatVariable("new variable name");
fsm.AddIntVariable("new variable name");
fsm.AddBoolVariable("new variable name");
fsm.AddStringVariable("new variable name");
fsm.AddVector2Variable("new variable name");
fsm.AddVector3Variable("new variable name");
fsm.AddColorVariable("new variable name");
fsm.AddRectVariable("new variable name");
fsm.AddQuaternionVariable("new variable name");
fsm.AddGameObjectVariable("new variable name");
Where did you get that?
Did the fsm page get updated since I last checked?
that just shows what is possible with sfcore
but you don't need everything of this (maybe not even anything)
Or vasi
so i add?
Prob won’t need global events
Add SFCore or modcommon if you want to easily edit fsms
Ok
do i need to look at the fsm?
Well, edit the variable in the fsm for what charm it is(forgot what variable) to the one for your custom charm when you place it
Ofc
- get fsm
- get fsm variables
- change Charm ID int variable to your custom charm id
- change Charm bool variable to true
- done
Or follow that
not a single bit of the fsm util needed
Grenade gave the instructions so you don’t need to look at it
But for the future I suggest always looking at fsms
Also look at the GameObject dump for the names of fsms
- get fsm
- how
In fsm viewer you can also enter the GameObject name to find fsms
First line
so i need the name :)
.
This
ok ill look
Shiny Control
Also this
There’s where I was getting shiny from
\--PFSM Name: Shiny Control ^^
so just Shiny Control?
so i cant find Shiny Contol in fsm vieuwer
viewer*
Did you open the scene?
resources.assets is not good enough?
ok so the scenename is in the .txt right?
What did you click to open that menu?
yes
hai. Im trying to do some FSM stuff as well but in 1221 specifically ((un)expected version differences
). This is Uumuu's control FSM in the avalonia fsm viewer along with others, just for help determining the naming format.
Is this <gameobject>-<fsm>?
yes
No, I’m saying in fsm viewer what did you click to get to the file explorer menu
There is another option that just lets you choose the scenes by name
oh i just clicked the upper button
Look at the one that says scene
ok
So this should in theory work when _coro is a static NonBouncer? 
private static void StartUumuuCoro(Scene scene, LoadSceneMode lsm)
{
//Console.AddLine("Uumuu test: " + scene.name);
if (scene.name == "Fungus3_archive_02")
{
Console.AddLine(_coro.ToString());
_coro.StartCoroutine(UumuuExtraCoro());
}
}
Console.AddLine("Uumuu coro check");
// Find Uumuu and the FSM
GameObject uumuu = GameObject.Find("Mega Jellyfish");
Console.AddLine("Uumuu coro mid pls work");
if (uumuu == null)
yield break;
Console.AddLine("aaaaaaaaaaaaaaaaaaaaaaaaaaaa");
PlayMakerFSM fsm = uumuu.LocateMyFSM("Mega Jellyfish");
fsm.GetState("Idle").GetAction<WaitRandom>().timeMax = 1.7f;```
(pretend braces exist and not a million shitty console things. I just like seeing them in-game bc it helps me
)
its just the old debug way to show stuff in the in-game debug console
Ah
backporting the api properly is effort 🥴
so just modifying the existing one instead
i was trying to edit fsms but I'm getting the error on SetVelocity2d: "static types cannot be used as type arguments"
Currently my code is:cs PlayMakerFSM mmc = gameObject.LocateMyFSM("Mossy Control"); mmc.GetAction<SetVelocity2d>("Leap Launch", 3).y = 100;
does your using contain an On?
i didn't use On
ok but do your usings contain it
i think i found my mistake i may or may not have forgot to include HutongGames.PlayMaker.Actions 🤡
what good resources are there for somebody who has never used C# or Unity but wants to make HK mods?
Welcome to this introduction to game development. We'll be starting from the beginning, so no prior knowledge of programming or the Unity game engine is required.
Unity can be downloaded here: http://unity3d.com/get-unity
Watch episode 01: https://youtu.be/9iCnjdXEfMA
If you'd like to support these videos, you can make a recurring monthly don...
As you're interested in making mods, some of the stuff is not exactly relevant but still really useful to know.
thanks!
@wide elbow https://radiance.host/apidocs/
Error CS0117 'GameObject' does not contain a definition for 'LocateMyFsm'
are you using HutongGames.PlayMaker, HutongGames.PlayMaker.Actions, and ModCommon.Util.?
you also need to add reference to playmaker.dll and modcommon
yeah i have those :)
is the class inheriting from MonoBehaviour
that doesn't work
internal class Fsms : MonoBehaviour, Mod
{
public override void Initialize(Dictionary<string, Dictionary<string, GameObject>> preloadedObjects)
{
}
private void wierdthing()
{
var fsm = GameObject.LocateMyFsm("FSM name here");
}
}
i cant do , mod but its needed for the initialize
the g is lower case
Error CS1061 'GameObject' does not contain a definition for 'LocateMyFsm' and no accessible extension method 'LocateMyFsm' accepting a first argument of type 'GameObject' could be found (are you missing a using directive or an assembly reference?)
make a new class for the Fsms
yes
i did
public class Fsms : MonoBehaviour
{
private void wierdthing()
{
var fsm = gameObject.LocateMyFsm("FSM name here");
}
}
does it still show an error?
yes
.
@vocal spire hey im trying to use frogcore to create a journal entry but i dont think i am understanding everything, which part makes it so it knows which enemy has to be killed in order to actualize the kill count ?
hello
so you know the journalplayerdata you give it?
you can do 2 things to make it grant the entry
also I suggest getting the updated frogcore from github which has extention methods for one way
1st way(I prefer this one, but still use the other way for some more advanced stuff): get the EnemyDeathEffects component of an enemy and use the SetJournalEntry method with the JournalHelper you initialize as the argument
Just realized the GitHub doesn’t have the most recent ver either
I really need to update it
lol
ty
im gonna look into that 👀
i think my problem was that my custom enemy didnt have a enemydeatheffect
2nd way is setting the variables in the journalPlayerdata for it, but the other way is better bc it shows the little notification in the bottom left
Oh, there’s another way to 1 that I didn’t explain
oh ? 👁️
So hook something(I think HealthManager(instance, this is the HealthManager on your enemy(s)).OnDeath?) and in there call JournalHelper(instance, this is your journal entry that you initialized).RecordJournalEntry
And if the ModdingApi was updated to have static reflection fixed, it will also show the notification
I don’t like that my pc is decide to be slow
It’s reminding me of my other pc
Which is the reason I got this pc
lmao
ayoooo i shall try this one then 👁️
i have to create one journal helper per enemy right ?
IT WORKED
also i got the little icon so i guess static reflection works fine
Also is there a way to decide where it will placer in the journal ?
nice
the insertafter thing in the perameters when initializing
Np
My pc is freezing up in discord
Anyways, for the insertafter you need to put the playerDataName of something
ah damn i messed up the saving its not saving
What are you doing to save stuff?
You can find stuff for these in Playerdata but they will have an added Kills, Killed, or newData at the end
bruh i was saving the settings but forgetting to load them lmao
lol
Instead of var put PlayMakerFSM
show me your code
basically this gets called on the before save hook
it is called and works ive verified with logs
settings is getting the values from the data
but then
idk if it really saves ?
ehm
i found the problem
i had LocateMyFsm but it was supposed to be LocateMyFSM
- get fsm variables
- change Charm ID int variable to your custom charm id
- change Charm bool variable to true
how do i get fsm variables
Where are you setting the values of the journal player data
help i cant find how to change the charm id
You don’t?
you mean this ?
CharmHelper gives you an id and you use that for whatever
Hmmm, that looks right
in the docs i can only find fsm.AddIntVariable("new variable name");
i mean how i change the charm id of the fsm
- get fsm variables
- change Charm ID int variable to your custom charm id
- change Charm bool variable to true
So do
FsmVariables vars = fsm.fsmVariables;
vars.GetFsmInt(“Charm ID”).Value = the charm id;
vars.GetFsmBool(“Charm”).Value = true;
Replace the quotes with better ones
?
i made a new class
???
wait what does monobehavior actually mean
It’s a “Component” in unity
Hmmm
ok so now that i changed the charm id will the charm dropped by devine be my charm?
Try installing Qol and viewing the save files json files
Idk, what is the current code to get the fsm
alright
public class Fsms : MonoBehaviour
{
public void wierdthing()
{
var fsm = gameObject.LocateMyFSM("FSM name here");
FsmVariables vars = fsm.FsmVariables;
vars.GetFsmInt("Charm ID").Value = 41;
vars.GetFsmBool("Charm").Value = true;
}
}
``` is all i have
ok damn how do i find Qol, google is definetly not cooperating
i only need to change FSM name here
its a mod
Why is that in a different class. Also the charm number is VERY wrong
use the modinstaller
oh?
aight
charmHelper.CharmIds[0] is what you want for the charm id if the first charm your mod adds is the one you want to drop
why is that in a different class
bc mulhima told me it needed to be a monobehavior and a different class
What needs to be a monobehavior
.
Show me where you use AddComponent<Fsms>
You don’t need a monobehavior at all for this
btw is it possible to save dictionaries ?
Show the code around where you add that
Yes, but I forgot if they break currently
lol ok
Also you can just save a JournalPlayerData class
how do i use qol
ooh nice
Run the game, open save, save save
i dont have AddComponent<Fsms> as it was not in the docs
Then why are you using a monobehavior
You NEED to add the component to use it
huh
Learn unity
so i just place that in initialze?
No
Where
Are
You
Using
The fsm
Not in initialize
Ex: a scene loaded hook
i dont have anything other than
public class Fsms : MonoBehaviour
{
public void wierdthing()
{
var fsm = gameObject.LocateMyFSM("FSM name here");
FsmVariables vars = fsm.FsmVariables;
vars.GetFsmInt("Charm ID").Value = 41;
vars.GetFsmBool("Charm").Value = true;
}
}
No preloads?
What
bgm was for the music
Are you trying to put multiple mod classes in the same assembly
I mean it works
But why
i have preloadedGO.Add("hornet", preloadedObjects["GG_Hornet_2"]["Boss Holder/Hornet Boss 2"]); Instance = this;
and
public static Dictionary<string, GameObject> preloadedGO = new Dictionary<string, GameObject>();
public static TransMod Instance;
Weren’t you preloading a charm object to pick up?
i just used ctrl+c
What happened to that?
public override List<(string, string)> GetPreloadNames()
{
return new List<(string, string)>
{
("Crossroads_01","Charm Holder/Poo Heart"),
("SceneName2", "Go/Path/Name/2")
};
}
that?
I’m just gonna write some code for you brb
ModHooks.Instance.AfterSavegameLoadHook += initSaveSettings;
😐
ModHooks.Instance.ApplicationQuitHook += SaveCHEGlobalSettings;
private void SaveCHEGlobalSettings()
{
SaveGlobalSettings();
}
(don't need that if you don't have globalsettings)
oh
i thought he was asking about globalsettings
private void initSaveSettings(SaveGameData data)
{ }
thats what i have
idk if it does anything
i stole that code from sfgrenade
didn't finish writing the code but I gtg
public static GameObject charmPrefab;
public override List<(string, string)> GetPreloadNames()
{
return new List<(string, string)>
{
("Crossroads_01","Charm Holder/Poo Heart"),
};
}
public override void Initialize(Dictionary<string, Dictionary<string, GameObject>> preloadedObjects)
{
Log("Initializing");
Instance = this;
charmPrefab = preloadedObjects["Crossroads_01"]["Charm Holder/Poo Heart"];
initCallbacks();
Log("Initialized");
}
private void initCallbacks()
{
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += SceneManager_activeSceneChanged;
ModHooks.Instance.AfterSavegameLoadHook += initSaveSettings;
ModHooks.Instance.LanguageGetHook += OnLanguageGetHook;
}
private void SceneManager_activeSceneChanged(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.Scene arg1)
{
if (arg1.name == "target scene")
GameManager.instance.StartCoroutine(mycoroutine)
}
now that i switched to journalplayerdata to save its working 😳 no clue why
¯_(ツ)_/¯
nice
That looks very sleek
56, is there anything special people need to do to get the Mac version working?
I thought that they were just supposed to run the .app, but no one has been able to get it working recently. (It tells them it is damaged)
This what the last few people have experienced:
#archived-modding-help message
They move the files to desktop, then run the app, but it says it's broken
OH
i am fixing it
or trying to at least
does anyone happen to know how to zipinfo in python
then no, have never done this
pretty sure I have it fixed I just had/have to do something

extremely interesting
<@&283547423706447872>
????
yeeted
??????
whatd he do though if its fine to ask
nothing serious
still bannable
Kept asking people to call a random cellphone number they provided
ah makes sense
Ok so I want to get into the creation of hollow knight mods. Anyone know of any comprehensive tutorials on the creation and other file manipulation oriented details of mod development?
apidocs -> video tutorials -> bad modding tutorial has a basic solution overview but you can generally just go through your ide and do a few things
Awesome thx!
?saves
Saves
Windows File Paths: (Assumes Default Steam Install Path, Adjust accordingly for DRM Free or Non-Standard Steam Path)
Game Files: C:\Program Files (x86)\Steam\steamapps\common\Hollow Knight\``` ** ** Mac File Paths: ```Save Files: ~/Library/Application Support/unity.Team Cherry.Hollow Knight/ Game Files: ~/Library/Application Support/Steam/steamapps/common/Hollow Knight/hollow_knight.app/``` ** ** Linux File Paths: ```Save Files: ~/.config/unity3d/Team Cherry/Hollow Knight/ Game Files: ~/.local/share/Steam/steamapps/common/Hollow Knight/```
When I got to appdata locallow teamcherry hollowknight there are no save files
Is The folder hollow knight there?
You only have 1 save atm
User1 data?
User1.dat
