#archived-modding-development

1 messages ยท Page 31 of 1

buoyant wasp
#

descending dark

#

too

rain cedar
#

Ah right

buoyant wasp
#

so 4 things with 1 skill, sure, it's not claw/dash/cs, but

rain cedar
#

Well, you do need other things

#

But still good

buoyant wasp
#

not to mention just the speed improvement for killing stuff ๐Ÿ˜ƒ

slate owl
#

I forgot dreamshield...

#

Which turns out to be shade soul ๐Ÿ˜„ ๐Ÿ˜„

#

Btw, are the charms from grub swapped too?

buoyant wasp
#

yes, but for nothing good

#

or rather, nothing required

#

(which i still maintain grubsong would be reasonable for having a good item :P)

rain cedar
#

Yeah, Grubsong would be fine

#

I just don't want to figure out what sets of items get you 10 grubs

#

What a pain

buoyant wasp
#

hah

#

yeah

slate owl
#

Well, I just got ismas tears from grub.

rain cedar
#

Yeah, that and spells can be behind grubs for now

slate owl
#

Ismas tears is optional to beat the game?

buoyant wasp
#

but ismas isn't strictly required

rain cedar
#

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

buoyant wasp
#

if you have shade cloak+claw+super dash, you're set

rain cedar
#

Claw + super dash is enough

buoyant wasp
#

without QGA?

rain cedar
#

I mean you do have to do an acid skip

#

But not that one

buoyant wasp
#

oh, right, the one at the bottom of crossroads (the bottom left?)

rain cedar
#

Yeah

#

That one is pretty free, though

slate owl
#

lol...

#

Hornet gave me mantis claw.

buoyant wasp
#

hah

#

that's what you get for not doing greenpath early

#

(besides the fact that it's really good for geo early too)

leaden hedge
#

he might have needed dive to get in

buoyant wasp
#

maybe

rain cedar
#

Nah

#

Wings can get you in

buoyant wasp
#

but there are so many things that gets you into greenpath

rain cedar
#

Yeah it's like half the items in the game

slate owl
#

Wait, the snag nest stag station can be opened for 300 geo?

#

So its intended to go there normally?

rain cedar
#

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

trim totem
#

what's the advantage to early stag nest

young walrus
#

The vessel fragment

bleak robin
#

hey im doing the randomizer mod, and i think im trapped in the abyss?

leaden hedge
#

did you take sharp shadow?

bleak robin
#

i took the item from where shade cloak is

leaden hedge
#

ye

#

unless you have claw you're softlocked

#

you need to get the tram pass

bleak robin
leaden hedge
#

you can get up there with a sibling

#

but you need tram pass to get out of basin

bleak robin
#

i don't have either of those, does that mean im fucked

leaden hedge
#

yes

#

now you know hollowface

buoyant wasp
#

yup, that's pretty much one of the only currently broken places

leaden hedge
#

don't pick up shade cloak without claw, or wings + tram pass

buoyant wasp
#

or dreamgate

bleak robin
#

i got dreamgate from where abyss shriek is

buoyant wasp
#

hah

bleak robin
#

the irony is not lost on me

buoyant wasp
#

"or dreamgate where you can set it outside of the abyss :)"

leaden hedge
#

you need it outside basin

buoyant wasp
#

hopefully someday @rain cedar can remove the hard save there

leaden hedge
#

specifically, you need it above the tall room at the top of basin that goes to CoT

noble trout
#

"hollow knight doesnt have mods" my friend who doesnt play the game

late sphinx
#

what a dungus

dapper folio
#

Inform them that not only do we have mods, but we have mod compatability

young walrus
#

Tell them they have a small ween too while you're at it.

solemn rivet
#

Sick burn

mighty minnow
#

anyone else had this happen to?

thorn comet
#

Why am I all glitchy?

solemn rivet
#

playing bonfire with the hp bars from debug is so much fun

#

oaky, I'll try adding my own hooks to the API

swift cairn
#

why is blackmoth dealing 2 damage instead of 5 for me?

solemn rivet
#

which version you're using?

amber plank
#

did you equip the fury charm at all?

solemn rivet
#

fury doesn't break it in the new version anymore

amber plank
#

ah

#

glad to know it was updated on the drive im assuming?

solemn rivet
#

SD say he was going to do that for me

amber plank
#

ah

#

was everything named correctly sense the build we got?

#

I*

solemn rivet
#

no

#

the API doesn't support that iirc

amber plank
#

maybe at some poin we can get that fixed

solemn rivet
#

not worth it tbh

amber plank
#

atlest item descriptions?

#

if not then just the notepad with all charm effects will be good

swift cairn
#

I'm using 1.2.4

#

and the most recent blackmoth update

solemn rivet
#

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?

swift cairn
#

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

solemn rivet
#

also, can you send me yout modlog.txt later please?

buoyant wasp
#

@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?

solemn rivet
#

what mod you talking about?

#

blackmoth has one 1.0.2

buoyant wasp
#

the one you're trying to help them with ๐Ÿ˜ƒ

solemn rivet
#

it's the only one though

#

xD

buoyant wasp
#

ah

solemn rivet
#

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?

buoyant wasp
#

you mean adding hooks into Assembly-Csharp or adding hooks that the API has already exposed?

solemn rivet
#

hooks into Assembly-CSharp

#

for now I've only added one hook for HeroController.DoAttack()

buoyant wasp
#

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

solemn rivet
#

I looked and there was none

buoyant wasp
#

ModHooks.AttackHook

solemn rivet
#

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

buoyant wasp
#

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.

solemn rivet
#

yeah...

#

I'm using an existing hook

#

seeing if it works rn

#

okay, it works

buoyant wasp
#

nice hollowface

solemn rivet
#

either way, since bonfire deals with lots of stats and stuff, I'll need to add a few hooks

buoyant wasp
#

as long as you document where they go and what they do ๐Ÿ˜ƒ

#

which is all of the Modding Namespace code, (not the rest of the game code)

solemn rivet
#

but I also have to add it in the relevant place in code, right?

buoyant wasp
#

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.

solemn rivet
#

got it

buoyant wasp
#

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

solemn rivet
#

which is WAAAAY easier

#

that's nice!

#

great job!

buoyant wasp
#

getting there

solemn rivet
#

I'll do a pull request then

solemn rivet
#

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...

buoyant wasp
#

That I unfortunately can't answer atm. at work, so don't have any of the dev stuff handy hollowsad

solemn rivet
#

it's fine

solemn rivet
#

managed a workaround

buoyant wasp
#

nice

solemn rivet
#

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()

rain cedar
#

@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

solemn rivet
#

I assume I could use that to override code, is what you mean?

rigid stag
#

@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

solemn rivet
#

can you send me your modlog.txt?

rigid stag
#

where is that?

solemn rivet
#

save folder

rigid stag
#

i dont usually go into that stuff so where is the folder

rain cedar
#

I assume that's about charm names and stuff

solemn rivet
#

@rigid stag /appdata/locallow/team cherry/hollow knight/

#

@rain cedar oh

#

I'll have to learn how to do that then

rigid stag
solemn rivet
#

that's because it's not loading the mod

#

where did you get the mod?

buoyant wasp
#

(and where did you put it? )

rigid stag
#

from the google docs page

#

and i think i fixed it unless it is compatible with randomizer

solemn rivet
#

it is compatible with all API mods

#

so, is it fixed?

rigid stag
#

it works until i die

solemn rivet
#

and then?

rigid stag
#

and then it takes 11 dashes to kill the bugs

solemn rivet
#

can you send me the log again?

rigid stag
solemn rivet
#

            ModHooks.Instance.HeroUpdateHook += DamageUpdate;
            ModHooks.Instance.HeroUpdateHook += GetSharpShadow;
            ModHooks.Instance.DashVectorHook += CalculateDashVelocity;
            ModHooks.Instance.DashPressedHook += CheckForDash;
            

            ModHooks.ModLog("Blackmoth initialized!");```
buoyant wasp
#

if it works until you die

solemn rivet
#

this should always run at start if installed correctly

buoyant wasp
#

the mod isn't loaded and you're likely just holding onto the settings from when the mod was loaded

solemn rivet
#

I thought you were going to say

#

"if it works until you die, then just git gud and don't die"

rigid stag
#

but i uninstalled randomizer

solemn rivet
#

?

rigid stag
#

yes

solemn rivet
#

what did you do with the downloaded file?

buoyant wasp
#

and in Hollow_knight_data/Managed/Mods/ is the dll ?

rigid stag
#

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*

solemn rivet
#

weird

#

I'll try it here

buoyant wasp
#

very

solemn rivet
rigid stag
#

no

#

wait

#

it doesnt

solemn rivet
#

do you have the modding API?

rigid stag
#

yes

solemn rivet
#

wth

buoyant wasp
#

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

rigid stag
#

see nothing in the top left

solemn rivet
#

do you still have that Wyza?

#

well, seems like it's not installed

#

try reinstalling the modding API

rigid stag
#

ok

buoyant wasp
solemn rivet
#

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
rigid stag
#

reinstalled it and it didnt work

solemn rivet
#

@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?

rigid stag
#

ok i fixed it

solemn rivet
#

oh

#

you sure?

#

xD

rigid stag
#

so i downloaded your api but when i installed seanpr and firzen's it worked

solemn rivet
#

oh

#

but

#

wait

buoyant wasp
#

mine is just a slightly newer version of theirs

solemn rivet
#

blackmoth is not an API

rigid stag
#

...

solemn rivet
#

you need to install both the modding api and the corresponding version of the mod

#

the api is a separate thing

rigid stag
#

ยฏ_(ใƒ„)_/ยฏ

solemn rivet
#

the [API] tag at the beginning simply says that it's compatible with the modding API

rigid stag
#

omg kill me

solemn rivet
#

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

rigid stag
#

grrr

solemn rivet
#

phew

buoyant wasp
#

perhaps the old non-api one should just be removed at this point?

solemn rivet
#

yeah, I guess

#

I don't want to bother updating it

#

and it's not much of a hassle to install the API anyways

buoyant wasp
#

@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)

solemn rivet
#

oh, that's neat!

buoyant wasp
#

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.

solemn rivet
#

I'm not much of a programmer, but what would I use "FINE" for?

#

for when something runs fine?

buoyant wasp
#

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"

solemn rivet
#

gotcha

#

also @rigid stag how's it working? It should be compatible with bossrush, rando and debug

rigid stag
#

its working now

solemn rivet
#

great! Thanks for the report!

rigid stag
#

thanks for the help

buoyant wasp
#

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

solemn rivet
#

got it

#

makes sense

#

I don't get the use of "fine" still, but

buoyant wasp
#

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"

solemn rivet
#

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

buoyant wasp
#

๐Ÿ‘

solemn rivet
#

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

buoyant wasp
#

k

solemn rivet
#

There are a few other issues

#

But it's mostly working

mighty minnow
#

wait what does it do

buoyant wasp
#

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 hollowface

timber gale
#

Dark Souls for Hollow Knight?

#

What does that entail?

dapper folio
#

just bonfire style levelling with geo

timber gale
#

I may have an old version but the monarch wings pickup did not work for me in boss rush

#

wait nvm

#

ignore that

leaden hedge
buoyant wasp
#

category? so bosses will drop certain kinds of items?

leaden hedge
#

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

buoyant wasp
#

hmmm

ornate rivet
#

oooh, the new UI looks awesome

#

like Megaman

buoyant wasp
#

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

ornate rivet
#

poss

leaden hedge
#

potentially

lusty lantern
#

But if it's megaman, shouldn't we gain their techniques?

unreal dune
#

Wait, is there a bossrush mod?

#

If so, how do I get it!?

leaden hedge
#

install modding api

#

then put that in managed/mods/

unreal dune
#

Link to modding API?

leaden hedge
#

check pins

#

its in the gdrive

unreal dune
#

k

#

thanks!

#

How should I install the modding API? (Where should I place the folder)

leaden hedge
#

in your root hollow knight folder

#

it should overwrite hollow_knight_Data

unreal dune
#

so steamapps/common/Hollow Knight?

leaden hedge
#

yes

unreal dune
#

got it

#

Cool

leaden hedge
#

if it worked

#

it should say BossRush 6.6.xxxx.yyyy at top left

unreal dune
#

Should I restart Steam before launching Hollow Knight again?

leaden hedge
#

then just start a new save

#

nah

unreal dune
#

It worked \o/

#

Will any new file from now on be bossrush, or can I just start a normal game as well

leaden hedge
#

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

buoyant wasp
#

(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

leaden hedge
#

maybe instead someone should code an enable / disable screen before the game loads hollowface

buoyant wasp
#

not it

leaden hedge
#

super not it hollowface

buoyant obsidian
#

I don't even know code tbh

buoyant obsidian
#

I'm lazy what's the charm number for Dreamshield?

leaden hedge
#

not 40

buoyant obsidian
#

I knew that much :D

leaden hedge
#

I think its 39 hollowface

buoyant obsidian
#

I also think so

unreal dune
#

So boss rush is hella fun

#

What does Nighmare God Grimm do?

hazy sentinel
#

kill you

blazing sand
unreal dune
#

Oh, its just NKG but there are always spikes and dont get hit

#

Oh

blazing sand
#

Later in the fight the spikes are replaced with another Grimm

unreal dune
#

Jesus

buoyant wasp
#

it kills you

unreal dune
#

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)

blazing sand
#

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

solemn rivet
#

bonfire adds a level up system

#

blackmoth makes dash your main form of dealing damage

timber gale
#

How does the bonfire system work

hazy sentinel
#

break the game

#

that's the system

solemn rivet
#

oh yeah

#

I have to implement the anti-verulean system

hazy sentinel
#

ban imo

unreal dune
#

What about cut content? It seems self explanatory, but what exact stuff does it add?

#

Sorry if I'm being a bother here

buoyant wasp
#

each mod has a readme

unreal dune
#

oh

#

whoops

#

lol

buoyant wasp
#

at least, i'm pretty sure they all do at this point

unreal dune
#

Oh, and will it work for the newest version of the game?

buoyant wasp
#

most of them, yes

unreal dune
#

Cool.

buoyant wasp
#

if the mod has [API] in it, then it requires the modding api be installed (also in the folder)

wispy mist
#

so is there a randomizer mod for HK?

buoyant wasp
#

yes

wispy mist
#

have a link?

buoyant wasp
#

pins

wispy mist
#

oh shit didnt even see them. thanks!!

buoyant wasp
#

mmhmm

buoyant obsidian
#

It's charm 38 not 39 :D

timber gale
#

does randomizer and boss rush do anything?

solemn rivet
#

what do you mean?

unreal dune
#

Radomizer - randomizes items

timber gale
#

Does it randomize the drops so you have no idea what you'll get

unreal dune
#

yep

hazy sentinel
#

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

solemn rivet
#

charms, spells, upgrades

#

and boss rush... Is a boss rush

buoyant wasp
#

so, yes, they both do a crap ton

leaden hedge
#

I'm pretty sure randomizer and boss rush don't interact

#

although

#

actually

buoyant wasp
#

i'm really not sure, it depends on when the hook is called that changes what you pickup

leaden hedge
#

does randomizer even do that, I thought it hooked into the get functions

#

whereas I hook into the SetInt functions

buoyant wasp
#

idk

leaden hedge
#

well it won't affect charms

#

but it might occasionally give / not give you spells and abilities

solemn rivet
#

all I know is that Blackmoth is compatible with both

swift cairn
#

oh yeah I need to check the 2 dmg thing

#

I'm pretty sure it's some charm

solemn rivet
#

just to be sure

#

send me the modlog.txt

swift cairn
#

where do I find it?

solemn rivet
#

in the save folder

buoyant obsidian
#

New charm is coming along really well

timber gale
#

Is there any way you could easily increase the number of spiders weaversong gives you?

rain cedar
#

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

timber gale
#

They can occasionally block shit right?

rain cedar
#

No idea

#

I don't make a habit of using garbage charms

buoyant wasp
#

i had to use it in boss rush and rando once

#

afaik, they have no hitbox

timber gale
#

I think I've had it happen once or twice, they can block projectiles

bleak robin
#

i think i locked myself in another softlock in randomizer

buoyant wasp
#

eh, projectiles are weird, i've had them flat out hit me and do nothing

#

where are you dark?

bleak robin
#

nailmaster sheo's house

#

i don't have crystal heart

buoyant wasp
#

why did you go there?

#

nail arts aren't randomized yet ๐Ÿ˜ƒ

rain cedar
#

Can you not just get out the same way you got in?

bleak robin
#

idk, just seeing where i could go, didn't remember i couldn't get out without it

rain cedar
#

I don't know the room that well

bleak robin
#

i feel like i can but its proving challenging

rain cedar
#

Can't be much harder than getting there

buoyant wasp
#

isn't there a shortcut out? like going up and over?

#

though i guess you need claw

bleak robin
#

the up and over requires crystal heart

#

i have claw

buoyant wasp
#

oh, hah, yeah, that'll be fun

rain cedar
#

Ah ok that looks possible if you have fireball or dash

#

Otherwise no way

bleak robin
#

i have every movement thing except tear and heart

rain cedar
#

Then yeah that's probably doable

#

Good luck

bleak robin
#

i keep getting to the very edge but i don't quite make it

rain cedar
#

Worst case scenario try dying there and see where the shade spawns at

bleak robin
#

then killed itself on the thorns

timber gale
#

Some of the spike hitboxes are absoluetly fucked I've noticed but that's hardly new

young walrus
#

You couldn't get to sheos hut?

hazy sentinel
#

no the problem is getting back

rain cedar
#

There's a bench outside sheo

young walrus
#

There's a shortcut though

hazy sentinel
#

no crystal heart

bleak robin
#

yea i cant get through the thorn hallway

young walrus
#

Oh.... That's the shortcut that has the thorns on top and bottom

bleak robin
#

my only hope is managing to get through this gap

young walrus
#

Right right

bleak robin
#

oh yea i also don't have fireball

young walrus
#

Yeah you're screwed there. Can't make that up and over

bleak robin
#

i thought that, i could touch like the very corner, but it still hit thorns

rain cedar
#

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

buoyant wasp
#

lol

#

other than making the runs 30 minutes longer

rain cedar
#

Yeah

#

And who needs charms?

buoyant wasp
#

exactly

#

really it's just that that bench should despawn if you somehow make it overthere without CH+claw

bleak robin
#

only bench is dirtmouth

buoyant obsidian
#

Somebody tell me there's an FSM to update shield damage

#

The damage is set in stone when you spawn the shield :(

rain cedar
#

The shield has to have a variable storing the damage

#

Even if there's no event you can change it manually

buoyant obsidian
#

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

buoyant wasp
#

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 ๐Ÿ˜ƒ

rain cedar
#

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

solemn rivet
#

try

buoyant obsidian
#

would setting that = x change my nail damage to x?

rain cedar
#

Probably until it's updated again

solemn rivet
#

FSMUtility.LocateFSM(GameObject.Find("Charm Effects"),"Spawn Orbit Shield").FsmVariables.GetFsmInt("damageDealt").Value = whatever

rain cedar
#

Have you actually tested that? Just because the nail has that int doesn't mean the shield does

solemn rivet
#

that's how it's set for sharp shadow as well

leaden hedge
#

everything has that int

solemn rivet
#

worth a try at least

buoyant obsidian
#

Oh, good to know I'll give it a shot

leaden hedge
#

but the shield is its own object

buoyant obsidian
#

oh wait yeah

#

it wouldn't necessarily affect every shield would it

solemn rivet
#

it used to work for spells as well

#

until the game ran out of prefabs

#

then everything went to shit

buoyant obsidian
#

Didn't work

solemn rivet
#

I've gotta go now

#

best of luck!

buoyant obsidian
#

Thanks

solemn rivet
#

One last try

#

When are you running that code?

buoyant obsidian
#

At the beginning of Attack()

solemn rivet
#

Hmm... The one setting the damage?

buoyant obsidian
#

Yeah I handle damage setting at the beginning of Attack()

solemn rivet
#

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

leaden hedge
#

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

buoyant obsidian
#

Let's say I'm making tons of dreamshields... I'd need an array of previously summoned dreamshields, wouldn't I?

leaden hedge
#

how many are you making

buoyant obsidian
#

Infinite. The charm divides your damage by the number of shields you summon, meaning your damage never really increases.

leaden hedge
#

ok then you need a list

buoyant obsidian
#

although your computer will die with more than a few dozen

buoyant wasp
#

@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

leaden hedge
#

I don't know why a few dozen would do anything bad

#

unless they aren't using the same texture

#

for whatever reason

buoyant obsidian
#

The particle effects are hefty

leaden hedge
#

@buoyant wasp I'll just make boss rush only work on steel soul hollowface

buoyant obsidian
#

Yeah I still can't find a way to update the damage on even just the first shield

leaden hedge
#

what I would recommend

#

is theres an api hook called onCollider

#

hook into that, and print out the names of objects

buoyant wasp
#

that would suck (ss bossrush)

#

also, did you know dreamshield blocks the fireballs in grimm?

leaden hedge
#

yes

#

it does

buoyant obsidian
#

Yep

leaden hedge
#

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

buoyant obsidian
#

I'll be honest I couldn't figure out the api for my life

leaden hedge
#

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?

buoyant obsidian
#

Yep

leaden hedge
#

did you try compiling the ExampleMod?

buoyant obsidian
#

I tried something of the sort

leaden hedge
#

well did you load it into Visual Studio 2017

#

by double clicking the sln file

buoyant obsidian
#

oh now it's loading

#

took a while

leaden hedge
#

alright so is it loaded now?

buoyant obsidian
#

It's going through a very slow installation of tools

leaden hedge
#

alright let it do that

#

it should only ever have to do that once

buoyant obsidian
#

alright where do I find all this logged information

#

through Debug

leaden hedge
#

Debug.Log?

buoyant obsidian
#

yeah

leaden hedge
#

C:\Program Files (x86)\Steam\steamapps\common\Hollow Knight\hollow_knight_Data\output_log.txt

buoyant obsidian
#

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.

leaden hedge
buoyant obsidian
#

that's for that offline site viewer right?

leaden hedge
#

yes

#

the int is Damage

#

its a child of Orbit Shield

buoyant obsidian
#

don't I just open viewer in Chrome?

leaden hedge
#

did you add var fsm =

#

to the start of it?

buoyant obsidian
#

Nope, what exactly do I have to add where?

leaden hedge
#

so you renamed it to data.json right?

buoyant obsidian
#

yep

leaden hedge
#

open that in a text editor

#

and the first line should be
{

#

make it say
var fsm = {

buoyant obsidian
#

Got it, it works

leaden hedge
#

now in Init, it gets playerDataInt(nailDamage)

#

also lol

#

1.149999976158142

buoyant wasp
#

ok, so, found another thing

buoyant obsidian
#

jesus what is that

leaden hedge
#

this is how much bigger it is with dreamwielder

#

worth LuL

buoyant obsidian
#

Is that an error from compiling?

buoyant wasp
#

dreamfight false knight is stupid

#

you teleport in, and he lands on top of you

buoyant obsidian
#

surely they didn't make it 1.149999999975257635434

buoyant wasp
#

and you can't move because you're still the in the teleport animation

leaden hedge
#

check the state dreamwielder?

#

then check float variables ( in a text editor )

#

ye I know about that

buoyant wasp
#

makes it hard to start the fight at 1 health

leaden hedge
#

but yeah @buoyant obsidian if you can find a reference to this object, you can just set do fsm.FSMVariables.GetFsmInt("Damage").Value = damage

buoyant obsidian
#

How would I go about finding a reference to both the original dreamshield as well as any new dreamshields I spawn?

leaden hedge
#

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 hollowface

buoyant obsidian
#

Would it be more viable to just hijack the Damage variable

#

and make it so it's equal to # of shields

leaden hedge
#

thats what you will do

#

but you need to find it first

buoyant obsidian
#

I mean for the FSM itself

#

if that's even possible

leaden hedge
#

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

buoyant obsidian
#

I'm not really following you

leaden hedge
#

load the data.json in a text editor

buoyant obsidian
#

done

#

I've been looking through it

leaden hedge
#

scroll down to where you see states

buoyant obsidian
#

yep

leaden hedge
#

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

buoyant obsidian
#

where exactly is it shown that this is action 4

leaden hedge
#
                "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"
                ],
buoyant obsidian
#

Oh, gotcha

leaden hedge
#

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

buoyant obsidian
#

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?

leaden hedge
#

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();
                    }
                }
            }
        }
buoyant obsidian
#

and if I wasn't using the api where would I put onCollider

leaden hedge
#

PlayMaker2DUnityProxy

buoyant wasp
#

other bug, if you end a boss rush fight with actual fury (1hp) then the next fight you don't have fury when full

leaden hedge
#

or it mightbe PlayMakerUnity2DProxy

#

I forget the name of the class hollowface

buoyant obsidian
#

Unity2DProxy

leaden hedge
#

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

buoyant wasp
#

interesting, i wonder if this does actual damage

leaden hedge
#

you can tell with debug mod

buoyant wasp
#

sporeshroom's visual damage effect appears on grimm during baloon phase

#

will have to try that out later

leaden hedge
#

it appears on WK rolls too

#

before they stopped being magic immune

buoyant obsidian
#

I'm not seeing where to connect everything here with onCollider

#

I don't see where any GameObjects are

leaden hedge
#

PlayMakerUnity2DProxy is a component

#

its attached to a gameobject

#

you're returning
base.gameObject

buoyant obsidian
#

Gotcha, I'd never heard of base until now

leaden hedge
#

I think this.gameObject works too

buoyant obsidian
#

so in Start() would I put if (base.name == "Shield") then locate Shield Hit?

#

like in onCollider

leaden hedge
#

you want to call a function in your mod class

#

assuming you have a central class

#

to hold everything

buoyant obsidian
#

HeroController

#

Attack()

leaden hedge
#

you should really make a singleton to control everything from once place

buoyant obsidian
#

I'm not sure how I'd even go about that

#

at the moment I'm only using methods that already exist

leaden hedge
#

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

buoyant obsidian
#

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?

leaden hedge
#

the class

#

your code requires a list

#

of every fsm

#

where are you going to put that, in each fsm thinkgrub

buoyant obsidian
#

in HeroController with everything else :P

leaden hedge
#

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

buoyant obsidian
#

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

leaden hedge
#

well then replace the code hollowface

buoyant obsidian
#

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

leaden hedge
#

yeah you could do that all over the place

buoyant obsidian
#

but let's say this HeroController variable changed, all the shields would need to know to change as well

leaden hedge
#

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

buoyant obsidian
#

but wouldn't that be more work having to work with all the variables that are already in onAttack()?

leaden hedge
#

what are you interacting with?

buoyant obsidian
#

HeroController's variables, basically

#

a good number of them

leaden hedge
#

if they are public you can just HeroController.instance.variable = value;

buoyant obsidian
#

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?

leaden hedge
#

you wouldn't

#

why are you deleting things?

buoyant obsidian
#

Mana regen is changed in Lightbringer

dapper folio
#

how much damage does unbreakable add?

leaden hedge
#

compared to fragile?

#

none

dapper folio
#

no comparison

#

just how much?

leaden hedge
#

50%

buoyant obsidian
#

.5x

dapper folio
#

so if full upgrade is 21, it's 41 or 42?

#

no, 31

#

32?

#

round up or down?

leaden hedge
#

errrrrrrrrrrrrrrrr

buoyant obsidian
#

Down I think

leaden hedge
#

with fury its 56

dapper folio
#

alright, thanks

leaden hedge
#

its 32

#

it rounds up

buoyant obsidian
#

Up I meant up

leaden hedge
#

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

buoyant obsidian
#

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

leaden hedge
#

well onCollider is for when FSMs with boxColliders are created

#

you'd just add DreamShieldMod.instance.onCollider(this.gameObject) in PlayMakerUnity2DProxy.Start()

buoyant obsidian
#

Could I just combine Start with onCollider?

#

since it's only relevant to onCollider anyway?

leaden hedge
#

you could

#

where are you putting fsmList

#

and when are you resetting it

buoyant obsidian
#

that's my current problem

#

and I reset it on loading a new scene, since shields disappear then

buoyant wasp
#

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

leaden hedge
#

happens occasionally

buoyant wasp
#

and it turns out that you can't complete radiance without either double jump or claw

leaden hedge
#

correct

buoyant wasp
#

you literally softlock

leaden hedge
#

you also cant do soul tyrant without dash or djump

buoyant wasp
#

oh?

leaden hedge
#

I moved the spawn

buoyant wasp
#

what does tyrant do that you need either?

leaden hedge
#

you can't get up from the spawn point

buoyant wasp
#

ah

leaden hedge
#

the distance is too far

#

atleast it was in my experience, you might be able to fireball skip

buoyant wasp
#

yeah, but you'd only have 1 shot at that if you were lucky enough to spawn with teleport

#

hmmm

buoyant obsidian
#

Is there any way I can find my dreamshields in GlobalPool?

buoyant wasp
#

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

leaden hedge
#

im adding tips at some point

#

no @buoyant obsidian

#

if you do find out I'd like to know

buoyant wasp
#

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

leaden hedge
#

people could just pick up the items hollowface

buoyant wasp
#

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

leaden hedge
#

they can pay by being soft locked

buoyant wasp
#

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

leaden hedge
#

its alright, they'll softlock themselves by not getting enough damage

buoyant wasp
#

yeah, got to failed knight my first run tonight with not enough to do it

lusty lantern
#

I can understand softlocking by doing something so retardedly stupid that you deserve it.

leaden hedge
#

I mean if I put a tip that says

#

hey

#

hey

#

hey

#

hey

#

pick up djump

buoyant wasp
#

๐Ÿ˜ƒ

#

since you're adding this menu thingy, any chance we can make it so you can disable charms?

lusty lantern
#

Make a sign you have to read to access the next area?

buoyant wasp
#

turns out gluberfly or grimmchild or shield also breaks collector

#

like fluke

#

or weaversong

leaden hedge
#

in my experience grimmchild fixes collector

buoyant obsidian
buoyant wasp
#

yeah, i just sat there for 2-3 minutes

buoyant obsidian
#

does this look like a thing

buoyant wasp
#

and it killed it finally

buoyant obsidian
#

or did I just make it up

leaden hedge
#

I don't think orbital shield is the name of the gameObject

buoyant obsidian
#

was it just Shield?

leaden hedge
#

oh discord gets rid of commas

buoyant obsidian
#

Is Shield Hit a gameobject?

leaden hedge
#

no thats the FSM name

#

Untagged,Shield,Shield Hit,5qQGGQ

#

TAG,GAMEOBJECT_NAME,FSM_NAME,CHECKSUM

buoyant obsidian
#

So just Shield yeah

leaden hedge
#

yes

#

I'll probably just fix collector instead

buoyant wasp
#

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

leaden hedge
#

atleast its not jonis

buoyant wasp
#

is kingsoul in the pool?

leaden hedge
#

no

buoyant wasp
#

any reason inparticular or just hadn't felt like coding it?

leaden hedge
#

works weird, and I'm trying to keep exceptions in the item activate code minimum

trim totem
#

could traitor lord be modded into the mantis lords fight

buoyant wasp
#

wasn't sure if you could use the same code you used for grimmchild in setting it's "level"

leaden hedge
#

no

trim totem
#

feels bad

leaden hedge
#

I could probably make it work like grimmChild

#

although grimmChild is actually an int

buoyant wasp
#

i thought kingsoul was an int too

leaden hedge
#

and royalCharmState is 3 bools encoded into a int for no reason

buoyant wasp
#

ah

#

didn't realize you had to have them all set

leaden hedge
#

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

buoyant wasp
#

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

leaden hedge
#

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

buoyant wasp
#

heh, that'd be amusing

trim totem
#

what would happen if it worked like grimmchild

leaden hedge
#

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

rain cedar
#

That would suck

#

You'd just have two pickups no sane person would ever take

#

Since they do nothing on their own

trim totem
#

how fast does kingsoul recharge

leaden hedge
#

I'll probably just put one in for the entire kingsoul

#

its slow

rain cedar
#

Not so slow it's useless, though

leaden hedge
#

think its 50 seconds for 99 soul

rain cedar
#

It's noticeable, just not amazing

buoyant wasp
#

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)

leaden hedge
solemn rivet
#

seems like it's either from credits or the secret backer room

leaden hedge
#

I know where the text is used

#

its for boss names

#

but what sheetName is it

solemn rivet
#

oh

leaden hedge
#

apparently its neither TITLES nor TITLE

solemn rivet
#

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?

leaden hedge
#

no he should be doing it when the colliders are created

buoyant obsidian
#

I'm just gonna make my own Dreamshield with blackjack and hookers

solemn rivet
#

invite me

solemn rivet
#

I'm not happy with the hooks I added for bonfire mod

#

can I get a second opinion?

lusty lantern
#

I'd ask what you mean by hooks but I have the feeling it would involve using the bonfire mod.

solemn rivet
#

it's about the modding API actually

buoyant obsidian
#

even scarier

buoyant wasp
#

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)

solemn rivet
#

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

buoyant wasp
#

That's not really all that different that what we're doing on the TakeHealth event

solemn rivet
#

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

buoyant wasp
#

yeah just take a look at TakeHealth

#

i'm 99% sure the code is basically the same

#

or im' 100% wrong

solemn rivet
#
        {
            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

buoyant wasp
#

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)

rain cedar
#

Yeah

solemn rivet
#

oaky

solemn rivet
#

great, it works!

#

also, while trying to make crit work I got some interesting results

buoyant wasp
#

lol

solemn rivet
#

I'm honestly considering leaving that as is

#

unfortunately, I think I can fix that

#

so I might as well

buoyant obsidian
#

I think I'm gonna remake Lightbringer from the ground up at some point

solemn rivet
#

in the api?

buoyant obsidian
#

Eh I really don't like the API, it doesn't seem like the easiest way to do what I want

buoyant wasp
#

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

buoyant obsidian
#

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

buoyant wasp
#

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.

buoyant obsidian
#

So hooks are basically methods at the beginning of methods that use your method instead of the vanilla one, right?

buoyant wasp
#

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

solemn rivet
#

I heard you like methods, so I put a method inside your method so you can method while you method

buoyant obsidian
#

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?

solemn rivet
#

from what I gather, events are like "template" methods. Now the subscription analogy makes way more sense

#

yeah, 753

buoyant wasp
#

replacing attack entirely probably doesn't exist at the moment but probably could. the other 2 i'm 99% certain exist as hooks already

rain cedar
#

You can somewhat replace attack

#

If you set cstate.attacking false you don't get the nail

#

But grubberfly beams still happen

buoyant wasp
#

also, yes, there is a HeroUpdate and newplayerdata hook already

solemn rivet
#

you can basically make the DoAttack method skip the call for the Attack method

#

which is where the animation is actually processed

buoyant wasp
#

so you could literally do this

solemn rivet
#

I also added a hook to the beginning of DoAttack

#

you would need a hook at the end, tho

buoyant wasp
#
ModHooks.Instance.NewPlayerDataHook += LightBringerDoesSomethingNewPlayerDataMethod;

and the method could be:

public void LightBringerDoesSomethingNewPlayerDataMethod(PlayerData playerdata) {
    playerdata.Instance.gotCharm_3 = true;
}
rain cedar
#

Nice function name

solemn rivet
#
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

buoyant wasp
#

@solemn rivet if you put csharp after the triple backticks, it syntax highlights

solemn rivet
#

oh!

buoyant wasp
#

incidentally, that works for html/css/json/javascript etc ๐Ÿ˜ƒ

solemn rivet
#

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

buoyant wasp
#

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

solemn rivet
#

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

buoyant obsidian
#

and for Lightbringer I'd still have to change all the graphics and stuff manually, right?

buoyant wasp
#

graphics are done in resource files right?

buoyant obsidian
#

yeah

#

it's a real pain

buoyant wasp
#

(honestly I know nothing about that stuff, so i can't say what is required)

buoyant obsidian
#

since they change the spritesheets every update

#

the code part only takes like 5 minutes an update

buoyant wasp
#

@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?

leaden hedge
#

yes

#

kinda depends on what you want to do, as to how complicated that would be

buoyant obsidian
#

The main things are the charms and grubberfly beams

leaden hedge
#

charms are easy

#

infact 99% sure you can add a hook for that

buoyant obsidian
#

there's also .txt files and menu graphics

leaden hedge
#

theres a langauge get hook