#archived-modding-development
1 messages · Page 87 of 1
So I guess I'm supposed to put a status update after the pictures I posted yesterday. I got Crossroads mostly working on Linux (and my changes should help it work on mac as well), while leaving the program also working on Windows just as it used to (I tested it a little bit in a VM). but I've run into a minor problem. I'm having some trouble getting Windows Forms working. On windows the official folder and file selection dialogs just won't appear- this is ok because there's a 3rd party library that works around this. On Linux any windows form, from alert boxes (which the program uses quite a few of) to file selection dialogs won't disappear on pressing "ok". You have to spawn another form of any type to hide the last one, so I guess I could make a 1x1 blank window but that seems kinda hacky.
It's possible this is a Unity bug since it warns me that System.Windows.Forms is not fully supported when I try to compile.
I know most of y'all are c# devs so if anyone here knows a non-hacky fix to this please let me know. I'm not sure I should publish it with this kind of bug.
Eh, sorry, can't help you there
Even tho my installer is winforms, it is all thanks to google-fu
Oh well, well the program works it just looks kinda bad because of it.
clicking x on that window does nothing, moving another window over it causes it to not re-render looking kinda glitchy, this is after clicking ok like I'm supposed to. I copied much of my windows forms code from CKAN and that program has working forms so IDK what's what.
it doesn't try redrawing anything so it shows whatever was on it last.
its not in the drive
because its hella meme
tbh it should be in the drive
but w/e
thanks
Alright unless someone pings me next time I post in this channel I'm gonna have made my own mod (or at least tried)
What mod? IDK yet I have some ideas but I need to figure out the process first so I can learn what's possible
what mod?
@compact sedge feel free to use or contribute to modcommon to help with your mod
Or just as a repo to copy snippets from
Thank you this is just the kind of thing I need :)
do you have any documentation for it?
c o m m e n t s
The modding api provides the hooks and some more helpers; this is just something I've been trying to use to consolidate things I reuse into one place so it's not copy pasted over many mods. And hopefully welcome others to add to it
So far I've commented some things thoroughly, like the template state machine
And others not yet (just a time constraint thing)
ok well that's sorta helpful, and definitely better than nothing, and since you're providing the code for free I can't exactly complain
But tag me in any questions and I can answer
alright hopefully I don't need to
Using Hornet as the black egg gatekeeper if you've got any of the restrictions enabled
Very conveniently placed NPC
Here's an example of one of the things you could use out of the box for stuff: https://github.com/Kerr1291/ModCommon/blob/master/ModCommon/Components/Debug/DebugColliders.cs
While it kinda lacks comments it should be fairly straight forward
?
Oh
I agree, actually
But I Remember reading the for (;;) optimizes better or something.
Odd
I'd say it doesn't matter but this isn't c++ so it might matter
It's not true with gcc in c/c++ at least
Soooo guess I'll be switching
For each was worse
But foreach is great so I'm gonna use it everywhere anyway
Cool
All bosses restriction was probably a bad idea
I need to do a lot of shit to make that work
Like preventing troupe banishment and zote death
plus you can't get the first ending I don't think with that restriction
Why not just not count the final grim fight and just set the player data books manually
Bools
I don't get what you mean by that
Yeah, maybe
For grimm I was just gonna get rid of brumm in the lantern room
I think that's where he shows up
Yeah, good option. Or if there's a player data bool for "has talked to brum in deepnest" maybe just force it to stay off
There's a gotBrummsFlame bool but that might have some bad side effects
Like making it impossible to get his flame or letting you get it infinite times
Depending on how its implemented
Hmm
It's really pretty easy to mess with NPCs on scene load
This is all I'm doing for hornet
GameObject hornet = GameObject.Find("Hornet Black Egg NPC");
hornet.SetActive(true);
FsmState activeCheck = FSMUtility.LocateFSM(hornet, "Conversation Control").GetState("Active?");
activeCheck.RemoveActionsOfType<IntCompare>();
activeCheck.RemoveActionsOfType<PlayerDataBoolTest>();```
Would it be possible to add a randomized start location (bench) to randomizer without too much headache?
Yeah, suppose that's true
Will have to wait until room randomizer is working, if ever
Yeah
Getting all the requirements for it is just super time consuming and not fun at all
if (GameManager.instance.GetSceneNameString() == "Cliffs_06" && Settings.allBosses) Object.Destroy(GameObject.Find("Brumm Lantern NPV"));```
Should be as simple as that
So there's one problem solved
Also yes it is NPV, that's not my typo
Yeah, I guess it's not important if the object is deactivated. Find doesn't locate inactive game objects
Which is why I wrote some extensions to do a find that would
Alright
Object.Destroy isn't gonna throw an exception if I pass it null, right?
If Find doesn't work on inactive shit
Ah well he's probably active all the time at scene load, anyway
Then some FSM turns him off
It will
Destroy a null throws a nullref iirc
If you pass null

so does lightbringer not work anymore?
nope it's dead, jim
nothing to its likes will ever be seen for a long time i'm afraid
okay thanks
56 was messing around with putting lightbringer code in with MonoMod hooks
another quick question, should I use the enemy health bars or just the hp bar
oh nice, I didnt play back then so lightbringer would be fun to try
not sure if both the hp bar mods are compatable
they are
okay thanks
well
the old one isn't with the newest version iirc
that one still uses health as FSM i think
the enemy hp bars by gradow and kdt is the proper one
okay i thought so, thanks for confirming
cant find any info on what the boss rush mod does
lol okay, thanks
KDT is waiting to see if gng adds boss rush
@rain cedar playing around with your randomizer for the first time, curious if there's a record of the kind of stuff the randomizer expects you to be able to do (for instance I'm in Crystal Peak and I think the only ways forward are manuevering a dark room without the lantern or doing crazy spike pogos up walls)
are you referring to this? https://www.speedrun.com/hollowknight/guide/ghb3u
Hollow Knight - Randomizer Speedrunning Guide - by RainingChain
oh cool this will be useful, thanks
i think I AM stuck though unless i maneuever the dark room
shouldn't have sat in that bench
What's stopping you from leaving peak towards crossroads?
Isn't that a dark room with a gate?
Yeah, you can buy the gate
Not being able to open tolls in the dark is stupid
So randomizer makes it so you can
Oh ok
Didn't know that
Then yeah I can leave that way
Is there a list of stuff you changed like that?
I know that the Baldur in the Ancestral Mound can be killed without Vengeful Spirit for starters
Mostly stuff that doesn't matter too much
Like removing benches that would soft lock you
on my first attempt I locked myself at Lake of Unn but I did a ctrl-f and found that it had already been brought up
Yeah, there's a couple benches that can still cause problems
I'll fix those when I release it for lifeblood
right on
really cool that this is a thing
i got turned on to randomizers by the LTTP randomizer race at AGDQ
and after i had played through that with my friends a bunch of times i was like 'i wonder if there's a hollow knight randomizer'
It's made really sloppily, I'm trying to do better with lifeblood
Just remaking the mod entirely instead of updating what's there
i was improvising my way up through Crystal Peak without Claw but figured that the randomizer PROBABLY doesn't expect me to do stuff like this especially on Easy https://youtu.be/zDtRruucSMU?t=1m (timestamped)
That actually is part of what can be required on hard
nice
But yeah not easy
yeah it was fun
i got to this part and was like "shit i can't proceed without the claw.... or can I?"
and i remembered my training
from the white palace
Is it just me or is there a glitch with the More Saves Mod?
When I press "[" and "]" to scroll through the pages of save files, it does not move.
TC added a check, that does nothing but break more saves
kek
Checks if save no is between 1 or 4 otherwise returns save no mod 4
Nothing I can do on my end
Api has to remove that pointless check
And people wonder if TC hates us..... 
could you use the monomod hooks
monomon haha

oh, yeah
here, KDT
Error while loading save file for slot 3 Exception: System.ArgumentException: JSON parse error: Missing a closing quotation mark in string.
at (wrapper managed-to-native) UnityEngine.JsonUtility:FromJson (string,System.Type)
at UnityEngine.JsonUtility.FromJson[SaveGameData] (System.String json) [0x00000] in <filename unknown>:0
at GameManager.GetSaveStatsForSlot (Int32 saveSlot) [0x00000] in <filename unknown>:0
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)```
what outputlog says about the save file edited with HKSM
weird
it says that for every file edited, btw
can you dump it with the other one to json
and see if theres actually a missing quotation mark
which one? RainingChain's?
yes
nice random issue
"LoadedMods":{"keys":["EnemyHPBar"],"values":["0.0.1"]},"Name":"}}
that's at the end
and Code is telling me that last bracket is unpaired
removed it, loading game to test
yeah
maybe it's missing {"
that would fix the matching brackets
yup
"Name":""} works
check the uneditted version
dunno why that is happening
iirc java's json reader/writer expects something different
also
I just checked
it overwrote all my saves with the edited save
now I have 4 identical save files
nice
nbd tbh
I can just edit them
jsonString = jsonString.substring(0, jsonString.length()-2)+"}}"; ```
java doesn't expect the outer }} in its json
so I have to remove them to read it
and at it back
but I think saves with modded data add different stuff at the end
can you give me the entire save file as json?
uneditted
oh, by 'uneditted' I thought you meant that I didn't open and edit it by hand
sorry
nah i just meant a working moddata one
hmu with a working modded .dat

about the moresaves thing
public static bool Platform.IsSaveSlotIndexValid(int slotIndex)
always needs to return true, or add a hook asking for a max value w/e I don't care
I dunno who actually actively maintains api atm
you can use that monomod "hook-on-demand" thingie and bypass that tho
can someone test this on a vanilla save
@rain cedar have you thought about working Mask Shards and Vessel Fragments into the randomizer pool? is this feasible?

when I edited my files before, even the save editor wouldn't be able to open them
ok cool, I released it like 2 hours ago so I don't have to unrelease it
what'd you change
but now it is able to open them again, both modded and unmodded save files
lemme just open them in-game to be safe
jsonString = jsonString.substring(0, jsonString.length()-2)+"}}";
to
if(json.has("modData"))
jsonString = jsonString.substring(0, jsonString.length()-2)+"\"}";
else
jsonString = jsonString.substring(0, jsonString.length()-2)+"}}";
lol
not even hacked tho
I got a 106% from discussion
fucking steam auto-backups
it's overwriting my folder with old saves ffs
yup just did that
omg
I'm looking through some fsms
so the Knight has a Charm Effects child
and it has some fsms...
this one is "Set Spell Cost"
it's basically "if soulTwister equipped, cost = 24, else cost = 33"
why make it fsm tho
also, I'm not exaggerating btw
it's literally a "if else"
it's such a meme
there's 3 million checks for everything
falling velocity is another good one
instead of just having a max velocity it checks if:
-you're not in acid
-you're not in water
-you're not dashing
-you're not using descending dark
and in the end it is overridden by inventory because it doesn't check when that is open so it never reaches a max velocity
tc good at coding
looking at nail range fsm
it's literally csharp if (longnail.equipped) increase nail range; if (mop.equipped) increase nail range;
once again, not even kidding
wasn't that not an fsm tho
but if you equip both doesn't your range not increase as much?

oh god so the animation doesn't match the actual hitbox?
I think it does
but for some reason the hitbox is not attached to the actual animation
they have to set the two independently
w h y
i can anecdotally say that the hitbox is bigger than the animation
good that's how it should be
if (this.mantis && this.longnail)
{
base.transform.localScale = new Vector3(this.scale.x * 1.4f, this.scale.y * 1.4f, this.scale.z);
this.anim.Play(this.animName + " M");
}
else if (this.mantis)
{
base.transform.localScale = new Vector3(this.scale.x * 1.25f, this.scale.y * 1.25f, this.scale.z);
this.anim.Play(this.animName + " M");
}
else if (this.longnail)
{
base.transform.localScale = new Vector3(this.scale.x * 1.15f, this.scale.y * 1.15f, this.scale.z);
this.anim.Play(this.animName);
}
else
{
base.transform.localScale = this.scale;
this.anim.Play(this.animName);
}```here be NailSlash
so animation scales multiplicatively
uh that looks additively
with one it's +25% with another it's +15% with both it's +40%
yeah, that's for the hitbox
huh
but animation is controlled by that fsm from earlier
it first applies the range from longnail
after that it checks and applies it for mop
so animation is 144% but the actual range is 140%?
That's like half the game right there
that's all of the states, btw
FSMs that only exist to trigger other FSMs
it has one state to check for longnail and one for mop, and that's all
that up there is the state if check for longnail returns true
I assume all it's doing is setting a bool somewhere else
also, now I think I know what causes sharp shadow to randomly break
it's fsms spawning fsms right
this is the whole fsm "Control" for "Sharp Shadow Impact" gameObject
Transitions
FINISHED => Recycle
Actions
GetOwner(0)
RandomFloat(pÁ,pA,Rotation)
SetRotation(NULL,3.402823669209385e+38,,,,Rotation,0,FALSE,FALSE)
ActivateAllChildren(0,TRUE)
Wait(?,FINISHED,FALSE)```
recycle?
Transitions
Actions
RecycleSelf)```
destroy itself probably
I figure something is preventing the "FINISHED" event from being sent
so it never "recycles"
maybe the ActivateAllChildren is returning an nre or something
the thing is, I can't reliably test this hypothesis
I can force it to send the FINISHED event, sure, but since the bug is kinda random...
no way to know if the fix actually works
can you replace the recycle altogether maybe?
[Tooltip("Recycles the Owner of the Fsm. Useful for Object Pool spawned Prefabs that need to kill themselves, e.g., a projectile that explodes on impact.")]
[ActionCategory("Object Pool")]
public class RecycleSelf : FsmStateAction
{
// Token: 0x06000F23 RID: 3875 RVA: 0x000557AB File Offset: 0x000539AB
public override void OnEnter()
{
if (base.Owner != null)
{
base.Owner.Recycle();
}
base.Finish();
}
}```
such use
much needed
ObjectPool.isRecycling = true;
if (obj != null && prefab != null)
{
ObjectPool.instance.pooledObjects[prefab].Add(obj);
ObjectPool.instance.spawnedObjects.Remove(obj);
obj.transform.parent = ObjectPool.instance.transform;
if (obj.GetComponent<ActiveRecycler>() != null)
{
obj.transform.SetPosition2D(ObjectPool.activeStashLocation);
FSMUtility.SendEventToGameObject(obj, "A RECYCLE", false);
}
else
{
obj.SetActive(false);
}
ObjectPoolAuditor.RecordDespawned(obj, true);
}
ObjectPool.isRecycling = false;```
lemme see if I can bypass that...
@pearl sentinel is there a new update for 1.3.1.8 api?
rando?
randomizer
ok yea
if you want to play rando rn you can downpatch to 1.2.2.1
of course, ill only try it when i actually finish the game
api is updated
in the drive i see .5 no .8
try not being on beta ez
oh :/
Does beta even have benefits right now?
Yeah, thought so
This is a dumb question but which version of Unity does Hollow Knight use?
No idea, but it's .net 3.5 if that helps
turns out it doesn't matter to dnSpy
I'm gonna try to decompile it in my vm and then copy it back to my host system
5.6
ooh I think that's the last version before they moved to year based versions
Yep
Nope. He's too complicated to try spawning
can you spawn him in greenath
See previous statement
meme imo
I know I was doing a shitty meme
O
So, I don't wanna speak too soon. But I started on something after having an epiphany this weekend
No I mean it has a safety warning
But I think I might be able to save and load hollow knight enemies from/to file with what I'm working on

And really any playmaker fsm game objects in general
so, I was working with that sharp shadow impact fsm thingie
turns out it's actually 2 impacts
[INFO]:[OneHP] - Sharp Shadow Impact found - Impact 1. Parent - Sharp Shadow Impact(Clone)```
So, what I figured out about prefab stuff
The enemies are prefabs, pretty sure, but, they aren't stored in the /Resources folder in their unity project
This means, they're only "loaded" when a scene that needs them is loaded
Like, as far as unity goes, this is a good thing
This is also part of the motivation behind what I'm doing tho
If I can get the data saved to a file, then the enemy or whatever could be created at runtime
oops
Also, you could then edit that data if you wanted to mod an fsm
that'd be super convenient
Basically, the way I'm doing it is inspired by that reflection fsm data getter I told you about before
I took that concept and expanded it to serialization for saving and loading
monomon haha
yea
hm... Might try something
do you have a handy link? Or should I just search for it?
i can grab it real fast
api w/ the stuff is in https://cdn.discordapp.com/attachments/327461802311155714/439917182097555459/QoL.zip
is there a way to make grimm's tent graphic respawn using debug
separate hooks dll is this
just throwing random qol stuff in there
rn it's just skip all cutscenes including credits and endings and menu drop + storage re-enabled
just add qol to references in VS, right?
there should be an api in the zip w/ the mod
k
whatever works
inb4 collision disabled
didn't test hooks.dll tbh
what's the reference folder?
oh, I figured it out
i could test it too for you
but still, worth showing
look at this masterpiece
with a single line of code I broke all FSMs at once
beautiful
LOOOOOOOOOOOOOOOOOOOOOOOOL we saw menderbug at work too there 😮
(I hooked to PlayMakerFsm.Awake and forgot to call orig at the end)
menderbug just fucking froze
shitmodst 2 confirmed?
I have been outdone
menderbug: "well i'm done now i'll just awkwardly stop working bye"
I've heard that word a bunch, what's mono mod?
MonoMod is what the API uses to patch assembly-csharp
to like replace the methods so they can add hooks
recently it got a runtime detour hook generator
which lets you replace any function or add stuff before/after it
which is how i did the lightbringer api thing
interesting
because w/ it there's nothing you can't change
except protected and internal and final and const stuff
field access modifiers?
you can reflect internals?
p r i v 8
not internal or final, afaik
but you can change and access a lot of code with monomod, is the point
private is enough for me, I'm sold
according to a random stackoverflow thing you can get internals
you still have to use reflection for privates but you can change all the methods super easily
like this is what I got from lightbringer overridden w/ monomod
oh god I left comments in it?
yeah
the nope comment is mine tho
i was trying to get the
this.anim.PlayFromFrame(0);
this.stepCounter = 0;
this.polyCounter = 0;
this.poly.enabled = false;
this.clashTinkPoly.enabled = false;
this.animCompleted = false;
this.anim.AnimationCompleted = new Action<tk2dSpriteAnimator, tk2dSpriteAnimationClip>(this.Disable);
this.slashing = true;
this.mesh.enabled = true;
stuff to work
then i realized why bother when you can just call orig
which does it for you
and these are all the hooks
what was wrong with the boss fights btw?
probably the fact that I declared static variables, right?
makes everything super simple
no it was just that everything in herocontroller was private
and annoying to modify
all the mod vars ended up being easier than I thought
i just made them all class vars
didn't get text to work tho
tbh I barely got text to work
this looks a lot simpler than the API, would this be a replacement to it?
of sorts
you would use it w/ the api
so you just make a mod like normal
and have the monomod hooks in the mod
if my pr gets merged then it would be part of the api
otherwise you'd just add a ref to the hooks dll
I see
example w/ the skip cutscenes thing
interesting
and with the API it's basically one giant class where I can put all my methods?
yeah
and they'll be written to wherever they need
it just runs the hooks before/after/instead of the methods but basically yea
^
but only one will run
oh good point
but for the most part you can just call the function before/after with modified args
Yeah, not a huge deal
oh
I'll have to get back into Hollow Knight modding this summer if I'm not too busy with moving
but I need to survive these next 4 days first
I have 3 exams tomorrow
oof
C programming, Prolog / Smalltalk programming, and Statistics
o+o=f
is Text an object or something cuz from all the tutorials ive seen online it works to make something like Text text but for my case it seems to declare that it doesnt exist in this context or whatev (also i pretty much tested using/importing most of hte libraries to see if thats the problem still persists tho)
imo missing reference
Text is usually a component in Unity if I'm understanding you right
ye
you need a ref to UnityEngine.UI
weird
and a using ofc
ok, so I have a potential fix to sharp shadow breaking bug using monomod hooks
I'm forcing it to recycle itself every time it gets called
ttacco - using canvas?
or imgui?
yeah im trying to use canvas
using Modding;
using UnityEngine;
using UnityEngine.UI;```
this what enemyhpbar uses
still weird though, im already using UnityEngine.UI but Text text basically still declares it "type Text could not be found" or something
oh goddamn
it aint putting out an error like "could not find reference" like that so i assumed it was part of UnityEngine in itself
aight its working now, my Java instinct is still there, like "why import a specific part of System when you can just import the entirety of System in itself"
text = gameObject.AddComponent<Text>();
except gameobject was gamemanager or something
iirc
maybe try something like ESPbase.AddComponent<TextMesh>(); TextMesh textComponent = ESPbase.GetComponent<TextMesh>();
what's ESPbase
o
you can do x y = gameObject.AddComponent<x>(); too
no need for the get component
yeah I know, I really should clean up my code a bit more
do you guys use ReSharper?
I should at home. I do at work. It's pretty nice
Change your style rules?
yea did that now
Var lul nice joke
wow this is nice
What is this js
The thing I always wanted and had to get a little helper script for was a hot key combo to put curly braces around a highlighted block
I wonder if I can get it for my c# code for free 🤔
All my code is open source and actively maintained 🤔
h o w
Hella gay
reasons to not drop out number 1
Ah I remember the days of edu freebies
nice
CSharper more like its a crutch use a real IDE use notepad /s
hoping i keep mine
I've not been in uni for 4 years it only got cancelled last year
Now I just snag dem "work benefits"
i know, just saying using tools to make youre life easier, when you can just go hardcore with a shitty notepad
wtf magic
Notepad > IDE > IDE with tools/extensions
Static code analysis tools = amazing
Write everything in asm binary only
Write everything in fsm only
srsly just starting here, not knowing anything about fsm a what not, but are they really that bad? (FSMs i mean)
Fsms aren't bad
But, the particular thing used for hollow knight creates visual fsms that one uses to do visual scripting
This isn't inherently bad, but it's not something that is easy to modify in code
And it's used for about 75% of hollow knight
Earlier today I posted an example of the spell twister charm fsm
Just ctrl+f it to see for yourself
Its not even the visual parts, the problem is each action is a class with memory for everything it needs, and they pretty much use single lines of code per action
Whereas something like hearthstone uses hundreds per action
So there's way less shit everywhere
Some are harmless and quirky, and some are just... Godawful
Like fsms all the way down
The thing is, playmaker is mostly targeted at non-programming
So a people who can't code can make something
But its not supposed to be used by non programmers completely
Like, it's not flexible and it most certainly doesn't scale
The usecase is, programmer makes complicated action designer glues a few actions together and they have a quick prototype
It's great if you wanna prototype
If you can't program actions into you just end up with insane bloat
Like hollow knight has like 3 versions of some deceleration action, decelerate, decelleratev2, and deceleratev3
I have no idea what the difference was
and the HPBars one
and no matter how much I attack them HP Bars won't appear
so I'm either dealing no damage
or the HPBars mod is broken
You can read the fsms code to figure it out assuming there is a difference
Hpbars is broken on lifeblood
the Gradow and Niko one?
Folding this is the old HP bar, not the new one?
does it work for all the other enemies tho?
Naming classes like that is akin to calling your classes Foo, Foo2, and Foo3
probably something was modified with Mantis God that prevents the hp bar from seeing their healths probably?
It at least tells you its decelerating something
Maybe the mantis lords got an HP Buff and it won't appear until their HP reaches the intended one
I'll go test this
or some verbs or variables and what not were modified in Mantis Gods, and the HP bar cant find it, just a guess
Though that happens in the real world too. When I started here our games used this main game class to inherit from called BaseGame2
When I asked about BaseGame instead of 2 they told me oh idk, but don't use it it's old and broken probably
@flat forum yeah it doesn't show up until it reaches intended

Use BaseGame3 its better
Just set damage to 100 it it showed up after a bit yeah
why does that happen, can it be fixed?
Shitmod I fixed that in hpbars
So I should also download Shitmod?
No
am i being dumb or is it
aren't the top and bottom ones the same
Is there a mod that replaces the bosses with their Dream Versions?
no
Aren't you supposed to cache fieldinfo
Maybe bc it could be null but you're casting it to a non nullable type?
i should be but also this was just me copy pasting lightbringer
So a possible exception?
Np
also x? is god
wait are you trying on making a Lightbringer revived edition?
i see
u won't
ree
public static void Parse<T,U>(T output, U data)
{
FieldInfo[] fields = data.GetType().GetFields(bflags);
Type outputType = output.GetType();
//use the field names to assgin all the input data
foreach(FieldInfo f in fields)
{
if(f.Name.Contains("parseIgnore_"))
continue;
Type fType = f.FieldType;
if(fType.BaseType.IsGenericType || (fType.IsArray && (f.GetValue(data) as Array).GetValue(0).GetType().BaseType.IsGenericType))
{
MethodInfo parseXMLMethod = null;
Type invokeType = fType;
object parsedData = null;
if(fType.IsArray)
{
invokeType = (f.GetValue(data) as Array).GetValue(0).GetType();
parseXMLMethod = invokeType.GetMethod("ParseXMLDataArray", new Type[] { fType });
object[] rawData = (object[])f.GetValue(data);
parsedData = parseXMLMethod.Invoke(rawData[0], new object[] { rawData });
}
else
{
parseXMLMethod = fType.GetMethod("ParseXMLData", new Type[] { fType });
object rawData = f.GetValue(data);
parsedData = parseXMLMethod.Invoke(rawData, new object[] { rawData });
}
outputType.GetField(f.Name, bflags).SetValue(output, parsedData);
}
else
{
outputType.GetField(f.Name, bflags).SetValue(output, f.GetValue(data));
}
}
}
That's the snippet I was proud of today
is this for the fsm serialization?
public class FsmStateData : CustomXMLElement<FsmState, FsmStateData>
{
public override FsmState ParseXMLData(FsmStateData data)
{
FsmState state = new FsmState(Globals.currentFsm);
Reflector.Parse<FsmState, FsmStateData>(state, data);
return state;
}
public override FsmState[] ParseXMLDataArray(FsmStateData[] data)
{
FsmState[] output = new FsmState[data.Length];
for(int i = 0; i < data.Length; ++i)
{
output[i] = ParseXMLData(data[i]);
}
return output;
}
Example
Did you dump animations and audio
That's gonna be next. Was tackling the harder stuff first
It'll likely use this code too
Unity doesn't really like you reading its textures or spritesheet data iirc
For that you can write the texture onto a new one fairly easily
You've gotta render the texture to a render texture then convert that back just to read them iirc
I did my masters work with computer graphics stuff and do shader shinangans at work so I'm not too worried there. I just need to poke around with 2k toolkit and see how it's put together. Some googling last night showed me it wouldn't be too bad
The biggest hurdles are managing prefabs and fsms/game object references right now
Since you can't really save a game object reference to a file
I should probably work on anything else, but this has apparently grabbed my interest for now
can confirm fsms are annoying me.
tbh not 100% sure how to read them
weren't you muted yesterday?
ikr
aww screw it I'll just ask.
Where's data on specific enemy stats stored (like health and stuff)? I'm unable to find it in the assembly file, but I'm also not sure how to read data from resources.assets.
Hp is in the health manager component
Probably a good way to see how things translate is to look at my text dump of hornet and the code rewrite of her fsms that I produced from that
That's most of hornet
He's muted now
That's the resulting code from the fsms that I figured out
If you look at the text dump, you can see the PFSM state unit and those actions
Each action is a .cs class
So in my state machine rewrite I created an Init () state, and you can see the function doing those actions, but as normal code instead of playmaker objects
Oh whoops, that text dump is missing hornet ' fsm. Her corpse would probably be better then
so I can see where health for example is defined in healthmanager, and how its used in your script, but I do not see where the value, say 700 for hornet 2, is set.
maybe I'm just stupid but I've never done unity modding before
You mean, how is the max hp defined?
yeah like where the value is actually assigned to a given mob
It's just hard coded in the inspector
They made the component with an "hp" field
Then typed in 200 or w/e
Then you can use that whole thing like a template, and copy/paste the object
Not for us
because I've just been poking around for the last 3 hours in the disassembler.
That's how tc does it
For us, we spawn an enemy, like hornet or whatever then check the hp
Then that's how we know the max
it seems like there's a lot of things y'all potentially cannot do, like create custom levels then.
maybe I'm wrong
Well levels are just art + colliders
Nothing special
You could make them in unity and import an asset bundle
ahh true
Or you can save game object references at runtime and spawn copies or move them around etc
I've done both
wait I probably shouldn't just be editing stuff with the disassembler should I because that will make it incompatible with other mods
thanks for the help, I'm new to a lot of this stuff so I'm sorry for any silly or dumb questions. I think I'll figure this out, I figured out c++ and I'll damn well figure out c# too
Just look at our various mods and things will start to click. Debug mod is a good one and it might sound silly, but my boop sound mod is really simple but shows how you can change a few things in fsms
Anyway, past my bedtime. Good luck!
thanks will do my best
ok your modcommon rocks. Everything is sorta starting to make sense to me now... sorta.
but I was able to quickly copy some real enemy code, remove the redundant parts done by EnemySM, and now I can modify this enemy AI however I want.
(I hope I'm doing it right)
where can i find the charms stats information in the files ?
this basically means i downloaded the wrong zip right
dunno, sometimes when i download directly it still says it
also boss rush doesnt work on lifeblood
well you added boss rush right?
according to the dev it wont be worked on until GnG cuz you never if Boss Rush is actually gonna be the new game mode
hm so it doesnt show my little icon on the map...could it be a mod?
NOTE TO SELF
don't examine the Dreamer monument in Resting Grounds in randomizer if you already have the Dream Nail
locked my game
how so? you cant pick up the item at the end of the dream sequence?
huh
well i reloaded
went past the monument instead and went and talked to the moth
then i backtracked and examined the monument again
and this time it didn't lock my game
so idk!
but the lock was my game literally just froze up instead of it initiating the dream sequence
completed my first randomizer run on easy. 3 hours on the dot. really cool, looking forward to trying Hard after the update
yo can you do item randomizer on CP?
No
alright thanks
I guess I'll downpatch if I wanna do it
but it does make sense since a lot of glitches are rip
I did SL1 NG+7 soul of cinder no rolling and iirc I'm the person who spent the least amount of time attempting it
so none
imo sl1 NG+7 SoC no sprint
beat aura to it
also no roll makes me want to die whenever I try it
is there a mod that stops the humming while sat at bench?
what humming
saluba's charm humminh
it's called the mute button
it might work
but sean is working on a new ver
so it's most certainly worth the wait
@copper nacelle can I distribute the hooks dll with blackmoth?
wait, so hook.dll requires .NET v4.0?
@solemn rivet it shouldn't - it should require the same runtime that the input assembly requires
weird
sure but probably better to add it as a mod dependency
I tried compiling blackmoth with it as a reference and it didn't work
because then I can add QoL and such
but when I changed blackmoth's .net version, it started compiling with no issues
Who has generated the hook.dll and can you please send me a copy of it?
Because in the worst case, you should be just fine with modifying the .dll's target framework in dnSpy or something else
the generated .dll doesn't require any .NET 4.0 features
so it's just the metadata
wait
Are any of the monomod dlls .net 4
bc I merged them all with the hooks dll using IlMerge so that it's easier to use
lemme revert back and show you all the error I was getting
hooks depends on .net v4.0 confirmed
lore implications

high school ez
I like how resharper suggested I delete my mod's main class
"it's useless", it says

savage

what is a2
it's paper size you dungo
a2, brute?
does anyone sell a-1 paper
no u
also, awful memes, Winrar
ur a number
awful, just awful
a2ful
a2 with fury of the fallen active, would be pretty fitting
who's gonna draw her in the artstyle tho
maybe I can ask in #art-discussion....
another idea would be to make a charm that behaves like her offensive heal combo
so you can counteract the fotf
oh is a2 a person
tbf just googling a2 doesn't help
unless you look down
which is clearly too difficult
point taken
gradow how much time have you spent looking at a2 on google images
3rd result
images m8
elmer - I'm not legally allowed to answer that without my lawyer
call me glue
wow nice #archived-modding-development
modding is just general for modders
it is modding, we talking about adding her as a character
possibly
maybe
probably
in the distant distant future
...?
replace all resources painfully ez
seriously tho
if I can, in the near-ish future, make a menu option so that the user can choose between diff hpbar styles (and possibly even add their own)
maybe I'll look more into asset replacement
aren't there like hundreds of character sprites though
yeah
but if you could simply import/export sprite sheets...
I mean, technically you can do that rn
but with serious restrictions
each sprite has to be a very specific size
if you go a few pixels off, it screws everything
i dont know what cp3 means
whoa they are still working on hollow knight? thats cool
yeah, they sure are
is there like a dev blog or something?
also, how hard would a new game + mode be to impliment
something similar to darksouls
just more enemy health?
keep certain things but everything is harder
ez
just enemy health is easy af
it would be cool if certain things persisted in the world after you beat it, encouraging new playthroughs
new enemy placement
retain some items is also easy
PlayerData.resetdata or whatever imo
just play enemy rando ez
maybe the player keeps the charms they have equiped, their geo, and looses everything else
you could just hook on setupnewplayerdata and add the relevant items
everything in the world resets, except maybe you keep pale ores and keys
hook on resetdata and save current items to a file, hook on setupnewplayerdata and re-add them
keys, eww
lol
the thing is, there's nothing really worth keeping, is it?
keeping ites reduces the fun of the next playthrough
but i feel like the player should keep something
a nice expansion would be to keep charms (some)
maybe their nail upgrade
and add the option to "upgrade" them
and 4 new levels get unlocked
