#archived-modding-development
1 messages ยท Page 31 of 1
Ah right
so 4 things with 1 skill, sure, it's not claw/dash/cs, but
not to mention just the speed improvement for killing stuff ๐
I forgot dreamshield...
Which turns out to be shade soul ๐ ๐
Btw, are the charms from grub swapped too?
yes, but for nothing good
or rather, nothing required
(which i still maintain grubsong would be reasonable for having a good item :P)
Yeah, Grubsong would be fine
I just don't want to figure out what sets of items get you 10 grubs
What a pain
Well, I just got ismas tears from grub.
Yeah, that and spells can be behind grubs for now
Ismas tears is optional to beat the game?
but ismas isn't strictly required
I added that into the logic in the new xml I sent to frenzied_coder
Yeah, Isma's is "optional" in that you don't strictly need it
But you need either it or crystal heart
So it's only kinda optional
if you have shade cloak+claw+super dash, you're set
Claw + super dash is enough
without QGA?
oh, right, the one at the bottom of crossroads (the bottom left?)
hah
that's what you get for not doing greenpath early
(besides the fact that it's really good for geo early too)
he might have needed dive to get in
maybe
but there are so many things that gets you into greenpath
Yeah it's like half the items in the game
Wait, the snag nest stag station can be opened for 300 geo?
So its intended to go there normally?
It used to be 50
My guess is someone at Team Cherry saw 100% runners go there early and they upped it
So no it wasn't originally intended
what's the advantage to early stag nest
The vessel fragment
hey im doing the randomizer mod, and i think im trapped in the abyss?
did you take sharp shadow?
i took the item from where shade cloak is
i made it all the way back up here, and no claw
i don't have either of those, does that mean im fucked
yup, that's pretty much one of the only currently broken places
don't pick up shade cloak without claw, or wings + tram pass
or dreamgate
i got dreamgate from where abyss shriek is
hah
the irony is not lost on me
"or dreamgate where you can set it outside of the abyss :)"
you need it outside basin
hopefully someday @rain cedar can remove the hard save there
specifically, you need it above the tall room at the top of basin that goes to CoT
"hollow knight doesnt have mods" my friend who doesnt play the game
what a dungus
Inform them that not only do we have mods, but we have mod compatability
Sick burn
hello https://imgur.com/a/axKIe this is what i noticed
anyone else had this happen to?
playing bonfire with the hp bars from debug is so much fun
oaky, I'll try adding my own hooks to the API
why is blackmoth dealing 2 damage instead of 5 for me?
which version you're using?
did you equip the fury charm at all?
fury doesn't break it in the new version anymore
SD say he was going to do that for me
maybe at some poin we can get that fixed
not worth it tbh
atlest item descriptions?
if not then just the notepad with all charm effects will be good
first: are you sure it's only doing 2 damage? 2 is a rather strange number tbh
second: if yes, what did you do that made it only do 2 damage?
yeah I'm sure, checked with debug mod
also I think I it was a charm or something I'll check when I get home
also, can you send me yout modlog.txt later please?
@solemn rivet - did you remember to put a version in your api version so that they can see it in the upper left hand corner on main menu?
the one you're trying to help them with ๐
ah
this is the first numbered version of blackmoth for the API
also, I'm adding hooks for bonfire mod
but I don't want to add hooks that will only be used once... Should I?
you mean adding hooks into Assembly-Csharp or adding hooks that the API has already exposed?
hooks into Assembly-CSharp
for now I've only added one hook for HeroController.DoAttack()
I'd list them out here and let sean/firzen(and maybe me) look at them. there are already alot of hooks and it might be viable to use the ones that exist
so, there's already a hook for that i think
I looked and there was none
ModHooks.AttackHook
it's different
Attack(attackDirection) =/= DoAttack()
and I need them both
my issue rn is
I need to reference the spriteFlash component of the HeroController object
maybe I should do it on level load?
I'll try it and see if it works
guess it depends on what you need to do with it. if it's something that needs to change based on some state that changes before or on attack, then a new hook might be needed, if it's something that isn't going to change except under something like a scene load or bench, then maybe you can do it elsewhere
we're working on making it easier to upgrade the API, but right now, every hook that is added is done by hand (just like you've had to do for bonfire each time a patch comes out), so adding hooks, while fine, adds a non-trivial amount of time to sean's plate when a new release comes out.
nice 
either way, since bonfire deals with lots of stats and stuff, I'll need to add a few hooks
as long as you document where they go and what they do ๐
if you're feeling particularly spunky, you could even fork https://github.com/seanpr96/HollowKnight.Modding and then do a pull request with your changes.
which is all of the Modding Namespace code, (not the rest of the game code)
but I also have to add it in the relevant place in code, right?
yup
we've split out the Modding namespace so it can be under source control
and, hopefully, we'll get to a point where we can just have a list of code that we can programmatically inject into the dll to add in the hooks like we currently manually do with dnspy. that's the next step firzen and I are working towards.
got it
but right now, we've gotten a huge chunk done in that future upgrades to HK means that instead of manually adding the Modding Namespace, we can compile it and merge it into the Assembly-Csharp dll in 2 steps
and the manual part is putting the hooks into HeroController/GameManager/etc
getting there
I'll do a pull request then
okay, how would I add a hook that overrides a portion of existing code?
this.playerData.AddMPCharge(num);
I need to replace this with the relevant function in Bonfire
but I don't want it to be replaced if you're not playing bonfire...
That I unfortunately can't answer atm. at work, so don't have any of the dev stuff handy 
it's fine
managed a workaround
nice
managed a workaround for most functionalities that required an override
now, if it works, all that's left is to make the save work
aaaand it works
in total I needed to add 5 hooks
HeroController.DoAttack(), HeroController.SoulGain(), HeroController.StartMPDrain(float), PlayerData.UpdateBlueHealth() and NailSlash.OnGUI()
@solemn rivet API does support renaming things
There is a hook for Language.Get
You can just look for the name and return whatever you want it to be instead
I assume I could use that to override code, is what you mean?
@solemn rivet for some reason it takes me 10-11 dashes to kill any bug in forgotten crossroads
this happened after i equiped fury of the fallen
can you send me your modlog.txt?
where is that?
save folder
i dont usually go into that stuff so where is the folder
@rigid stag /appdata/locallow/team cherry/hollow knight/
@rain cedar oh
I'll have to learn how to do that then
Here Gradow idk why it doesnt mention your mod
(and where did you put it? )
from the google docs page
and i think i fixed it unless it is compatible with randomizer
it works until i die
and then?
and then it takes 11 dashes to kill the bugs
can you send me the log again?
it still doesnt talk about your mod
ModHooks.Instance.HeroUpdateHook += DamageUpdate;
ModHooks.Instance.HeroUpdateHook += GetSharpShadow;
ModHooks.Instance.DashVectorHook += CalculateDashVelocity;
ModHooks.Instance.DashPressedHook += CheckForDash;
ModHooks.ModLog("Blackmoth initialized!");```
if it works until you die
this should always run at start if installed correctly
the mod isn't loaded and you're likely just holding onto the settings from when the mod was loaded
I thought you were going to say
"if it works until you die, then just git gud and don't die"
but i uninstalled randomizer
okay, was this the version you downloaded: https://drive.google.com/open?id=11u4QTDUeq_09t8DjXrMY0qIyKaWGz7Gz
?
yes
what did you do with the downloaded file?
and in Hollow_knight_data/Managed/Mods/ is the dll ?
the dll is there
i dragged the hollow_knight_Data into C:\Program Files (x86)\Steam\steamapps\common\Hollow Knight and the clicked replace
then*
very
does this show up at upper left?
do you have the modding API?
yes
wth
i posted a version of the API here a couple days ago that prints the Modding API's version # in the corner along with the mods
do you still have that Wyza?
well, seems like it's not installed
try reinstalling the modding API
ok
It's Beta, but i've done several runs on rando and bossrush with it and it works.
my modlogs:
Loading assembly: hollow_knight_Data\Managed\Mods\Blackmoth.dll
Trying to instantiate mod: Blackmoth.BlackmothMod
Blackmoth initializing!
Blackmoth initialized!
[Blackmoth] Sharp Shadow object not set!
[Blackmoth] Sharp Shadow Damage set to 5
reinstalled it and it didnt work
@buoyant wasp what would be better: add my hooks to that version, or wait for a stable release?
I've got no idea
@rigid stag : can you send me the modlog.txt after removing the randomizer mod?
ok i fixed it
so i downloaded your api but when i installed seanpr and firzen's it worked
mine is just a slightly newer version of theirs
blackmoth is not an API
you need to install both the modding api and the corresponding version of the mod
the api is a separate thing
the [API] tag at the beginning simply says that it's compatible with the modding API
omg kill me
the version tagged with 1.2.1.4 is simply for those who don't want to use the API
it's also very bugged and outdated
grrr
phew
perhaps the old non-api one should just be removed at this point?
yeah, I guess
I don't want to bother updating it
and it's not much of a hassle to install the API anyways
@solemn rivet - Re-Hooks. If you want to put them into the version i just posted, that'll work. Also the version i posted has new logging in it. Instead of ModHooks.Instance.ModLog, you can access 5 levels of logging in ModHooks.Logger (though ModHooks.Instance.ModLog will continue to work, I've marked it as depreciated and it really just calls the new logger internally)
oh, that's neat!
so now there is FINE, DEBUG, INFO, WARN, ERROR. currently it's hard coded to always print DEBUG and above, it's on my list to make the level configurable.
I'm not much of a programmer, but what would I use "FINE" for?
for when something runs fine?

no, that's below debug, as in. I'm going to print out a crapton of information that only I, the developer, could ever possibly need
debug is "more information that i the developer can use and possibly a user might be able to use"
gotcha
also @rigid stag how's it working? It should be compatible with bossrush, rando and debug
its working now
great! Thanks for the report!
thanks for the help
here's a description someone put on stack overflow, it works just as well as anything else
Fine - Only when I would be "tracing" the code and trying to find one part of a function specifically.
Debug - Information that is diagnostically helpful to people more than just developers (IT, sysadmins, etc.).
Info - Generally useful information to log (service start/stop, configuration assumptions, etc). Info I want to always have available but usually don't care about under normal circumstances. This is my out-of-the-box config level.
Warn - Anything that can potentially cause application oddities, but for which I am automatically recovering. (Such as switching from a primary to backup server, retrying an operation, missing secondary data, etc.)
Error - Any error which is fatal to the operation, but not the service or application (can't open a required file, missing data, etc.). These errors will force user (administrator, or direct user) intervention. These are usually reserved (in my apps) for incorrect connection strings, missing services, etc.
it's generic, but it applies, more or less
if your log method is going to regularly log hundreds or thousands of lines, it's probably something that is "Fine" (in other languages sometimes there is a FINER, FINEST levels too)
fine being "fine grained"
OH
now it makes sense!
anyway
I'll try to finish bonfire save-less
and then, when I have the time, try to make the save behave
๐
here's the first "working" version of the bonfire mod with the API required to make it work
for now, it doesn't save your levels and stats
and the cursor is blinky
aside from that, it should work fine
@buoyant wasp I didn't use your version of the API yet
I'll re-hook everything later when I have the time
k
wait what does it do
bonfire is basically Dark Souls for Hollow Knight
if you're actually going to play it, i'd suggest the non-api version (unless you have played it before and know of the 0.0.1 version limitations), at least until gradow finishes the port and polish 
just bonfire style levelling with geo
I may have an old version but the monarch wings pickup did not work for me in boss rush
wait nvm
ignore that
opinions?
not sure if I should put what (category of item) the boss would drop
category? so bosses will drop certain kinds of items?
well it'd randomize all 9 of these at once
then say, if hornet would drop descending dark, thorns and hp
it'd have a symbol for spell, charm and upgrade
so each boss would still be random, but you'd be able to see (roughly) what they are going to drop
hmmm
honestly, i think that'd make it too easy
cause spells and upgrades are almost always going to be the 2 most important things, and if you're letting them pick the poss they want to fight, you're already given them a ton of benefit
poss
potentially
But if it's megaman, shouldn't we gain their techniques?
Link to modding API?
so steamapps/common/Hollow Knight?
yes
Should I restart Steam before launching Hollow Knight again?
It worked \o/
Will any new file from now on be bossrush, or can I just start a normal game as well
any new file will be boss rush
infact any file at all will be boss rush
but it doesn't work correctly on existing saves
so if you want to play normally at all you need to uninstall bossrush
(uninstall being just move it out of the mods folder, or like most of us, make a folder inside of mods called "disabled" and move it there)
in fact, i'd go so far to say as the next mod api zip should just have that folder in there out of the box
maybe instead someone should code an enable / disable screen before the game loads 
not it
super not it 
I don't even know code tbh
I'm lazy what's the charm number for Dreamshield?
not 40
I knew that much :D
I think its 39 
I also think so
kill you
This is a segmented fight of KDT's mod Nightmare God Grimm (NGG 0.2.1), why segmented you ask? Because the final phase in this version is nonsense and pretty...
Later in the fight the spikes are replaced with another Grimm
Jesus
it kills you
Jesus christ
This makes NKG look like childs play
What are Blackmoth and Bonfire?
(im only asking because it doesnt look like there are info pages)
I'm pretty sure bonfire gives you increasable stats like dark souls
I never tried it though
Maybe after the 3rd CP and hornet DLC launch and I suck every bit of content from those I'll start modding my game
bonfire adds a level up system
blackmoth makes dash your main form of dealing damage
How does the bonfire system work
ban imo
What about cut content? It seems self explanatory, but what exact stuff does it add?
Sorry if I'm being a bother here
each mod has a readme
at least, i'm pretty sure they all do at this point
Oh, and will it work for the newest version of the game?
most of them, yes
Cool.
if the mod has [API] in it, then it requires the modding api be installed (also in the folder)
so is there a randomizer mod for HK?
yes
have a link?
pins
oh shit didnt even see them. thanks!!
mmhmm
It's charm 38 not 39 :D
does randomizer and boss rush do anything?
what do you mean?
Radomizer - randomizes items
Does it randomize the drops so you have no idea what you'll get
yep
you can make a log of what the items are changed to if you want
but the idea is that you don't know what's where
so, yes, they both do a crap ton
i'm really not sure, it depends on when the hook is called that changes what you pickup
does randomizer even do that, I thought it hooked into the get functions
whereas I hook into the SetInt functions
idk
well it won't affect charms
but it might occasionally give / not give you spells and abilities
all I know is that Blackmoth is compatible with both
where do I find it?
in the save folder
New charm is coming along really well
Is there any way you could easily increase the number of spiders weaversong gives you?
It's probably possible by changing states on the charm fsm
But really that's not the buff weaversong needs
The spiders only do 2 damage
It's a joke
They can occasionally block shit right?
I think I've had it happen once or twice, they can block projectiles
i think i locked myself in another softlock in randomizer
eh, projectiles are weird, i've had them flat out hit me and do nothing
where are you dark?
Can you not just get out the same way you got in?
idk, just seeing where i could go, didn't remember i couldn't get out without it
I don't know the room that well
i feel like i can but its proving challenging
Can't be much harder than getting there
oh, hah, yeah, that'll be fun
i have every movement thing except tear and heart
i keep getting to the very edge but i don't quite make it
Worst case scenario try dying there and see where the shade spawns at
Some of the spike hitboxes are absoluetly fucked I've noticed but that's hardly new
You couldn't get to sheos hut?
no the problem is getting back
There's a bench outside sheo
There's a shortcut though
no crystal heart
yea i cant get through the thorn hallway
Oh.... That's the shortcut that has the thorns on top and bottom
my only hope is managing to get through this gap
Right right
oh yea i also don't have fireball
Yeah you're screwed there. Can't make that up and over
i thought that, i could touch like the very corner, but it still hit thorns
I should just remove every bench in the game always
It's the only surefire way to avoid this stuff
No negative side effects to doing that
exactly
really it's just that that bench should despawn if you somehow make it overthere without CH+claw
only bench is dirtmouth
Somebody tell me there's an FSM to update shield damage
The damage is set in stone when you spawn the shield :(
The shield has to have a variable storing the damage
Even if there's no event you can change it manually
Teach me oh wise one
particularly to change all instances of dreamshield's damage at once
if possible
FSMUtility.LocateFSM(GameObject.Find("Charm Effects"), "Spawn Orbit Shield").FsmStates[3].Actions[2].OnEnter();```
That's what I'm using to spawn them
really there is only 1 hard save that is a true softlock, abyss. the one dark went to isn't really one, because there is literally nothing there right now other than the nail arts.
now once the nail arts are in the game
then you'll have to actually care ๐
I don't know for the shield specifically but as an example the player nail damage can be found with:
HeroController.instance.gameObject.transform.Find("Attacks/Slash").GetComponent<PlayMakerFSM>().FsmVariables.GetFsmInt("damageDealt").Value
try
would setting that = x change my nail damage to x?
Probably until it's updated again
FSMUtility.LocateFSM(GameObject.Find("Charm Effects"),"Spawn Orbit Shield").FsmVariables.GetFsmInt("damageDealt").Value = whatever
Have you actually tested that? Just because the nail has that int doesn't mean the shield does
that's how it's set for sharp shadow as well
everything has that int
worth a try at least
Oh, good to know I'll give it a shot
but the shield is its own object
it used to work for spells as well
until the game ran out of prefabs
then everything went to shit
Didn't work
Thanks
At the beginning of Attack()
Hmm... The one setting the damage?
Yeah I handle damage setting at the beginning of Attack()
Well, I have no idea
It might give you some ideas to see how I do it in blackmoth. If you do, look inside Update()
Now, off I go
probably best to skip the 2nd line of code I gave you
and instead get a reference to the gameObject from the Orbit Sheild FSM Variables
then just manually instantiate that
and keep a reference to what it returns
then find out what controls its damage
Let's say I'm making tons of dreamshields... I'd need an array of previously summoned dreamshields, wouldn't I?
how many are you making
Infinite. The charm divides your damage by the number of shields you summon, meaning your damage never really increases.
ok then you need a list
although your computer will die with more than a few dozen
@leaden hedge - somethign to change on boss rush
dying resets the "perfect" kill counter, so if you get hit, you can just die, and do it again
and still get the 2 charm pickup
I don't know why a few dozen would do anything bad
unless they aren't using the same texture
for whatever reason
The particle effects are hefty
@buoyant wasp I'll just make boss rush only work on steel soul 
Yeah I still can't find a way to update the damage on even just the first shield
what I would recommend
is theres an api hook called onCollider
hook into that, and print out the names of objects
that would suck (ss bossrush)
also, did you know dreamshield blocks the fireballs in grimm?
Yep
then spawn a shield on attack only
wait for everything to spawn, attack once so a sheild spawns
and find out the name of the object that has the hitbox
then come back to me
I'll be honest I couldn't figure out the api for my life
ok
in dnspy
look for PlayMaker2DUnityProxy
and change the start function to have, Debug.Log(this.name);
it'll be in assembly-csharp.dll
not sure what you're struggling with, with the api
did you install VS2017?
Yep
did you try compiling the ExampleMod?
I tried something of the sort
alright so is it loaded now?
It's going through a very slow installation of tools
Debug.Log?
yeah
C:\Program Files (x86)\Steam\steamapps\common\Hollow Knight\hollow_knight_Data\output_log.txt
nvm I had it open the whole time haha
I think it's just called Shield
Object Pool attached to GlobalPool has run out of Orbit Shield prefabs, Instantiating an additional one.
that's for that offline site viewer right?
Nope, what exactly do I have to add where?
so you renamed it to data.json right?
yep
open that in a text editor
and the first line should be
{
make it say
var fsm = {
Got it, it works
ok, so, found another thing
jesus what is that
Is that an error from compiling?
surely they didn't make it 1.149999999975257635434
and you can't move because you're still the in the teleport animation
check the state dreamwielder?
then check float variables ( in a text editor )
ye I know about that
makes it hard to start the fight at 1 health
but yeah @buoyant obsidian if you can find a reference to this object, you can just set do fsm.FSMVariables.GetFsmInt("Damage").Value = damage
How would I go about finding a reference to both the original dreamshield as well as any new dreamshields I spawn?
now its REALLY convenient that I gave you a onCollider hook
REALLY CONVENIENT
so if you check the name of the gameObject attached to the playmaker2DUnityProxy
you can tell if you have a reference to the shield 
Would it be more viable to just hijack the Damage variable
and make it so it's equal to # of shields
that only gets updated on init
which it never goes back to
and dividing it by the number of shields in fsm
would be very unenjoyable
I'm not really following you
load the data.json in a text editor
scroll down to where you see states
yep
you'll see name : init
then go down to actionData
then to action Names
the 4th action is HutongGames.PlayMaker.Actions.GetPlayerDataInt
now if you scroll down to about line 290
you'll see fsmStringParams
{
"useVariable": false,
"name": "",
"tooltip": "",
"showInInspector": false,
"networkSync": false,
"value": "nailDamage"
},
"fsmIntParams": [
{
"useVariable": true,
"name": "Damage",
"tooltip": "",
"showInInspector": false,
"networkSync": false,
"value": 10
}
],
then a bit further down you'll see fsmIntParams
so the 4th action in the Init state, Gets the PlayerDataInt(nailDamage) and puts it in the Damage Variable
so you need to skip that, and set Damage manually
where exactly is it shown that this is action 4
"actionNames": [
"HutongGames.PlayMaker.Actions.GetOwner",
"HutongGames.PlayMaker.Actions.GetParent",
"HutongGames.PlayMaker.Actions.FindChild",
"HutongGames.PlayMaker.Actions.GetPlayerDataInt",
"HutongGames.PlayMaker.Actions.FindChild",
"HutongGames.PlayMaker.Actions.Tk2dPlayAnimation",
"HutongGames.PlayMaker.Actions.SetAudioPitch",
"HutongGames.PlayMaker.Actions.SetAudioVolume",
"HutongGames.PlayMaker.Actions.SetCollider",
"HutongGames.PlayMaker.Actions.ActivateGameObject"
],
Oh, gotcha
I know the 2nd string is correct
because FindChild uses the first string
and theres only one FsmInt
so that has to be the store value
FSMUtility.LocateFSM(GameObject.Find("Charm Effects"), "Spawn Orbit Shield").FsmStates[3].Actions[2].OnEnter();
Looking back at that
It'd be Actions[4]
but what's the states value?
states is an array
so in the sheild fsm
states[0] is init
then if you scroll down, you'll see states[1] is Idle
then 2 is Send Event
anyway i'm way too lazy to test this
public void onCollider(GameObject go)
{
if (go.name == "Shield")
{
PlayMakerFSM fsm = FSMUtility.LocateFSM(go, "Shield Hit");
fsm.SetState("Dreamwielder?");
if (fsmList == null)
fsmList = new List<PlayMakerFSM>();
fsmList.Add(fsm);
foreach (PlayMakerFSM _fsm in fsmList)
{
_fsm.FsmVariables.GetFsmInt("Damage").Value = (int)Math.Ceiling((float)PlayerData.instance.nailDamage / (float)fsmList.Count);
}
//Manually run the init state
for (int i = 0; i < fsm.FsmStates[0].Actions.Length; i++)
{
//Skip the damage set function
if (i != 3)
{
fsm.FsmStates[0].Actions[i].OnEnter();
}
}
}
}
and if I wasn't using the api where would I put onCollider
PlayMaker2DUnityProxy
other bug, if you end a boss rush fight with actual fury (1hp) then the next fight you don't have fury when full
Unity2DProxy
just in start will work
you want to put this code in your actual mod code
and just call
Mod.onCollider(this.gameObject);
as for fury, I guess I could try and move it to after the level loading
interesting, i wonder if this does actual damage
you can tell with debug mod
sporeshroom's visual damage effect appears on grimm during baloon phase
will have to try that out later
I'm not seeing where to connect everything here with onCollider
I don't see where any GameObjects are
PlayMakerUnity2DProxy is a component
its attached to a gameobject
you're returning
base.gameObject
Gotcha, I'd never heard of base until now
I think this.gameObject works too
so in Start() would I put if (base.name == "Shield") then locate Shield Hit?
like in onCollider
you want to call a function in your mod class
assuming you have a central class
to hold everything
you should really make a singleton to control everything from once place
I'm not sure how I'd even go about that
at the moment I'm only using methods that already exist
you'd just add a new class like
public class DreamShieldMod{
public static DreamShieldMod instance
{
get
{
if (DreamShieldMod._instance == null)
{
DreamShieldMod._instance = new DreamShieldMod();
}
return DreamShieldMod._instance;
}
set
{
DreamShieldMod._instance = value;
}
}
public DreamShieldMod(){
//setup your class here
}
private static DreamShieldMod _instance;
}
then you can add all your variables and functions to here
and do
DreamShieldMod.instance.function() to access them
What functions would I even have? The one for spawning a shield on attack input and the one for hijacking the FSM's damage?
also what exactly is this an instance of?
the class
your code requires a list
of every fsm
where are you going to put that, in each fsm 
in HeroController with everything else :P
well, doing it this way is way more maintainable
you just need to remember where you put hooks
and then copy your class back in
and add the 2 function calls in
plus it centralizes all your code
but let's say that I'm replacing the attack() method only when X charm is equipped
well, not even replacing attack(), just replacing the slash part of it
well then replace the code 
I'm totally lost
My understanding was that whenever the FSM god decided to summon a shield, it would notice that it was summoning a shield and tell the shield that its damage was equal to a variable in HeroController
yeah you could do that all over the place
but let's say this HeroController variable changed, all the shields would need to know to change as well
but you could instead do
HeroController.OnAttack(){
...
DreamShieldMod.instance.onAttack();
...
}
PlayMakerUnity2DProxy.Start(){
...
DreamShieldMod.instance.onCollider();
...
}
then just move the stuff that you're checking in attack, to the onAttack function and onCollider function
then all your code and variables are in one place
but wouldn't that be more work having to work with all the variables that are already in onAttack()?
what are you interacting with?
if they are public you can just HeroController.instance.variable = value;
I'm really not getting the whole hook thing. Let's say I'm adding a single line into Update()
and deleting another line in Update()
how would I go about hooking that?
Mana regen is changed in Lightbringer
how much damage does unbreakable add?
50%
.5x
errrrrrrrrrrrrrrrr
Down I think
with fury its 56
alright, thanks
Up I meant up
because 32*1.75 = 56
@buoyant obsidian why not just calculate how much mana you should have in your own update function
then overwrite the mana
then it doesn't matter how much the vanilla gives you
because there are still vanilla particle effects
so how would I go about calling onCollider in Attack() in HeroController
let's say I have it set to create a shield instead of swinging my nail
well onCollider is for when FSMs with boxColliders are created
you'd just add DreamShieldMod.instance.onCollider(this.gameObject) in PlayMakerUnity2DProxy.Start()
Could I just combine Start with onCollider?
since it's only relevant to onCollider anyway?
that's my current problem
and I reset it on loading a new scene, since shields disappear then
few more things
after killing failed knight, screen goes white, and stays that way, you can pickup charms, but you can't see what you get, so you just have to hope you are over one when you press up
NKG is the same way, only the screen goes black instead of white
happens occasionally
and it turns out that you can't complete radiance without either double jump or claw
correct
you literally softlock
you also cant do soul tyrant without dash or djump
oh?
I moved the spawn
what does tyrant do that you need either?
you can't get up from the spawn point
ah
the distance is too far
atleast it was in my experience, you might be able to fireball skip
yeah, but you'd only have 1 shot at that if you were lucky enough to spawn with teleport
hmmm
Is there any way I can find my dreamshields in GlobalPool?
not really sure how to fix this. cause it's not going to be clear to new boss rush players that ignoring double jump or claw+dash is a softlock
im adding tips at some point
no @buoyant obsidian
if you do find out I'd like to know
i mean, you could just move the platforms in radiance
which is the only reason you can't do it
if you can get to phase 3, just add a few more
people could just pick up the items 
phase 1/2 can be done without them
pfft
lol, i know, if you get to grimm and kill grim and you don't have double jump, all 3 drops is double jump, you literally have no choice but to pick it up
actually, no, not double jump, claw
double jump is too easy for radiance, make them pay for being stupid
they can pay by being soft locked
i really dislike the concept of softlocks
there should always be some way to complete the game. if it takes an extra hour to do it, that's fine. if it requires some really precise skill, that's fine too. but getting into a spot where you literally cannot progress without restarting just sucks
its alright, they'll softlock themselves by not getting enough damage
yeah, got to failed knight my first run tonight with not enough to do it
I can understand softlocking by doing something so retardedly stupid that you deserve it.
๐
since you're adding this menu thingy, any chance we can make it so you can disable charms?
Make a sign you have to read to access the next area?
turns out gluberfly or grimmchild or shield also breaks collector
like fluke
or weaversong
in my experience grimmchild fixes collector
if (GameObject.name = "Orbital Shield")
yeah, i just sat there for 2-3 minutes
does this look like a thing
and it killed it finally
or did I just make it up
I don't think orbital shield is the name of the gameObject
was it just Shield?
Is Shield Hit a gameobject?
no thats the FSM name
Untagged,Shield,Shield Hit,5qQGGQ
TAG,GAMEOBJECT_NAME,FSM_NAME,CHECKSUM
So just Shield yeah
hehe
honestly, picking up any of the summon's charms is just plain bad, they cause more trouble than provide benefit even though they are free
also, i don't think blue health or fragile heart work right again
you have the health, but the masks don't show
atleast its not jonis
is kingsoul in the pool?
no
any reason inparticular or just hadn't felt like coding it?
works weird, and I'm trying to keep exceptions in the item activate code minimum
could traitor lord be modded into the mantis lords fight
wasn't sure if you could use the same code you used for grimmchild in setting it's "level"
no
feels bad
I could probably make it work like grimmChild
although grimmChild is actually an int
i thought kingsoul was an int too
and royalCharmState is 3 bools encoded into a int for no reason
bit 0 = king fragment
bit 1 = queen fragment
bit 2 = void soul
so
1 = right half
2 = left half
3 = king soul
4 = void soul
yeah, i knew the final values (cause the overlay uses them), just didn't know how it was managed in the backside
i just figured it was an int or a short or something that they incremented
yeah pretty sure it has bool either way to stop you duping
or else you could just get queens fragment twice
and end up with void soul
heh, that'd be amusing
what would happen if it worked like grimmchild
well you'd get half, then the other half, then kingsoul, then void soul
I guess I could make it like nailDamage
and set the step to 3
and only put one in
infact
now that I think about it
I could put 1 with 1 step and 1 with 2 step
and it'd work fine
zzzzz
That would suck
You'd just have two pickups no sane person would ever take
Since they do nothing on their own
how fast does kingsoul recharge
Not so slow it's useless, though
think its 50 seconds for 99 soul
It's noticeable, just not amazing
yeah, i wouldn't want it to be split
same argument i made for kingsoul in rando
just make the kingsoul/queensoul combined
then WP can truly be nothing (literally)
anyone know what sheet these are from?
seems like it's either from credits or the secret backer room
oh
apparently its neither TITLES nor TITLE
btw
did you and 753 manage to change the shield's damage?
from what I read, it seems like you were trying to set it on sceneLoad
but wouldn't that break when the game runs out of shield prefabs, like spells?
no he should be doing it when the colliders are created
I'm just gonna make my own Dreamshield with blackjack and hookers
invite me
I'd ask what you mean by hooks but I have the feeling it would involve using the bonfire mod.
it's about the modding API actually
even scarier
if you post the dll, and what hooks you added, i can review them this evening when i get off work (in 4-5 hours)
my issue is that they literally serve no other purpose than what I need them to
for instance, I need a hook to add blue masks
so I added this hook:
public int OnBlueHealth()
{
if (this.BlueHealthHook != null)
{
return this.BlueHealthHook();
}
return 0;
}
and call it here in PlayerData.UpdateBlueHealth():
{
this.healthBlue = ModHooks.Instance.OnBlueHealth();
if (this.equippedCharm_8)
{
this.healthBlue += 2;
}
if (this.equippedCharm_9)
{
this.healthBlue += 4;
}
}
so it "works" in the sense that it doesn't mess with other mods
but... It's so ugly
That's not really all that different that what we're doing on the TakeHealth event
oh, okay then
because that was the "workaround" I mentioned yesterday
instead of overriding the bluehealth calculations, I simply leave the default as a return case
yeah just take a look at TakeHealth
i'm 99% sure the code is basically the same
or im' 100% wrong
{
if (this.TakeHealthHook != null)
{
Delegate[] invocationList = this.TakeHealthHook.GetInvocationList();
for (int i = 0; i < invocationList.Length; i++)
{
damage = (int)invocationList[i].DynamicInvoke(new object[]
{
damage
});
}
}
return damage;
}```
you're right
okay, so I'll re-hook those
looks like you might want to take the approach of OnTakeHealth to handle if there are multiple hooks. just to support cross mod stuff. (since otherwise whatever hook gets called last would be the one that set the value....i think)
Yeah
oaky
great, it works!
also, while trying to make crit work I got some interesting results
lol
I'm honestly considering leaving that as is
unfortunately, I think I can fix that
so I might as well

I think I'm gonna remake Lightbringer from the ground up at some point
in the api?
Eh I really don't like the API, it doesn't seem like the easiest way to do what I want
the downside to the non-api approach is that 1: your mod can only ever work by itself and 2: every release means you have to recode the entire thing
Won't I have to recode the entire thing even if I used the API? Every major update they change some of the methods slightly, so even what's being hooked to wouldn't work
not necessarily, no. For example the overlay system only needed a small modification to account for the new charms in TGT. And 0 change from 1.2.1.0 to 1.2.1.4. Randomizer i don't think had to be redone between 1.2.1.0 and 1.2.1.4. (also, since you're not editing the code directly, that means that even if you had to make changes, you'd only have to adjust your source and build, which is still vastly less than hand copying every single piece of the mod into the dll)
it's basically saying "oh i'd have to adjust 3 methods" vs "i have to adjust 3 methods AND re-implement all the code again"
i mean, you're obviously the author of your work, and can do it however you like. But having to hand patch dlls every release is a recipe for a mod dying and no one being able to fix it.
So hooks are basically methods at the beginning of methods that use your method instead of the vanilla one, right?
not necessarily. some hooks are at the beginning, some are at the end, some are in the middle. it depends on what it's trying to accomplish
and there is potential to add other hooks if we find a need
just cause one doesn't exist, doesn't necessarily mean it can't
I heard you like methods, so I put a method inside your method so you can method while you method
Let's say I want to entirely replace the HeroController Attack() method, add stuff to beginning of the HeroController Update() method, and change a single variable value in the PlayerData SetUpNewPlayerData() method
that'd all be possible?
from what I gather, events are like "template" methods. Now the subscription analogy makes way more sense
yeah, 753
replacing attack entirely probably doesn't exist at the moment but probably could. the other 2 i'm 99% certain exist as hooks already
You can somewhat replace attack
If you set cstate.attacking false you don't get the nail
But grubberfly beams still happen
also, yes, there is a HeroUpdate and newplayerdata hook already
you can basically make the DoAttack method skip the call for the Attack method
which is where the animation is actually processed
so you could literally do this
I also added a hook to the beginning of DoAttack
you would need a hook at the end, tho
ModHooks.Instance.NewPlayerDataHook += LightBringerDoesSomethingNewPlayerDataMethod;
and the method could be:
public void LightBringerDoesSomethingNewPlayerDataMethod(PlayerData playerdata) {
playerdata.Instance.gotCharm_3 = true;
}
Nice function name
if (this.vertical_input > Mathf.Epsilon)
{
this.Attack(AttackDirection.upward);
base.StartCoroutine(this.CheckForTerrainThunk(AttackDirection.upward));
return;
}
you can add a hook that overrides this call if you want
and calls whatever you want
@solemn rivet if you put csharp after the triple backticks, it syntax highlights
oh!
incidentally, that works for html/css/json/javascript etc ๐
that's good to know!
thanks!
but, yeah
you can add a hook there and set it to Attack(AttackDirection.whatever) if you're not calling your function
that way you can "override" it
well, and we could look at modifying the attack hook. could opt to add a 2nd optional parameter that is a reference variable that you could set that would say "stop processing attack".
that would be less hackish and provide more flexibility in the future
something like this should work:
public void OnAttackDoSomething(AttackDirection attackDirection)
{
if (LightbringerNewAttackHook != null)
{
LightBringerNewAttackHook(attackDirection);
}
else
{
Attack(attackDirection);
}
}```
yeah
what Wyza said is better
actually, my way is awful
in order to not add four hooks to DoAttack, you would need to completely rewrite the call for Attack
and for Lightbringer I'd still have to change all the graphics and stuff manually, right?
graphics are done in resource files right?
(honestly I know nothing about that stuff, so i can't say what is required)
since they change the spritesheets every update
the code part only takes like 5 minutes an update
@leaden hedge - would it be reasonable to just create a separate custom sprite sheet and just update which sprite is being used for something rather than rewriting the existing sheets?
The main things are the charms and grubberfly beams
there's also .txt files and menu graphics
theres a langauge get hook
