#archived-modding-development
1 messages ยท Page 48 of 1
how's the on-screen debug going?
do i need to set DontDestroyOnLoad for CreateTextPanel?
hmm
well
it's a start
looks horrible, but i have text....
beautiful
what are you writing exactly? Everything in modlog?
basically
hmm
that way you can do logging
and have it show up while working on coding
it's an in-game tail
basically
indeed
better than re-opening it every 10 seconds in notepad
or that
it would also be useful to include relevant logs from output_log
but I guess that'd be too hard
"relevant"
because more it's mostly garbage
yeah
just put try/catch around anything that fails so that you can always log it to modlog ๐
god, no
that'd be awful
I can just try not to suck
and fail miserably at it
and put try/catch around stuff till it doesn't break anymore
doing this, i finally have a reason to put a try/catch around all the hook calls
That's not how you're meant to use try/catch, though
Clearly you're meant to have purposeful exceptions to use them as control flow
yeah, catching is for unhandled exceptions
๐
@leaden hedge - One thing is that textpanel doesn't seem to show until you are actually in game, any chance to make it show in the main menu?
it should show in main menu
yeah, not sure why, but it doesn't. also the Start() method on the behavior doesn't seem to start until much later than I expected. Like, all of the mods finish loading before it starts
but i know that the GameObject code is getting called because i log when it tries to add text and when it starts
i just found a really weird bug with blackmoth
whenever you switch charms the dash damage is weakened significantly
blackmoth is just a giant pile of unfixed bugs
yep
start should trigger the frame after component is created iirc
save folder
save folder iirc
oh
i just deleted the save
i was gonna make a new save
i'll put it here if the bug happens again
@leaden hedge which RenderMode should i be using?
sso
k, that's what i have
did you delete the whole folder?
no i deleted the save in game
it shouldn't matter
i suppose that the "next frame" could very well be after the mods finish loading
unless you closed and reopened the game, it should still be fine
might be
though, i don't know why it wouldn't show up in the menu
cause clearly we have frames at that point
not sure show me your code
internal class Console : MonoBehaviour
{
public static GameObject OverlayCanvas;
private static GameObject _textPanel;
private List<string> messages = new List<string>(20);
public void Start()
{
Debug.Log("Console.Start");
DontDestroyOnLoad(gameObject);
if (OverlayCanvas == null) {
CanvasUtil.CreateFonts();
OverlayCanvas = CanvasUtil.CreateCanvas(RenderMode.ScreenSpaceOverlay, new Vector2(1920, 1080));
OverlayCanvas.name = "ModdingApiConsoleLog";
DontDestroyOnLoad(OverlayCanvas);
_textPanel = CanvasUtil.CreateTextPanel(OverlayCanvas, string.Empty, 12, TextAnchor.UpperLeft,
new CanvasUtil.RectData(new Vector2(1920, 400), new Vector2(200, 680)), false);
Debug.Log("Overlay Created");
}
}
public void AddText(string message)
{
Debug.Log("Attempting to log to console:" + message);
if (_textPanel != null)
{
if (messages.Count > 19)
messages.RemoveAt(0);
messages.Add(message);
_textPanel.GetComponent<UnityEngine.UI.Text>().text = string.Join(string.Empty, messages.ToArray());
}
}
}
and then
private Console _console;
internal void LogConsole(string message)
{
try
{
if (GlobalSettings.ShowDebugLogInGame)
{
if (_console == null)
{
GameObject go = new GameObject();
UnityEngine.Object.DontDestroyOnLoad(go);
_console = go.AddComponent<Console>();
}
_console.AddText(message);
}
}
catch (Exception ex)
{
Debug.LogException(ex);
}
}
that's in ModHooks.cs
in here you can see that the "Attempting to log to console" message shows up a ton before the "Console.Start" message
odd shouldn't make a real difference though as it wouldn't even update the text until all mods are loaded anyway
well, mostly cause we have mods that affect the menu (more saves)
so it'd be nice to show it there, just don't know why it wants to not show
and without doing any thing it works once you load a save?
yup
also, i pulled canvas util from bossrush
so
i am assuming that's the most recent
oh, i bet i know what's going on.....hmm, sec
nope, was just thinking it wasn't showing cause nothing got logged after it was created, but that isn't it. is there an "after start" method?
Maybe awake?
awake gets called whenever it gets enabled
I'd just create the canvas after _canvas == null
then just give the console class a reference to the canvas you created
actually
try doing
public static Sprite createMonoColourSprite(byte[] col)
{
Texture2D tex = new Texture2D(1, 1);
tex.LoadRawTextureData(col);
tex.Apply();
return Sprite.Create(tex, new Rect(0, 0, 1, 1), Vector2.zero);
}
then add an Image to both your canvas and text object
so
Image imgCanvas = _canvas.AddComponent<Image>();
imgCanvas.sprite = createMonoColourSprite(new byte[]{ 0xFF, 0xFF, 0xFF, 0xFF} );
and your canvas should be white
and do the same for text
but pick a different colour
so you can check its actually being drawn
k
well
canvas is definitely getting drawn
i'm assuming the first 3 bytes are RGB?
Image imgCanvas2 = _textPanel.AddComponent<Image>();
imgCanvas2.sprite = CreateMonoColourSprite(new byte[] { 0xFF, 0x00, 0xFF, 0xFF });
that's what i had on the textpanel
so it should be a purple block i'd think
yeah
canvas might not get lined up correctly because you're not actually supposed to render stuff on that layer
hmm, textpanel doesn't seem to like that, it doesn't change anything
public static Sprite CreateMonoColourSprite(byte[] col)
{
Texture2D tex = new Texture2D(1, 1);
tex.LoadRawTextureData(col);
tex.Apply();
return Sprite.Create(tex, new Rect(0, 0, 1, 1), Vector2.zero);
}
public void Start()
{
Debug.Log("Console.Start");
DontDestroyOnLoad(gameObject);
if (OverlayCanvas == null) {
CanvasUtil.CreateFonts();
OverlayCanvas = CanvasUtil.CreateCanvas(RenderMode.ScreenSpaceOverlay, new Vector2(1920, 1080));
OverlayCanvas.name = "ModdingApiConsoleLog";
//Image imgCanvas = OverlayCanvas.AddComponent<Image>();
//imgCanvas.sprite = CreateMonoColourSprite(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF });
DontDestroyOnLoad(OverlayCanvas);
_textPanel = CanvasUtil.CreateTextPanel(OverlayCanvas, string.Join(string.Empty, messages.ToArray()), 12, TextAnchor.UpperLeft,
new CanvasUtil.RectData(new Vector2(1920, 400), new Vector2(0, -400)), false);
Image imgCanvas2 = _textPanel.AddComponent<Image>();
imgCanvas2.sprite = CreateMonoColourSprite(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF });
Debug.Log("Overlay Created");
}
}
oh sweet
i been fighting with trying to load asset bundles this weekend
looks like that's coming along nicely though
getting there ๐
๐
_textPanel = CanvasUtil.CreateTextPanel(OverlayCanvas, string.Join(string.Empty, messages.ToArray()), 12, TextAnchor.UpperLeft,
new CanvasUtil.RectData(new Vector2(1920, 400), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)), false);
maybe
infact
_textPanel = CanvasUtil.CreateTextPanel(OverlayCanvas, string.Join(string.Empty, messages.ToArray()), 12, TextAnchor.UpperLeft,
new CanvasUtil.RectData(new Vector2(0, 400), new Vector2(0, 0), new Vector2(0, 0), new Vector2(1, 0)), false);
testing
nope, oh, i see why the background doesn't work
Can't add 'Image' to New Game Object because a 'Text' is already added to the game object!
A GameObject can only contain one 'Graphic' component.
oh
disable it for a second 
also
internal class Console : MonoBehaviour
{
public static GameObject OverlayCanvas;
private static GameObject _textPanel;
private List<string> messages = new List<string>(20);
public void Start()
{
Debug.Log("Console.Start");
DontDestroyOnLoad(gameObject);
if (OverlayCanvas == null) {
CanvasUtil.CreateFonts();
OverlayCanvas = CanvasUtil.CreateCanvas(RenderMode.ScreenSpaceOverlay, new Vector2(1920, 1080));
OverlayCanvas.name = "ModdingApiConsoleLog";
DontDestroyOnLoad(OverlayCanvas);
_textPanel = CanvasUtil.CreateTextPanel(OverlayCanvas, string.Empty, 12, TextAnchor.UpperLeft,
new CanvasUtil.RectData(new Vector2(1920, 400), new Vector2(200, 680)), false);
_textPanel.GetComponent<UnityEngine.UI.Text>().text = string.Join(string.Empty, messages.ToArray());
Debug.Log("Overlay Created");
}
}
public void AddText(string message)
{
Debug.Log("Attempting to log to console:" + message);
if (messages.Count > 19)
messages.RemoveAt(0);
messages.Add(message);
if (_textPanel != null)
{
_textPanel.GetComponent<UnityEngine.UI.Text>().text = string.Join(string.Empty, messages.ToArray());
}
}
}
wouldn't that fix it not working for stuff logged prior to creation
yeah, i thought so too, which is why i was attempting to pass in the text to use in the CreateTextPanel, but that wasn't working. I'm wondering if something else isn't afoot there though. going to log the value of messages near Overlay Created to see if perhaps unity is recreating the object when it starts and actually wiping out what was there before
yeah unity is kinda weird sometimes with gui stuff
like it'll cache sprites to be put on the gpu until you actually render them when you use OnGUI
so if you use lots of sprites it'll just lag like shit
it's called "helping" right?
ok, so yes, it's getting rendered on the menu
which means
the problem isn't the render
it's timing
sounds like, "it's not my problem" ๐
this time, that sounds correct ๐
yeah I'd recommend using coloured sprites to check alignment
and that stuffs being rendered correctly
yeah
i may enhance canvas util to have an option to have borders
on canvases created
its part of unity
you just need to set a thing on your sprite and image
I think its Image.Type and Sprite.Borders
I don't think it worked last I tried though
I guess you could easily mimic the behaviour just using anchors
not sure on what optimizations sliced sprites do and if that'd make lag
yay, closer, figured out the timing issue, i was checking to see if the textpanel was created before putting the message onto the list
instead of putting the message regardless
which is why it wasn't getting added during start
now just need to get the vertical alignment right
I fixed that in my post above 
also the in-game font is nice in some places
but IMO for dev intended tools
arial works fine
i guess i could add an overload to CreateTextPanel that allows font
oh yeah I hardcoded it to either use normal or bold
there, done
that's actually looking awesome, Wyza! Cheers!
^
which one of the examples you gave did you say you fixed KDT? we have several versions of _textPanel's assignment
floating around
hah, ok, yeah, we're good there now i think
LowerLeft
ye
now, if i wanna stick a grey background behind it
i just create a image canvas, attaching it to the same parent canvas?
with the sprite code?
create an image panel, then make the text the child of the image panel
well
you could make the both under same parent
doesn't really matter, just gotta watch sibling order then
eh, if the best way is just do do nested children, i don't care really ๐
yeah deeper objects get rendered ontop of shallower objects
and its much easier to sort things via depth instead of sibling order
gotta keep an eye on your rect though
because your anchors and sizeDelta are based off your immediate parent
hmm
so i'm guessing I have the size or position or both wrong here
if (OverlayCanvas == null) {
CanvasUtil.CreateFonts();
OverlayCanvas = CanvasUtil.CreateCanvas(RenderMode.ScreenSpaceOverlay, new Vector2(1920, 1080));
OverlayCanvas.name = "ModdingApiConsoleLog";
DontDestroyOnLoad(OverlayCanvas);
GameObject background = CanvasUtil.CreateImagePanel(OverlayCanvas,
CreateMonoColourSprite(new byte[] {0x00, 0x00, 0x00, 0xFF}),
new CanvasUtil.RectData(new Vector2(0, 500), new Vector2(0, 0), new Vector2(0, 0), new Vector2(1, 0)));
_textPanel = CanvasUtil.CreateTextPanel(background, string.Join(string.Empty, messages.ToArray()), 12, TextAnchor.LowerLeft,
new CanvasUtil.RectData(new Vector2(0, 500), new Vector2(0, 0), new Vector2(0, 0), new Vector2(1, 0)), Arial);
Debug.Log(string.Join(string.Empty, messages.ToArray()));
Debug.Log("Overlay Created");
}
cause presently i don't see it on the screen anywhere
so i'm guessing it's somewhere off the screen
what does anchor pivot do?
sets where you rotate it around
it also technically sets were you draw from
so at 0,0 you'll rotate around BL, 0,1 is TL etc
so would I want both min and max to be 0,0?
that'd lock it to bottom left
for pivot it doesn't matter
text panel wants to be min 0,0 max 1,1 which will make it fill parent
and sizeDelta wants to be 0,0
so
new CanvasUtil.RectData(new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(1, 1))
yeah that'll make something fill its parent
you could do like -5, -5 to put 5 pixels of padding
k
Hey @leaden hedge , you know about the Boss Rush bug where the collector stops taking damage?
^
where collector stops taking damage
Lol, okay, I'd only experienced it in boss rush, my bad
yeah, pretty much everything other than nail can make it happen in vanilla
it happens when you overkill him, or kill him with something that isn't "from" you
just sneeze on him and it'll happen
Ah, strange... any chance of putting in a manual way to restart the fight as a workaround?
Fingers crossed this time's the real one then
I recommend not picking up grimm child, weaversong or dreamshield
as those are the main culprits
and they suck anyway
Haha, true. I take weaversong a lot, over like, HP/MP or more useless stuff though
and have seen a choice of "grimm child, grimm child and grimm child"
thats gotta be super unlikely
is level 0 grimmchild an option 
I've seen it 2 times twice, and all 3 once
I've played a lot of boss rush <_< Really like the mod, ha
i'd say i see it probably every 3-4 runs
hmm, is black not a viable sprite color?
or does it need to be 0x01
instead of 0x00
should be RGBA
the default texture format is 24bit RGBA
unless its reading the bytes backwards
which honestly
wouldn't surprise
me
apparently it's reading it not in that order
cause 0xFF, 0x00, 0x00, 0x00 works
for solid black
cause that makes so much sense /s
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
ok, so i have my greyish box
but no text
if (OverlayCanvas == null) {
CanvasUtil.CreateFonts();
OverlayCanvas = CanvasUtil.CreateCanvas(RenderMode.ScreenSpaceOverlay, new Vector2(1920, 1080));
OverlayCanvas.name = "ModdingApiConsoleLog";
DontDestroyOnLoad(OverlayCanvas);
GameObject background = CanvasUtil.CreateImagePanel(OverlayCanvas,
CreateMonoColourSprite(new byte[] { 0x80, 0x00, 0x00, 0x00}),
new CanvasUtil.RectData(new Vector2(0, 500), new Vector2(0, 0), new Vector2(0, 0), new Vector2(1, 0), new Vector2(0,0)));
_textPanel = CanvasUtil.CreateTextPanel(background, string.Join(string.Empty, messages.ToArray()), 12, TextAnchor.LowerLeft,
new CanvasUtil.RectData(new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(1, 1)), Arial);
Debug.Log(string.Join(string.Empty, messages.ToArray()));
Debug.Log("Overlay Created");
}
odd
thats not what should happen
new CanvasUtil.RectData(new Vector2(0, 500), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(1,0)));
should make something that goes from left to right and 500 tall
i added a pivot to the image panel creation
because it was sticking it in the center of the screen
center bottom i mean
oh
the text might be being rendered off the far left
new CanvasUtil.RectData(new Vector2(500, 500), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0,0)));
is that for imagepanel or textpanel?
image
aight try new CanvasUtil.RectData(new Vector2(500, 500), new Vector2(0, 0), new Vector2(0.5, 0.5), new Vector2(0.5, 0.5), new Vector2(0.5,0.5)));
for image
gonna watch gdq
yup
that's close enough
alright so text isn't being put off screen
draw text panel as image
see what it does
Hey guys, I'm new here, just stepping in real quick to kindly ask if an established Randomizer has been made yet. Much appreciated ๐
yes
(there's a lot of pins lol)
Seanpr & Firzen?
they are the authors
mmhmm
have fun
sigh i'm a derp
reason text wasn't showing was cause it couldn't find the arial font
nice
is it arial lowercase?
you have a mod where you use it?
Resources.GetBuiltinResource(typeof(Font), "Arial.ttf") as Font
ah
thanks
closer
just gotta figure out why the text bounds outside the box
GameObject background = CanvasUtil.CreateImagePanel(OverlayCanvas,
CreateMonoColourSprite(new byte[] { 0x80, 0x00, 0x00, 0x00}),
new CanvasUtil.RectData(new Vector2(800, 400), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0,0)));
_textPanel = CanvasUtil.CreateTextPanel(background, string.Join(string.Empty, messages.ToArray()), 12, TextAnchor.LowerLeft,
new CanvasUtil.RectData(new Vector2(-5, -5), new Vector2(0, 0), new Vector2(0, 0), new Vector2(1, 1)), Arial);
It's a thing

now just need to have a hotkey to toggle it off
canvas has a canvas group
you can set alpha on that
and everythings alpha fades with it
oh neat
hmm, can I just add the Update() method to the MonoBehavior to capture the keybind?
Oh shit I havent been paying attention to chat but is that what I think it is?
yes
cool
you can probably use
public IEnumerator FadeInCanvasGroup(CanvasGroup cg)
{
float loopFailsafe = 0f;
cg.alpha = 0f;
cg.gameObject.SetActive(true);
while (cg.alpha < 1f)
{
cg.alpha += Time.unscaledDeltaTime * 3.2f;
loopFailsafe += Time.unscaledDeltaTime;
if (cg.alpha >= 0.95f)
{
cg.alpha = 1f;
break;
}
if (loopFailsafe >= 2f)
{
break;
}
yield return null;
}
cg.alpha = 1f;
cg.interactable = true;
cg.gameObject.SetActive(true);
yield return null;
yield break;
}
public IEnumerator FadeOutCanvasGroup(CanvasGroup cg)
{
float loopFailsafe = 0f;
cg.interactable = false;
while (cg.alpha > 0.05f)
{
cg.alpha -= Time.unscaledDeltaTime * 3.2f;
loopFailsafe += Time.unscaledDeltaTime;
if (cg.alpha <= 0.05f)
{
break;
}
if (loopFailsafe >= 2f)
{
break;
}
yield return null;
}
cg.alpha = 0f;
cg.gameObject.SetActive(false);
yield return null;
yield break;
}
then just do
base.StartCoroutine(this.FadeInCanvasGroup(OverlayCanvas.GetComponent<CanvasGroup>());
hmm
although not sure what happens if you spam the button then ๐ค
Is there a logic to the randomizer that prevents you from getting softlocked
yes
not saying it's impossible, but it's definitely difficult to softlock these days
most of the known places where it happens have been patched out
There's 3 I know of, but 2 of them are just from sitting at benches you have no business sitting at
Sitting at benches ?
Yeah, benches
benches that are in a "pit" you can't climb out of
Like let's say after hornet you have only crystal heart for movement
You use that to get to that hut with quirrel in it
Then sit there
Don't do that
isn't crystal heart basically dash
With dash you wouldn't be stuck
ohh
I'll start back on mod stuff tomorrow
well, progress, i can make it fade out, fade in, but then the next time it should fade out, it fades out and instantly fades in
public void Update()
{
if (Input.GetKeyDown(KeyCode.F10))
{
StartCoroutine(_enabled
? CanvasUtil.FadeOutCanvasGroup(OverlayCanvas.GetComponent<CanvasGroup>())
: CanvasUtil.FadeInCanvasGroup(OverlayCanvas.GetComponent<CanvasGroup>()));
_enabled = !enabled;
}
}
oh, nvm,
1.2.2.1-28 Beta - Adds new diagnostic overlay for Modders to use while developing mods. Overlay will print out the same messages that are printed to ModLog.txt in game (tail). To enable Edit ModdingApi.GlobalSettings.json and make "BoolValues" look like this
"BoolValues": {
"keys": [
"ShowDebugLogInGame"
],
"values": [
1
]
}
Overlay visibility can be toggled On/Off using F10.
also, @leaden hedge - CanvasUtil is in the api now. Though I updated all the naming conventions to follow the C# standard. https://github.com/seanpr96/HollowKnight.Modding/blob/master/Assembly-CSharp/CanvasUtil.cs . I added XML comments to everything, but most of them are empty as I don't really have a handle on how all of the vectors really work.
yeah I put an explanation of how they all work in the AddRectTransform function with examples
but they are stuff
yeah, i still didn't quite understand how size works
so basically the anchors decide how big a "panel" will be
so 0.5,0.5 min and 0.5,0.5 max will be 0x0
because 0.5-0.5=0, 0*screenWidth = 0
then the sizeDelta is added to that
to get the final size
I guess if you know css
its an absolute positioned div and
anchorMin = left + bottom
anchorMax = right + top
sizeDelta = padding
I don't think css has stuff for offset / pivot
so it's not size, it's sizedelta
i think that's the problem
the wording makes you think that you are describing the size itself
you can rename the variable if you want
if at some point you take the time to figure out how to do scrollable text areas that'd be great to add to the canvas util
@copper nacelle
im fking done with your mod
shit mod
go die
i hate you
I fking died at 102%
played the game 12 hour straight
6 hour the next day
died to radiance
im done
going to neck
thanks again, Wyza ๐
also, finally got asset bundle loading working in my project
@rose barn 
reign more like rein
you saw nothing
I don't have 1000 discord screenshots for nothing
true
if I add a new variable to player data does it stay set across app instances
in any case @rose barn - it is unacceptable to tell someone to die, you're welcome to dislike the mod, you're not welcome to indicate harm for the person
@copper nacelle - via the API or via dnspy?
API
you can't really. PlayerData itself isn't mutable in the API. you could, however, add a setting that would get saved across loads
cool
i think example2 in the source has an example of custom save settings
Alright so
im almost 100% sure the debug menu freezes when i start a new save
I tested it a few times and that seems to be the cause
anything in the logs?
was hegemol supposed to be a guardian or something
hegemolDefeated is next to lurienDefeated and there's also maskBrokenLurien and maskBrokenHegemol
ยฏ_(ใ)_/ยฏ
Question, is there a way to get all the exits from an area? I see there's something like an entry gate?
Could I search a loaded scene for all exit gates?
there's a ton of weird stuff like that all throughout the code. the naming of the scenes gives you some interesting understanding of what the game used to be like in the alpha days
dunno @pearl sentinel
@rain cedar or @leaden hedge might know
Alrighty. Just wondering of there was something obvious in the game manager
Before I start digging
@pearl sentinel Find all GameObjects containing a TransitionPoint component after loading in
It does, yeah
Sweet
does killsFinalBoss/killsHollowKnight increment when you get all endings
or only the true ending
I would assume killsHollowKnight is for any ending and killsFinalBoss is only true ending
Should be easy for you to test
wtf
it doesn't go up
it goes down
I opened the save where I killed HK and the Radiance
and both values are set to 0
Yeah because that's how they handle journal entries
they set it to like 10 tik-tiks so when you hit 0 you've killed 10 tik-tiks and your journal is updated
is there any good way to check for the player getting an ending
I was gonna set killsHollowKnight/killsFinalBoss to 0
and check for change on both of them
just check for 0?
hmm?
Lol
lol
TypeLoadException: Could not load type '<>c' from assembly 'NewGamePlus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
at (wrapper delegate-invoke) UnityEngine.Events.UnityAction`2<UnityEngine.SceneManagement.Scene, UnityEngine.SceneManagement.LoadSceneMode>:invoke_void__this___Scene_LoadSceneMode (UnityEng
help
no
figured it out kinda
got rid of the hook
UnityEngine.SceneManagement.SceneManager.sceneLoaded += OnSceneLoad;
and the error went away
which is weird because I was using that exact hook in the same way in HellMod
most likely, the problem is within OnSceneLoad
i broke the game
I used the mod api's sceneChanged
and on scene change
black screen
most likely your hook broke something
yeah
meh, i think I'm going to break down and wrap all the hook calls in the API in try/catch....the only reason i wasn't doing it before was that it didn't make a difference since it'd just log the error to output.txt, but now that we have an on screen display of modlog, i can't see a reason not to do it
nevermind
didn't figure it out
same error 
@buoyant wasp do you know how to load the lights in a scene
I tried loading a scene onScene change
and now the screen is black
but I exist
I know next to nothing about the scenes
darn
what's the full stack trace you get when you load into a scene? and what does your method that you're calling on change look like?
doing this UnityEngine.SceneManagement.SceneManager.LoadScene("Tutorial_01");
on scene load
the scene loads fine
I got light
by killing myself
running into some spikes I found caused me to respawn w/ lights on
oh, i have no idea what effect you would have by loading scenes manually
I've done a bunch with manual scene loading. It does tend to leave things in a janky state but if you load the scenes additively and then unload them things sometimes remain unchanged. That's how I load all the enemy types in for my enemy randomizer
really need to figure out how to load stuff like that without loading the entire scene
Problem is that the enemies are only raw game objects that exist in the scene.
No enemy prefabs in the game, as far as I was able to see with a lot of digging
Now, doing the loading and serializing out the data ourselves into a format others could use is a possibility
only if the extraction is simple to do when new releases come along. last thing we want is to have to do alot of crap when they release a patch that changes the behaviors of half the enemies in the game
Yeahhh
@leaden hedge hey dud, could u plz add moss charger to bosses you can fight?
In boss rush
dud!
DuD!
ik most people don't consider moss charger a boss, but i think moss charger is more of a boss than gruz mom
i've only ever fought moss charger once
the first time i played the game the "intended" way
I'm confused
I'm trying to get Randomizer to work but I'm stuck at getting to Properties in Visual Studio
wtf
why are you in VS
C E A S E
A N D
D E S I S T
@willow path why VS
you download the API from the google drive
you install it
you download randomizer from the google drive
you install it (move the stuff)
no compiling or visual studio or anything needed
didn't work
unless Fury of the Fallen isn't randomized
I did that for Lightbringer and Boss rush
it worked
did the randomzier logo show up
you put the folder in the wrong spot
there's a folder called randomizer or something
ye
I got confused because it was just png
folder
then you move the folder in the files to C:\Program FIles (x86)\Steam\steamapps\common\Hollow Knight\
I think that's the right thing
it works
Lightbringer is the best mod
Modding API is the best Mod IMO (totally not biased at all)
@leaden hedge - What does RectMask2D do?
lightbringer definitely has the best trailer though
if i had any talent in video production at all
i still wouldn't do it, because it'd take too much effort ๐
lol
shidst mod is best mod
i played shitmodst
it sayed
said
play lightbringer
therefor
lightbringer is best mod
no
shidst mod is satire about how the life of a mod needs light to be brought to it
it's very deep
then wouldn't it say
the lore behind it can only be interpreted by people with high IQ
play lightbringer
"play lightbringer
means
"
no, that's just made to distract you
play lightbringer = bring light by playing shitmodst
is it a coincidence that the creator of lightbringer also made shitmodst
To be fair, you have to have a very high IQ to understand Shidst Mod. The humour is extremely subtle, and without a solid grasp of theoretical physics most of the jokes will go over a typical viewerโs head. Thereโs also 753โs nihilistic outlook, which is deftly woven into his characterisation- his personal philosophy draws heavily from Narodnaya Volya literature, for instance. The fans understand this stuff; they have the intellectual capacity to truly appreciate the depths of these jokes, to realise that theyโre not just funny- they say something deep about LIFE. As a consequence people who dislike Shidst Mod truly ARE idiots- of course they wouldnโt appreciate, for instance, the humour in 753โs existential catchphrase โPlay Lightbringer,โ which itself is a cryptic reference to Turgenevโs Russian epic Fathers and Sons. Iโm smirking right now just imagining one of those addlepated simpletons scratching their heads in confusion as Dan Harmonโs genius wit unfolds itself on their television screens. What fools.. how I pity them. ๐
And yes, by the way, i DO have a Shidst Mod tattoo. And no, you cannot see it. Itโs for the ladiesโ eyes only- and even then they have to demonstrate that theyโre within 5 IQ points of my own (preferably lower) beforehand. Nothin personnel kid ๐
oh no
get destroyed kidz
play lightbringer
.
it's a pretty shitty modst if I say so myself the mod was made by 753, but you probably can't access shitmodst anywhere because it's actual garbage just like...
wrong
fake news
only people with iq of 90000 understand advanced quantum physics concepts like mandelads affect and interpoliroidnizationalnucleartransposition69fakslikeinator
check mate atheists
mandelads
what exactly is going on here?
shidst mod is best mod
meaningful discussion of shitmodst's lore
need to change my title here i think
there
lmao
a person with a high iq would know that populasramsos theory suggests that inverse relations like more numbers does not mean more betterer
joy, killer of wyza
take that atheisdassts
well, it flows better than "wyza, stick in the mud"
atheists, if god doesn't exist then what's lightbringer?
shidst mod's complex lore actually answers that
I cant even speak with weak minded plebiansdns such as urself, ur argument is null
i pity those with your incredibly low IQ
hehe, just considering how best to threaten the hammer
o no
gasp

wait what's the hammer
_ban
the hammer's the MC
gasp
_banpls
@leaden hedge - https://github.com/seanpr96/HollowKnight.Modding/blob/master/Assembly-CSharp/CanvasUtil.cs Commented version of CanvasUtil. Think i have it right, but if you wouldn't mind going over it and correcting it where I'm not, that'd be great
yo what is the hell mod?
it's about what you think it is
hell
@trim nimbus
# Hell Mod
#### By 56 (me)
## Effects
- 1/2 Nail Damage
- 2x incoming damage
- 1/3 max SOUL
- 1/2 SOUL collection
- no SOUL collection while your shade is alive
- Heal focus is nerfed to Deep Focus speed
- Deep focus multiplier increased by 1.3725
- Dream shield only costs 1 notch (bugged, shows up as 1 but still uses 3)
- 80% spell damage (20% reduction)
## Installation
Hell Mod is an API mod, so install the Hollow Knight API (by Seanpr, Firezen, and Wyza) and then place the HellMod.dll into the Mods folder
nightmare god + hell mod
it would work
wouldn't that do like 8 masks?
yes
two damage + hell mod + overcharm
wow
so you would have two hits until you're dead with max masks
yeah someone should do that
Glass soul messes with nail damage so it's not entirely compatible
One of them would likely overwrite the other unless they're coded multiplicatively to the current value
Which isn't entirely possible
Since it would just stack upward indefinitely
recompile glass soul with nothing for the attack hook
is lightbringer crashing for me on mac because it isn't compatible or because of something else
lightbringer is not mac compatible
all the api mods are cross platform
neat
the boss rush on the drive is it
okay thanks
fun random bit of info: i went and hit that weird metal statue thing that doesn't do anything inside the dreamer's den in deepnest with a thing printing out the name of objects my nail collides with. it's called "god shrine stuff"
actually i'll just post the pic https://puu.sh/yXlQZ/0401fd0c52.png
@buoyant wasp rectmask2d hides everything in this object and children objects that goes outside this objects rect
there is imagemask2d but thats just the same as an image with one line of code and it doesn't work very well
so I didn't put it in
The X, Y, Width, Height part of CreateSprite is for subsprites, i.e if the texture has 4 sprites you dont need to load 4 textures from that one texture you just need to put the correct positions in
And Toggle Group is for a set of toggles where only one can be true
ah
so, it's a texturemap where you select which part of the texture you are using for the sprite
IE the spritemaps you gave me a long time ago with all the charms in them
there, comments updated
@leaden hedge - so i've incorporated your loader code in for the menu. it shows the Mods menu option, but click on it, takes me to the games options rather than the mod list
EventTrigger events = modButton.gameObject.GetComponent<EventTrigger>();
events.triggers = new List<EventTrigger.Entry>();
EventTrigger.Entry submit = new EventTrigger.Entry();
submit.eventID = EventTriggerType.Submit;
submit.callback.AddListener((data) => { fauxUIM.UIloadModMenu(); });
events.triggers.Add(submit);
EventTrigger.Entry click = new EventTrigger.Entry();
click.eventID = EventTriggerType.PointerClick;
click.callback.AddListener((data) => { fauxUIM.UIloadModMenu(); });
events.triggers.Add(click);
you have that code?
yeah
well thats the code that removes the game option trigger and adds the mod menu trigger
put a print before and after that snippet
to make sure its actually being executed
hmm, its not, array index exception. Guessing because i put a filter on which mods it will show and none of them apply. (since the mod needs to have implemented both unload and initialize for off/on to work) I just need to check to make sure there is at least 1 mod that falls into that category. but tomorrow when i'm not passing out at my chair
Literally no mods implement unload
I'd drop that system if you're using the mod options thing
I'd make it mod implement a getOptions function
that returns an array of Options
each Option has a title, callback and optionSet
then just populate that menu with those
title = text on the left to say what it is
optionSet = the possible options i.e. off, on
when it changes give them the callback with the option it was set to
then you could put stuff like difficultly and debug options in there
lmao
is it as fancy as this ๐ค
@rain cedar i am adding an interface that a mod must implement in order for it to show up as togglable in the menu
Right now it's purpose is purely to enable or disable mods.
And now. Actually passing out. Later
Neat
Wyza is our hero
does Assembly-CSharp.dll have the code for bosses too?
no
alright but I'd be lying
okay then, how do I change the player maker stuff
do you have a virgin sacrifice handy?
yes
before we get into the how, we need to ask what
and said virgin
I only see unity studio, dnspy, and the asset changer thingy
yep, I am blind
with this installed, just run the game and go to whatever scene contains what you want to mod
it'll dump their fsm
and you can then spend countless hours trying to figure out wtf is going on with it
and change what you need to change using the assembly
it says I need permission when I want to download it from google drive
have permissions changed while I was away?
this is the right one, correct?
its private for me too
wait, it's for an older version though
when I click your link, it's also private for me
does it matter?
it doesn't really matter, no
it just dumps stuff
now the hard part
go for it
this seems to be the latest version I have
october 18th
seems consistent with the github, so I assume it's uptodate
ok thanks
I can't open the readme in the seanpr mod API zip, I don't have any programs that can open that file type. Does anyone know what it says? I'm guessing they're instructions which are what I need
I'm pretty sure
drag it into any text editor
yeah it's .md
Ahhh nice, notepad++ worked. Thanks!
YES, feelsgoodman. Just downloaded my first hollow knight mod. Got the debug and API. I need it too practice bosses for speedruns
hopefully debug will be getting better functionality for practicing bosses soon โข
I just clicked hide menu, what's the hotkey to get the debug HUD on again? ๐
f1
thank you
I'm only half a hero, @leaden hedge did all the hard work to make the menu UI stuff look and work like the normal menu.
i'm just putting the pieces together
so i've made my mod's UI in unity and i'm loading it in through an asset bundle. any reason i shouldn't be doing this? it seems to work and look fine
kdt's just been working on making "standard" mod UI elements that behave/look similar to the vanilla game so that the mods feel like they belong
but you can do really whatever you want
so far just buttons, slider, and labels etc. at runtime i'm having the scripts find the assets and link up to them by adding listeners etc as needed.
just nice to be able to layout stuff in the editor and prototype scrolling areas and such
well scroll rects and sliders suck in code
so I've not even bothered with them
although I don't think anything in game actually uses them
actually volume and brightness use sliders
so I guess I should implement them
I'd love you long time if you did scroll rects ๐
Sliders are also a convenient way of making a loading bar
image has a thing for it
Which, since I have a load step where I load and unload about 50 scenes, is nice to have
Ah, cool
fillMethod
and
fillAmount
oh and
type
although no point giving code for it if you use the editor to make them 
but then you can use an actual image for it instead of a slider
๐
Overall, modding this game has been very easy. You guys do good work
So other than a lot of bug fixing, enemy randomizing seems to work well. I just need to figure out how with only a few exceptions (like the collusem)
*how I want the logic to work
which exceptions
Replacing a spawned enemy in the collusem makes the event softlock
ah
I have some ideas for a work around
weird it does that
work around isn't too hard anyway
just keep one enemy and repeatedly call its die function
That's kinda what I was thinking would work, cool
Do you know why sometimes spawned enemies will just zip through the floor/world?
in the fsm I think theres a state that says something like decrement battle enemies
Like giant moss charger doesn't seem to like getting spawned anywhere
Even up in the air
soul master for instance can't move outside his boss arena
but he floats / teleports
Gotcha. And the logic for that is un the fsm?
probably in its controller fsm
Looks like may be digging into that to see if I can un-region lock some of these.
Though it may not be worth it
Since idk if anyone wants random bosses while exploring
Nosk is particularly annoying to run into
half of them probably won't even work anyway
nkg won't
tmg won't
mantis lords probably wont
soul master probably wont
do they weird
They will cling on invisible walls
I'd have assumed they would have needed the 2 anchor points either side of their arena
But that's about it
radiance probably won't work, zote probably won't either
Normal zote?
nah gpz
Ah
NGG spawning randomly when?
:p
But yeah, mostly need to figure out how I want to shuffle things. Also, baulder shell enemy is horrific. Each spit is randomizing the roller it shoots out
It spat a nosk at me once
holy shit
just make it consistent
imagine an Elder Baldur spitting another Elder Baldur
speaking of elder baldurs do they respect the one baldur rule
It could
if they spit a none baldur
Which is?
Oh
normal elders can only have one baldur out at a time
Uhhh, what do I replace the playermaker.dll with to make the files go in save_fsm when I run the game
you need to use a patcher which should be with the mod you downloaded
what do I do with the patcher
wait, enemies that spit trams?
Lol
what do I put in the XDelta patch textbox
@ornate rivet so, you run the patcher, select the vanilla playermaker.dll as input and PlayMaker1117-whatever as another input
the lines don't really matter too much
you can extend them if you want
just the health_manager is extremely big
I cant edit them
if you use my version of the viewer, the lines work all the way ๐
that's why it's called a viewer
not an editor
yeah this is just for editing
then what do I do with it
this is to tell you how the FSMs are laid out
ooh
its like trying to edit a book
without opening it
this just lets you see whats already written in there

you can look at the source code for NGG, Randomizer, (bossrush? dunno), they all have examples of editing the FSMs
ok
it's kind of light giving yourself a root canal with a rusty spoon
I can't remember if I put good examples in any of those
once I got a better understanding
lol
lol
yeah NGG does some basic stuff
changing transitions and values
no injection of "new" code
I believe you guys changed the spells functionality in Bonfire
and it's all FSM, so if you want to take a look...
i did, but the newest code wasn't ever posted to github i don't think
or you posted it and i didn't know, i know i sent it to you ๐
but that was when you went poof
I did nothing
yeah
I'm still kinda poof-d
I'm here, but not
I'm like a shadow
like a blackmoth
no one really did anything the last month
until yesterday when I posted code for the mod menu
pretty much
although in the case of injecting and removing code from fsm states pretty sure FsmUtil does have code for that
although its not quite as fleshed out as CanvasUtil
although I don't think they quite work entirely as is
heh, i'll hold off on adding that to the API until it's more fleshed out
will bigger mods be released once all the patches have been released
