#archived-modding-development

1 messages Β· Page 501 of 1

copper nacelle
#

I can fix that

worn eagle
#

does modifying an instantiated transform change the source transform

jolly oriole
#

btw, you don't need to mind my pr rn, fixing a few more thing, then maybe close the pr, reset my fork and doing the changes again

worn eagle
#

nvm

worn eagle
#

oh good ol trial version

#

I'm uninstalling ivcam

jolly oriole
#

just use obs for recording

#

but otherwise it looks nice

copper nacelle
#

wtf

#

looks hot

worn eagle
#

I am using obs, I think my audio settings were set weird somewhere

ornate rivet
#

looks amazing

jolly oriole
#

@vocal spire is there e repo for lifeblood master?

vocal spire
#

source is lost to time

#

also no

vocal spire
copper nacelle
#

local man does not comply with gpl

vocal spire
#

?

jolly oriole
#

gpl? isn't modding api mit?

copper nacelle
#

pretty sure lbm had fsmutil

jolly oriole
#

oh

#

well it has ModCommon so ig

copper nacelle
#

oh yeah modcommon is a thing

#

should probably be lgpl or something considering modcommon is mit

vocal spire
#

πŸ€”

#

dnspy editing time

#

epic music begin now

#

also I had copied fsmutil from some other boss mod

#

you know, the good thing about specifically editing lifeblood master in dnspy is I was too dumb at the time to use GetAction, it's all copying states and changing transitions

copper nacelle
#

in dnspy

#

why

vocal spire
#

because I lost the source

#

and I don't want to look for it zote

jolly oriole
#

bruh

ornate rivet
#

time to sue him

jolly oriole
#

kick him out of pale court

vocal spire
#

πŸ€”

copper nacelle
#

now hold on that's just losing labor

vocal spire
#

kicking the only other playmaker person out

jolly oriole
#

oh fuck yea, there was something

ornate rivet
#

redfrog pretends he lost the source but in reality lifebloodmaster's dll is malicious and he's desperately trying to hide it

vocal spire
#

πŸ€” how did u know

ornate rivet
#

it's true

jolly oriole
#

the true malicious thing to do is to somehow make a c/c++ dll do all the work in a mod, that the c# dll only loads the c/c++ one and nothing else

#

so no one can read what the mod does

vocal spire
#

I can't find a emoji that fits

#

this is a tragedy

worn eagle
#

just use thinking for the 147th time

vocal spire
#

ok

#

πŸ€”

#

thank you for keeping track

leaden hedge
#

program it in playmakerfsm

#

but change the name of every fsm action to be random garbage

vocal spire
#

lol

leaden hedge
#

and have one action per line of code

vocal spire
#

that's the greatest idea ever

#

anyway when doing that lm fails to load

#

time to recreate the code I guess

#

then I can get back to finishing a terraria mod

#

so I can get back to finishing a among us mod

#

so I can get back to finishing pale court

copper nacelle
#

why are you recreating it

vocal spire
#

Β―_(ツ)_/Β―

copper nacelle
#

dnspy has a save as solution button you know

vocal spire
#

yeah

#

was gonna mention I might use that

copper nacelle
#

it's good

#

I used it for moresaves

vocal spire
#

nice

jolly oriole
#

but things like const values and bool flags (fuck those honestly) have to be corrected

vocal spire
#

F

copper nacelle
#

I mean they're not wrong they're just inlined

jolly oriole
#

yea but they look ugly

vocal spire
#

I probably didn't use any consts

jolly oriole
vocal spire
#

oh no, my bad code is on discord

#

proves how bad my 3rd mod was

jolly oriole
#

i'm still working on my 1st one though

vocal spire
#

F

#

my first one was worse than that abomination. it was dream shield coop updated. Scary stuff..... i keep wanting to update it, but just no

#

also when you upload code to github, does the spacing ever just go weird

copper nacelle
#

tabs become 8 spaces in length on github

#

that's why you don't use tabs

#

😀

vocal spire
#

huh

jolly oriole
#

ctrl+f "\t", replace with " "

vocal spire
#

ok

#

well now I have lm source again shroompog

heavy patrol
#

And this is coming from someone who just started playing last week haha

jolly oriole
valid kiln
#

wait thats actually amazing

warm yew
#

truly magnificent

deep wave
jolly oriole
#

list of mods in the mods folder

vocal spire
#
  1. search bar for mods
  2. having a way to search mods by a specific person
    3. taking more inspiration from t mod loader
deep wave
#

me not knowing what tmodloader even looks like

empty ridge
#

hiiii again. i followed the tutorials on the apidocs and i kind of understand things a little better now. i'm able to make a little custom scene and import it as an assetbundle. how could i make it so that it plays my own bgm when i enter the scene?

#

sorry this must seem pretty basic 😞

copper nacelle
#

you can create a gameobject and put an audiosource on it

empty ridge
#

does it output to the audiomixer by default?

copper nacelle
#

you can just set the volume to use like GameManager's audio level

#

there's a method

#

idr the exact name

empty ridge
#

oh dang the music wasnt playing because i forgot to build the scene πŸ˜…

floral furnace
#

GameManager.instance.GetImplicitCinematicVolume()

copper nacelle
#

yeah but / 100f

#

iirc

#

might've been /10f

floral furnace
#

oh wait are you supposed to divide it further

#

i just took the value directly and played it at that volume πŸ₯΄

copper nacelle
#

maybe you don't have to

#

it is divided by 10 already in the method

#

i thought i did

#

oh well

empty ridge
#

worked like a charm, thanks!

copper nacelle
#

np

merry lotus
#

So I've been thinking about slowly learning to mod the game, and I just wanted to double check a couple of things:

  • Are there any "recommended" ways to start learning it?
    I already have https://radiance.host/apidocs/Getting-Started.html#creating-mods bookmarked

  • There's a few pinned messages about using specific versions of Unity, but they specifically reference various asset things (the most recent one from two years ago, says to use Unity 2017.4.10f1). Is this specifically for adding assets to the game, or do I need to change to that version before doing anything?
    (The version of Unity I currently have installed looks to be Unity 2018.4.12f1; so I want to know if I need to change that before I start looking at existing mods).

copper nacelle
#

that's just for asset bundles

#

don't need unity for anything else

floral furnace
#

and steal source code

#

its 95% of the mods free real estate

vocal spire
#

πŸ‘

merry lotus
#

My current plans are just to edit some existing mods for personal use, to help with learning how it all works. So, the code will mostly be stolen lol.
If I want to edit elements that are on the menus, do I need to mess with "asset bundles"?

#

And so, if I'm not doing things with asset bundles, does that mean I don't need to use Unity at all? I can just entirely use IntelliJ? (I know the game uses C# scripts, but I just assumed that I'd somehow need to do something more than just code).

vocal spire
#

if you aren't using assetbundles, no unity is required. if you need assetbundles depends on how you want to go about whatever you're doing. sometimes there's a single way, sometimes there are a bunch.

merry lotus
#

I don't actually know what asset bundles are. Based on the name, I assume that they're assets, like game objects- and I don't plan on adding anything to the game that isn't already in it.

vocal spire
#

Yep

copper nacelle
#

Yeah, basically entirely new enemies/objects/etc

merry lotus
#

Ah. Well that's a huge relief then!

jolly oriole
# empty ridge hiiii again. i followed the tutorials on the apidocs and i kind of understand th...

easiest way t add real BGM: use SFCore

copper nacelle
#

still no license x5fiftPrime

jolly oriole
#

added mit to sfcore, happy now?

copper nacelle
#

I'm never happy

#

but that is nice thank you

jolly oriole
#

np

empty ridge
#

ok so i got most of that right when i tried to use it earlier

#

im guessing i just didnt set some attribute right cuz id enter the collider and the music would just cut out entirely

#

glad to know im not a complete idiot zote thx for the help, i need to sleep now

jolly oriole
#

gn!

jolly jungle
#

Aight anyone knows why my mod doesn't appear in the topleft

jolly oriole
#

technically, every mod dll that has a class derived by Mod should appear in the top left

#

do you have a github repo with that mod so i could take a look at it?

jolly jungle
#

It did, when I started development

#

Then it just disappeared

#

Uh, nop

#

nope

#

I didn't start using github

#

yet

#

I mean to

#

Eventually

marble hollow
#

im running out of ideas

jolly oriole
#

yea ok, do you have a GetVersion method in the mod class?

marble hollow
#

for my customknight

jolly oriole
jolly jungle
jolly oriole
#

does it crash/throw an exception?

jolly jungle
#

Nope, not at all

#

It simply doesn't

jolly oriole
#

can you show the top left corner?

jolly jungle
#

Wait I gtg I'll be back in a minute

#

yeah

#

Anyhow brb

jolly oriole
#

can you give the namespace / name of the mod?

#

it's possible that your mod isn't displayed if a mod loaded after it has the same namespace

jolly jungle
#

Wdym namespace?

jolly oriole
#

nvm, didn't read

jolly jungle
#

Also I'm back btw ||zotewheeze||

jolly oriole
#

but can you give your modlog / output_log?

jolly jungle
#

Oh shit you're right

#

I ahven't checked that in ages

#

And after that it only prints out language keys/strings cuz I hadn't turned that off and I probably should

jolly oriole
#

then probably in output log

jolly jungle
#

Should I just send the file?

jolly oriole
#

yea

#

hm, idk what is wrong then

jolly jungle
#

Oh well

#

Seems like people will just need to forget the presence of the mod tamershrug

ornate rivet
#

how come increasing the scenewidth on the cameracontroller doesnt fix the camera from not following you

jolly oriole
#

cameracontroller has scenewidth?

ornate rivet
#

GameCameras.instance.cameraController.sceneWidth

jolly oriole
#

i just change GameManager.tilemap.width and GameManager.sceneWidth

ornate rivet
#

that makes more sense

jolly oriole
#

and FindObjectOfType<GameMap>().SetManualTilemap(0, 0, width, height);

#

and all that in a On.GameManager.RefreshTilemapInfo

ornate rivet
#

hmm the camera still won't follow past the same spot

#

oh wait

#

yea

#

the camera still stops following at 160,40ish

#
private void GameManagerOnRefreshTilemapInfo(On.GameManager.orig_RefreshTilemapInfo orig, GameManager self, string targetscene)
{
    if (targetscene == DryyaScene)
    {
        Log($"wid {GameManager.instance.sceneWidth} and heigh {GameManager.instance.sceneHeight}");
        self.sceneWidth = 500;
        self.sceneHeight = 500;
        Log($"Tiled wid {self.tilemap.width} height {self.tilemap.height}");
        self.tilemap.width = 500;
        self.tilemap.height = 500;
        FindObjectOfType<GameMap>().SetManualTilemap(0, 0, 500, 500);
    }
    orig(self, targetscene);
}
jolly oriole
#

after orig

#

in orig it sets width

ornate rivet
#

huh so orig doesnt use the value in gamemanager?

ornate rivet
#

alright thanks

jolly oriole
#

np

worn eagle
#

is there any reason the unityexplorer ui won't show up on start?

copper nacelle
#

do you have all 3 of the dlls

worn eagle
#

I do

#

it was working before, it stopped showing up while I was toying around with the main menu

heavy patrol
#

Are there any good examples of how Source codes of mods should be uploaded to git hub?

vocal spire
#

There really isn’t a good example since all of them are basically the same

heavy patrol
#

Fair enough

worn eagle
#

dreading implementing the mitm server

deep wave
#

what exactly changed in newest moddingAPI that appears to have broken everything? and is it worth rolling back the version on installer vesselsip

vocal spire
#

Time to go look at GitHub!

jolly jungle
#

and is it worth rolling back the version on installer :vesselsip:
Probably, for now tamershrug

leaden hedge
#

how exactly is it broken

vocal spire
#

Failed to load stuff

copper nacelle
#

this is so non descriptive

leaden hedge
#

it works for me, with just debug mod installed

deep wave
#

yeah but certain mods like hollow twitch refuse to load

vocal spire
#

Got a modlog?

jolly oriole
#

the thing with decomaster: it initializes its own json thing, with its own settings and still somehow fails

vocal spire
#

Huh

copper nacelle
jolly oriole
#

imma test every commit from the globalsettings one onwards to check which one decomaster can't handle

copper nacelle
#

any git bisect

#

this guy

jolly oriole
#

don't worry, i know what i'm doing

copper nacelle
jolly oriole
copper nacelle
#

why'd you even move the actual add component

jolly oriole
#

because decomaster somehow crashes with the dictionary it preloaded

copper nacelle
#

all my homies do not need to hook gamemanager.awake

jolly oriole
#

but gamemanager also doesn't do shit until main menu is loaded

#

as it doesn't exist at that point

copper nacelle
#

and

#

i don't get it

#

how terrible

worn eagle
#

are there under 255 gameplay scenes in the game

jolly oriole
#

there are nearly 500 total ones, so i doubt it would be under 255 gameplay ones, especially with mods

#

but the decomaster error is really weird, as it's a KeyNotFoundException:

[INFO]:[DecorationMaster] - Loaded Json
[ERROR]:[API] - Error: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
[ERROR]:[API] -   at System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.String,UnityEngine.GameObject]].get_Item (System.String key) [0x00000] in <filename unknown>:0 
[ERROR]:[API] -   at DecorationMaster.ObjectLoader.Load (System.Collections.Generic.Dictionary`2 preloadedObjects) [0x00000] in <filename unknown>:0 
[ERROR]:[API] -   at DecorationMaster.DecorationMaster.Initialize (System.Collections.Generic.Dictionary`2 preloadedObjects) [0x00000] in <filename unknown>:0 
[ERROR]:[API] -   at Modding.ModLoader.LoadMod (IMod mod, Boolean updateModText, Boolean changeSettings, System.Collections.Generic.Dictionary`2 preloadedObjects) [0x00000] in <filename unknown>:0 
[ERROR]:[API] -   at Modding.ModLoader+<LoadMods>d__10.MoveNext () [0x00000] in <filename unknown>:0 
#

hm :/

[WARN]:[API] - Could not find object "Zote Death/Head" in scene "Fungus1_20_v02", requested by mod "DecorationMaster"
worn eagle
#

damn now I have to send one more byte each time a scene changes 😩

worn eagle
#

would it be wise to create a pool of player objects instead of instantiating one every time a player enters the same scene as you to prevent microstutters?

jolly oriole
#

something in the decorationmaster preloads for some reasong depends on gamemanager so hard that it stops existing completely if gamemanager isn't there

#

wait wut

Fallback handler could not load library E:/GOG/Hollow Knight Manhunt/hollow_knight_Data/Mono/data-A84A4010.dll
jolly oriole
vocal spire
#

πŸ‘

sage holly
#

when assetbundling, is there a way to keep the shadders out of the bundle?

#

please ping me when answering

jolly oriole
sage holly
#

is that safe to do? then I'll do that

jolly oriole
#

i have never tested it (i personally don't use assetbundle browser), but according to unity's website it should be safe

sage holly
#

ok

leaden hedge
#

no

#

also wrong channel

empty ridge
#

why is it that when i put my scene into the asset bundle browser, it wont let me put an audio clip in with it?

jolly oriole
#

a bundle can either have scenes or assets in it

#

not both at the same time

empty ridge
#

how come?

jolly oriole
#

unity

empty ridge
#

so its for some godly reason i couldnt comprehend

#

got it

jolly oriole
#

i also don't know why, but unity says so

empty ridge
#

huh

vocal spire
#

No

#

Well

#

I could

#

But I won’t

#

That’s doable by save editing

gilded lotus
hardy stump
#

is there an existing hook that triggers on parry and maybe exposes the enemy you just parried?

#

and related to this, where is parry damage calculated and processed?

prime urchin
#

Is it possible to preload an object which is loaded by a scene but not technically part of it? For reference I'm attempting to get "GG_Challenge_Door_Canvas" which is loaded with the GG_Atrium scene but isn't part of the scene's object hierarchy. I can probably do it manually but I'm wondering if there's a better way.

dark wigeon
#

I think you just have to get those by reference since they don't exist in the scene to GameObject.Find

#

search shows GG_Challenge_Door (4)/Door/Unlocked Set/Inspect, Challenge UI fsm -> Open UI state -> first GameObject param to get a ref to that

#

maybe there's an easier way but that's usually what I do

prime urchin
#

Well, when I'm in the scene I can access it via Resources.FindObjectsOfTypeAll<GameObject>() but it seems that the current preload method just checks the objects within the scene, so I'd have to preload the scene myself to do it this way. I'll see about getting it by reference as you said.

ornate rivet
#

I've asked this question a thousand times and yet I never remember the answer but
What do I do if the player isn't taking input until I go to the pause menu once

#

I've tried RegainControl

vocal spire
#

What changes when the player unpauses

vocal spire
prime urchin
#

Yeah, that works - better than what I was going to do otherwise anyway, hah

worn eagle
#

is there a way to get your public ip address in c#? I've just been creating a web request to a site that gives it to you and parsed the response

copper nacelle
#

that is the way

#

Every other thing seems far more inconvenient

prime urchin
copper nacelle
#

that's nice

worn eagle
#

apparently I triggered a breakpoint in kernelbase.dll

vocal spire
#

I love unknown crashes too, since for some reason doing a foreach with all the doors on a map in among us to close all of them decides to crash

copper nacelle
#

oom

worn eagle
#

I figured, could profiling hollow_knight.exe with rider find anything?

copper nacelle
#

no idea

jolly oriole
copper nacelle
lean ledge
#

what happened there

copper nacelle
lean ledge
#

hollow knight tilt controls

copper nacelle
ornate rivet
#

that moment when the l isn't capitalized

jolly oriole
#

but the I is capitalized

ornate rivet
#

wtf it still spawned left

leaden hedge
#

Hirungolwe L Saleh L

jolly oriole
#

which fsm is that even?

ornate rivet
#

Dream Entry-Control

deep wave
# copper nacelle

hk but your big brother gave you the controller but won't let you sit in his gamer chair

jolly oriole
#

try setting it to true

ornate rivet
#

dideth

#

maybe it doesnt start at the right state

jolly oriole
#

possible

somber cliff
#

In my Start function on Load Scene I am running the following code:

            try
            {
                On.SceneManager.Start += OnSceneManagerStart;
            }
            catch(Exception e)
            {
                Modding.Logger.Log("--------------------------------");
                Modding.Logger.Log("EXCEPTION::::: " + e);
            }

prints: [INFO]:--------------------------------
[INFO]:EXCEPTION::::: System.InvalidCastException: Cannot cast from source type to destination type.

#

Appears to be an issue with version 1.4.3.2-58

#

a friend has version 1.4.3.2-57 and it runs fine on there side.

#

where can i grab the modding api versions to test myself? And does anyone know if anything has changes on the scenemanager start hook?

copper nacelle
#

any stack trace

somber cliff
copper nacelle
#

suboptimal

#

can i have the dll

somber cliff
#

hmmm...

#

can we chat privately...

jolly oriole
#

56, have fun with code from the sanctuary

copper nacelle
#

incredibly interesting

leaden hedge
#

56 will steal your account

ornate rivet
#

wtf I've tried everything and the idiot still spawns on the left side

somber cliff
ornate rivet
#

lmao

ornate rivet
#

facing left

jolly oriole
#

hm

ornate rivet
#

does .faceright not make the knight face right?

jolly oriole
#

i just instantiated wp03's dreamenter, which spawn you facing right

ornate rivet
#

I'm instantiating WD's which also should just face you right

jolly oriole
copper nacelle
#

i mean if you'd like

ornate rivet
#

I would love for 56 to shit on my code

#

he'll fix to too then :)

copper nacelle
#

echprime

#

is a uintptr to a long an invalid cast

jolly oriole
#

don't want to open unity rn

#

nvm

#

but you do have a door transitionpoint in the scene, right?

ornate rivet
#

door1 yea

#

I guess I'll just manually scale it in the end

jolly oriole
ornate rivet
#

it's the same one the scene uses I think

jolly oriole
#

does your transitionpoint have alwaysEnterLeft set?

ornate rivet
#

maybe, I'll have to check

#

good thinking

#

you were right :)

#

thank you

#

I forgot this was the scene where mebi forgot to not delete the door1 so I made my own

copper nacelle
#

-59

somber cliff
#

wait what ?

copper nacelle
#

api

#

updated

#

fixed

#

etc

somber cliff
#

will you have my wifes kids ?

vocal spire
#

πŸ€”

copper nacelle
#

πŸ₯΄

steady comet
#

Maybe a stupid question but why doesn't Ruins1_30 appear in the scene list in the FSM viewer?

#

Oh wait it is a stupid question, it's there but in the wrong order lmao

#

Don't mind me

jolly oriole
safe hamlet
#

done

jolly oriole
#

thanks!

merry lotus
#

api
updated
fixed
etc
Was this update specifically to fix whatever was causing DecoMaster and HollowTwitch to not work? Can I finally delete my macro that posts a link to Zaliant's upload of -57?

Also, is there a place to see changelogs of moddingAPI? I feel like there's a few mods like that that seem to update, but with no mention of what changed, and their github pages don't seem to be up-to-date. (The other that comes to mind is QoL)

jolly oriole
#

well, it does still not work with decomaster, but we know what causes it at least, but that change would give audio fragments, similar to how it was before preloading was muted

#

just tested it btw

merry lotus
#

ah

jolly oriole
ornate rivet
#
public void PlayMusic(AudioClip clip, float vol = 0f)
{
    MusicCue musicCue = ScriptableObject.CreateInstance<MusicCue>();
    List<MusicCue.MusicChannelInfo> channelInfos = new List<MusicCue.MusicChannelInfo>();
    MusicCue.MusicChannelInfo channelInfo = new MusicCue.MusicChannelInfo();
    channelInfo.SetAttr("clip", clip);
    channelInfos.Add(channelInfo);
    musicCue.SetAttr("channelInfos", channelInfos.ToArray());
    GameManager.instance.AudioManager.ApplyMusicCue(musicCue, 0, 0, false);
}

any reason why this wont play my music in the custom scene

#

other sounds work

jolly oriole
#

channelinfos has to be MusicCue.MusicChannelInfo[6], all 6 indizes are needed (null values possible)

ornate rivet
#

hmm I didnt need to do this before

#

so do I just set the first index and leave the rest null?

jolly oriole
#

yes

#

but why do you have a vol parameter if you don't even use it?

ornate rivet
#

the old code had it

#

it still doesnt work

jolly oriole
#

hm

#

do you have an error in either modlog or output log?

ornate rivet
#

nope

#

maybe

jolly oriole
#

that's not important

ornate rivet
#

this is weird, the godhome custom scenes worked just fine

jolly oriole
#

can you log what Log($"Snapshot: {musicCue.Snapshot}") logs as a string?

ornate rivet
#

probably doing/not doing something dumb

#

ok will do

#

tis null

jolly oriole
#

just out of curiosity, which scene do you call that method in?

#

because i think whatever area the method is getting called in, has a audiomixersnapshot loaded which doesn't play the main track

#

and GameManager.instance.AudioManager.ApplyMusicCue for some reason does the same as your volume parameter for the applySnapshot parameter, so your easiest solution is to copy the contents of MusicRegion.FadeIn() (important parts marked)
btw, you get the audiomixersnapshot with the simple line of

var yoursnapshot = Resources.FindObjectsOfTypeAll<AudioMixer>().First(x => x.name == "Music").FindSnapshot("Main Only");
#

@ornate rivet

ornate rivet
#

that makes sense

jolly jungle
#

Quick, what's the easiest way to rewire a boss's FSM to only use one attack?

jolly oriole
#

in the state that makes decisions, manipulate the decision making

#

e.g.

var hkGO = to.Find("Hive Knight");
var hkFsm = hkGO.LocateMyFSM("Control");
var hkFsmVars = hkFsm.FsmVariables;

var srev3_1 = hkFsm.GetAction<SendRandomEventV3>("Phase 1", 1);
srev3_1.events = new FsmEvent[] { FsmEvent.FindEvent("JUMP") };
srev3_1.weights = new FsmFloat[] { 1.0f };
srev3_1.trackingInts = new FsmInt[] { hkFsmVars.FindFsmInt("Ct Jump") };
srev3_1.eventMax = new FsmInt[] { int.MaxValue };
srev3_1.trackingIntsMissed = new FsmInt[] { hkFsmVars.FindFsmInt("Ms Jump") };
srev3_1.missedMax = new FsmInt[] { 4 };

var srev3_2 = hkFsm.GetAction<SendRandomEventV3>("Phase 2", 2);
srev3_2.events = new FsmEvent[] { FsmEvent.FindEvent("JUMP") };
srev3_2.weights = new FsmFloat[] { 1.0f };
srev3_2.trackingInts = new FsmInt[] { hkFsmVars.FindFsmInt("Ct Jump") };
srev3_2.eventMax = new FsmInt[] { int.MaxValue };
srev3_2.trackingIntsMissed = new FsmInt[] { hkFsmVars.FindFsmInt("Ms Jump") };
srev3_2.missedMax = new FsmInt[] { 4 };

var srev3_3 = hkFsm.GetAction<SendRandomEventV3>("Phase 3", 1);
srev3_3.events = new FsmEvent[] { FsmEvent.FindEvent("JUMP") };
srev3_3.weights = new FsmFloat[] { 1.0f };
srev3_3.trackingInts = new FsmInt[] { hkFsmVars.FindFsmInt("Ct Jump") };
srev3_3.eventMax = new FsmInt[] { int.MaxValue };
srev3_3.trackingIntsMissed = new FsmInt[] { hkFsmVars.FindFsmInt("Ms Jump") };
srev3_3.missedMax = new FsmInt[] { 4 };

for hive jump knight

jolly jungle
#

Ah, thanks

#

And then just plug in whatever I feel like

#

Thanks

#

Aight I'll need to continue tomorrow I guess

#

Didn't get to try this out yet

#

Thanks though

worn eagle
#

is there anything else I need to do to create a pool of any gameobject besides .CreatePool()?

#

when I spawn a pooled object I get this stack trace, even when I add an ActiveRecycler component to it:

System.NullReferenceException: 
[INFO]:  at (wrapper managed-to-native) UnityEngine.GameObject:GetComponentFastPath (System.Type,intptr)
[INFO]:  at UnityEngine.GameObject.GetComponent[ActiveRecycler] () [0x00000] in <filename unknown>:0 
[INFO]:  at ObjectPool.orig_Spawn (UnityEngine.GameObject prefab, UnityEngine.Transform parent, Vector3 position, Quaternion rotation) [0x00000] in <filename unknown>:0 
[INFO]:  at ObjectPool.Spawn (UnityEngine.GameObject prefab, UnityEngine.Transform parent, Vector3 position, Quaternion rotation) [0x00000] in <filename unknown>:0 
[INFO]:  at ObjectPoolExtensions.Spawn (UnityEngine.GameObject prefab, Vector3 position) [0x00000] in <filename unknown>:0 
jolly oriole
#

ObjectPool.CreatePool(gameobject, 1); doesn't work?

#

oh, .CreatePool() is an extension, idk if it's because that, may be worth testing

#

mhm, shouldn't nullreference

worn eagle
#

same issue with regular ObjectPool.Spawn()

jolly oriole
#

one workaround i could see is to copy all fields of an existing ActiveRecycler to the custom one

#

and if that doesn't help i'm completely out of ideas

mellow shore
#

hey folks, can anyone here help me figure out FSM viewer? (thanks grenade)

#

for the geo rock--what does final payout here mean?

leaden hedge
#

see where its read, one of the states will have an intcompare

#

or some other action that reads an int

mellow shore
#

ah... i don't know what this means

leaden hedge
#

when you click on the boxes, and you have state selected instead of variables

#

it'll list what that box does

#

one of them will do something with final payout

heavy patrol
#

Dumb question, how do I replace the Unknown in "MyMod: UKNOWN" where mods are displayed in the menu screen

worn eagle
#

override GetVersion

heavy patrol
#

Thanks!

jolly oriole
jolly jungle
#

i.e. the amount that drops when it destroys itself?

jolly oriole
#

Names of the fsm variables, but yes

heavy patrol
#

So I've been trying to write some code relating to FSM's, but I keep running into the issue of "PlaymakerFSM" could not be found, even though I have referenced ModCommon.dll, and used Using ModCommon.Util

#

Is there anything simple I'm missing?

jolly oriole
#

reference PlayMaker.dll which is next to the other unity dlls from the game

heavy patrol
#

Yes, thank you so much!

jolly oriole
heavy patrol
#

Haha, feels bad

#

At least people can use it now lol

mellow shore
#

thanks grenade!

jolly oriole
#

Np

ornate rivet
#

I'm returning from a custom scene and want to do the whole lying down animation so I was using the knight's "Dream Return" fsm, the animation plays just fine but the knight can be moved around even while they are lying down.

#

The fsm does go through a state that does relinquishctrl so idk why

worn eagle
#

If I have a mod that uses vasi that's gpl3 and distribute the dll to a few friends, does that mean i have to make the source public and gpl3 as well?

jolly oriole
#

(depending on what you need from vasi, you could just use modcommon, which is MIT)

copper nacelle
#

you're supposed to distribute the source w/ the dll

#

i can change that tbh

#

i don't care

#

mpl is better for a lib

worn eagle
#

oops

copper nacelle
#

i still do not care do what you want

worn eagle
#

and muh modcommon bloat

copper nacelle
#

modcommon's fsmutil is like 80 versions behind but it's a breaking change so i won't touch it

ornate rivet
#

rip I still use it

jolly oriole
#

that's the thing with fsm.GetAction<T>(...), right?

copper nacelle
#

yeah

jolly oriole
#

then i also use that

copper nacelle
#

i'm sorry for your loss

#

like this

#

resizes the array bigger

ornate rivet
#

lmao

floral furnace
#

if u read the .net docs ur lame

jolly oriole
copper nacelle
#

as πŸ₯Ά

jolly oriole
#

or do you want the old c style cast?

copper nacelle
#

idk what you're doing

#

but as won't throw and you'll nre yeah

jolly oriole
#

i'm not that much into code conventions: with a cast, is a space between the bracket and the orig value after ok? vs removes that automatically so i'm unsure

copper nacelle
#

i do (Type) thing

#

preference

worn eagle
#

same

copper nacelle
#

i made vasi mplv2 now btw

worn eagle
#

noice

jolly oriole
# jolly oriole neat

making it part of sfcore, just so i don't have to copy the file into every mod

copper nacelle
#

another version frogchamp

jolly oriole
#

nah, gonna pump every util i ever used in my mods in it before opening yet another pr

jolly jungle
#

Why are they called Cores?

copper nacelle
#

no i mean another fork of fsmutil

jolly oriole
#

oh

#

oh right, there was a bit of fsmutil in the api, right?

#

hm, i thought i saw something like that

copper nacelle
#

no

jolly oriole
#

but then i can also have stuff like gameobject.FindGameObjectInChildren("name")

jolly oriole
ornate rivet
#

core because it's a core mod, important for other mods

leaden hedge
#

imagine calling anything descriptive

#

if i made a utility mod for my code, i'd probably call it code.dll Kappa

ornate rivet
#

best name tbh

jolly oriole
#

mod: mod.dll
core mod: core.dll
other mod: code.dll
other core mod: helper.dll

#

and every last piece of content in those is obfuscated to hell and back

worn eagle
#

what happens if two mods share the same name

leaden hedge
#

apparently i don't even need to obfuscate, canvasutil is black magic according to some Kappa

#

if the name before : Mod is the same

jolly oriole
#

file name: impossible, windows/modinstaller will overwrite the first one with the second
namespace: works fine as long as classname is different
namespace & class name: typename error i think

leaden hedge
#

then one of them doesn't load

#

might be both dont load

worn eagle
#

canvasutil has been pretty useful

#

would be better if you could set fadein and fadeout speed to match that of qol but you couldn't have known that it would've existed ahead of time shermaU

stone elm
#

Is the rando logic documented somewhere? I know it's in the mod repo in XML, I was just looking for any sort of primer to help me understand any semantics there. Is my only course of action to look at the code and semi-reverse-engineer it?

steady comet
stone elm
#

I disagree on "it's fairly self-explanatory". I can grok a lot of it by looking at it but the actual meaning of the elements isn't noted anywhere. I know the code deserializes the XML and I could try to use that as context, that's what I mean by 'semi-reverse-engineer'. For example: what does the action element mean here? https://github.com/homothetyhk/HollowKnight.RandomizerMod/blob/master/RandomizerMod3.0/Resources/items.xml#L11

What about areaLogic vs. itemLogic? Why are they the same, what could they mean?

I'm not asking for direct answers to my questions, just wondering if there's some place in which they have already been answered that I can refer to. Otherwise I'll just put in the time and effort to figure it out, I don't want to bother someone to hold my hand. πŸ™„

steady comet
#

Oh I see. I mean I assumed you were just talking about the logic (which IMO refers to the parts which tell the randomizer where it's allowed to place items), rather than the other data. AFAIK there isn't anything documented anywhere tamershrug

young walrus
#

area, room, and item are the different modes of randomizer, so they requires slightly different logic in some cases

#

especially with room rando, b/c you can be put directly into that item's room

#

the actual item logic is just this line

stone elm
#

Okay, that gives me a lot of context, thanks @young walrus. It seems best bet is to spend the time looking through it all and asking questions here if it comes down to it.

young walrus
#

this line is for crystal heart

#

>Upper_Crystal_Peak + (SUPERDASH | (CLAW + (DASH | WINGS | AIRSTALL)) | (WINGS + SHADESKIPS))

#

upper crystal peak is just a custom variable that says you can get to upper CP. similar to "right city"

#

a way to simplify the logic chains

#

so to get to CH, you need to get to upper CP. plus one of the other conditions

#

| means or. + means and

stone elm
#

Got it. Is Upper_Crystal_Peak defined in another file?

steady comet
#

(For room rando, waypoints aren't a thing so it just uses macros in macros.xml)

#

In some cases you basically just have to figure out where the waypoints refer to - for instance it isn't necessarily obvious without looking at how they're used that "Upper_Basin", "Mid_Basin" and "Lower_Basin" refer to the bottom of the broken elevator, outside the lower tram and the basin toll bench respectively

stone elm
#

Okay, that'll have me back here asking questions probably but it's good to know.

jolly jungle
#

Aight, I need help finding the location of the Hive Knight's Globs

#

Their "location" is somewhere at the bottom of the screen, although I think it's at the right x-value

#

I'll send more when my pc unbluescreens itself

#

But basically yeah

#

If anyone has any ideas please tell

jolly oriole
#

it's probably either somewhere in its fsm, or if it says something with spawnfromglobalpool, it can be spawned in a similar way

jolly jungle
#

Wdym spawned?

#

I'm pretty sure it's the same three globs the whole fight, with the actual object staying offscreen somewhere

#

Damnit

jolly oriole
#

i have no idea

copper nacelle
#

they're recycled

#

oh wait no globs not bees

#

idk about the globs

jolly jungle
#

Ooh wait what

#

Wdym the bees are recycled?

copper nacelle
#

it's just the same bees

#

if you kill them or they go off screen they deactivate until they're put at the top again

jolly jungle
#

Ah, yeah, makes sense

quick garden
#

uhh, sorry, but where can i instal gun mod, i can't find it pinned

young walrus
#

on the installer

#

this channel is for making mods

quick garden
#

sorryyy

deep wave
empty ridge
#

So uh, how do i add enemies to my scene?

jolly oriole
#

preloading them, then instantiate

#

or you do the painfull task of remaking them

ornate rivet
#

dont forget to set active and set their position to next to you lol

#

and sometimes you might have to edit the fsm, especially for bosses

empty ridge
#

cool, i'll see what happens

#

does the same go for things like benches and geo rocks?

ornate rivet
#

yea

#

geo rocks should be easy

worn eagle
#

are there hooks to when a player presses an input key/button?

#

or do I have to poll for them?

jolly oriole
#

afaik you have to poll

worn eagle
jolly oriole
#

but you could make your own "hook", with coroutines

prime urchin
#

You could hook the action's IsPressed property

leaden hedge
#

IsPressed is the poll

#

that the game does, so it only gets ran when the game itself checks for an input

prime urchin
#

It's kinda the closest there is afaik if you want a hook but yeah, it's effectively the same thing

empty ridge
#

ok so i tried to preload a bench and my mod failed to initialize

#

is there something wrong with this? public override List<(string, string)> GetPreloadNames() { return new List<(string, string)> { ("Crossroads_47","Restbench") }; }

#

besides formatting lol

empty ridge
#

ok nvm, had the wrong asset name...

#

didnt know it was caps sensitivesoulpensive

nimble lake
#

when a new mod is out
:modders:

jolly oriole
#

thanks for reminding me to make a repo for CustomBgm

nimble lake
#

np hollowknice

jolly oriole
worn eagle
#

I haven't played many fighting games, so I have to ask: are the number of anticipation frames for an attack in hk comparable to that of a fighting game?

jolly oriole
#

i would say comparable, but faster

copper nacelle
#

should ask Katie

worn eagle
copper nacelle
#

has cyclone

stray vault
#

yes

vocal spire
#

has cyclone

mystic folio
#

Hey, so I wanna replace the font sprites in Hollow Knight to recognize more non-English characters. Using TextMeshPro, what kind of file do I want from Unity exactly and would I get it into Hollow Knight?

vocal spire
mystic folio
#

Well, I know what font Hollow Knight uses - Perpetua. I wanna generate a new font sprite for that would also include these characters: Ε™Ε₯ΔΕ―ΕˆΔ›Δ; but I am unsure how to properly put it inside Hollow Knight. Do I want TextMeshPro to generate the whole custom .asset file and then somehow merge it with Hollow Knight?

vocal spire
#

I don’t know how fonts are stored, but if you mean replacing the game’s files, not exactly the modern way of modding

#

I assume once you’ve created the font or something you’d need to assetbundle the font, then replace the original font at runtime or something

mystic folio
#

If I could replace the font through the Modding API and not by replacing it original game files, that would be great. I'll use whatever I can get working.

pure nova
#

What would be the best to way to change all of one enemies' FSMs? Like say I wanted to edit every crawlid in the game, what would be the way to go about doing it?

copper nacelle
#

prob just do name contains on scene load

worn eagle
#

so I'm trying to handle generic types for writing to packets and I'm wondering if this kind of implementation is alright

public void Write<T>(T type, object value) where T : Type
{
    if (type == typeof(byte))
        Write((byte) value);
    else if (type == typeof(byte[]))
        Write((byte[]) value);
    ...
    else if (typeof(IEnumerable).IsAssignableFrom(type))
    {
        Type listType = value.GetType().MakeGenericType(new[] {type});
        Write(listType, ((IEnumerable) value).Cast<object>().ToList());   
    }
    else
        Log($"Writing to a packet with a value of type {type.Name} is not supported.");
}

with the last branch handling lists:

public void Write<T>(T elementType, List<object> list) where T : Type
{
    foreach (object element in list)
    {
        Write(elementType, element);
    }
}
copper nacelle
#

why are you generic over T : Type and then have a T passed in

worn eagle
#

I'm not experienced

copper nacelle
#

pretty sure you want just <T>(T value)

#

if you want type comparisons you can do typeof(T) == typeof(byte)

worn eagle
#

alright

copper nacelle
#

there's also the alternative of (value is byte)

#

idk which one is faster

worn eagle
#

My aim is to use reflection to get some PlayerData fields and send them over to clients

prime urchin
#

You could even do something like

switch (value)
{
    case byte b:
        Write(b);
    // other cases...
}

which may or may not be more convenient

copper nacelle
#

yeah

#

if you're going to reflect over fields then you want just the is or the switch

#

no point in the generic because it'll be just invoked with an object

#

why are you thinking me zaliant

#

so racist

worn eagle
#

oh I forgot to give a name to the var

#

thats why the switch didn't work

#

Maybe I should provide a big picture explanation of what I'm trying to do

empty ridge
#

so i've gotten the geo rock and bench into my scene. i tried to do the same with a primal aspid and it worked.... but it just sits there flying.

#

what gives

pure nova
empty ridge
copper nacelle
#

i mean like ```cs
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += SceneChanged;

void SceneChanged(Scene from, Sceene to) {
foreach (var go in UnityEngien.Object.FindObjectsOfType<GameObject>()) {
if (!go.name.Contains("Crawler")) continue;

 // do what you want

}
}

worn eagle
#

poll for inputs in monobehaviour attached to knight
send inputs to server, server sends them to clients
inputs are saved to a queue in a script similar to herocontroller minus singleton bs and attached to remote player object and processed there

#

Maybe a better question for Katie to answer

copper nacelle
#

inputs :monkaUMEGA:

#

if you drop packets that'll desync terribly

copper nacelle
#

np

worn eagle
#

Isn't that where prediction would come in?

copper nacelle
#

idk

#

i remember firzen linked me something on it

#

if you want that

worn eagle
#

If you can afford to look for it

deep wave
#

yes, it's called Hollow Point on the installer

white terrace
#

oh sorry

worn eagle
#

I'm understanding a bit better what Katie meant by recreating the knight

#

Still a bit hazy on which parts exactly tho

#

hc, pd, heroanimctrler, heroaudioctrler prob, and all the fsms prob

jolly oriole
#

is the rollback then based on the players fps or the fixedupdates?

worn eagle
#

idk yet

jolly oriole
#

ig fixedupdate is better, as that is 60 times per second regardless of hardware (maybe lower when toaster)

worn eagle
#

not sure if the List case is handled correctly

jolly oriole
#

if i read this correctly, the list case will never happen as List<int> would be checked for the type List<List<int>>

prime urchin
#

I'm not entirely sure - I want to say no, but it's something to test. Alternatively, you could make an (IEnumerable<T> value) overload for the method and then just loop over and call the original Write for each item

pure nova
pure nova
#
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += SceneChanged;

void SceneChanged(Scene from, Sceene to) {
  foreach (var go in UnityEngien.Object.FindObjectsOfType<GameObject>()) {
     if (!go.name.Contains("Crawler")) continue;

     // do what you want
  }
}```

How would I "assign" a gameobject var to what it selects?

prime urchin
#

Well, if the 'if' statement is false, that means the 'go' variable from the loop has a GameObject that contains the name of "Crawler". You just need to assign 'go' to a GameObject variable in your class like so.

GameObject crawler;

void SceneChanged(Scene from, Scene to) {
  foreach (var go in UnityEngine.Object.FindObjectsOfType<GameObject>()) {
     if (!go.name.Contains("Crawler")) continue;

     crawler = go;
     break;
  }
}
errant geyser
#

Hey, sorry that this is rather offtopic, but this seems to be the only channel with devs around.

Does anybody have resources on how the HK autosplitter works? I know what a pointerpath is, but I'm not sure about the specifics like how an entrypoint is found.
My motivation is that I don't own a PC and have to make that stuff work on linux; this makes it a bit hard to figure things out, especially since I have no clue about unity internals and what translates from dotnet in windows to the mono implementation and what not.
I know C#, how to decompile the IL, and how to use gdb, if that helps.

deep wave
#

livesplit doesn't exist on linux, so its basically accepted that the autosplitter won't work

vocal spire
errant geyser
#

This is not entirely true, there are efforts to create a cross-platform lib.
Which is why I kind of want to see if I can write something on my own

#

I think I found the right sections in the github repo tho, it uses hex patterns, thanks Jamie

pure nova
# vocal spire Are you trying to edit all of them

Yes. What Unordinal described worked, but only sometimes. It's wildly inconsistent. Sometimes they change, sometimes they don't. Sometimes if I use a different scene transition whether or not they change differs. Sometimes it doesn't matter. It's odd.

#

My code is meant to make the Crawlid bigger, give it more health, and make it faster, which I deem is enough for it to be good enough practice. Here is my code:

void SceneChanged(Scene from, Scene to)
        {
            foreach (var go in UnityEngine.Object.FindObjectsOfType<GameObject>())
            {
                if (!go.name.Contains("Crawler")) continue;

                GameObject crawler = go;

                //Makes the crawlid big.
                crawler.transform.localScale *= 1.5f;
                
                //Lifts the crawlid up a little so it doesn't clip.
                Vector3 position = crawler.transform.position;
                position.y += 1.0f;
                crawler.transform.position = position;

                //Gives it more health.
                crawler.GetComponent<HealthManager>().hp = 40;

                //Makes it faster.
                PlayMakerFSM fsm = crawler.LocateMyFSM("Crawler");
                fsm.GetAction<WalkLeftRight>("Walk", 1).walkSpeed = 8f;
                fsm.GetAction<WalkLeftRight>("Maintain", 0).walkSpeed = 8f;
                fsm.GetAction<WalkLeftRight>("Start R", 0).walkSpeed = 8f;
                fsm.GetAction<WalkLeftRight>("Start L", 0).walkSpeed = 8f;

                break;
            }
        }```
For some reason, it is only inconsistent in whether or not it changes when the FSM part is present. But it gets even weirder, (at least to me, it might make complete sense to you). It also affects whether or not it is big and has more health, even though both don't use FSM whatsoever.
#

Apologies for the wall.

winter quail
#

is there a way to make custom knight textures quickere than manually editing each one

knotty monolith
#

copy and paste zote

winter quail
#

yeh but their not all the same :/

prime urchin
pure nova
#

Then I assume the one it does is the one closest to where it loads in.

deep wave
#

doubt that proximity would make a difference to what order FindObjectsOfType returns

copper nacelle
#

so you have like GameManager.instance which is static and then you can get to any of the classes it has on fields by adding the offset of the field and then dereferencing

#

and repeat

#

which is the path part

#

If cheat engine's "mono disassembler" or whatever works on Linux then you can use that to get addresses and offsets very easily

#

besides that the other thing you'd need to change are the memory reading functions because they p/invoke winapi

#

if you have any other questions feel free to ping me

copper nacelle
#

oh yeah and the entry point is based on that

#

There's a pdf devil has

potent dirge
worn eagle
#

getting some weird values with reflection

data = new ExchangeData();
var pd = PlayerData.instance;
List<string> fieldNames = pd.GetType().GetFields().Select(fi => fi.Name).ToList();
foreach (FieldInfo fi in data.GetType().GetFields())
{
    if (!fieldNames.Contains(fi.Name)) continue;
    Log("FI Name: " + fi.Name);
    Log("FI Value: " + Mirror.GetField<PlayerData, object>(pd, fi.Name));
    //Mirror.SetField(data, fi.Name, Mirror.GetField<PlayerData, object>(pd, fi.Name));
}

ExchangeData being a non singleton ver of PlayerData

[INFO]:[Hero Tracker] FI Name: version
[INFO]:[Hero Tracker] FI Value: 1.4.3.2
[INFO]:[Hero Tracker] FI Name: playTime
[INFO]:[Hero Tracker] FI Value: PlayerData
[INFO]:[Hero Tracker] FI Name: completionPercent
[INFO]:[Hero Tracker] FI Value: PlayerData
[INFO]:[Hero Tracker] FI Name: openingCreditsPlayed
[ERROR]:[UNITY] - NullReferenceException: Object reference not set to an instance of an object
#

my bad, completely flooded your post

copper nacelle
#

if you're looping using fieldinfos there's a function which takes those directly

#

the nre is weird

#

idk if i handle boxing

#

i'll look at it

vocal spire
copper nacelle
#

I didn't get an NRE but I did get an InvalidCastException

worn eagle
#

getting pd fields?

copper nacelle
#

getting openingCreditsPlayed as an object instead of a bool

worn eagle
#

hmm from what I've read c# primitives inherit from ValueType which inherits from System.Object/object

copper nacelle
#

they're structs

#

but structs have an implicit inheritance from valuetype

#

but like they aren't obj references for the most part

#

that's usually handled by auto-boxing

#

Oh and the nre might be it throwing on .ToString

#

i assume you want decent performance for this yeah?

worn eagle
#

that'd be optimal

#

boxing/unboxing is pretty expensive yeah

copper nacelle
#

yes

#

optimally i think this would be a source generator thing

#

if there's not a huge number of fields that you want to actually exchange then it'd be significantly more performant to do this by hand

worn eagle
#

I was afraid I'd have to do that

copper nacelle
#

don't have to

#

just performance wise it's a decent difference

#

i wonder if there's a way to exchange generically

#

because the problem is the field iterations is at runtime so it can only call the getfield as an obj

#

Oh

#

I have a terrible idea

#

Gimme a bit

jolly oriole
#

terrible ideas are nice

worn eagle
#

is it a good idea to JsonConvert pd and send that large string in a packet

copper nacelle
#

no

#

pd has so much garbage on it

worn eagle
#

I should've said exchangedata

#

which will only have the fields necessary to build a player

copper nacelle
#

that doesn't seem terrible but i don't do servers

worn eagle
#

I planned on writing all the fields of exchangedata to a packet on their own but was having trouble generically handling collections so grenade suggested jsonconverting the class

copper nacelle
jolly oriole
#

maybe the entire data needed to transfer

#

oh fuck, the first two aren't even needed

potent dirge
#

Are you working on multiplayer?

worn eagle
#

prob gonna need stuff like has[NArt] too

#

yeah

potent dirge
#

Isn't coordinates in playerdata, unintuitively enough?

#

Or at least shade zone and stuff

jolly oriole
#
class ExchangeData
{
    int health;
    int maxHealth;
    int healthBlue;
    int joniHealthBlue;
    int nailDamage;
    int nailRange;
    int fireballLevel;
    int quakeLevel;
    int screamLevel;
};

i mean, the things with has{whatever} cann/will be set by local code and just the animations get synced

worn eagle
potent dirge
#

Maybe it was changed from 1221 to 1432, but I swear I saw a ton of stuff in pd that made no sense to be in there but there it was πŸ₯΄

#

Could be wrong on player coords tho lol

jolly oriole
#

only postitions in playerdata are

- Shade position on the map
- Dreamgate postition on the map
- Positions of the customizable map pins
#

which are also the same fields that json.net can't read and displays as (0, 0, 0)

worn eagle
#

newtonsoft can't read vector3s?

potent dirge
#

LUL amazing

jolly oriole
#

no, only with custom jsonconverters, but for all unity types that would be another thing bundled in the api

worn eagle
#

guess I'm removing any vec3s from exchangedata

#

I'm still gonna need many of the fields from pd if I'm gonna be simulating a copy of the knight entirely

#

what is marm

#

there's a marmConvoNailSmith bool

copper nacelle
#

50k clones

#

first one is copy-paste second one is dynamic

#

might throw it in vasi

jolly oriole
#

would be the language string RELICDEALER_NAILSMITH

jolly oriole
copper nacelle
#

more merging x5fiftAleph

#

It's already way too big

#

Merging was a mistake

vocal spire
#

πŸ€”

copper nacelle
#

wtf

#

Don't think me

#

I'm right it's fucking 15mb

#

And you can't even search the modded version because of merging hooks in

jolly oriole
#

wait what

#

the whole modding api? or just the converers?

copper nacelle
#

modding api

jolly oriole
#

hm i think i'll look if i can "get inspired" to just do vector3 converters

copper nacelle
#

it's mit just rob it

leaden hedge
#

you dont need to send max hp or jonis max hp, or both jonis and current hp

#

just how much hp they have right now

#

you also don't need 3 ints for fireball level, quake level, scream level
either use 6 bools or 1 short
i guess a short you could do 1 bit for mark of pride, longnail, vs, ss, scream, shreik, ddive, ddark

#

which does 4 of those ints in one quarter the space

worn eagle
#

so jsonconvert bad?

copper nacelle
#

json is not particularly efficient

leaden hedge
#

if you know the bit format of the packet you don't need identifiers

#

and you also don't need 128 bits to send 8 bits of data

#

not including the string to id it

#

which would be like another 1000bits just for that struct

worn eagle
#

guess I'll have to crunch through bit shifting

leaden hedge
#

you can make an array of bytes

jolly oriole
#
[ERROR]:[API] - Failed to read save using Json.NET (GameManager::LoadGame), falling back.
[ERROR]:[API] - System.InvalidCastException: Failed to read type 'Vector3'. Expected object start, got 'StartArray' <>
[ERROR]:[API] -   at Modding.JsonConverters.PartialConverter`2[UnityEngine.Vector3,System.Single].InternalReadJson (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.JsonSerializer serializer, Boolean isNullableStruct) [0x00000] in <filename unknown>:0 

good thing to test it before

leaden hedge
#

and make a function like

public byte makebyte( bool[] b ){
  byte out = 0 ;
  for(int i = 0; i < 8; i++){
    out += b[i] * (1 << i-1);
  }
  return out;
}
#

why did i type that as bit FeelsOkayMan

#

and to get them out you do something like

public bool[] getbits( byte b ){
  bool[] out = new bool[8];
  for( int i = 0; i < 8; i++){
    out[i] = b & ((1 << i-1)) != 0
  }
  return out;
}
#

i guess you could use bit shifts to do the multiply in the other function too

#

probably faster

#

also you wouldnt send a full vector3 anyway

#

as the knights depth is known by the local player

#

so you only need to send x and y position

worn eagle
#

fortunately I've been doing that for spawning players

leaden hedge
#

you could probably store position in one float by doing jank

#

and losing a slight amount of precision

#

by doing float pos = ypos * widthofroom + xpos

copper nacelle
#

if pow 2 doesn't emit a shift I'd be shocked

worn eagle
#

this code is gonna be so indecipherable feelspkman

leaden hedge
#

although you'd probably need some extra data for that to work

#

at which point its probably worth just doing it as halfs

worn eagle
#

which pd fields should we keep?

#

if we're going to be simulating all remote players i wrote the controller attached to them to be more or less the same as herocontroller

#

and each player is a clone of Knight minus herocontroller, heroanimationcontroller, heroaudiocontroller, converyormovementhero, all fsms, and vignette

prime urchin
#

Bleh, I've just learned that in Unity you should use == when checking for null and not is. There's a bit of time down the drain, hah.

#

I guess I should make use of the implicit conversion to bool after all

copper nacelle
#

Yeah it's shit

#

Can't use ?? or ?. or is for nulls

prime urchin
#

Yeah, I almost regret using nullability features in this now - fun times

#

I forgot what it was like to write C# without ?? and ?.

jolly oriole
#

fuck newtonsoft, gives me "Integer": "0"
and if i try to (int) reader.Value, i get a fucking System.InvalidCastException: Cannot cast from source type to destination type

copper nacelle
#

any int.Parse

jolly oriole
#

my bad for the presentation of it, but it's a simple int as an object, i just logged it with " around

copper nacelle
#

Convert.ToInt32

jolly oriole
#
Tclass ret = ReadJson(token, (Tclass) existingValue);

how is this a NullReferenceException?

copper nacelle
#

existingValue is passed in as what

jolly oriole
#

technically it should be a Vector3

#

or should i just pass it as an object?

copper nacelle
#

it's probably boxed or something if it's nreing

#

idk

#

i'd try object

jolly oriole
#

ig this worked

#

with object

copper nacelle
#

gg

jolly oriole
#

and if it wasn't already obious, i made the custom converter myself, as all others either wanted values as a list (???) or didn't want to accept vector3s in a list

#

i guess i also make the change back with the point of loading mods, so that decomaster, hollowtwitch and maybe a few others work again

#

oh fuck, i also have to test saving

#

works pog

#

now only to add the other 50 types of unity

copper nacelle
#

i mean are the other 50 even used in pd

jolly oriole
#

not in pd, but i think i'll help others a bit if i also include stuff like vector2

copper nacelle
#

vector2 seems reasonable

#

idk if i'd bother with the rest

#

but you do you

worn eagle
#

Cloth component serialization pog

jolly oriole
#

isn't that already serializable because it's a component?

#

you really want the cloth component?

#

cloth should work with just a converter for vector3's added

prime urchin
#

got the Microsoft.Unity.Analyzers but it apparently doesn't check for 'is null' and 'is not null' so I guess I'm stuck manually find and replacing

copper nacelle
#

just regex

jolly oriole
#

πŸ‘ it πŸ‘ just πŸ‘ works πŸ‘

copper nacelle
#

do you even need the patch for StartManager

#

or was that to avoid the like 8 year cutscene at the start

#

it was to avoid the 8 year cutscene

#

good ol git blame

#

merged

jolly oriole
#

poggers

copper nacelle
jolly oriole
#

... i may or may not have not added the docstring things

copper nacelle
#

do you need the set

#

echaleph

#

is there a reason for existingValue existing

jolly oriole
#

in case one would like to add stuff / the not replace thing

#

so currently no

copper nacelle
#

was the private set supposed to be there

#

for the converter types

#

because it is a dead setter

worn eagle
copper nacelle
#

set the bit based on bool value

#

if you have b[i] as true (i.e. 1) then you put a 1 in the spot

#

multiplication would be convenient because 0 would cancel it out

#

doesn't work as well in c# where you can't cast bools to ints

#

the 1 << (i - 1) puts the 1 i-1 bits into the byte

worn eagle
copper nacelle
#

yeah

worn eagle
#

oh it was just pseudocode

copper nacelle
#

i'd just do @out += b[i] ? (1 << (i - 1)) : 0;

#

i mean it'd work in like c

#

i gotta say return 0 instead of throwing really is not the play

worn eagle
#

yeah that's true

copper nacelle
#

shouldn't it be << i

worn eagle
#
public static byte MakeByte(bool[] b)
{
    int bLength = b.Length;
    if (bLength >= 8) throw new Exception($"Cannot create a byte from a bool array of length {bLength}");
    byte @out = 0;
    for (int i = 0; i < 8; i++)
    {
        @out += (byte) (b[i] ? (1 << i) : 0);
    }
    return @out;
}
public static bool[] GetBits(byte b)
{
    var @out = new bool[8];
    for (int i = 0; i < 8; i++)
    {
        @out[i] = (b & (1 << i)) != 0;
    }
    return @out;
}

this look like it'd work?

copper nacelle
#

yeah

#

do like invalidoperationexception though

#

could skip the cast if you iterate with a byte instead of an int

#

dunno if that actually changes the assembly

worn eagle
copper nacelle
#

1b

#

nvm there's not a byte literal

#

terrible

worn eagle
#

guess I should handle other data types too

#

no idea how im gonna handle things like naildamage which players might have set to 999 through debug

jolly oriole
#

either only account for the vanilla range or use what's availablefrom the 32bit integer (so 31 bits), but i guess only allowing 12 bits is enough, as one could get 4095 naildamage with that

prime urchin
#

You could use something like LEB128 if you really wanted

#

probably not worth the effort

#

actually I might have an implementation of it somewhere here if that's something you're interested in, gimmie a sec

#

Usage is just LEB128.GetBytes(integer) to convert to bytes and LEB128.GetSigned(bytes) or LEB128.GetUnsigned(bytes) to convert back

copper nacelle
#

so it double loads

jolly oriole
#

oh ufkc

copper nacelle
#

wait no

#

it's not even supposed to load menu in the modloader

#

that was moved in during the first move

#

suffering

jolly oriole
copper nacelle
#

i'm fixing it

jolly oriole
#

poggers

copper nacelle
#

this is not it

jolly oriole
#

it's not supposed to look like that, right?

copper nacelle
#

yeah

jolly oriole
#

though i quite like the double or triple text the first few lines

vocal spire
#

πŸ€”

#

I thought it always was supposed to look like that

jolly oriole
#

so uhm

#

i have a screenshot

#

though i have to test if i'm limited by 3.5 GB

jolly oriole
#

@vocal spire uuwuu failed to load:

[ERROR]:[API] - Error: System.MissingMethodException: Method not found: 'FrogCore.JournalHelper.AddJournalEntry'.
[ERROR]:[API] -   at Modding.ModLoader.LoadMod (IMod mod, Boolean updateModText, Boolean changeSettings, System.Collections.Generic.Dictionary`2 preloadedObjects) [0x00000] in <filename unknown>:0 
[ERROR]:[API] -   at Modding.ModLoader+<LoadMods>d__9.MoveNext () [0x00000] in <filename unknown>:0 
#

meanwhile i didn't get much over 4 GB

vocal spire
#

fine I'll fix frogcore on the installer

#

*one day

jolly oriole
#

i just need to utterly hug ram, can't be that hard

vocal spire
#

hmmm

#

load some among us mods

#

oh wait nvm

#

forgot that the initialize is completely different

#

i be dumb

jolly oriole
#

i think i'll settle for a GB of ints

vocal spire
jolly oriole
#

memoryHugger = new int[268435456];

vocal spire
vocal spire
jolly oriole
#

no, a GB of int values

vocal spire
#

k

jolly oriole
#

YES

vocal spire
#

cool

#

I'm currently trying to take a screenshot at runtime(very fun)

#

except in code

#

it's working out and not working out

jolly oriole
#

6.1 GB poggers

ornate rivet
#

ok but I bet most hk players have 8 gb ram max

jolly oriole
#

also requires some rather unique methods

#

4 GB over 4 arrays is fine, but 4 GB in a single array is too much

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

makes sense

jolly oriole
#

seems to work fine as long as the memory used per array is <=2GB

jolly oriole
#

oh my god, pressgtodab criples my fps from 900 to 300

worn eagle
#

tf

jolly oriole
#

will probably also break if one save&quits

worn eagle
#

all it does is add an anim to the knight's anim library and poll for key down G

jolly oriole
#

nah, before the knight is loaded it checks every frame if the instance isn't null anymore, which utterly breaks on save&quit as the knight GO gets destroyed

worn eagle
jolly oriole
#

but i can change that if you'd like

vocal spire
#

F

#

Hook update on HeroController or something

#

Smh my head

jolly oriole
#

used awake, as it's better

merry lotus
#

If you're updating Press G to Dab, then possibly add a config file to change the key?
Granted, I'm unsure how tedious that is.

jolly oriole
#

i have no idea how i'd do that, but i'll look

#

will probably steal code from debugmod

worn eagle
#

putting effort into a shitpost mod

patent zealot
#

Oh my god

#

I had crystal blobbles, gatling aspid and g to dab this whole time...

#

Thats cursed

merry lotus
#

At a basic level, I'd assume you could just read a single line of a text file. The config could literally just be that one line.
And then make the line be whatever the constant is for the input. (I'm unsure how is used in the code, but requiring it to be the constant/input-name seems like it'd remove all of the tedium)

merry lotus
vocal spire
#

Can’t you just have the KeyCode enum with an string enum converter or whatever?

jolly oriole
vocal spire
#

Yeah

jolly oriole
#

but i'll just let it stay as G, otherwise the mod name is misleading

jolly oriole
#

crystalobbles should also be rather easy to make it not eat frames, with gatling aspid i'm not sure

jolly oriole
#

holy shit is gatlingaspid bad good, every scene change the gamemanager gets another component

#

nvm, not another component, but another coroutine that basically doesn't stop

copper nacelle
jolly oriole
worn eagle
copper nacelle
#

64 bit

#

Kinda pog

worn eagle
#

also

phase 2

deep wave
#

correct

copper nacelle
#

correct

#

counting the spike shit as a phase is so much effort

ornate rivet
#

oh god what if all the mods break

#

oh god

#

what if pale court breaks

worn eagle
#

So I joined after godmaster and haven't experienced an update, will this require an api update?

copper nacelle
#

Yeah

#

Probably just a rebuild tbh

ornate rivet
#

will we wait for it to come out of beta?

floral furnace
#

its still in beta tho

copper nacelle
#

I can make a branch ig

#

Effort

#

I'll look at it

worn eagle
#

wish there was a complete list of fixes

copper nacelle
#

I'll assembly diff in a bit

#

After dinner

floral furnace
#

best case scenario we dont need to update our mods either right

copper nacelle
#

probably

floral furnace
#

this answer does not fill me with confidence but it is understandable

worn eagle
#

netstandard

copper nacelle
#

YOOOOO

#

That's such a fucking improvement

ornate rivet
#

noice

#

Jack's work no doubt

floral furnace
#

iflj

charred topaz
#

if it's a new version of dot net, would that also mean they are using a newer version of Unity too?

copper nacelle
#

2020.2.2.33144

ornate rivet
#

woah

charred topaz
#

oh dang

copper nacelle
#

from 2017.4.10

#

so yeah

ornate rivet
#

WOAH

charred topaz
#

that may brick mods that use asset bundling

ornate rivet
#

yea

#

that was a scared woah

worn eagle
#

πŸ¦€PALE COURT IS CANCELLED πŸ¦€

ornate rivet
#

ok buddy

copper nacelle
#

πŸ¦€

worn eagle
#

any reason for the name change

ornate rivet
#

maybe because hk got updated

copper nacelle
#

because someone said hk is shit

ornate rivet
#

sigh

#

I wonder if the shader bug in assetbundling is fixed in unity 2020

#

probably right?

charred topaz
#

shader bug?

drifting leaf
#

People will not uppatch if they can't get pale court

ornate rivet
#

the one where we have to manually set the material's shader in game

charred topaz
#

I think I ran into that once where the default sprite shader was showing up as a missing shader in-game. I think i fixed it by removing it from the "Always Included Shaders" list

ornate rivet
#

ah

worn eagle