#archived-modding-development

1 messages ยท Page 40 of 1

buoyant wasp
#

focus cost is PlayerData.instance.focusMP_amount

copper nacelle
#

wait what it uses 33

#

but it says I've got MP left even though maxMP should be 33

leaden hedge
#

you'll probably have to completely ignore the GetInt stuff

#

and just make soul gain return 0, and manually update the MPCharge and MPReserve

#

or, API could use SetInt in AddMPCharge instead of just setting it

#

but that'd be a "fix" to vanilla code

buoyant wasp
#

oh, yeah, AddMPCharge isn't using the GetInt/SetInt like it should

#

bleh

copper nacelle
#

should I do AddMPCharge?

#

or should I set MPCharge

buoyant wasp
#

no, the problem is, is that they inconsistently use how they access the variables

#

so, some places they use GetInt/SetInt where we can hook in properly

#

in this case, they bypass that entirely and read/write directly to the various variables

#

which means for the soul gain, it's never looking at your custom max mp

copper nacelle
#

that's weird

buoyant wasp
#

that doesn't even scratch the surface

copper nacelle
#

isn't that with SoulGain() having +11 and stuff?

#

AddMPCharge has > this.maxMP and stuff

buoyant wasp
#

yup

#

that's the problem

#

it should be >this.GetInt("maxMP")

#

but they didn't do that

copper nacelle
#

so should I just copy their code and add .getInt and use that instead of addmpcharge?

buoyant wasp
#

no, honestly I'd just change the values in playerdata and be done with it, and don't care about the whole changing the save's data irrevocably. it's pretty well established that opening a vanilla save with mods loaded can/will break the save unless that save was with the mod

#

so

#

just ditch the GetInt hook entirely, and then create 2 hooks, one for new game and one for after save game load, and just change PlayerData.instance.maxMP = 33.

#

it's not optimal, but really there isn't a good way around it

#

we could fix it in the API, but we generally shy away from "fixing" base game issues. (we made 1 exception with the mouse pointer lock they did recently, but otherwise....) if it's broken in vanilla, it's broken in the mod api. Otherwise we'd be doing their patching and that'd just become a nightmare

leaden hedge
#

not paid to do it so don't hollowface

buoyant wasp
#

you manage to get a new video card on black friday kdt?

copper nacelle
#
        public int OnSoulGain(int amount)
        {
            Log("On Soul Gain");
            if (PlayerData.instance.GetInt("MPCharge") + amount > PlayerData.instance.GetInt("maxMP"))
            {
                if (PlayerData.instance.GetInt("MPReserve") < PlayerData.instance.GetInt("MPReserveMax")) 
                {
                    PlayerData.instance.MPReserve += amount - (PlayerData.instance.GetInt("maxMP") - PlayerData.instance.GetInt("MPCharge"));
                    if (PlayerData.instance.GetInt("MPReserve") > PlayerData.instance.GetInt("MPReserveMax"))
                    {
                        PlayerData.instance.MPReserve = PlayerData.instance.GetInt("MPReserveMax");
                    }
                }
                PlayerData.instance.MPCharge = PlayerData.instance.GetInt("maxMP");
            }
                else
                {
                    PlayerData.instance.MPCharge += amount;
                }

            return 0;
        }
    }

would this work if I really wanna keep the save data stuff

#

I just used find and replace for like 10 seconds

buoyant wasp
#

might

copper nacelle
#

it worked! happygrub

leaden hedge
#

nah, had another gpu around

buoyant wasp
#

oh nice

copper nacelle
#

have any of you tried GPU Passthrough?

#

oh shit

#

I forgot to actually decrease the amount

#

my playtime on my test save went from 10 minutes to 40 minutes doing this lmao

buoyant wasp
#

of the 400 hours i have into HK, probably 100 of it is just working on the API

copper nacelle
#

lol

#

the soul gain is currently 5 and that's weird

#

I'm gonna make it more cruel

#

but also be nicer

#

wait nvm that's too cruel

#

11 --> 3 might be overkill

leaden hedge
#

use a bool

copper nacelle
#

?

leaden hedge
#

do something like

soulGain = !soulGain
soulOnHit = soulGain ? 5 : 6
copper nacelle
#

would that use a global?

leaden hedge
#

just put a variable in your mod class

copper nacelle
#

alright

#

is there a round up function

#

because you can use charms to get more soul and stuff

leaden hedge
#

check Mathf

#

its probably Mathf.RoundUp()

copper nacelle
#

how do I make Mathf exist in the current context?
using Mathf?

leaden hedge
#

using UnityEngine

copper nacelle
#

alright

buoyant wasp
#

the amount of soul passed into the hook is post-charm

#

so

copper nacelle
#

how's this

#
            soulGain = !soulGain;
            amount = soulGain ? amount / 2 : (int)Math.Ceiling((float) amount / 2); // first hit is rounded down, second is rounded up
#

besides being ugly

buoyant wasp
#

is there a reason to not always round down?

copper nacelle
#

cause then 11/2 = 5

buoyant wasp
#

so?

leaden hedge
#

makes shit numbers

copper nacelle
#

^

#

it also makes it 7 hits instead of 6 which is nicer

#

that worked well

buoyant wasp
#

i guess

#

possible values are 11, 14, 19, and 22

copper nacelle
#

5, 11, 16, 22, 27, 33

#

instead of 5, 10, 15, 20, 25, 30, 33

buoyant wasp
#

no i meant, the possible base soul gain numbers

copper nacelle
#

ohh

buoyant wasp
#

you'll get one of those 4 values in that method

#

depending on charms

#

so, base, soul catcher, soul eater, soul catcher + soul eater

copper nacelle
#

dream wielder is a lie, right

#

like it says increased SOUL but it doesn't actually do it

leaden hedge
#

its on dreamnail hit

#

it gives you 66 instead of 33

buoyant wasp
#

yeah dream wielder's soul gain on dreamnail hit is huge

copper nacelle
#

yeah

#

2 spells

buoyant wasp
#

and it's fast

copper nacelle
#

so with this dream wielder is now just normal dream nail

#

except fast af

#

and soul eater + soul catcher is normal collection

buoyant wasp
#

well, that assumes that dream nail uses soul gain

#

which i doubt

copper nacelle
#

aw shit I screwed something up

#

nail damage went back to 5

buoyant wasp
#

soul gain, i think, only is on nail hit

#

MP gain from grubberfly is seperate

#

as is dream nail

copper nacelle
#

dream wielder is probably the most effective thing for this mod then

#

grubberfly has MP gain?

buoyant wasp
#

er

#

grubsong

#

sorry, brain is turning to mush

copper nacelle
#

it's fine

#

so tanking + dream nail is the most effective build for this mod I think

buoyant wasp
#
bool flag21 = this.playerData.equippedCharm_3 && damageAmount > 0;
                            if (flag21)
                            {
                                bool equippedCharm_ = this.playerData.equippedCharm_35;
                                if (equippedCharm_)
                                {
                                    this.AddMPCharge(this.GRUB_SOUL_MP_COMBO);
                                }
                                else
                                {
                                    this.AddMPCharge(this.GRUB_SOUL_MP);
                                }
                            }
copper nacelle
#

do I add that?

buoyant wasp
#

no

#

that's inside of the takedamage method in the base game

copper nacelle
#

ohhh

buoyant wasp
#

so

copper nacelle
#

so grub song is correctly affected

buoyant wasp
#

you could change GRUB_SOUL_MP_COMBO/GRUB_SOUL_MP

#

no, because you're not overwriting AddMpCharge in the PlayerData class

#

you have your own version that your version of soul gain uses

#

but nothing else does

#

i'd just change those 2 variables

copper nacelle
#

just add them to the OnInt switch, right?

buoyant wasp
#

no, these are in HeroController

#

so...hmmm

#

when's the best time

#

maybe...after scene load

#

HeroController should exist at that point

#

i think

#

try hooking into ModHooks.Instance.SceneChanged <---hmmm, name is not hook, boo...

copper nacelle
#

alright

buoyant wasp
#

and then

#

HeroController.instance.GRUB_SOUL_MP

#

idk what the default value is

copper nacelle
#

just / 2 ?

buoyant wasp
#

yeah, should work

copper nacelle
#

alright

#

I'll do it tomorrow morning

#

gotta sleep now

buoyant wasp
#

though, i would store the initial value the first time

#

since the SceneChanged event fires each time you go into a new room

#

and if you keep doing GRUB_SOUL_MP /2, after 2 or 3 rooms, it'll be 0

#

๐Ÿ˜ƒ

copper nacelle
#

lol

#

maybe do the rounding thing?

buoyant wasp
#

so the first time, store the normal value, and then just assign that every time after

#

like

#
int? grubSoulMpBase;

public void OnSceneChanged(string sceneName) {
    if (grubSoulMpBase == null)
        grubSoulMpBase = HeroController.Instance.GRUB_SOUL_MP:

    HeroController.Instance.GRUB_SOUL_MP = grubSoulMpBase / 2;
}
#

or something to that effect

copper nacelle
#

that seems right

#

thanks for the help

buoyant wasp
#

yup

copper nacelle
#

gotta sleep now tho so elderbug

buoyant wasp
#

yeah, have a good one

copper nacelle
#

you too

weary oyster
#

is there any way to add custom keybinds to the debug mod?

#

i need noclip keybind in my life

fair rampart
#

lol

#

probs there is

rain cedar
#

There's not but soon

#

I was gonna add that a bit ago but there was a problem in the API then I was away for a week because of thanksgiving

weary oyster
#

alright sweet

#

gonna be very useful

fair rampart
#

guys how does boss rush mode work?

#

cant i skip to the boss i wanna fight instantly?

rain cedar
#

No

fair rampart
#

oh

#

okay

rain cedar
#

Just repinning the drive link to move it back to the top

weary oyster
#

also being able to bench anywhere would be ace

#

but im guessing theres a reason thats not a thing already?

rain cedar
#

You can add multiple dream gate positions, which is pretty close to bench anywhere

weary oyster
#

yea i guess that'll have to do

fair rampart
#

umm

#

i think i found a bug with the boss rush mode

#

i got killed by something invisible

#

during the dung defender fight

manic wing
#

sounds shitty

leaden hedge
#

did you stagger him when he was swinging poop?

#

sounds like a pretty common vanilla bug

fair rampart
#

ah

#

mby , i wasnt really paying attention to his poop

#

Btw what is MP?

#

in the mod

knotty grove
#

amount of Soul

fair rampart
#

oh ok

#

umm

#

i found this glitch

#

he was able to move from the start and got himself stuck there

#

this is a glitch

leaden hedge
#

correct

knotty grove
#

I think that happens literally every time in boss rush XD

fair rampart
#

lol

#

Also i found out if u have dream shield you can basically delete the attacks of the mantis lords, if the shield touches a mantis lord's spear it disapears

manic wing
#

like the actual spear of the projectile?

#

or*

hazy sentinel
#

I'd assume the projectile

fair rampart
#

ya

#

the projectile

hazy sentinel
#

because the spear is part of the sprite hollowface

fair rampart
#

ya

#

lol

manic wing
#

well yeah that's why i asked because it would have been really weird

fair rampart
#

also plz remove wayward compass from the selections available

leaden hedge
#

no

fair rampart
#

y

#

;-;

leaden hedge
#

no filler = too many good items

#

its already too easy

fair rampart
#

ohh

#

ya tru

manic wing
#

also how else would you know which way to go?

fair rampart
#

I dunno either D:

#

We need it

fair rampart
#

i think u should add a way to skip the charm selection

#

and simply not choose any

#

have it be a rancid egg or something

leaden hedge
#

there is

#

it literally come up on screen

fair rampart
#

huh?

leaden hedge
#

press quick map

fair rampart
#

ohhhh

#

ok

#

lol

fair rampart
#

Guys

#

can u install multiple mods at once?

#

like, boss rush + debug

knotty grove
#

those 2, yes

#

certain mods you can install more than 1 of

#

those that use the modding api

fair rampart
#

ah ok

#

Umm

#

how 2 install debug mode?

fair rampart
#

how do i reshow the menu of debug mode

#

after i hide it?

#

nvm got it

knotty grove
#

f1 SeemsGood

fair rampart
#

Umm, i cant use numpad keys

#

does this have to do with debug or no>?

somber spear
fair rampart
#

Guys how do i disable boss rush mode?

buoyant wasp
#

@somber spear - we basically already have this with the API

#

@fair rampart - just create a folder inside Managed/Mods/ called, for example, "Disabled" (doesn't matter what it's called really), and drag BossRush.dll into it

fair rampart
#

ok

somber spear
#

@buoyant wasp but you need the mod loader still, no?

buoyant wasp
#

the API is the loader

somber spear
#

Mod loader needs to be updated with every single game version

buoyant wasp
#

yes, but so would the unity plugin engine

somber spear
#

UPM doesnt need to be updated

buoyant wasp
#

because it's doing the exact same thing

somber spear
#

No

buoyant wasp
#

it's injecting code into Assembly-Csharp

#

that's what this step is doing

fair rampart
#

guys how easy is it to code with unity?

buoyant wasp
#
Place the aforementioned files into the directory where your target game is located, and run PluginManager.Setup.exe (using Mono to do so, if not on Windows)
#

that's literally doing exactly what we do already, it takes the game's dll, and weaves custom code for the plugins into it

somber spear
#

@buoyant wasp It doesn't touch Assembly-CSharp at all

#

Just asked the dev

buoyant wasp
#

how are they injecting the code then?

#

at runtime?

charred matrix
#

UPM author here

#

It doesn't touch Assembly-CSharp at all

#

The way it works is described in the README.md file

#

UPM injects a static constructor into the GameObject class found within the UnityEngine namespace. This way, it is able to execute code before anything else in the game. Using this, it loads plugins from a folder named "Plugins" in the game's folder, and instantiates any MonoBehaviour derivatives with the [OnGameInit] attribute.

#

It modifies UnityEngine.dll (or UnityEngine.CoreModule.dll in the case of Unity 2017.2+)

#

Eliminates the need to inject into specific classes, and makes it game-agnostic

fair rampart
#

hmm

#

dont mind me im a pleb walking through

buoyant wasp
#

that sounds... horrible

buoyant wasp
#

dealing with gameobjects sucks

charred matrix
#

It's nothing to do with that

#

It could inject into any other class, GameObject is just a class that's guaranteed to be accessed before anything else

buoyant wasp
#

ok, so, lets say you want to supersede the mechanism for saving. how would you accomplish that?

charred matrix
#

Which ensures the static constructor runs before anything else

somber spear
#

Mod loader having to be updated with every single game version is really inconvenient

buoyant wasp
#

eh, not really anymore @somber spear . I have it building in 1 step now

#

it takes... 5 minutes

charred matrix
#

If you want to modify an already-existing class, then I have some plans for a feature to do that down the line
Currently you'd have to create a sort of "wrapper" class for the MonoBehaviour, which isn't ideal

somber spear
#

@buoyant wasp and what if I'm on a different version that doesnt have mod loader support?

buoyant wasp
#

yeah, all of our modding is modifying existing classes

#

i mean we're adding a few assets, but alot of it is hooking into classes and methods to execute additional logic or replacing the logic

charred matrix
#

I'll let you know once I have the system in place then, if you're interested

buoyant wasp
#

it's worth looking at, but it'd have to be pretty powerful. Right now I can easily wrap a method in a class with like, 4 lines of code and it handle everything else.

#

and of course we'd then have to get all the modders to switch from VS to Unity Engine

#

some modders already use UE, but several don't

charred matrix
#

VS? You mean Visual Studio?

buoyant wasp
#

yes

charred matrix
#

Nothing stopping you from using that

#

That's just an IDE

#

Unity's a game engine, it has no effect on what you write your code with

buoyant wasp
#

"An installation of Unity 5.x or 2017.x" <-- Why would I need this?

charred matrix
#

(for reference, I use VS & Rider)

#

You only need that to get the .dll files

#

If you have a game using Unity already (such as Hollow Knight), you don't need it

buoyant wasp
#

some clarity there would be a good idea

#

since it indicates you have to install the unity framework

charred matrix
#

It does mention that, but I suppose I could word it better

buoyant wasp
#

but yeah, if you find a way to make it easy

charred matrix
#

"and at least one of the following:"

#

but yeah, I'll add a footnote later to make it clearer

buoyant wasp
#

but here's an example of what we have right now

#
namespace Modding.Patches
{
    [MonoModPatch("global::SaveStats")]
    public class SaveStats : global::SaveStats
    {
        
        public Dictionary<string, string> LoadedMods { get; set; }
        public string Name { get; set; }



        [MonoModIgnore]
        public SaveStats(int maxHealth, int geo, MapZone mapZone, float playTime, int maxMPReserve, int permadeathMode, float completionPercentage, bool unlockedCompletionRate) : base(maxHealth, geo, mapZone, playTime, maxMPReserve, permadeathMode, completionPercentage, unlockedCompletionRate)
        {
        }
    }
}
#

basically this says "take the SaveStats class, Add LoadedMods and Name to it.

#

and ignore that constructor, it's just there to satisfy compile time requirements

charred matrix
#

I see

buoyant wasp
#

but then i now can Save Custom data to the Save File

charred matrix
#

and I assume the installer reads these attributes and makes the appropriate changes to Assembly-CSharp then?

buoyant wasp
#

we distribute the modded dll at the moment, but it basically takes the "modding dll" and merges it into Assembly-CSharp, yes

#

and yes, we know about the legal stuff

#

TC looks the other way

charred matrix
#

Heh, neat

#

It's always nice when the developers understand

buoyant wasp
#

but then we expose a ton of the methods that are often used like TakeDamage, GainMana, Attack, etc. so that you can subscribe to those as events

#

and modify the values inside

charred matrix
#

As in, change the access modifiers to public?

buoyant wasp
#

nope

#

so

charred matrix
#

Oh, you make an eventhandler that they call?

buoyant wasp
#
        private void orig_StartMPDrain(float time)
        {
        }

        public void StartMPDrain(float time)
        {
            orig_StartMPDrain(time);
            focusMP_amount *= ModHooks.Instance.OnFocusCost();
        }
charred matrix
#

I see

buoyant wasp
#

and then modders subscribe to FocusCostHook

#

which they can return a modified result

#

and MonoMod takes StartMPDrain, renames it to orig_StartMPDrain for us

#

so we can call the original, let it do it's thing, then apply any changes to the result.

#

sometimes we prefix and append, sometimes just prefix, sometimes slightly alter behavior

charred matrix
#

Neat

buoyant wasp
#

that's the simple stuff, it gets more complicated with a few other methods where we have to inject stuff in the middle of it. I tinkered with doing it via IL, but ended up just decompiling the method and modifying and replacing it in the dll that gets merged. it's not ideal, and the MonoMod author is looking at how we could automate it, but for now. those methods are few.

rustic fossil
#

As difficult to make as it would be, I would so much love a mod where dreamers are bosses

buoyant wasp
#

well, if you could reuse assetts from the game for skills and spells, that wouldn't be bad, the hardest part would be writing the behavior. NGG just re-uses behaviors that are already there

leaden hedge
#

adding behaivour to something that doesn't already have it would be easy

#

only reason I don't add any to NGG is because it'd have to interface with existing FSM code

buoyant wasp
#

well, i mean in-so-far as you'd have to actually develop said behavior

#

not that adding it wouldn't be doable

candid cloak
#

do you guys know what -noheap does when used in steam launch options

buoyant wasp
#

based on the name, i suspect it disabled heap allocations

rain cedar
#

Basically how that's relevant is the game keeps running during garbage collection

buoyant wasp
#

it shouldn't break anything, and apparently(?) sometimes fixes stuff

#

can't say i've needed it myself

rain cedar
#

@buoyant wasp The most recent modding api you posted here has a weird empty file named "Mods" instead of a folder

buoyant wasp
#

weird...

rain cedar
#

I blame winrar for being a shit program

buoyant wasp
#

it's why i moved to 7-zip

#

cause winrar stopped improving

#

though in this case I just used powershell to zip the folder, so maybe it's something weird with that

rain cedar
#

Yeah, maybe

buoyant wasp
#

but opening it up in windows zip shows it as a folder

#

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

rain cedar
#

@leaden hedge Would it be cool if I used the teleport function from boss rush for something in debug?

leaden hedge
#

go for it

rain cedar
#

Thanks

#

Procrastinating adding keybinds by adding more interesting things

buoyant wasp
#

lol

#

and fixing clicks?

rain cedar
#

What's wrong with clicks?

buoyant wasp
#

at least in my copy, I can't click on things like noclip

#

it does nothing

#

doesn't toggle the color, nor set noclip on/off

rain cedar
#

Oh yeah I remember you mentioned that

buoyant wasp
#

i can double check it's still true

#

yup, still broken, current debug version 1.2.1?

rain cedar
#

Probably

#

I've got 1.3.0 locally but it's broken in a few ways

buoyant wasp
#

the weird thing is

#

all skills works, spells work, items work other than trampass

#

geo/etc

#

overcharm works, but ingsoul/grimm doesn't... it's just bizarrely inconsistent in what does and doesn't do anything

rain cedar
#

Alright I tested locally and everything you mentioned works fine

buoyant wasp
#

lol

#

it's more saves

#

@leaden hedge

rain cedar
#

How would that be breaking this?

buoyant wasp
#

i have to guess that the overlay he displays is only invisible outside of the menu

#

but still exists

leaden hedge
#

it might be blocking clickthroughs

buoyant wasp
#

and so the areas where those buttons are is under where it sits

#

cause removing it causes me to be able to click them

leaden hedge
#

oh I thought the default behaviour for canvas elements wasn't to block raycasts

#

apparently not zzz

buoyant wasp
#

well, at least we know what the cause is anyway.

#

k, i moved all the methods in ModHooks.Instance that call the actual hooks to internal since the only thing that should ever be calling them is in Assembly-CSharp. This means folks won't be trying to call ModHooks.Instance.GetPlayerBool(string name) directly anymore.

#

tested and all seems to still work the same, which is expected

rain cedar
#

Neat

rain cedar
#

Any opinions on the best way to save an arbitrary number of KeyCode -> function pairs given only string, int, bool, and float dictionaries?

buoyant wasp
#

you can always add your own dictionary

rain cedar
#

Does that still serialize properly?

buoyant wasp
#

like public SerializableIntDictionary

#

sorry, in a match,

public SerializableIntDictionary KeyCodes;
leaden hedge
#

KeyCodes should just map directly to ints

rain cedar
#

Would something like this work?

public SerializableDictionary<KeyCode, MethodInfo> binds;```
leaden hedge
#

you can just do

int x;
x = (int)KeyCode.A
KeyCode a = (KeyCode) x
rain cedar
#

I feel like MethodInfo there might break it

buoyant wasp
#

MethodInfo probably won't work

#

unless it itself is serializable

#

which i doubt

rain cedar
#

Alright I can use a string instead and build the MethodInfo when it's requested then cache it

buoyant wasp
#

yeah

#

as long as the dictionary inherits from SerializableDictionary and the 2 types are they themselves serializable, it should work

leaden hedge
#

then you don't even need another dict

#

dictionary<string, int> will work fine

rain cedar
#

I would rather not mix this into the int dictionary already in the settings

buoyant wasp
#

yeah, it doesn't hurt to have more

#

the 4 that are there are just there to reduce boilerplate

rain cedar
#

That makes sense

#

Now I've gotta figure out how to store class name, function name, parameter names, and what to put into those parameters in a string

#

I might just make my own serializable MethodInfo class

leaden hedge
#

why do you need that

buoyant wasp
#

couldn't you just have a dictionary in the mod that maps the name to the method?

rain cedar
#

Yeah I suppose that would work too

#

Probably easier

#

Definitely easier

buoyant wasp
#

i guarantee it's easier

#

the serialization unity provides is crap

#

(hence the need for the stupid SerializationDictionary which is the unofficial/official way to have dictionaries)

#

"Oh, it's so fast, except it supports almost nothing" - literally their readme, sorta

rain cedar
#

Not hard to be fast when nothing works with it

buoyant wasp
#

pretty much

rain cedar
#

This way of doing it also gives me a convenient list of all the possible binds

#

And I could probably use UnityAction instead of MethodInfo to make it a bit easier

#

I dunno, UnityAction is a lot less flexible

#

We'll see

buoyant wasp
#

the irony being that json.net which is the defacto standard serializer, probably could serialize/deserialize the save game data in < 20ms, which for saving/loading is low enough that you probably wouldn't notice if it was shoved into a thread

rain cedar
#

Oh, you can't have arbitrary parameters on a UnityAction

#

So nevermind about that

#

Yeah 20ms is nothing

buoyant wasp
#

i have half a mind to test that out sometime, just to amuse myself

leaden hedge
#

you could probably get everything of interest saving fast enough to not even cause frame drops

#

on every frame I mean hollowface

buoyant wasp
#

lol

#

actually, yeah, if you capped at 60, that gives you what....16ms per frame. sure you could probably do it that way. i bet them encrypting the data costs more time than that

#

oh well

#

still stuck using the sucky one

charred matrix
#

Combine that with unsafe code and potentially a native library and it could go even faster

leaden hedge
#

I'm just saying if you're going to fix saving, you might aswell fix the fact that 90% of playerdata never changes, or is pointless

#

it has both nail damage and nailsmithUpgrades ๐Ÿค”

buoyant wasp
#

so, "fix the game?"

charred matrix
#

by the way, on the topic of hooking methods at runtime

#

I tried it out, and it works

#

Offers the ability to hook both before and after methods, or replace them entirely

buoyant wasp
#

yeah, i looked at harmony when i was hunting around

charred matrix
#

You give it the MethodInfo structs for the appropriate methods

#

It's very cool

#

I'm thinking of wrapping a simpler API around it, gonna see what I can do

buoyant wasp
#

I think the reason I didn't like it was that it required alot of bootstrapping and a few other things. one of the authors that works on Harmony is the one who wrote MonoMod which is what i settled on. I think I also wasn't thrilled with harmony having 2 dozen issues open and no commits in the last 5 months'

charred matrix
#

Heh, that's fair I guess

buoyant wasp
#

I've gone down the IL patching route

#

it is doable

#

but it sucks

charred matrix
#

Yeah, it's annoying to maintain, at least in my experience

buoyant wasp
#

yup, and it's annoying to get right in the first place

#

especially if patching the IL causes the stack size to change

charred matrix
#

Yeah

rain cedar
leaden hedge
#

weird lol

rain cedar
#

Happened again at false knight when he started a new one

#

Had to restart the game

leaden hedge
#

I'll probably be replacing shinies with a ui

#

but yeah grimm and THK are buggy

#

and if they bug out, it breaks it on reload

rain cedar
#

Sounds annoying

leaden hedge
#

I assume its something to do with the shiny drops somehow getting unreferenced, I'll probably just put it into an inventory screen once I finish that code

rain cedar
#

Noticed this going through changing things in debug

private static void GrimmchildClicked()
{
    if (!DebugMod.GrimmTroupe())
    {
        Console.AddLine("Grimmchild does not exist on this patch");
        return;
    }

    if (!PlayerData.instance.GetBoolInternal("gotCharm_40"))
    {
        PlayerData.instance.SetBoolInternal("gotCharm_40", true);
    }

    PlayerData.instance.SetIntInternal("grimmChildLevel", PlayerData.instance.GetIntInternal("grimmChildLevel") + 1);

    if (PlayerData.instance.GetIntInternal("grimmChildLevel") >= 6)
    {
        PlayerData.instance.SetIntInternal("grimmChildLevel", 0);
    }

    panel.GetButton("Kingsoul", "Charms Panel").UpdateText("Kingsoul: " + PlayerData.instance.royalCharmState);
}```
#

Updating kingsoul text when the grimmchild state changes

#

What a god

leaden hedge
#

why can VS not tell System.Func<string,string,string> apart from System.Func<string,string,Sprite> but mono can ๐Ÿค”

rain cedar
#

Alright, I'm not hardcoding binds anywhere anymore

#

And I've got the toggle all key working with this in Initialize

if (settings.FirstRun)
{
    settings.FirstRun = false;
    settings.binds.Clear();

    settings.binds.Add("Toggle All UI", (int)KeyCode.F1);
}```
#

Now for the hard part

#

Gotta add UI for this

#

There will in total be 78 bindable things

#

Basically everything that could be even slightly useful to anyone

rain cedar
#

So apparently using System.Web.UI makes the assembly unloadable

#

Good thing all I wanted from there is the Pair class and it's super easy to just make my own

leaden hedge
rain cedar
#

@leaden hedge Ciplax just started streaming boss rush if you want to watch new version stuff

cedar raven
#

@leaden hedge reward skip ready yet?

leaden hedge
#

nah it worked for me

#

double check keybinds?

buoyant wasp
#

The Pair class was added in .net 4.5 I think, which is probably why trying to use it in a Mod breaks stuff

leaden hedge
#

Tuples were added in 4.0 iirc

buoyant wasp
#

ah, so they were

rain cedar
#

I'm compiling against 3.5, though

#

You'd think that would give an error

leaden hedge
#

I guess this shows a simple example of how my proposed ModInventory works
PaneHandler.cs and Rewards.cs

rain cedar
#

Alright I'm working really slowly because I keep getting distracted but keybinds are working pretty well now

#

I don't think I care enough to make it say proper button names for controller binds

buoyant wasp
#

4/13...lol

rain cedar
#

There's a lot of binds

buoyant wasp
#

i'd argue it might be better to have the binds be a large area where you can have multiple categories visible at once

rain cedar
#

Yeah but that's way more work

buoyant wasp
#

otherwise you're going to have a hard time dealing with " hmm, did I bind this key to something else already? IDK, let me flip through these 13 pages and look"

rain cedar
#

I could have it ask for confirmation on binding a duplicate

buoyant wasp
#

that'd be good

#

and maybe tell you what it is that is being duplicated

rain cedar
#

Also, unrelated but this is horrible:

foreach (KeyCode kc in Enum.GetValues(typeof(KeyCode)))
{
    if (Input.GetKeyDown(kc))
    {
        DebugMod.settings.binds[bind.Key] = (int)kc;
        HelpPanel.UpdateHelpText();
        break;
    }
}```
buoyant wasp
#

"Hey this key is already bound to X,Y,Z"

rain cedar
#

Is there a better way to check pressed keys?

#

I guess you're not likely to know off the top of your head

buoyant wasp
#

kdt did key press checks in more saves

#

could see what he did there

rain cedar
#

He's just using the built in input handler to check pre-set actions

#

I think

#

That's easy, hard part is checking for an arbitrary key press

buoyant wasp
#

does Input have some sort of method that just returns all currently pressed key(s)?

rain cedar
#

Closest thing is a string of all keyboard keys currently pressed

buoyant wasp
#

string?

#

that's weird

rain cedar
#

Yes it's horrible

buoyant wasp
#

not string[]?

rain cedar
#

It's just a string

buoyant wasp
#

boggle

rain cedar
#

I mean you can just convert it to a char array

#

But still that leaves out joystick and mouse buttons

buoyant wasp
#

I'd say that there has to be a better way, but after having dealt with all this code in the last month....

rain cedar
#

I don't have high expectations for Unity functionality

cedar raven
#

no bugs yet for boss rush with common reward pickups

buoyant obsidian
#

Impossible

rain cedar
#

Alright I've got it putting a warning in the console and requiring a double press for duplicate binds now

#

Optimally it would also eat the input when settings binds

#

But I can't be bothered to figure that out

buoyant wasp
#

eh, good enough

rain cedar
#

Yeah, pretty much my thoughts

#

It is a bit terrible how it works, though

#

There's not really any "waiting" state

#

It just sets the bind to KeyCode.None

#

And any bind with that KeyCode attempts to set itself to any key that's pressed

#

It works, though

#

Which is pretty much my criteria for "good enough"

buoyant wasp
#

maybe when kdt finalizes his UI updates we can make the binds window bigger hollowface

#

so was this teleport code you were working on for just quickly moving around the map? or were you doing something with the boss respawning?

rain cedar
#

I want to eventually add better options for practice

#

Kinda like save states you can set

#

Move to a certain room at the given position with a stored gear preset and respawn bosses in the room

buoyant wasp
#

ah, i was thinking of something similar, though i was thinking of forking bossrush to do it

rain cedar
#

Ugh Stream.CopyTo isn't in 3.5

#

Can't have any nice things when modding this game

buoyant wasp
#

yeah, there are alot of things i go to use that i use at work all the time, only to find out that it doesn't work in 3.5

rain cedar
#

I think I broke something important

#

[ERROR]:[API] - Error: System.OutOfMemoryException: Out of memory

#

Alright I fixed it

#

Loading all images for debug mod from the assembly as embedded resources now

#

Uploaded that and API 1.2.2.1-19 to the drive

#

I don't think either of those are horribly broken

buoyant wasp
#

lol

#

so loading images externally causes issues?

#

and yeah, -19 seems to work pretty well, i've done several bossrush/randos on it

rain cedar
#

Nah external images is fine

#

Just a bit harder to fuck up installation when it's literally one file

buoyant wasp
#

i have -20, which is where i moved all the methods to internal that i'll probably upload later. it's otherwise identical to -19.

#

haha

#

yeah

#

also means that if you change the images

#

you don't have to worry about cleaning up the old ones if the names change

rain cedar
#

I don't think I would want to embed something that's likely to change

#

Like the randomizer xml

buoyant wasp
#

right, but i mean, if for whatever reason you deleted an image because it wasn't needed anymore

#

it really would just stay out there forever

#

the old way

rain cedar
#

That's assuming I care enough to delete unused images

buoyant wasp
#

haha

rain cedar
#

Of which there are several

#

The file size is still < 1MB

buoyant wasp
#

it could be 20mb, it's not like it's changing 10x a week and requiring you to download 1gb files everytime it changes ๐Ÿ˜ƒ

rain cedar
#

1GB mods the dream

buoyant wasp
#

sigh i think tonight i'm going to try and figure out how to ship the default CA's so that mods can use https correctly

#

the other thing that it's time to start looking at is doing modloading so that you have all the mods installed, but be able to selectively activate/inactivate them without having to shuffle the dlls in/out

rain cedar
#

If Unload was ever used it'd be pretty easy for mod makers to support it on their end

buoyant wasp
#

right, the biggest things is just to make sure the hooks for the mod are un-registered, and ui elements/input stuff is undone.

#

though i had considered something where the hook part could be done automagically, but events are not 1st class entities in C#

#

(which pisses me off to no end)

rain cedar
#

I'd say it's good enough to just call Initialize/Unload and leave the rest to the mod

buoyant wasp
#

yeah, mostly i just had spent last night pouring over the internet trying to figure out how to make it so that i could make the event subscription stuff in the hooks less verbose. I really like having the logging noting when a mod subscribes to the event, but it means that 1 line turns into 8. outside of doing T4 template transformations before the build, there is no way to make an "abstract" event like a normal type. anything else is just a ugly hack

#

it doesn't change the functionality, it just bugs my internal OCD that code i write is clean and pure

rain cedar
#

Just go back to dnspy and you won't have to worry about clean code because it's impossible

buoyant wasp
#

don't get me wrong, i love dnspy, it's now one of my favorite tools i never knew existed, but... i love my source control too much

fair rampart
#

guys

#

i wanna install randomizer

#

but i already have an api installed

#

for 1.2.1.4

#

what do i do?

young walrus
#

install the 1.2.2.1 api

fair rampart
#

alright

buoyant wasp
#

(well, assuming you've installed 1.2.2.1 game)

leaden hedge
#

InControl has action.ListenForBinding() which sets the actions binding to the next viable input, although you'd have to make an action set

buoyant wasp
#

ok, lets try out this new fancy bossrush update

#

hmm, did you change the font size so less of the boss name shows @leaden hedge?

leaden hedge
#

no

#

although it was being weird for ciplax too

buoyant wasp
#

also, you have the words "rewards" 3 times on the screen

leaden hedge
#

yeah its a hack of the inventory code

buoyant wasp
#

ah

leaden hedge
#

so the previous and next pane is rewards

#

It's going to change so boss select is the next pane

buoyant wasp
#

yup, makes sense

leaden hedge
#

so you can toggle between them to go forward when you want

#

rather than having a key to skip

buoyant wasp
leaden hedge
#

yep looks the same

buoyant wasp
#

yay. i got "inventory storage"

leaden hedge
#

yeah if you kill something whilst in the middle of a spell or dash

buoyant wasp
#

i love the freezing effect

#

you get some really amusing looks

leaden hedge
#

nice upswing

buoyant wasp
#

are the 3 dots supposed to do something?

leaden hedge
#

they are placeholders

#

I'm going to put the image of the item inside them

#

when I can be bothered to crop out and mask 60 odd sprites

buoyant wasp
#

haha

#

well, you can look at the randomizer overlay, all the sprites in it are an even 160x160

#

which might not be quite big enough, but

#

or 152x152, idk, they are all completely uniform

leaden hedge
#

I think iirc the circle is just 80x80

buoyant wasp
#

but yeah, then you wouldn't have to crop and resize and center and all that crap

#

๐Ÿ˜ƒ

#

a thought

#

between the kill and the ability to select an item, put a short input CD, like 1-1.5 seconds

#

twice now, i've killed the boss with something like a spell right when i went to hit with the nail, and accidentally picked a random item

leaden hedge
#

is your nail the x button lol

#

or same as menu accept

buoyant wasp
#

oh, i guess it's not nail, but jump, but yeah, in any case, just a small delay between kill and select

timber gale
#

^Yes please! I hate when I'm upslashing to kill a boss (usually gruz mother) and it instantly picks a charm for me

leaden hedge
#

you guys need some input control

#

and to count boss hp

buoyant wasp
#

lol, that's weird

#

look at where the right tendril is

#

just kind of hanging out there

leaden hedge
#

happens

#

don't know why

#

quality code

buoyant wasp
#

so, reviews of updated boss rush. the new selection screen fixes alot of problems

#

assuming you can put in the delay. cause i'm sorry, but sometimes you kill a boss earlier than expected and you've already gone to press an input to dodge or something and select on accident.

#

as far as counting boss hp, i do like the notion that someone proposed a while back to give health bars for bosses on the bottom,

#

that'd be neat

leaden hedge
#

I specifically avoided delay in the design, because delay makes uis feel like shite

#

but I guess for the first input I can put like .2 seconds or something

buoyant wasp
#

that might be enough, yeah

#

false knight is still broken

#

so as soon as the fight starts he jumps on your face

late sphinx
#

oh damn is bossrush getting further updates

fair rampart
#

probs

cedar raven
#

@leaden hedgedying to CG2 still send me to king's pass

leaden hedge
#

Stop dying

buoyant wasp
#

kdt's answer to every bug is "git gud"

rain cedar
#

Either that or "Not my problem"

noble trout
#

Me: Watcher knights are placed poorly and make a huge difficulty spike
Kdt: they are easy just dodge them and damage them
Someone else: but he is right they are hard
KDT: not my problem

#

There was a conversation that went down like that

rain cedar
#

Just get good

young walrus
#

"this boss that guards a key completion point is harder than i expected"

#

hmm..... imagine that

rain cedar
#

But Uumuu is more tedious than anything and Herrah doesn't even have a boss

buoyant wasp
#

eh, i don't care if it's difficult, i just care if it's broken

#

so, being stuck in the spawn animation while a boss smashes your face, is not cool

#

having to do the boss with little or no abilities, well, that's just tough. honestly the new boss rush design might be too easy at this point. everything after the first 9 is generally a face roll

rain cedar
#

You've probably got ~15 items after the first 9

#

Not surprising it gets easy

buoyant wasp
#

mmhmm

#

when you couldn't choose which ones you fought, it was alot easier to get screwed by rng drops

#

and so the "perfect" kill thing helped alleviate that

#

honestly now that you can pick the order, i'm not sure it's needed. or maybe there should be a "hard" mode for it where even perfect kills still only let you get 1 item.

fair rampart
#

Guys help when i start the game with boss rush mod installed instead of the usual menu there's just a help button, when i press it it just says "not my problem"

#

@leaden hedge

buoyant wasp
#

lol

buoyant wasp
#

what version of unity does HK run on?

rain cedar
#

Looks like this is a thing
Application.unityVersion

buoyant wasp
#

going down the rabbit hole, doesn't seem to help

#

guess i can log it

#

see what happens

buoyant wasp
#

its 5.4.3f1, if anyone ever needs to know

leaden hedge
#

Boss rush is too easy? What if I put every item into tiers so stuff like fluke / lv2 spells / f str required 2 pickups instead of one hollowface

rain cedar
#

Just make it so you can only pick up an item if you don't get hit

#

Bet that'd stop the complaining

charred matrix
#

You can open globalgamemanagers in a hex editor to quickly check the Unity version

#

or mainData for pre-5.x games

#

(really, you can check any UnityFS or asset file, but those two files are the ones I go for)

buoyant wasp
#

i think there is a number of ways we could balance it

#

i think the way it is now, is good for "easy", but i think a harder variant for more seasoned players would be good

#

either reducing the max you can get to 1, or making it so that the better stuff takes multiple drops (though doing it that way would mean that it would be exceptionally unlikely to ever get lvl2 of anything

#

or, make it so charms actually cost notches. you still get, 11 notches, but no longer allow for all of them to be equipped, you're limitted to what you use

rain cedar
#

But the max charm notches is 2,147,483,647, not 11 hollowface

buoyant wasp
#

suppose you could do some kind of currency based system

buoyant obsidian
#

Yeah and have the option to buy stuff like nail damage upgrades, spells, and charms

#

maybe award bonus points if you beat a boss in one try without dying

rain cedar
#

So basically do it how Kein did is what I'm getting here

buoyant obsidian
#

tbh I like KDT's implementation better

leaden hedge
#

no way people would just save up for fluke and lv2 fireball

buoyant obsidian
#

(when it works ;) )

buoyant wasp
#

i never played the old boss rush

#

so

#

i'm just saying we need to have some sort of hard mode and figure out how to balance it

buoyant obsidian
#

Less health?

buoyant wasp
#

nah

#

unless we're talking like 2-3 masks max

buoyant obsidian
#

I was thinking 16 masks

#

but they're all blue

#

That way you actively see how well you're doing

#

kinda like Cuphead's King Dice fight

buoyant wasp
#

and steel soul of course

buoyant obsidian
#

kinda implied yeah

leaden hedge
#

I'm getting rid of the guaranteed drop

#

and unless you can beat my average time you get nothing hollowface

buoyant obsidian
#

personally not a big fan of the "rush" part of boss rush

#

I'm more of a survival guy

#

Is the latest boss rush in the drive folder?

leaden hedge
#

no

buoyant obsidian
#

Where can I find it?

leaden hedge
#

1 sec i'll upload it

buoyant obsidian
#

Lel dreamshield kills Gruzz mommy without her waking up

leaden hedge
#

this fixes mawlek, fc, being able to press buttons on the inventory instantly, and adds a timer per boss hollowface

buoyant obsidian
#

You can make it skip the intro cutscene I'm pretty sure

leaden hedge
#

I think you can just set the first scene somewhere in gamemanager

#

but its a hardcoded string

#

I guess I could hook into the function to get scene name

#

and replace the first cutscene with FK's room

buoyant wasp
#

timer per boss?

#

like, if you don't finish you die?

#

or just "how fast did i kill this boss"

leaden hedge
#

no it just says how fast you killed the boss

buoyant wasp
#

oh nice

leaden hedge
#

it has a number under to compare to, but I've only added the first few

buoyant wasp
#

did you figure out why the text sizes on the select screen (why they suddenly went big)

leaden hedge
#

I need more averages for later bosses due to number of builds / drops

#

dunno, I made them smaller again, disabled the bold and put them on horizontal overflow

#

they are still a little too big

#

though

rain cedar
#

You should be able to change the first scene with the before scene load hook already

#

I mean technically it would change all times you enter Tutorial_01/King's Pass but whatever

#

Doesn't matter for boss rush

buoyant obsidian
#

Note to self NEVER get glowing womb

buoyant wasp
#

yeah, getting womb sucks

#

especially until collector is fixed

buoyant obsidian
#

For me it's Hornet

#

they keep freezing time causing me to miss an input and hit a spike or something dumb

buoyant obsidian
#

Unbreakable heart doesn't work?

buoyant wasp
#

i think it does

#

i think the masks don't show

buoyant obsidian
#

I don't think I can heal past them, so they're effectively blue masks

#

also I got Joni's and now everything is... odd

buoyant wasp
#

joni's is bad

leaden hedge
#

jonis is broken

buoyant wasp
#

never, ever, ever take jonis

fair rampart
#

lol

buoyant wasp
#

@leaden hedge - I assume you're calling the UpdateBlueHealth method and it still freaks?

leaden hedge
#

yes

buoyant wasp
#

bleh

buoyant obsidian
#

I'm getting a lot of frame loss and stuttering

#

probably not even from boss rush though

fair rampart
#

hmm

#

u should probs checkk the system performance report

buoyant wasp
#
public override bool IsCurrent()
        {
            try
            {
                GithubVersionHelper helper = new GithubVersionHelper("iamwyza/HollowKnightRandomizerTracker");
                Version currentVersion = new Version(GetVersion());
                
                Version newVersion = new Version(helper.GetVersion());
                LogDebug($"Comparing Versions: {newVersion} > {currentVersion}");
                return newVersion.CompareTo(currentVersion) < 0;
            }
            catch (Exception ex)
            {
                LogError("Couldn't check version" + ex);
            }

            return true;
        }
rain cedar
#

How do I have to set this up on github for it to be able to get the version properly?

leaden hedge
#

its probably looking at the latest tag

buoyant wasp
#

you can look at the modding api one right now

#

i have it setup

#

so for the API i did this code

#
{
                GithubVersionHelper githubVersionHelper = new GithubVersionHelper("seanpr96/HollowKnight.Modding");

                string currentGithubVersion = githubVersionHelper.GetVersion();
                string[] temp = currentGithubVersion.Split('-');
                int modVersionRevision = Convert.ToInt32(temp[1]);
                Version tempNewVersion = new Version(temp[0]);
                Version tempGameVersion = new Version(gameVersion.major, gameVersion.minor, gameVersion.revision, gameVersion.package);
                Logger.LogDebug("Checking Game Version: " + tempGameVersion+ " < " + tempNewVersion);
                if (tempGameVersion < tempNewVersion || (tempGameVersion == tempNewVersion && modVersionRevision > _modVersion))
                    IsCurrent = false;
            }
            catch (Exception ex)
            {
                Logger.LogError("[API] - Couldn't check for new version." + ex);
            }
#

it will go fetch the latest release name, and then compare it to the one they have installed

#

if they don't, you get the "new update avialable

rain cedar
#

Alright

buoyant wasp
#

though, that said, naming doesn't matter per modder. They can use whatever design to name and compare they want, the "IsCurrent()" funciton just cares if it's true or false. if it's false it will say "New Update Available"

#

using semantic versioning though makes it alot easier since the .net version class supports it already

verbal isle
#

I had the collector break using dreamshield once

young walrus
#

that's a vanilla game bug

buoyant wasp
#

collector is just broken

#

in vanilla

#

fluke breaks him, weavers break him, sporeshroom breaks him, defenders crest breaks him

#

grimmchild simultaneously breaks and fixes him if you wait long enough

#

the beta release notes said they were fixing him, so...

astral python
buoyant wasp
#

yup

#

oh, right, forgot about that bug

#

@leaden hedge - if you kill HK any time other than before radiance, you don't get your MP/HP UI back

#

until you die

astral python
buoyant wasp
#

joni's

#

lol

cedar raven
buoyant wasp
#

for speedrunners yes

toxic valley
#

gotta say, it has the best loading screen ever

cedar raven
#

@leaden hedge if u load a normal savefile in boss rush, u'll get stuck with boss rush load screen

toxic valley
#

"place holder loading screen"

buoyant wasp
#

@cedar raven - correct

#

don't try to start anything other than "new game" while bossrush is installed

#

kdt is working on an expanded version of "More Saves" which will have some icons to point out when a save has different mods associated with it

#

to help reduce that

toxic valley
#

collector is broken in boss rush

buoyant wasp
#

not really

#

the collector is just broken

toxic valley
#

it stays in dead position where you are supposed to hit him

buoyant wasp
#

you probably had one of the dozen things i mentioned above

toxic valley
#

im looking at a stream

young walrus
#

this is a vanilla game bug

toxic valley
#

oh

young walrus
#

not related to boss rush

toxic valley
#

ok

buoyant wasp
#

yup, basically any damage other than nail, dive, abyss, or regular fireball can and often does break him

#

so fluke, weaver, dreamshield, sporeshroom, etc all will do that

toxic valley
#

yeah he used dreamshield

young walrus
#

i mean... we "could" turn off those abilities during the collector fight in the mod yeah Wyza?

#

to prevent this softlock

toxic valley
#

dat kinda sux

buoyant wasp
#

could, yes. though the next patch is suppose to fix him period

#

and that's been in beta a couple weeks, i'd be surprised if it didn't drop soon

young walrus
#

i won't hold my breath for that

#

fix one thing, break 8 more

buoyant wasp
#

probably ๐Ÿ˜ƒ

young walrus
#

he'll probably fly through the ceiling now or some random shit

timber gale
#

Also quick slash can break him

copper nacelle
#

how do you get the enemies in a scene

#

or just the enemies on screen

#

debug mod's EnemyData confuses me significantly

buoyant wasp
#

have you looked at the source code for the mod?

daring snow
#

how's the Blackmoth mod? I've been curious about trying it

copper nacelle
#

yes

#

it does something with the fsms but I still don't get it

buoyant obsidian
ornate rivet
hollow pier
#

i voted 753

#

but not for lightbringer

#

bamboozled again

buoyant wasp
#

1.2.2.1-21 (BETA) - Some changes to the way the Logger was done to try and resolve some concurrent access issues. Mod.Instance no longer exists by default (turns out Static fields/properties are static to the base class and not inherited classes), so if you were using MyNewMod.Instance, you'll need to add your own instance field. As far as I know, only 2 mods were using this anyway. Added the new github version helper to let you use github releases to notify folks when new versions of the mods are out. (will update examples here shortly to show how). Also all the methods which actually call the hooks are now internal, so you can't accidentally try to call them from outside of Assembly-Csharp. should reduce confusion.

rain cedar
#

Debug was using that

#

Feels bad

buoyant wasp
#

yeah, problem is

#

whatever the last mod that is instantiated is

#

is what Instance would be

rain cedar
#

Nice

buoyant wasp
#

yeah....works great with 1 mod, does bizzare stuff with multiple ๐Ÿ˜ƒ

#

thankfully it's a 2 line fix for mods

buoyant wasp
rain cedar
#

Fixed the Instance thing already for debug mod

buoyant wasp
#

figured as much

rain cedar
#

I'll look into the releases thing on github in a bit

#

Never really used that before

buoyant wasp
#

it's dead simple these days thankfully

#

it used to be a pain, but now it's literally "draft release" "give version number" "optionally give notes/name" "publish"

rain cedar
#

Sounds easy

#

I really need to fix up the debug mod code one of these days

#

I've got stuff like clicking a button calls a function that calls another function that calls the function that actually does stuff

buoyant wasp
#

lol

rain cedar
#

I just need to switch from storing the button functions as UnityActions to MethodInfo and I'll have a lot more flexibility

buoyant wasp
#

not that you'd want to, but I use a addon called Resharper (it's pay, so). Honestly to me VS without resharper isn't VS, but i digress. It does so much stuff to help reduce unecessary code, formating, converting loops to linq, i mean, it's insaine. All that to say. It has a bunch of "best practice" coding styles like naming conventions. it's rather scary to see everything that dnspy spits out with the squiggly lines

rain cedar
#

Maybe

#

I don't like buying things, though

buoyant wasp
#

hehe. I used it for years at the college i worked at, and then it's basically manditory where i work

rain cedar
#

Oh it's not even a thing you buy

#

It's a yearly subscription

#

Gross

buoyant wasp
#

yeah, but I do enough coding that it's worth it to me

rain cedar
#

Well I'm gonna apply for the free products

#

Can't hurt

#

They don't even ask for reasoning, they just want a .edu email address

#

So it can't be that exclusive

buoyant wasp
#

nah, it's like MS

#

they want to hook you while your at a school

#

so that when you leave

#

you have to buy it ๐Ÿ˜ƒ

#

looks like they do open source licenses too

leaden hedge
#

@copper nacelle if you're using api, oncollider will list everything with a hitbox as they spawn

#

Then you just need to use FSMUtility.ContainsFSM(gameObject, "health_manager_enemy"), to check if its an enemy

buoyant wasp
#

(fair warning on Oncollider, make sure any operations you do in that hook are fast, it's called an absurdely huge number of times)

leaden hedge
#

Mainly during load

buoyant wasp
#

yeah, 10k+ times easily

#

so filter as early as you can in the call to only do work on what you need to and return if not.

leaden hedge
#

Comparing layers is probably faster then containsfsm

#

I think enemies are on 11 and 17

buoyant wasp
#

so @leaden hedge changed the logging in -21 a little bit which shys away from your approach of using the Modhooks.Logger in favor of the Logger that's part of the Mod class. if you want to log for the Mod itself, you should just remove Modhooks.Logger entirely so that it's just "Log(somemessage)". if you're wanting to do a global logging, just use Logger.Log now. Logger is now a static class (had to change it because was having threading issues with it being created multiple times). Should be fairly trivial to do a find/replaceall

#

guess i could make a wrapper class to make it backwards compatible, but meh

leaden hedge
#

can you make it work with implicits hollowface

buoyant wasp
#

like, auto convert an int/float to string?

leaden hedge
#

yes

buoyant wasp
#

yeah

#

i can do that np

#

I think i'll just add an overload that accepts type object and then just do .ToString() on whatever you pass it

#

so for all the basic types, it'll "just work"

buoyant wasp
#

1.2.2.1-22 - Adds Overloaded methods for all logging to allow for you to pass in an object to which it will do a "ToString()" on. @leaden hedge

leaden hedge
#

I got that same thing sean did

#

in 7zip ๐Ÿค”

#

where /mods was a file

buoyant wasp
#

gotta be somethign weird with powershell doing the zip

#

powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::CreateFromDirectory('$(SolutionDir)\OutputFinal', '$(SolutionDir)\ModdingAPI.zip'); }"

#

guess i'll go look up how to do it with 7z instead, probably just as easy

leaden hedge
buoyant wasp
#

Cause you're trying to access a instance method from an static method

#

if you need to do that

#
internal static BossRush Instance;

then in Initialize

Instance = this;

then you can do

    Instance.Log("striing!");
rain cedar
#

Done with homework for tonight, time to see what resharper is all about

buoyant wasp
#

also, ahhhhhhh kdt is a white theme editor person, my eyes

rain cedar
#

Haha yeah I use dark mode on literally everything

buoyant wasp
#

mmhmm

leaden hedge
rain cedar
#

Also resharper is giving me 154 warnings so that's a bit daunting

leaden hedge
#

its just vs i use white theme on

buoyant wasp
#

hehe, yeah, though it does have the "fix this warning, fix in file, fix in project"

leaden hedge
#

is there something I can return to GetSaveFileNameHook to make it not save / load

buoyant wasp
#

hmm

#

i mean, you could pass in a file that doesn't exist

#

to prevent loading

#

to prevent saving

#

oh, lol

#

just do

#

GameManager.GameConfig.disableSaveGame= true;

#

cause the save function does this

#

if (!this.gameConfig.disableSaveGame)

#

to prevent loading just return a file that doesn't exist though, an error will show up in the output log, but w/e

leaden hedge
#
[ERROR]:[API] - Error: System.MissingMethodException: Method not found: 'Modding.ModHooks.get_Logger'.
  at Modding.ModLoader.LoadMods () [0x00000] in <filename unknown>:0 
buoyant wasp
#

yup

#

that's what i meant about not using ModHooks.Logger anymore

#

and using either just straight "Logger"

#

or

#

Log (if you're in the Mod class)

leaden hedge
#

im not using ModHooks.Logger

buoyant wasp
#

hmmm

leaden hedge
#

this happens between the end of Initialized BossRush and the start of Saving Global Settings

buoyant wasp
#

full modlog?

leaden hedge
#
[INFO]:[API] - Adding GitHub SSL Cert to Allow for Checking of Mod Versions
[INFO]:CN=*.github.com, O="GitHub, Inc.", L=San Francisco, S=California, C=US
[INFO]:GameLoading
[INFO]:[API] - Trying to load mods
[INFO]:[BossRush] - Initializing BossRush
[INFO]:[BossRush] - Initialized BossRush
[ERROR]:[API] - Error: System.MissingMethodException: Method not found: 'Modding.ModHooks.get_Logger'.
  at Modding.ModLoader.LoadMods () [0x00000] in <filename unknown>:0 
[INFO]:Saving Global Settings
[INFO]:Saving Global Settings
buoyant wasp
#

any other mods in your mod folder?

leaden hedge
#

oh yeah I have moresaves hollowface

buoyant wasp
#

that probably has the same issue

leaden hedge
buoyant wasp
#

interesting, you moved watcher knights

rain cedar
#

Wow way to get bullied into changes by casuals

leaden hedge
#

oh yeah

#

people wouldn't stop complaining about wk being "impossible"

rain cedar
#

Them being later isn't gonna make people better at the game

#

Make them earlier tbh

fair rampart
#

It's not impossible

#

if u r a speedrunner

leaden hedge
#

it doesn't really make a difference, you just do WK and broken vessel instead of each other

fair rampart
#

Which im not

#

so its impossible >:CC

#

jk

leaden hedge
#

the last boss you did in phase 1 was WK and first in phase 2 was usually Broken Vessel

#

now its just last in p1 = vessel, first in p2 is wk

rain cedar
#

Broken vessel is definitely easier than watchers

#

It's like one of the easiest bosses in the game

buoyant wasp
leaden hedge
#

hmm]

buoyant wasp
#

also

leaden hedge
buoyant wasp
#

k

#

not gonna run it tonight, should have went to bed an hour ago ๐Ÿ˜‰

#

i like the extra timers, but I kind of wonder if there isn't a better way for htem to be handled display wise, they take up alot of realestate and are somewhat distracting since they are always ticking

#

also, not sure what you changed exactly, but those timers seem to affect stuff in weird ways

#

the final screen that gives you the game time

#

said 15 hours

#

and 82% completion

leaden hedge
#

its probably loading whatever slot you clicked on

buoyant wasp
#

ah

leaden hedge
#

which is weird

#

maybe that screen is coded differently

rain cedar
#

Force camera follow cheat that actually works

#

What a world

#

That's been broken since release and literally nobody has complained so I guess nobody uses it

#

But I fixed it anyway

fair rampart
#

omG

#

THANK YOU

#

I always wanted this

#

for testing specific things

leaden hedge
#

thats the opposite of how it should work ๐Ÿค”

#

everyone complains something is broken and not fixing it anyway

rain cedar
#

But yeah it was a pain to make work because Team Cherry are assholes and do their camera locking in LateUpdate

#

I'm gonna try to get rid of the black bars around all the scenes now too

#

So you can actually use debug to practice oob

#

Pretty sure avast has taken it upon itself to start deleting my game executable

#

So that's fun

fair rampart
#

Lol

#

rip

rain cedar
#

I only even have that garbage installed because my school requires an av to use the internet

fair rampart
#

avast doesnt do that for me tho

#

avast is garbage?

#

i thought it was ok

rain cedar
#

I don't really like any antivirus

#

It's needless bloat

#

Best av is just not being an idiot

fair rampart
#

r u sure?

#

They help me alot when im downloading things im not sure if are a virus or not

rain cedar
#

Why are you downloading things that sketchy in the first place?

fair rampart
#

antivirus to use the internet?

#

malwarebytes

#

It doesnt happen often

#

but it does happen

#

like when i download a mod from a certain discord

#

from a random person that im not sure if is safe