#archived-modding-development

1 messages · Page 507 of 1

vocal spire
#

Did you make sure to build the mod again?

cedar hemlock
#

ehm

#

shit

#

im stoopid

#
[INFO]:[Thing] - SceneIsValid
[ERROR]:[UNITY] - NullReferenceException: Object reference not set to an instance of an object
[ERROR]:[UNITY] - TransHK.Rareclass.Find (Scene scene, System.String name)
[ERROR]:[UNITY] - TransHK.TransMod+<SetSprite>d__5.MoveNext ()
[ERROR]:[UNITY] - UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)
[ERROR]:[UNITY] - UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
[ERROR]:[UNITY] - TransHK.TransMod:SceneChanged(Scene, Scene)
[ERROR]:[UNITY] - UnityEngine.SceneManagement.SceneManager:UnloadScene(String)
[ERROR]:[UNITY] - <BeginSceneTransitionRoutine>c__AnonStorey13:<>m__2()
[ERROR]:[UNITY] - <BeginRoutine>c__Iterator0:MoveNext()
[ERROR]:[UNITY] - UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
[ERROR]:[UNITY] - 
[INFO]:[TransMod] - Scenechanged
vocal spire
#

Well

cedar hemlock
#

it starts right at

Log("SceneIsValid");
                GameObject retGo;
                foreach (var go in scene.GetRootGameObjects())
                {
                    if (go.name == name)
                    {
                        Log("if (go.name == name)");
                        return go;
                    }
                    retGo = go.transform.Find(name).gameObject;
                    if (retGo != null)
                    {
                        Log("if retGo != null");
                        return retGo;
                    }
                }
vocal spire
#

Ohhh I think I see the problem

#

Let me rewrite something for you

#
public static class Rareclass
    {
        public static void Log(string s)
        {
            Modding.Logger.Log($"[Thing] - {s}");
        }
        public static GameObject Find(this Scene scene, string name)
        {
            Log("NewMethodCalled");
            if (scene.IsValid())
            {
                Log("SceneIsValid");
                Transform retGo;
                foreach (var go in scene.GetRootGameObjects())
                {
                    if (go.name == name)
                    {
                        Log("if (go.name == name)");
                        return go;
                    }
                    retGo = go.transform.Find(name);
                    if (retGo != null)
                    {
                        Log("if retGo != null");
                        return retGo.gameObject;
                    }
                }
            }
            return null;
        }
    }
cedar hemlock
#

omgomg

#

finally

#

thysm

jolly oriole
#

uhm, i may forgot unity 2017 quircks

#

as retGo = go.transform.Find(name); can give null

#

@jolly oriole fix that when you're home

cedar hemlock
#

so if i want to change sprites of bosses, i have to:
1 . change if (arg1.name != "Room_Final_Boss_Core") return; to the correct scene
2. change var boss = arg1.Find("Hollow Knight Boss"); to the right name
Right?

vocal spire
#

There are many ways to do it

#

That is one of them

cedar hemlock
#

ok

#

so this gonna be in customknight+ ? lol

vocal spire
#

Nah frogcore

#

Oh you mean replacing sprites?

#

Maybe

#

Anyways time to update frogcore on the installer since it’s been broken for a while now

#

Also gonna add some ez tk2d sprite replacement stuff

cedar hemlock
#

imma make it so the scene and boss arent hardcoded

vocal spire
#

Where did I leave the frogcore source

cedar hemlock
#

idk

vocal spire
#

Found

#

Time to make people fear me

#

With the power

#

Of frog

cedar hemlock
#

nice

vocal spire
#

Jk frogcore is tiny compared to other core mods

vocal spire
cedar hemlock
#

it has to be capital

#

F

#

bruh whats wrong withstring selectedBoss = "Hollow Knight Boss";

#

nvm

jolly jungle
#

Time to make people fear me
With the power
Of frog

cedar hemlock
#

why is it when i click in the middle of the line when i type it replaces stuff that is already there

jolly oriole
#

when the insert key was pressed, the cursor slightly changes and the typing is change to replace the text at the current position

cedar hemlock
#

oh

#

i must have accidently pressed it

jolly oriole
#

@cedar hemlock
it's easy, just requires this nonsense

private void SceneChanged(Scene arg0, Scene arg1)
{
    if (arg1.name != "Room_Final_Boss_Core") return;
    GameManager.instance.StartCoroutine(SetSprite());

    // Change audio
    var sm = arg1.Find("_SceneManager").GetComponent<SceneManager>();
    var mc = sm.GetAttr<SceneManager, MusicCue>("musicCue");
    var ci = mc.GetAttr<MusicCue, MusicCue.MusicChannelInfo[]>("channelInfos");

    // ToDo replace null with custom audioclip
    ci[MusicChannels.Main].SetAttr<MusicCue.MusicChannelInfo, AudioClip>("clip", null);
    // ToDo replace null with custom audioclip
    ci[MusicChannels.MainAlt].SetAttr<MusicCue.MusicChannelInfo, AudioClip>("clip", null);
    // ToDo replace null with custom audioclip
    ci[MusicChannels.Action].SetAttr<MusicCue.MusicChannelInfo, AudioClip>("clip", null);
    // ToDo replace null with custom audioclip
    ci[MusicChannels.Sub].SetAttr<MusicCue.MusicChannelInfo, AudioClip>("clip", null);
    // ToDo replace null with custom audioclip
    ci[MusicChannels.Tension].SetAttr<MusicCue.MusicChannelInfo, AudioClip>("clip", null);
    // ToDo replace null with custom audioclip
    ci[MusicChannels.Extra].SetAttr<MusicCue.MusicChannelInfo, AudioClip>("clip", null);

    mc.SetAttr<MusicCue, MusicCue.MusicChannelInfo[]>("channelInfos", ci);
    sm.SetAttr<SceneManager, MusicCue>("musicCue", mc);
}

with the first 4 lines (and the last one) already existing

cedar hemlock
#

nice

#

95 errors shroompog

jolly oriole
#

poggers

cedar hemlock
#

lemme change some things

#

14 a lil better

#

8...

#

Error CS1069 The type name 'AudioClip' could not be found in the namespace 'UnityEngine'. This type has been forwarded to assembly 'UnityEngine.AudioModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Consider adding a reference to that assembly.

#

a bunch of times

#

so i just add the reference for this right?

#

2 now..

#

2 times this:

#

do you know what reference i need to add?

stone elm
#

Visual studio has helpful hints if it detects the reference you're looking for. Look for the lighbulb at the left of the line.

jolly oriole
#

either modcommon, sfcore or maybe vasi (honestly don't know about this one)

#

but le me check if theres a no dependency workaround for that

stone elm
#

There's a small chance VS figured it out, but if the assembly isn't there in the first place then yeah

cedar hemlock
#

i dont see an lightbulb

stone elm
#

Then maybe it doesn't know. Was just a thought. I'm just trying to throw out tips since you seem new to VS and C#.

cedar hemlock
#

yeah i can a bit java so i know a bit c#

stone elm
#

Well, you know the syntax well enough. There are enough fundamental differences that it probably feels a little tough I imagine. A weird difference here or there

jolly oriole
cedar hemlock
#

yeah i was helping someone so i am a bit busy :)

#

hmm

#

modcommon doesnt work

#

vasi then

#

still nothing

jolly oriole
#

hm

#

modcommon should have that afaik

#

oh wow

cedar hemlock
jolly oriole
#
Modding.ReflectionHelper.SetAttr(theObjectToChange, "nameOfTheField", valueYouWantSet, true);
cedar hemlock
#

hm

#

do i place that in scenechanged?

#

and what do i want to change, whats the field, whats the value

jolly oriole
#

1 sec

cedar hemlock
#

it your code so you prob know :)

jolly oriole
#
private void SceneChanged(Scene arg0, Scene arg1)
{
    if (arg1.name != "Room_Final_Boss_Core") return;
    GameManager.instance.StartCoroutine(SetSprite());

    // Change audio
    var sm = arg1.Find("_SceneManager").GetComponent<SceneManager>();
    var mc = Modding.ReflectionHelper.GetAttr<SceneManager, MusicCue>(sm, "musicCue");
    var ci = Modding.ReflectionHelper.GetAttr<MusicCue, MusicCue.MusicChannelInfo[]>(mc, "channelInfos");

    // ToDo replace null with custom audioclip
    Modding.ReflectionHelper.SetAttr(ci[MusicChannels.Main], "clip", null);
    // ToDo replace null with custom audioclip
    Modding.ReflectionHelper.SetAttr(ci[MusicChannels.MainAlt], "clip", null);
    // ToDo replace null with custom audioclip
    Modding.ReflectionHelper.SetAttr(ci[MusicChannels.Action], "clip", null);
    // ToDo replace null with custom audioclip
    Modding.ReflectionHelper.SetAttr(ci[MusicChannels.Sub], "clip", null);
    // ToDo replace null with custom audioclip
    Modding.ReflectionHelper.SetAttr(ci[MusicChannels.Tension], "clip", null);
    // ToDo replace null with custom audioclip
    Modding.ReflectionHelper.SetAttr(ci[MusicChannels.Extra], "clip", null);

    Modding.ReflectionHelper.SetAttr(mc, "channelInfos", ci);
    Modding.ReflectionHelper.SetAttr(sm, "musicCue", mc);
}
cedar hemlock
#

and:

#
Error    CS0411    The type arguments for method 'ReflectionHelper.SetAttr<TObject, TField>(TObject, string, TField)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
jolly oriole
jolly oriole
#

the 6 lines

// ToDo replace null with custom audioclip
Modding.ReflectionHelper.SetAttr(ci[(int) MusicChannels.Main], "clip", (AudioClip) null);
// ToDo replace null with custom audioclip
Modding.ReflectionHelper.SetAttr(ci[(int) MusicChannels.MainAlt], "clip", (AudioClip) null);
// ToDo replace null with custom audioclip
Modding.ReflectionHelper.SetAttr(ci[(int) MusicChannels.Action], "clip", (AudioClip) null);
// ToDo replace null with custom audioclip
Modding.ReflectionHelper.SetAttr(ci[(int) MusicChannels.Sub], "clip", (AudioClip) null);
// ToDo replace null with custom audioclip
Modding.ReflectionHelper.SetAttr(ci[(int) MusicChannels.Tension], "clip", (AudioClip) null);
// ToDo replace null with custom audioclip
Modding.ReflectionHelper.SetAttr(ci[(int) MusicChannels.Extra], "clip", (AudioClip) null);
cedar hemlock
#

hovering over it

#

it says alt-enter

#

add explicit cast...

jolly oriole
#

also good

#

yes

cedar hemlock
#

i clicked it and did nothing

#

nothing

jolly oriole
#

fixed the code a bit above, should have everything

cedar hemlock
#

did i do something wrong?

jolly oriole
#

vs being vs, idk

cedar hemlock
#

so do i place an audio file in mods or will there be an folder

jolly oriole
#

you can load an audioclip in any way, shape or form unity provides and pass it as one (or multiple) of the null parameters

vocal spire
#

I suggest assetbundling

jolly oriole
#

assetbundling for a single audioclip sux ass

cedar hemlock
#

wait

vocal spire
#

good point

jolly oriole
#

although for thk it would be 6-7, at which point it could be good again

cedar hemlock
vocal spire
#

how are you loading it?

cedar hemlock
#

okay from the beginning

#

i place the .dll in mods

vocal spire
#

well how are you loading the audio file in the dll

cedar hemlock
#

oh do i need to do the same as the image

vocal spire
#

nah

#

but I suggest doing that since you don't have to give out anything more than a dll

cedar hemlock
#

ok but if i want do do it only for myself can i just place the wav in mods?

vocal spire
#

yes

cedar hemlock
#

okay

vocal spire
#

but you need to load the file from there

#

unlike loading from the resources like the image

cedar hemlock
#

so how do i tell it the wav is in ... ?

vocal spire
#

well I closed visual studio so I'll type from memory

cedar hemlock
#

nice

vocal spire
#

Path.WithoutExtention(Path.WithoutExtention(Assembly.GetExecutingAssembly().Name.FullName)))I think

cedar hemlock
#

do i type the path at FullName?

#

oh and where

vocal spire
#

or Assembly.GetExecutingAssembly().Name.FullName + @"\..\..\"

cedar hemlock
#

in the scene changed?

vocal spire
vocal spire
vocal spire
#

fine, I'll open visual studio again

cedar hemlock
#

lol

vocal spire
#

File.ReadAllBytes(Assembly.GetExecutingAssembly().Location + @"\..\filename");

cedar hemlock
#

at ..\ i place the path

vocal spire
#

this will return a byte array that you can put in one of WavUtility's methods

vocal spire
#

place the file name

#

currently it gets the path to the mods folder by getting the path to the dll file(contains the dll file's name)

cedar hemlock
#
File.ReadAllBytes(Assembly.GetExecutingAssembly().Location + @"\PathHere?\filename duh");
vocal spire
#

no

cedar hemlock
#

hmm

#

okay so only the filename needs to be changed

vocal spire
#

Assembly.GetExecutingAssembly().Location + @"\..\" gets you to the mods folder

cedar hemlock
#
Assembly.GetExecutingAssembly().Location + @"\..\hereifiwanttodoitinanotherfolder\Filename"
#

right?

vocal spire
#

yes

cedar hemlock
#

okay

#

then how do i do it into the Modding.ReflectionHelper ?

vocal spire
#

do you have WavUtilityyet

cedar hemlock
#

nope

vocal spire
cedar hemlock
#

which one?```
var sm = arg1.Find("_SceneManager").GetComponent<SceneManager>();
var mc = Modding.ReflectionHelper.GetAttr<SceneManager, MusicCue>(sm, "musicCue");
var ci = Modding.ReflectionHelper.GetAttr<MusicCue, MusicCue.MusicChannelInfo[]>(mc, "channelInfos");

vocal spire
cedar hemlock
#

ehm

#

all of that?

jolly oriole
#

that's btw broken for anything loaded from memory, untiy paths and multichannel

vocal spire
#

oh

#

cool

#

now I know why it didn't work before

#

it's probably better I switched to assetbundling anyways since it was a lot of audio clips

cedar hemlock
vocal spire
#

yes

#

use the ToAudioClip method with the path as the perameter

cedar hemlock
#

all

#

wth

vocal spire
#

yes

#

probably

cedar hemlock
#

all 400 lines lol

vocal spire
#

unless you want to erase anything not used by the method I described or the methods used by that and so on

vocal spire
cedar hemlock
#

65 errors zote

vocal spire
#

you need to reference unityengine.audiomodule or something btw

#

well I gtg

#

see ya

cedar hemlock
#

that needed for sfgrenades to so i already have it

cedar hemlock
#

a lot of shit doesn't exist in the current context

vocal spire
#

Back

#

Can you show the exact errors

cedar hemlock
#

speed

vocal spire
#

Yes

cedar hemlock
#

ok wait a se

#

c

#

fixed it

#

i needed using System; and using System.Text;

stone elm
#

Those are the kinds of things visual studio can fill in for you

cedar hemlock
#

yeah i didn't look for the lightbulb

#

i just looked at the source

vocal spire
#

lol

vocal spire
#

Always look at the lightbulb

stone elm
#

Well, you can do things the hard way or use the IDE

jolly oriole
#

never use ide

#

always write code in discord chat

vocal spire
#

Well that’s 1/2 my life at this point

stone elm
vocal spire
#

Write code in discord

stone elm
#

I knew a guy that wrote ASP classic in notepad to make a web game... It scared me.

stone elm
cedar hemlock
#

lol

vocal spire
stone elm
#

That almost sounds like you had no choice, since school pcs can be locked down. But still, though, way too much effort for me. The most basic I've gone is vscode. I'm a poser. zotedisgust

vocal spire
#

I got vscode eventually tho. Slightly better

prime urchin
#

only slightly? basic notepad is a nightmare

cedar hemlock
#

how do i add the Wavutil or whatever

vocal spire
#

You copy everything in the GitHub file and paste it in a .cs file in visual studio

cedar hemlock
#

no

#

i meant something else

#

ehm

vocal spire
#

Getting a audio clip from it?

cedar hemlock
#

how do i get the bites into the things that need it

vocal spire
cedar hemlock
#

or does it go automaticly using wavutils

vocal spire
#

Just do AudioClip myclip = WavUtility.ToAudioClip(path);

#

Grenade said the bytes way doesn’t work

cedar hemlock
#

oh okay

#

do i need the @ ?

jolly oriole
vocal spire
#

Yay

vocal spire
cedar hemlock
#

ok i gtg now

#

thanx for the help!

vocal spire
#

Np

cedar hemlock
#

Oh and btw if i want to change sprites of multiple enemies can that be done in one cs or do i need to make multiple

#

I meant that can you define that you want img 1 fir this and img 2 for that etc

light zodiac
#

When i write the line

public class ClassName : Mod, ITogglableMod

It gives me this error:
error CS0535: 'ClassName' does not implement interface member 'ITogglableMod.Unload()'

Can someone help me with this

steady comet
light zodiac
#

So in that method I only do -= the function I want to run?

steady comet
#

Basically, in Unload you reverse everything you do in Initialize

#

So if there's only one function you want your mod to run while it's loaded, then you should just -= that function in the unload

light zodiac
#

Thank you

vocal spire
#

Can be done in one cs

cedar hemlock
#

okay

vocal spire
#

Show your code that checks what the scene name is

cedar hemlock
#

USceneManager.activeSceneChanged += SceneChanged;

 private void SceneChanged(Scene arg0, Scene arg1)
        {
            if (arg1.name != Bossscene) return;
            {
                GameManager.instance.StartCoroutine(SetSprite(arg1));
#

i think thats everything

#

oh and string Bossscene = "Room_Final_Boss_Core";

vocal spire
#

Ok

cedar hemlock
#

oh and have no idea if it works

vocal spire
#

Let me rewrite a little for ya

cedar hemlock
#

ok thk still works

#

the music doesn't

vocal spire
#

Replace csharp string Bossscene = "Room_Final_Boss_Core";
With

Dictionary<string, string> Bossscenes = new Dictionary<string, string>() { "Room_Final_Boss_Core", " Hollow Knight Boss" }; ```
cedar hemlock
#
Error    CS0246    The type or namespace name 'Dictionary<,>' could not be found (are you missing a using directive or an assembly reference?)    
vocal spire
cedar hemlock
#

the music part is totaly broken lol

vocal spire
vocal spire
cedar hemlock
#

lightbulb say fix formatting but it doesn't work

cedar hemlock
#

gonna try adding it to the dll

vocal spire
cedar hemlock
#
Error    CS7036    There is no argument given that corresponds to the required formal parameter 'value' of 'Dictionary<string, string>.Add(string, string)'```
vocal spire
cedar hemlock
#

i did that

vocal spire
#

Oh let me quickly fix that

cedar hemlock
#

sfg version doesn't use WavUtitlity or smth

#

(its in my code)

#

nvm fixed it

#

oh and my Bossscene does not work

vocal spire
#

Back, had to do something

#

Yeah leme fix that

#

Replace csharp string Bossscene = "Room_Final_Boss_Core";
With

Dictionary<string, string> Bossscenes = new Dictionary<string, string>() { { "Room_Final_Boss_Core", " Hollow Knight Boss" } }; ```
cedar hemlock
#
if (arg1.name != Bossscene) return;
            {
#

but i gtg now

fair rampart
#

can someone help me use uuwuu

copper nacelle
#

this is modding development

fair rampart
#

oh

jolly oriole
#

how does foreach (var item in defaultItemList) throw an NRE when initialized with defaultItemList = new List<Item>();???

prime urchin
#

seems impossible if that's the only code

#

either the list isn't actually being initialized before or it is and it has a null item that's being used

#

or it's being set to null somewhere inbetween

jolly oriole
#

i mean

copper nacelle
#

are you sure it's the foreach

jolly oriole
#

yes

prime urchin
#

sure it's not the list in the component that's null?

jolly oriole
#

the function got to the '8' log before stopping

copper nacelle
#

put a log before the add

jolly oriole
#

oh yea, should've tried those

#

trying now

#

ofc it's the add

#

i never initialized that list

#

no need to test

copper nacelle
#

gaming

jolly oriole
#

well, works now

copper nacelle
#

if this is 1.5 you can setup a pdb and not have to log spam

#

very nice qol improvement

jolly oriole
#

i'll continue to log spam as long as 1432 exists

#

it's 1432 btw

copper nacelle
#

I'm sorry for your loss

jolly oriole
#

making it work on 1432 first, who knows which century 1.5 will release

jolly oriole
#

the entire inventory is fucked pog

vocal spire
#

Nice

jolly oriole
#

i'm somewhat close to done now, somehow completely missed an entire go with fsms on it

jolly oriole
#
CallMethodProper error on Enemy List -> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IndexOutOfRangeException: Array index is out of range.

nice

jolly oriole
#

poggers, menu screen broke

vocal spire
#

Yay

#

Found the problem

#

boss mod core not found

#

Jk

jolly oriole
#

that's dynamic optional mod dependency

vocal spire
#

Cool

#

For tot’s boss?

jolly oriole
#

idk, for testing

#
NullReferenceException: Object reference not set to an instance of an object
  at SFCore.Utils.FsmUtil.ChangeTransition

sadge

vocal spire
#

Cool, my favorite null reference, fsm utils

jolly oriole
#

nvm i figured out why

#

fuck gamecameras immediatly destroying itself

fresh cipher
vocal spire
light zodiac
#

Does anyone know where i can find the source code of royal dreamer

honest violet
#

hey everyone, it was suggested to me that this would be the place to ask if a HK mod could be added to the ModInstaller? I really love that mod but because it changes the same file as the API's, I can't use it in my game if I want all the other cool mods available in the installer

merry lotus
#

The installer itself just adds .dll files, and installs the moddingAPI. Is this a mod you made that you're trying to get something integrated to the API, or is this a mod that you like that just uses a different method of modding?

honest violet
honest violet
#

oh btw it's the "no cost for wayward compass & gathering swarm" mod

cedar hemlock
#

easy mod?

light zodiac
#

free utility mod?

cedar hemlock
#

cus thats on the installer

cedar hemlock
#

the lightbulb doesn't help

honest violet
# cedar hemlock cus thats on the installer

I'm so sorry I'm very confused. English isn't my native language so I'm not sure what you're saying. Is there a mod that does this already in the installer, is that what you're saying?

cedar hemlock
#

easy mod is on the installer

#

that makes wayward compass and swarm free

honest violet
#

but if I enable easy mod, will it make everything else easier? or can i just toggle whatever part of easy mod i want to use?

cedar hemlock
#

it will make everything else easier

honest violet
#

sorry, in modding discussion they said to come here. so there's no way to add another mod to the installer? since i don't want the game to be easier

cedar hemlock
#

no in modding help they said you to come here and you can pr the modlinks

honest violet
#

i don't understand you, i'm sorry. i'm not frustrated by you, just not understanding anything pr or modlinks. it's ok i can give up on this, it's not very important and i suppose if there was an easy way someone would have told already. thanks for giving answers, ruttie.

cedar hemlock
#

ok

cedar hemlock
#

bruh

#

the textures completely broke

#

ok nvm

#

fixed the textures

#

idk why it was if (arg1.name != Bossscene) so i made it if (arg1.name == Bossscene)

cedar hemlock
#

btw the music is totally broken without errors in modlog

jolly oriole
cedar hemlock
#

He wants to add it to the modinstaller

#

Oh and is it okay if i just copy everything from custombgm into the mod im making or should i do,it in another

jolly oriole
#

I mean, i don't know why you'd want 2 mods for your single use case

honest violet
jolly oriole
#

np

vocal spire
cedar hemlock
#

Hmm maybe i missed it or smth

vocal spire
#

Let me find it

cedar hemlock
#

Ok ill see if it works

vocal spire
#

Also show the code in the SetSprite method

#

Needs a little editing

cedar hemlock
# vocal spire This

Error CS1929 'Dictionary<string, string>' does not contain a definition for 'Contains' and the best extension method overload 'PlayMakerUtilsDotNetExtensions.Contains(VariableType[], VariableType)' requires a receiver of type 'VariableType[]'

vocal spire
#

Change Contains to ContainsKey

cedar hemlock
#

bruh

#

it worked

#
       private IEnumerator SetSprite(Scene arg1)
        {
            Log("Setting sprites");
            var boss = arg1.Find(selectedBoss);
            boss.GetComponent<tk2dSprite>().GetCurrentSpriteDef().material.mainTexture = _tex;
            yield return null;
        }
#

readonly string selectedBoss = "Hollow Knight Boss";

jolly oriole
#

apparently i managed to make the fsm just stop working upon reaching this action and i don't know how.
as in: it literally just stops, no further logs, no exception, nothing

vocal spire
#
       private IEnumerator SetSprite(Scene arg1)
        {
            Log("Setting sprites");
            var boss = arg1.Find(Bossscenes[arg1.name]);
            boss.GetComponent<tk2dSprite>().GetCurrentSpriteDef().material.mainTexture = _tex;
            yield return null;
        }
cedar hemlock
#

yes

vocal spire
#

Just need to do some stuff with the texture stuff to make it work with multiple scenes/bosses

cedar hemlock
#

update: try using Bossscene instead of Bossscenes as that easier

vocal spire
#

?

#

Wdym

cedar hemlock
#

arg1.Find(Bossscenes[arg1.name]) needs to be arg1.Find(Bossscene[arg1.name])

vocal spire
#

Ok

#

Thought bossscenes made more sense as it can contain multiple boss scenes

cedar hemlock
#

yeah i can change it later

#

its easier if i change Bossscenes to Bossscene then changing everything else :)

vocal spire
#

Ok

cedar hemlock
#

btw sfgrenade why is your music you provided for bgm so loud lol

#

i need to set the music so low lol

jolly oriole
#

because it's poggers

cedar hemlock
#

lol

vocal spire
#

Is it the music from the vc?

#

If so, awesome

cedar hemlock
#

from github

jolly oriole
vocal spire
#

Nice

cedar hemlock
#

i managed to break blue hk again

jolly oriole
vocal spire
#

Nice

cedar hemlock
#

hmm

#

did they really add descriptions? xD

jolly oriole
#

... the items have descriptions in the base game

vocal spire
#

lol

cedar hemlock
#

oohh im stupid

vocal spire
#

Remove hunter’s notes time

cedar hemlock
#

i always forget that

vocal spire
jolly oriole
vocal spire
#

Ohhh

#

That makes sense

jolly oriole
#

easiest solution to that problem as well

#

after that i only need to fix the lazy fsm not working anymore when opening the inventory on that screen

vocal spire
#

What does the normal inventory look like?

jolly oriole
vocal spire
#

Are you going to leave the space there blank, or do something like space out the stuff on the left?

jolly oriole
#

blank is easy

#

and i also need to test it when one has no items

vocal spire
#

Ok

cedar hemlock
#

also your code might have broken the custom texture

vocal spire
#

How?

#

What happened to it?

cedar hemlock
#

idk modlogs doesn't give errors and thk just doesn't change

vocal spire
#

Is Qol installed and enabled?

cedar hemlock
#

yes

vocal spire
#

Hmmm

cedar hemlock
#

do i need to reference?

vocal spire
#

Show where you define Bossscene

#

No

cedar hemlock
#

Dictionary<string, string> Bossscene = new Dictionary<string, string>() { { "Room_Final_Boss_Core", " Hollow Knight Boss" } };

vocal spire
#

Hmm

cedar hemlock
#

how does the texture part know what selectedboss is?

vocal spire
#

Wdym

#

Can you show where you define selected boss?

cedar hemlock
#

it isn't there

vocal spire
#

Ok

#

Did you remove it?

cedar hemlock
#

i thought it was in your code as you added " Hollow Knight Boss" } };

vocal spire
#

Ok

#

Just making sure it’s the same value

#

Can you show your code in scene changed

cedar hemlock
#
private void SceneChanged(Scene arg0, Scene arg1)
        {
            if (Bossscene.ContainsKey(arg1.name))
            {

                GameManager.instance.StartCoroutine(SetSprite(arg1));
vocal spire
#

Looks right

cedar hemlock
#

ok i changed some things let me try again

vocal spire
#

Did you make sure you built the mod

cedar hemlock
vocal spire
#

Gtg

#

Phone at 1%

cedar hemlock
#

bruh fixed it

vocal spire
#

What changed

cedar hemlock
#

i changed " Hollow Knight Boss" to "Hollow Knight Boss"

vocal spire
#

Did I seriously leave a space

cedar hemlock
#

yes lol

vocal spire
#

I blame coding on phone

#

It’s gonna die now

cedar hemlock
#

bye

vocal spire
#

Goodbye

jolly oriole
#

how does this look?

cedar hemlock
#

i liked it when there was a line

jolly oriole
#

btw, idk if anybody else had a similar problem of an fsm just not continueing to function, stopping dead without an exception

leaden hedge
#

i had an issue where fsms would point to the wrong tab, then crash

jolly oriole
#

i figured it out, apparently completely misread the state name

#

and even then the stopping was because i didn't change back a number (when i changed it for testing)

jolly oriole
leaden hedge
#

oh

jolly oriole
#

i also had some weird interactions with the viewer

leaden hedge
#

is there a fix to arrays starting at 1 for some reason

jolly oriole
#

i never had an array start at one, or do you mean this kinda thing?

leaden hedge
#

iswtg if you ask what transtrans does in here

#

yeah that

jolly oriole
#

that's just display

#

starts at 0 in the second line

leaden hedge
#

yes i know its just displaying wrong

jolly oriole
#

oh

leaden hedge
#

its putting the 0th element at position 1 in the array

jolly oriole
#

apparently not

#

the avalonia version shows that the first 'index' indicates the array

jolly oriole
#

i love a thorough modlog

vocal spire
#

Hello

#

Very thorough

stone elm
#

I have rookie numbers

jolly oriole
#

i only bloated my modlog so i see everything about this pfsm

vocal spire
jolly oriole
#

sadge, closing and reopening works now though

vocal spire
#

Nice also not nice

marble hollow
#

ah yes my favourite item, d̵͂͊f̸̒͝e̶͑̽w̸̓̕ȑ̶̒f̷̅̽r̵̂̀d̵̅̊s̶͐͠ẗ̷̰́ǧ̷̳f̷͋̽w̵̛͝r̵̈́̈́y̷̖̔h̴͂̇a̷̎̆w̶͈̋t̸̓̀

vocal spire
#

Same

languid goblet
#

inventory overhaul?

vocal spire
#

For item helper(thing that allows adding of more items to the equipment menu)

#

I made one, but it was really bad, so sfg is making a much better one

jolly oriole
#

basically, i'm copying the journal and make it work with items/equipment

vocal spire
#

I tried making a new panel at one point but it all died

jolly oriole
#

more progress now, the cursor doesn't disappear when closing the inventory for no reason

vocal spire
#

It was centered at the lower left portion of the screen, and moving the cursor causes millions of null references

jolly oriole
ornate rivet
#

that's very nice

#

UI Master SFG

jolly oriole
jolly oriole
#

@vocal spire customknight thing (idk if you still work on it): kingsoul/voidheart shows with the original texture instead of the skin one

vocal spire
#

Ok

#

I thought there was already a fix made

#

For now it only edits the knight though(will add more in the future, might make it use sprite collection names to replace stuff)

jolly oriole
jolly jungle
#

Damn, this is cool

#

How would one make something like this from scratch?

cedar hemlock
#

So i decided to look into custom charms, but there's one problem...
if i equip a charm and leave the equipment menu it doesn't stay equiped or smth

#

i seems equiped and its there but i can just equip it again

#

and again and again

vocal spire
jolly oriole
ornate rivet
#

rip

vocal spire
#

Confusion

jolly oriole
#

test for the item limit with random sprites from the game

#

result: it just works nicely

ornate rivet
#

ah ok

jolly oriole
#

the random sprites might just be sometimes a bit bigger than the inventory items (e.g. the black blanker or whatever that is)

fair rampart
#

Heyo, Quick question: Would it be possible to mod a Character creator into the game? My Idea was to have all the knight assets be redone as a blank masked one and then stack 5 Layers on top of each other like so.

Eyes
Horns 1
Horns 2
Cloak colour
Blank mask

fair rampart
#

Also if this works, the sprite combination would has to have a saved designation I presume, so this could be applied onto the multiplayer mod 🤔 chose the code corespondent to your combination you want to have and ad it into a config or better yet in game

cedar hemlock
#

Check the source code of decorationmaster

dark wigeon
#

@fair rampart unity can load shaders directly from assets files if they are referenced by a scene

#

so I just make a blank scene and then reference the assets files

#

but all assets from the assets files are loaded when referenced in editor so I strip out all other assets other than shaders

#

and yes available in scene view

#

I've tried that
not sure what you're trying but the actual setup is a bit complicated

jolly jungle
#

Hello hello hello everyone

#

A few questions

#

Why is it necessary to search for FindObjectsOfType<HealthManager>() and not just look directly for the name of whatever it is?

jolly oriole
#

because in a scene there can be

Crystal Flyer
Crystal Flyer (1)
Crystal Flyer (2)
...

and GameObject.Find() requires a specific name

dark wigeon
#

no sources just guessing

#

umm

#

can you send me what you have

#

I can explain better with an example

jolly jungle
#

Hm

#

What about just returning all things in scene?

jolly oriole
#

you'd need to write your own method for that

jolly jungle
#

Would that be the only way to reskin non-enemy objects or is there something I missed?

#

Please be something I missed

jolly oriole
jolly jungle
#

And static objects like breakable environment?

jolly oriole
#

idk, would probably be dependent on each object

jolly jungle
#

Damnit

#

We'll get there when we get there, I suppose

#

What about particle effects?

#

Wait those are particle effects

#

So they have stuff special to them

#

Hm

#

Alright what about things like the background/foreground/etc.?

dark wigeon
#

just a little more detail about that:
I would manually create a blank scene and blank shader .assets file and copy the needed shader bytes to your shader .assets file rather than copying whole game files
you can create a blank assets file with the scene creator here https://github.com/nesrak1/HKWorldEdit2/blob/master/Assets/Editor/Bundler/BundleCreator.cs#L12
I think as long as it's a valid assets file renamed with .unity extension it should load it as a scene.
to reference it, just create a blank gameobject, create a blank material, then attach the material to the gameobject.
details on creating a blank asset and filling it here: https://github.com/nesrak1/AssetsTools.NET#create-new-asset-from-scratch
so the main issue why you can't just include the shader into the scene is because unity has bugs and apparently putting a shader into a scene crashes the editor
so instead it goes in another assets file (which has to be outside the editor Assets folder otherwise the editor crashes due to an assertion)
you can reference the other assets file by changing the assets file's dependencies array. the index of the dependency into the array starts at 1 not 0.
you can create a dependency like this: https://github.com/nesrak1/HKWorldEdit2/blob/master/Assets/Editor/Bundler/Loader.cs#L211
so if you only have one reference and it's to that assets file that holds the shader, you want to point it towards fileid 1 and pathid whatever path it is in that file.
so basically you point the material's shader pointer towards the shader and save and you should be good to go.

#

@fair rampart

#

it would probably be better for me to write some generic code, that way there's no confusion

jolly jungle
#

btw kein what're you making?

foggy yew
#

Hey sooo
I have this absolute crazy idea to replace every enemy with primal aspids and do it with gatling aspids
How would i do that?(To replace every enemy with the primal aspids)

dark wigeon
#

yep raw shader bytes

#

just copy the asset data directly

#

there's not really a good built in way so just get a binaryreader, set its position at assetInfo.absoluteFilePos and then read assetInfo.curFileSize bytes

#

there is no such thing as an asset file

#

there are assets files and then assets

#

yeah ok whatever I make mistakes too

#

asset is the raw bytes for a thing like shader or texture or gameobject

#

assets file is the file that holds assets

#

if your project is in raw mode instead of text mode, project assets files are the same format as compiled game assets files

#

except I think type tree, but that's it, that's just so that when you upgrade it knows which fields are what

charred topaz
#

Hey @dark wigeon, do you know if it's possible to change what assemblies are referenced in an asset bundle? When I look at the data inside of the built asset bundle for InfernoKingGrimm, it's looking for the IKG scripts under "Assembly-CSharp.dll". But the scripts are actually under InfernoKingGrimm.dll when I go to load the mod in HK. Would there be any way of changing this so that it references the correct assembly? I'm unable to use asmdefs to change the assemblies because of how my project is structured.

dark wigeon
#

you can just do that in uabe

#

export dump the MonoScript that references Assembly-CSharp.dll, change it in the text file and reimport it

#

this isn't a new beta hk bundle right

#

oh I guess you probably want that to happen automatically after bundle build?

#

but if you really do want to postprocess the bundle you can script it, it just takes a bit of setup

charred topaz
# dark wigeon you can just do that in uabe

Yeah, I was trying to see if I can get my mod updated to the latest HK Beta, wasn't sure if using UABE was possible in that version yet. I had a working (but jank) system working that did the assembly change, but that's bricked in the beta.

dark wigeon
charred topaz
#

cool
is it also something I can use through C# or through command line to automate the process?

dark wigeon
#

nothing on command line but you can use the library in c#

charred topaz
#

ok, I'll take a look at it later

dark wigeon
jolly oriole
jolly oriole
#

(the one with just monobehaviours i also removed all function bodies and references to the modded assembly-csharp)

naive nimbus
#

Someone is actually using this for a mod!!! I'm so happy!!

jolly jungle
#

Oh I thought they made it themselves

cedar hemlock
cedar hemlock
jolly jungle
#

You don't need to be an artist to make textures tamershrug

cedar hemlock
#

eh its less work lol

jolly oriole
cedar hemlock
#

ok

paper valve
#

hello hi everyone

#

would you know where i can find good tutorials/documentation on how to start creating hk mods ?

jolly jungle
#

Right here

cedar hemlock
# jolly oriole Language get hook, next to the bool hook

so do i just copy

if (key.StartsWith("CHARM_NAME_"))
            {
                int charmNum = int.Parse(key.Split('_')[2]);
                if (charmHelper.charmIDs.Contains(charmNum))
                {
                    return "CHARM NAME";
                }
            }

and paste it again, then change "CHARM_NAME_" to "CHARM_NAME_X" X being thenumber?

#

or do i change the number elsewhere?

paper valve
jolly oriole
cedar hemlock
#

take your time :)

jolly oriole
#

so

#
if (key.StartsWith("CHARM_NAME_"))
{
    int charmNum = int.Parse(key.Split('_')[2]);
    if (charmHelper.charmIDs.Contains(charmNum))
    {
        return "CHARM NAME";
    }
}

is written the same way the bool handling is.
if you only add a single charm, you could write

if (key.Equals($"CHARM_NAME_{charmHelper.charmIDs[0]}")) return "My Custom Charm Name";

if you have multiple on the other hand, it could be

// possible to have this somewhere in the class
private string[] charmNames = { "Name 1", "Name 2", ... };

...

// In the language get hook
if (key.StartsWith("CHARM_NAME_"))
{
    // get the charm id of the charm name convo key
    int charmNum = int.Parse(key.Split('_')[2]);
    // check if charm id is one of our own
    if (charmHelper.charmIDs.Contains(charmNum))
    {
        // return custom name set above
        return charmNames[charmHelper.charmIDs.IndexOf(charmNum)];
    }
}
#

let me quickly add comments

cedar hemlock
#

so in (charmNum)) i type the number of the charm to change?

jolly oriole
#

no, as that is supplied by the request of a string

jolly jungle
cedar hemlock
#

so, then at (key.Split('charmnumhere??')[2]);

vocal spire
#

No

cedar hemlock
#

im stupid

jolly oriole
#

the only thing to change would either be

  1. the "My Custom Charm Name" in
if (key.Equals($"CHARM_NAME_{charmHelper.charmIDs[0]}")) return "My Custom Charm Name";

or
2. the private string[] charmNames = { "Name 1", "Name 2", ... }; in

// possible to have this somewhere in the class
private string[] charmNames = { "Name 1", "Name 2", ... };

...

// In the language get hook
if (key.StartsWith("CHARM_NAME_"))
{
    // get the charm id of the charm name convo key
    int charmNum = int.Parse(key.Split('_')[2]);
    // check if charm id is one of our own
    if (charmHelper.charmIDs.Contains(charmNum))
    {
        // return custom name set above
        return charmNames[charmHelper.charmIDs.IndexOf(charmNum)];
    }
}
vocal spire
#

In private string[] charmNames

cedar hemlock
#

oh okay i get it now

#

i messed smth up lol

#

oh wait

#

i might know the issue

#

that just reversed it

jolly oriole
#

well, it does look like it actually loaded the name though

cedar hemlock
#

yes

#

i'll just reset the OnLanguageGethook

#

hmm

#

the code you gave me is different from the example

jolly oriole
#

possible

cedar hemlock
#

when i use the code from the example the name no longer works

#

yours:

if (key.StartsWith("CHARM_NAME_"))
{
    // get the charm id of the charm name convo key
    int charmNum = int.Parse(key.Split('_')[2]);
    // check if charm id is one of our own
    if (charmHelper.charmIDs.Contains(charmNum))
    {
        // return custom name set above
        return charmNames[charmHelper.charmIDs.IndexOf(charmNum)];
    }
}

the example:

if (key.StartsWith("CHARM_NAME_"))
            {
                int charmNum = int.Parse(key.Split('_')[2]);
                if (charmHelper.charmIDs.Contains(charmNum))
                {
                    return "CHARM NAME";
                }
            }
jolly oriole
#

the only difference being that i replaced the return value with something that can be customized per charm

cedar hemlock
#

yea

#

it's interresting bc the example code is also made for multiple charms, but then gives code that is only used to change all the names to one thing

jolly oriole
#

yea, i could update it rn, which i think i'll do rn

cedar hemlock
#

ok so i got the names and desc's working, now the effects

jolly oriole
cedar hemlock
#

and where do i put the effects?

jolly oriole
#

that has to be managed by each mod on it's own, i don't have helpers for that

cedar hemlock
#

ok and how do i do that?

jolly oriole
#

good question

cedar hemlock
#

is it in the docs or somewhere else..?

cedar hemlock
#

on the docs i see if (PlayerData.instance.GetBool("equippedCharm_27")), so is the number of the charms equippedCharm_41, equippedCharm_42, equippedCharm_43 and equippedCharm_44?

jolly oriole
#

well, that depends on the loaded mods

#

so ig a method similar to the language hook would be good

#

but something like

if (PlayerData.instance.GetBool($"equippedCharm_{charmHelper.charmIDs[0]}"))
{
  // code here for one charm
}
if (PlayerData.instance.GetBool($"equippedCharm_{charmHelper.charmIDs[1]}"))
{
  // code here for one charm
}
if (PlayerData.instance.GetBool($"equippedCharm_{charmHelper.charmIDs[2]}"))
{
  // code here for one charm
}
if (PlayerData.instance.GetBool($"equippedCharm_{charmHelper.charmIDs[3]}"))
{
  // code here for one charm
}

for 4 charms would be ideal

jolly jungle
#

Btw ruttie did you finish the blue hollow knight reskin thing?

jolly oriole
#

especially if the effects severely differ from one another

cedar hemlock
#

if yes, yes

jolly jungle
#

Cool

#

Do you have screenshot or not right now

#

As in, do you happen to have a screenshot, or not yet

jolly jungle
#

It, uh

#

Looks not blue zote

cedar hemlock
#

lol

#

it's cause of the particles

#

thats a rly bad picture for the drive to take lol

#

to change the particles will take some time

cedar hemlock
cedar hemlock
jolly oriole
cedar hemlock
#

oh okay

#

it works! thx

#

is there an doc somewhere with all the charm effects?

#

(the code for them ofc)

jolly oriole
#

no, they're scattered throught the game

cedar hemlock
#

sad

jolly oriole
#

some in HeroController.CharmUpdate (or gamemanager, idk), some in fsms, some only in attack methods

cedar hemlock
#

but ehm

#

where are fsm's actually?

jolly oriole
cedar hemlock
#

ok then how do i give the charms textures

jolly oriole
#

when doing

charmHelper.customSprites = new Sprite[] { new Sprite(), new Sprite(), new Sprite(), new Sprite() };

supply loaded sprites instead of the new Sprite() x4
load the sprites the same way you loaded the thk spritesheet

cedar hemlock
#

yeah so...

jolly jungle
cedar hemlock
paper valve
#

whats the easiest thing i can create in order to get the hand of it

cedar hemlock
#

try making things cost geo

paper valve
#

wdym

cedar hemlock
#

i also started with that and miserably failed

cedar hemlock
#

if you need help i have the code for it

jolly oriole
cedar hemlock
#

wdym

#

if i re-use this code for the charms will the charms not become like thk?

#

i mean how do i tell the code to use one texture for this and the other texture for that etc

jolly oriole
cedar hemlock
#

soo in tmpTextures.Add(QuickerFocusKey, QuickerFocusFile); QuickerFocusFile is the name of the image?

light zodiac
#

How do I make a settings file for my mod (Like Qol.GlobalSettings)?

cedar hemlock
light zodiac
cedar hemlock
#

np

charred topaz
dark wigeon
#

the assstsFiles list is actually now only for backend stuff and doesn't get set anywhere by the library

#

just use LoadAllAssetsFromBundle

#

can you send me the bundle? I'll just write it for you

charred topaz
#

ok, in a second

#

I was just wondering how would I be able to read the base field information on the assets. When I tried calling that method, I couldn't find a "table" property on them

jolly oriole
dark wigeon
#

he said "I'm unable to use asmdefs to change the assemblies because of how my project is structured."

#

not sure exactly what he meant but I assumed he was saying that wasn't an option

vernal widget
#

Does anyone know whats happening with the new multiplayer mod

cedar hemlock
vernal widget
#

Oh sorry

charred topaz
# jolly oriole nick, idk if you've read this, but could be an alternative to the fix after buil...

That is one of the first things I tried, but it comes at a cost. Basically I also have an assembly called HollowKnight.dll in my project, that contains a bunch of things that are from HK's Assembly-CSharp (IMod, NonBouncer, the TMPRO library, etc). When the asset bundle gets built, I want to reference "Assembly-CSharp.dll" instead of "HollowKnight.dll", so any scripts from that assembly get loaded properly when I go to launch the game. The problem is that I cannot rename "HollowKnight.dll" to "Assembly-CSharp.dll" in the project, because it's not possible to add a reference to "Assembly-CSharp" in the editor, thus disallowing me from using anything in that assembly in WeaverCore.dll or InfernoKingGrimm.dll in the project

jolly oriole
#

yeah, the way i do it is to have 2 seperate projects, one specifically for unity where i remove everything relating to the modded assembly and only leave normal unity/c# in (not even function bodies), but unity doesn't care if the types aren't exactly the same (like 2 different enums), though the thing with tmpro is probably bad, maybe possible to just put the .cs files generated by something like utinyripper somewhere into the assets folder, as those are then referenced to assembly-csharp

#

so i get funny looking classes like

light zodiac
#

I was trying to make a Global Settings file and I'm getting an error

Code in the new Settings.cs filecs public class GlobalModSettings : ModSettings { public int health = PlayerData.instance.GetInt("maxHealth"); public int blue_hearts = 0; public int soul = 0; }

Code in the main.cs file cs public GlobalModSettings Settings = new GlobalModSettings(); public override ModSettings GlobalSettings { get => Settings; set => Settings = (GlobalModSettings) value; }

In the docs it says to do Settings.health but that gives me an error

copper nacelle
#

what is the error

#

calling getint in a settings file is not the move ngl

jolly oriole
#

but in theory shouldn't show an error

#

at least not in the ide

copper nacelle
#

yeah just warning in advance

light zodiac
copper nacelle
#

instance method?

light zodiac
#

I'm not following

jolly oriole
#

can you rename Settings to _globalSettings?

copper nacelle
#

where are you doing this

jolly oriole
#

as Settings is reserved for save settings afaik

copper nacelle
#

it do be

light zodiac
copper nacelle
#

internal class x5fiftM

#

that is an instance member you can't just say Settings.health wherever you want

dark wigeon
#

I tested with ModifyBundle infernogrimmmod_bundle InfernoKingGrimm.dll

light zodiac
copper nacelle
#

have a static member or pass the settings to your class

charred topaz
jolly jungle
#

Suppose I have multiple enemies I want to reskin

jolly oriole
#

ok

jolly jungle
#

Can I go over all things with a HealthManager and then just do ifs for every name?

jolly oriole
#

is probably the most memory efficient and performant option

jolly jungle
#

Wonderful

#

Thanks

#

So should taking off the Where but keeping the Select do it?

#

Eh who cares let's just try

jolly oriole
#

i'd remove the where

cedar hemlock
light zodiac
jolly jungle
#

Any idea why two references just disappeared?

#

Microsoft.CSharp and System.Net.Http

#

Went poof all of a sudden

#

I didn't touch them

jolly oriole
jolly jungle
#

So, any ideas, or just panic?

jolly oriole
#

no idea

jolly jungle
#

And why the, ah, panic?

jolly oriole
#

because it went poof

jolly jungle
#

Ah of course zote

#

is hk still in .net framework 3.5?

jolly oriole
#

1432 yes

jolly jungle
#

Hm

#

Damnit

#

So apparently the first one of the two is not meant to exist in 3.5 or something

#

Still can't figure out the second

#

And the poofing part was me misunderstanding an error, it was more of "adhgs help why are these here please make them poof"

cedar hemlock
#

will 1.5 also updat the net framework?

jolly jungle
#

I think so

#

That's why I asked

vocal spire
cedar hemlock
#

ok nice

#

will there be a big difference?

jolly oriole
#

not really but still kinda

vocal spire
#

Yes, but actually no

jolly jungle
#

More like no, but actually yes

cedar hemlock
#

then i will probably be back here why my shit aint working

jolly oriole
#

well hk 1.5 won't change that much, but a lot of the mapi will change with the 1.5 release

jolly jungle
#

Depending on how complicated it is, it can be as simple as updating references

cedar hemlock
#

nice

jolly jungle
#

Btw what did you want to see earlier ruttie?

vocal spire
#

All my mods will require SFCore since I can’t be bothered to do global settings the new way

jolly jungle
#

The new way?

jolly oriole
#

generic mods get yeeted out of mapi

vocal spire
#

You can do the “new” way currently if you want to get used to it

cedar hemlock
vocal spire
#

Remember the code I gave you that was based off a dictionary

cedar hemlock
#

ye

#

its 21:06 here so i probably wont be messing with it now tho

vocal spire
#

So add more stuff to the dictionary’s initializer, and do some stuff with more textures

cedar hemlock
#

ok

jolly jungle
#

Alright problem solved, all I needed to do was violently remove the references

vocal spire
#

Cool

#

Violence is always the answer

jolly jungle
#

Clearly

#

Anyone knows what GameObject.DestroyAll() does?

#

Couldn't find anything about it

jolly oriole
#

wait

#

is it a helper method from modcommon or something?

jolly jungle
#

Also Destroy doesn't work for me

jolly jungle
#

it's the only thing it elts me do

#

When I write destroy

jolly oriole
#

it's an extension

jolly jungle
#

I also tried Destroy(x)

jolly oriole
#

idk which mod adds that though

vocal spire
#

GameObject.Destroy(instance) is the normal way objects are destroyed

jolly oriole
#

oh yea, destroy is a static method

jolly jungle
#

So what should I write

#

?

jolly oriole
#

GameObject.Destroy(go) or UnityEngine.Object.Destroy(go)

jolly jungle
#

ohhhh

#

I see

vocal spire
#

GameObject.Destroy(UnityEngine.Object instance)

jolly jungle
#

so that's why it didn't recognise it

#

thanks

cedar hemlock
#

bro don't go talking too complicated with me lol

#

(im not very good at unity and coding)

jolly jungle
#

Why's it tiny?

#

Or, more to the point, how do I fix this?

#

Should I just get a better sprite?

jolly oriole
#

one of the sprite.create parameters is pixelperunit, set that to 66 (or 200/3 to be exact)

jolly jungle
#

Why that?

#

Is that a constant in the game?

vocal spire
#

No

#

(?)

jolly oriole
#

because for no reason the in game sprites are somehow 1.5 times as large as custom ones (while showing in uabe as normal)

jolly jungle
#

Hm

#

What about spritesheets?

jolly oriole
#

i have no clue why you'd use a spritesheet for a single image

jolly jungle
#

Oh no

#

I meant

#

If I load the spritesheets together with this

#

What do i do?

#

How would I differentiate between them?

jolly oriole
#

i have no clue how to do that

vocal spire
#

Wdym

#

Loading multiple images?

jolly jungle
#

I'm loading a bunch

#

Both single sprites and spritesheets

vocal spire
#

Are you asking how to load multiple or something else?

jolly jungle
#

Something else

#

The spritesheets seem to be correct scale

jolly oriole
#

i mean, if the spritesheets are for things like enemies it is perfectly fine to do the same

vocal spire
#

Well do what grenade said

#

Sheets are different(tk2d stuff)

jolly oriole
#

as the texture itself doesn't get altered, just how big the texture is displayed on a sprite

jolly jungle
#

For what spritesheets will this not work?

vocal spire
#

Wdym

jolly oriole
#

one would have to test

jolly jungle
#

Ah zote

pure nova
#

Aren't sprite sheets made by Unity itself?

jolly jungle
#

So if I ever see anything at x1.5 scale, I'll know what caused it

vocal spire
pure nova
#

Oh, I must be thinking of something else then.

jolly oriole
pure nova
#

Oh, I see.

#

Oh, it seems I've used "Oh," more than one time in a row.

jolly jungle
#

Aight, it works!

#

Thanks :D

jolly jungle
#

Oh, we all do, sometimes

jolly oriole
#

nah

vocal spire
#

Oh, nice

coarse lintel
#

oh god I'm snail

pure nova
#

Oh, Shal, it seems you're worthy of the snail role. But to be fair, seeing as how late am I to your message, so am I.

dark wigeon
#

yes unity actually makes better packed spritesheets than tk2d

cedar hemlock
#

when the update comes how fast will the api be updated?

#

is it a big task or are there only minor differences

nimble lake
#

I think they would rather wait for it to fully release

cedar hemlock
#

when 1.5 is released

#

cause i'll be .net 4.6+ and unity will be 2020(.2 i think?) so there will be lots to change

nimble lake
#

mhm

#

I remember when they just released the beta

#

There were a lot of changes and discussion about that here

#

Even after 1.5 is fully released, it'll be a while before it's supported like it is now

cedar hemlock
#

yeah probably

cedar hemlock
#

i managed to break the charms in not only 1 but 2 ways

jolly oriole
cedar hemlock
#

oh ok

#

so i have this:

public const string Charm1 = "Lifeblood Crystal";
        private const string Charm1File = "Lifeblood.Resources.Charm1.png";
...
Assembly asm = Assembly.GetExecutingAssembly();
            dict = new Dictionary<string, Sprite>();
            Dictionary<string, string> tmpTextures = new Dictionary<string, string>();
            tmpTextures.Add(Charm1, Charm1File);
...

            charmHelper.customSprites = new Sprite[] { ts.Get(TextureStrings.Charm1), ts.Get(TextureStrings.QuickestFocusKey), ts.Get(TextureStrings.DeeperFocusKey), ts.Get(TextureStrings.DeepestFocusKey) };
#

and i named the file with the texture Lifeblood.Resources.Charm1.png

#

and made it an embedded recource

#

im missing something

jolly oriole
#

depending on the project structure you may have another path instead of "Lifeblood.Resources.Charm1.png" (possibly "Lifeblood.Charm1.png", but generally "Project.OptionalFolder1.OptionalFolder2.Filename.extension")

cedar hemlock
#

ooohhh

#

im stupid

#

i thought Lifeblood.Resources.Charm1.png needed to be the name of the image

jolly oriole
#

lol

vocal spire
#

lol

cedar hemlock
#

moddingapi

cedar hemlock
#

what is #region blabla ... #endregion for

#

why do they all turn in to this

nimble lake
#

What is the Modding reference?

#

I opened up some old projects and a lot of them are missing the Modding namespace and I don't know what is it referencing

cedar hemlock
#

its so you dont have to type modding.modhooks and you can just use modhooks

#

you type at the top using modding;

nimble lake
#

Where can I find it?

cedar hemlock
#

just type it

#

at the top

#

or do you mean

#

nvm

nimble lake
stone elm
nimble lake
#

i mean it's missing

cedar hemlock
#

you need to reference the assembly.csharp

light zodiac
cedar hemlock
#

you go to the assembly explorer

#

solution*

#

and right click references

nimble lake
#

wait what? but it was already referenced

cedar hemlock
#

and add a reference to asembly.csharp

light zodiac
#

make sure that the one you're referencing is the modding api

#

you might have referenced the vanilla one

cedar hemlock
#

ye

nimble lake
cedar hemlock
copper nacelle
#

yeah they just collapse stuff in an ide

#

and give me brain cancer

cedar hemlock
light zodiac
#

i used PlayerData.instance.healthBlue = 2; to add 2 lifeblood masks when a scene is changed. When the scene loads, the life blood masks do get added (i can see the lifeblood hit animation and my white masks dont decrease when i get hit) but the lifeblood masks doesn't show up in the HUD. How can i fix that?

copper nacelle
#

suffer

#

don't set it

#

use EventRegister.SendEvent("ADD BLUE HEALTH")

cedar hemlock
#

afaik they only get added to the ui when the scene changed

cedar hemlock
#

?

copper nacelle
#

no

#

i in fact

#

mean literally do not that

cedar hemlock
#

what

#

then what is "ADD BLUE HEALTH"

copper nacelle
#

it adds blue health

cedar hemlock
#

ohh

#

you literally

#

do addblue health

#

what

#

does "ADD BLUE HEALTH" give you health?

#

no right?

copper nacelle
#

yes

#

it gives you blue health

#

that is why it says

#

add blue health

cedar hemlock
#

but where do you put the amount

copper nacelle
#

it gives you 1

#

loop it

cedar hemlock
#

huh

#

crazy

light zodiac
copper nacelle
#

alternatively you can try setting it

#

and then doing EventRegister.SendEvent("UPDATE BLUE HEALTH")

#

but i think i had some issue with that

#

maybe i'm misremembering though

cedar hemlock
#

so is this a bit good:

        private bool dash()
        {
            EventRegister.SendEvent("ADD BLUE HEALTH");
            bluehealth++;
            if (bluehealth != 2) 
            {
                dash();
            }           
            throw new NotImplementedException();
        }
#

hmm no

#

sry lemme change it

#

so thats better?

copper nacelle
#

what

cedar hemlock
#

is that good

copper nacelle
#

no

cedar hemlock
#

or am i stupid

copper nacelle
#

why are you doing this recursively

#

why is there still a throw

#

and why is it called dash

cedar hemlock
#

ModHooks.Instance.DashPressedHook += dash; :P

copper nacelle
#

fair enough

#

you should be returning true

cedar hemlock
#

ok

#

doesn't do shit

copper nacelle
#

interesting

#

show

cedar hemlock
#

code?

copper nacelle
#

yeah

cedar hemlock
#
public override void Initialize()
        {
        ModHooks.Instance.DashPressedHook += dash;
        }

int bluehealth = 1;
        private bool dash()
        {
            EventRegister.SendEvent("ADD BLUE HEALTH");
            bluehealth++;
            if (bluehealth != 2) 
            {
                dash();
            }
            return true;
        }
copper nacelle
#

why is it still recursive

#

why do you have an instance field

cedar hemlock
#

wdym

#

what do i need to change

ornate rivet
#

you call dash in dash

cedar hemlock
#

oh

ornate rivet
#

and bluehealth is an instance field

vocal spire
#

lol

vocal spire
cedar hemlock
#

great

#

which bool?

vocal spire
#

Show your bool hooks

#

Autocorrect evil

cedar hemlock
#

yes

#
private void initCallbacks()
        {
            /// Hooks
            ModHooks.Instance.GetPlayerBoolHook += OnGetPlayerBoolHook;
            ModHooks.Instance.SetPlayerBoolHook += OnSetPlayerBoolHook;
            ModHooks.Instance.GetPlayerIntHook += OnGetPlayerIntHook;
            ModHooks.Instance.SetPlayerIntHook += OnSetPlayerIntHook;
            ModHooks.Instance.AfterSavegameLoadHook += initSaveSettings;
            ModHooks.Instance.ApplicationQuitHook += SaveCHEGlobalSettings;
            ModHooks.Instance.LanguageGetHook += OnLanguageGetHook;
            ModHooks.Instance.CharmUpdateHook += OnCharmUpdate;

        }
vocal spire
#

No, I meant the OnGet(and set)PlayerBoolHook(s)

cedar hemlock
#

ohso

#
private bool OnGetPlayerBoolHook(string target)
        {
            if (Settings.BoolValues.ContainsKey(target))
            {
                return Settings.BoolValues[target];
            }
            #region Custom Charms
            if (target.StartsWith("gotCharm_"))
            {
                int charmNum = int.Parse(target.Split('_')[1]);
                if (charmHelper.charmIDs.Contains(charmNum))
                {
                    return Settings.gotCharms[charmHelper.charmIDs.IndexOf(charmNum)];
                }
            }
            if (target.StartsWith("newCharm_"))
            {
                int charmNum = int.Parse(target.Split('_')[1]);
                if (charmHelper.charmIDs.Contains(charmNum))
                {
                    return Settings.newCharms[charmHelper.charmIDs.IndexOf(charmNum)];
                }
            }
            if (target.StartsWith("equippedCharm_"))
            {
                int charmNum = int.Parse(target.Split('_')[1]);
                if (charmHelper.charmIDs.Contains(charmNum))
                {
                    return Settings.equippedCharms[charmHelper.charmIDs.IndexOf(charmNum)];
                }
            }
            #endregion
            return PlayerData.instance.GetBoolInternal(target);
        }
#

and

#
private void OnSetPlayerBoolHook(string target, bool val)
        {
            if (Settings.BoolValues.ContainsKey(target))
            {
                Settings.BoolValues[target] = val;
                return;
            }
            #region Custom Charms
            if (target.StartsWith("gotCharm_"))
            {
                int charmNum = int.Parse(target.Split('_')[1]);
                if (charmHelper.charmIDs.Contains(charmNum))
                {
                    Settings.gotCharms[charmHelper.charmIDs.IndexOf(charmNum)] = val;
                    return;
                }
            }
            if (target.StartsWith("newCharm_"))
            {
                int charmNum = int.Parse(target.Split('_')[1]);
                if (charmHelper.charmIDs.Contains(charmNum))
                {
                    Settings.newCharms[charmHelper.charmIDs.IndexOf(charmNum)] = val;
                    return;
                }
            }
            if (target.StartsWith("equippedCharm_"))
            {
                int charmNum = int.Parse(target.Split('_')[1]);
                if (charmHelper.charmIDs.Contains(charmNum))
                {
                    Settings.equippedCharms[charmHelper.charmIDs.IndexOf(charmNum)] = val;
                    return;
                }
            }
            #endregion
            PlayerData.instance.SetBoolInternal(target, val);
        }
vocal spire
#

Show the settings class you have

cedar hemlock
#

this one?

#
private void initSaveSettings(SaveGameData data)
        {
            // Charms
            Settings.gotCharms = Settings.gotCharms;
            Settings.newCharms = Settings.newCharms;
            Settings.equippedCharms = Settings.equippedCharms;
            Settings.charmCosts = Settings.charmCosts;
        }
vocal spire
#

No

#

The class

#

For your settings

#

Maybe named something like CHESaveSettings

cedar hemlock
#

initglobalsettings?

vocal spire
#

No

cedar hemlock
vocal spire
#

The class

cedar hemlock
#
        {
            SaveGlobalSettings();
        }
cedar hemlock
vocal spire
#

Class

cedar hemlock
#

Class

#

the whole class