#archived-modding-development

1 messages Β· Page 107 of 1

flat forum
#

also, when I start it's 0

solemn rivet
#

I don't think so, kerr. Seems like this button is always there, but disabled

#

just like the gng background and stuff

exotic venture
#

can you enable it?

solemn rivet
#

I mean

#

the graphics

#

not the button itself

exotic venture
#

ohhh rip

solemn rivet
#

The referenced script on this Behaviour (Game Object 'GGButton') is missing!

flat forum
#

Now this - The name 'Instance' does not exist in the current context
regarding ModHooks.Instance.AttackHook += OnAttack;

solemn rivet
#

this makes no sense

#

can you send a larger portion of code?

flat forum
#

wel

#

I had dinner

#

then did something

#

and it unbroke

#

But problem persists - whenever I attack damage gets set to 5

#

public int defaultNailDamage = 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades");

#

guess this is the problematic thing

#

Any idea why?

solemn rivet
#

try printing PlayerData.instance.GetInt("nailSmithUpgrades") to see if you're getting the correct field

#

is your code updated on github?

flat forum
#

I don't think so

#

(still haven't quite figured out how to delete files)

solemn rivet
#

update it then I'll check it for you

flat forum
#

Ok

#

gimme a sec

solemn rivet
#

just make a commit and push it

flat forum
#

can I do it with rm?

solemn rivet
#

rm is to remove stuffs

flat forum
#

trying to remove the NewFotF.cs from the GitHub site

solemn rivet
#

why?

flat forum
#

because I want to upload the new one and don't know if it'll replace the old one

#

or just create another

solemn rivet
#

it'll replace it

flat forum
#

Uploading same file will replace it

#

Ok

#

lemme try

#

Ok

#

I think it worked

#

that should be latest vesion

solemn rivet
#

ok

#

sent a small pr fixing sets and gets

flat forum
#

I don't seem to have recieved it?

solemn rivet
#

oops

#

forgot to send the pr, had just forked it

#

there, I sent it

flat forum
#

hehe

#

So, what did you change?

solemn rivet
#

instead of, say, PlayerData.instance.nailDamage it's better to use PlayerData.instance.GetInt("nailDamage")

#

for reasons

flat forum
#

mhm

solemn rivet
#

so - does it work?

flat forum
#

lemme test it

#

I closed VS to get the Github working

#

What's a HelloWorld?

#

it gave a single error

#

The left-hand side of an assignment must be a variable, property or indexer

#

regarding this line

#

PlayerData.instance.GetInt("nailDamage") = defaultNailDamage;

solemn rivet
#

oh

#

change it to PlayerData.instance.SetInt("nailDamage", defaultNailDamage);

#

my bad

flat forum
#

Um

#

damage still gets reset to 5 on attack

solemn rivet
#

but does it deal the correct damage?

flat forum
#

Lemme check

#

Deals 5 damage per hit

solemn rivet
#

do you have fotf equipped?

flat forum
#

wait

#

I set it to 21 with +

#

and now it's fixed

#

HM

#

Ok

#

works fine now

#

thanks a lot

#

Ok

#

so

#

here's the thing

#

at full health Nail Damage gets set to 5

#

I have to manually get it up to normal

#

starts working fine after I set it and am at least 4 masks beneath my maximum

#

Or

#

wait

solemn rivet
#

but how much nailDamage do you have?

#

because that shouldn't be happening

flat forum
#

NailDamage is 5 at full health and unless I manually do an update to naildamage using Debug mod it's stuck at 5

solemn rivet
#

no, I mean

#

without the mod

#

how many upgrades do you have?

#

what's the damage supposed to be at?

flat forum
#

Max Nail

#

that's my 106% save I'm testing things on

solemn rivet
#

weird

flat forum
#

without FotF everything is fine

#

the moment I equip it damage gets set to 5

#

and that whole thing starts

#

Ok so
If it gets set to 5, unless I manually change it nothing will happen

solemn rivet
#

try nailsmithUpgrades instead of nailSmithUpgrades

#

shouldn't work, but

#

OH

#

I got it

#

I'll submit a pr

flat forum
#

what does -39991 damage look like

#

LET'S SEE

#

Looks like nothing

#

not doing anything at al

supple sigil
#

what

#

a

#

surprise

flat forum
#

I expected to heal enemies

#

I was like
Are you hurt? Maybe I can help

but nothing at all happened

supple sigil
#

i dont think they even implemented a health increase mechanic

solemn rivet
#

sent it

#

also, as it is, the game won't update your nailDamage when you upgrade the nail

#

just sayin

flat forum
#

The left-hand side of an assignment must be a variable, property or indexer
again, replacing that thing with the one you sent earlier

solemn rivet
#

oh, yeah

#

because you hadn't pushed it to github

#

I didn't even think to fix that, my bad

#

but, like I said

#

you're gonna have some issues with the code as it is

flat forum
#

mhm

#

I'll test it now

#

once it works I'll put it on Github

#

Now it doesn't change

solemn rivet
#

like I said

flat forum
#

but it looks fine, what's broken?

solemn rivet
#

let me ask you this

#

imagine you're reading the code

#

and I told you that nailSmithUpgrades has changed

flat forum
#

mhm

solemn rivet
#

what would change?

flat forum
#

well

#

nailUpgrade has changed

solemn rivet
#

it's only called once, right?

#

when is that?

flat forum
#

in this thing?
defaultNailDamage = 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades");

solemn rivet
#

yup

#

but that line is inside an if statement

#

so the code starts running, it creates the int defaultNailDamage and sets it to 0 (default value)

flat forum
#

(Also, I can't thank you enough for explaining things and helping me out)

solemn rivet
#

then, it gets to if (defaultNailDamage == 0)

flat forum
#

and it sets the damage to the NailUpgrades thing

solemn rivet
#

yup

#

but

#

once it does that,

#

defaultNailDamage β‰  0 forever

#

so the if never gets triggered again

#

and defaultNailDamage never gets updated for the new value for nailSmithUpgrades

flat forum
#

So, we reset it back at the end?

solemn rivet
#

you could do that, OR

#

even better

#

forego using defaultNailDamage at all

flat forum
#

or do a

 if (defaultNailDamage != 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades"))
            {
                defaultNailDamage = 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades");
            }
#

will that work?

solemn rivet
#

just check if nailDamage is 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades")

#

yeah, what you said would work

#

(also, it's != and not !==)

flat forum
#

oops

solemn rivet
#

so you have two possible solutions

flat forum
#

When are double signs used? == or &&

#

and others

#

I've seen them here and there

solemn rivet
#

yours - which replaces the == 0 with != 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades")

#

and mine - which removes the dependency on defaultNailDamage entirely

#

it's up to you

#

oh, those are the default symbols

#

a=b means "the value of a becomes the value of b"

#

a==b means "are the values of a and b equal?"

#

idk what & is used for

#

but && is the logical and

flat forum
#

mhm

#

|| is or

solemn rivet
#

yup

flat forum
#

=)

solemn rivet
#

and ! is negative

#

so !(a == b) is logically equivalent to a != b

#

so the second is just shorthand

flat forum
#

let me test it

#

welp

#

for some reason doesn't seem to work

if (defaultNailDamage != 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades"))
            {
                defaultNailDamage = 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades");
            }
#

Why?

#

Ok

#

so

#

Nail Damage this time IS the same

#

so it doesn't trigger the process?

#

that can't be it

#

Ok

#

Lemme try

solemn rivet
#

First - see if the fotf buff is working

#

Then try getting an upgrade and see if it scales with it

flat forum
#

First step - Fail

#

second step

#

uuuuuhhhhh

solemn rivet
#

Push the code again

#

I'll see what I can do

flat forum
#

And I'm sure there was a version that worked

#

I think I even uploaded the .dll

#

I can't seem to find it now

solemn rivet
#

ok, let's take a look

flat forum
#

(This single line has become equal to a horror movie to me)

#

(Me: Half-Assing Homework.png
Dad: ok, let's take a look)

solemn rivet
#

hmm

#

seems fine?

flat forum
#

That's The Problem

#

I'll try again

solemn rivet
#

I'll try compiling it myself

flat forum
#

Ok

#

still broken for me

#

Well?

solemn rivet
#

hm...

#

OH

#

ffs

#

dunno when it changed but

#
            if (PlayerData.instance.GetInt("nailDamage") != defaultNailDamage)
            {
                PlayerData.instance.SetInt("nailDamage", defaultNailDamage);

                if (PlayerData.instance.GetBool("equippedCharm_6"))
                {
                    Log("Stronger Attack");

                    PlayerData.instance.SetInt("nailDamage", PlayerData.instance.GetInt("nailDamage") + 5 * (PlayerData.instance.GetInt("maxHealth") - PlayerData.instance.GetInt("health")));

                    PlayMakerFSM.BroadcastEvent("UPDATE NAIL DAMAGE");

                    _NailDamageTracker = PlayerData.instance.GetInt("nailDamage");

                    Log("Set Nail Damage to to " + _NailDamageTracker);
                }
            }```
#

should be

#
            if (PlayerData.instance.GetInt("nailDamage") != defaultNailDamage)
            {
                PlayerData.instance.SetInt("nailDamage", defaultNailDamage);
            }

            if (PlayerData.instance.GetBool("equippedCharm_6"))
            {
                Log("Stronger Attack");
                PlayerData.instance.SetInt("nailDamage",
                    PlayerData.instance.GetInt("nailDamage") +
                    5 * (PlayerData.instance.GetInt("maxHealth") - PlayerData.instance.GetInt("health")));
                PlayMakerFSM.BroadcastEvent("UPDATE NAIL DAMAGE");
                _NailDamageTracker = PlayerData.instance.GetInt("nailDamage");
                Log("Set Nail Damage to to " + _NailDamageTracker);
            }```
flat forum
#

Let me just

#

I'll com3 back tommorow morning

solemn rivet
#

done, it works

flat forum
#

Yay

solemn rivet
#

you somehow placed the damage buff inside the check for if the nailDamage had changed

#

and since it never did change, it never triggered the damage buff

flat forum
#

Wait really?

#

I'm kinda sleepy

#

Probably because of that

burnt laurel
#

alright

#

how do i kill mantis lords with blackmoth

copper nacelle
#

dash into them

burnt laurel
#

i know that much

#

but as soon as 2 attack i'm overwhelmed and cant heal at all

#

and yes

copper nacelle
#

do you have mothwing cloak at least

burnt laurel
#

i am grabbing the lifeblood

#

yes

copper nacelle
#

re wtf

burnt laurel
#

i have the 1st nail upgrade, mothwing cloak, and lifeblood

#

how am i dying

copper nacelle
#

πŸ…±oi

burnt laurel
#

Β―_(ツ)_/Β―

copper nacelle
#

dash through all the dashes ez

#

dash up through dives

#

pogo if needed

exotic dune
#

mantis lords seems reasonable in blackmoth, hornet 1 is the one i have trouble with

copper nacelle
burnt laurel
#

hornet 1 was super easy for me

hazy sentinel
#

is blackmoth still broken

burnt laurel
#

with shields?

#

that's fixed as far as i know

exotic dune
#

idk something about that fight means i have to fight her like a turtle or i get fucked

hollow pier
#

can you actually cancel dive with dash

burnt laurel
#

you have shade dash, you can just dash through her attacks

#

wait a minute

exotic dune
#

it's probably not that hard and i'm just an idiot lol

burnt laurel
#

since i can barely heal

#

why dont i equip more lifeblood

copper nacelle
#

πŸ›‘

burnt laurel
#

any charm recommendations?

#

for this fight

#

right now i got the lifeblood charm and dashmaster equipped

#

5 charm notches

compact sedge
#

if you're not planning on cheating don't take long slash

exotic dune
#

longnail might help but you get mop right after that fight so

compact sedge
#

longnail = fly off and hit the spikes

#

unless you're cheating

#

then it's really good

burnt laurel
#

i barely have any geo and i only have a few charms

exotic dune
#

you could get joni's maybe, if you can't heal
i mean, knowing mantis lords you can

burnt laurel
#

uhh

#

not while both are out

copper nacelle
#

ur bad

burnt laurel
#

atleast i cant

#

i know im bad

#

you dont think i already know this?

#

it took like an hour to get past hornet 1, it's a miracle i've beaten the radiance

copper nacelle
#

wtf

burnt laurel
#

dont ask

#

i dont even know

#

hmmm

#

i dont know what to do

#

i'm doing what all of you suggest

#

yet i still die

solemn rivet
#

listen to hornet

#

_gitgud

#

reee

copper nacelle
#

^

solemn rivet
#

;gitgud

#

reeΒ²

#

I miss the gitgud command

rain cedar
copper nacelle
#

it is now

#

used to not be tho

solemn rivet
#

oh

#

that's why then

#

I recall using it here once

burnt laurel
#

you'd think 8 masks would be enough for this fight

#

but i manage to lose all 8 before i even kill 2o f them

copper nacelle
#

that's cause it is

burnt laurel
#

whatever

#

i get it

#

i'm terrible

copper nacelle
#

are you dashing up/diagonally?

burnt laurel
#

no not really

#

i find it sorta difficult to for whatever reason

#

idk why

copper nacelle
#

imo free damage

#

dash up through the dive

#

up through the boomerangs

#

ez

burnt laurel
#

alright so i see my main problem

#

spike pits

#

throughout all this "studying" (me failing miserably), i've noticed that i tend to take most damage from spike pits

copper nacelle
#

dash up

#

can't dash into the spikes if you don't go to the sides

burnt laurel
#

thats my problem

#

oh

#

i see what you mean

#

also i tend to accidentally dash off of the wall and just smack face first into a disc

copper nacelle
#

why go on the wall

burnt laurel
#

idk

#

back down to 1 mask

#

hmmm

#

so where would be a good opportunity to heal

#

usually whenever i try to heal they both just dash at me and kill me

copper nacelle
#

double boomerangs

burnt laurel
#

ok

copper nacelle
#

also 2 heals between phases

burnt laurel
#

phases?

#

like them dying?

copper nacelle
#

1 -> 2

burnt laurel
#

sedtgerstfgukhsrtjdtgyj

#

im tempted to just get debug mod

#

i dont care anymore

#

it isn't really fun to just get killed over and over, and practice doesn't seem to be making perfect here

copper nacelle
#

re

#

you can do it

exotic dune
#

i'm going to have the best trigger finger after i beat blackmoth some time in the 2200s

burnt laurel
#

i'm at a point where i can almost do the entire phase 1 (the first mantis lord) without getting hit

flat forum
#

Ok

#

It works now

#

so

#

right now tho

#

it's not been balanced to any damage affecting mods

#

like Hell mod or BlackMoth

#

Will do something like
NailDamage *= 1 + (2* ((MaxPlayerHealth-PlayerHealth)/MaxPlayerHealth))

fair rampart
#

can i habe a lightbringer latest version pleas

young walrus
#

πŸ“Œ

copper nacelle
#

^^^^^^^^

burnt laurel
#

so is lightbringer basically blackmoth but with the elegy instead of dashing

#

or am i thinking of the wrong mod

young walrus
#

it's only similar in that the primary method of damaging enemies has changed

#

a lot of charms were changed in lightbringer

#

and they do interesting things

#

the attacking in lightbringer is like elegy, but it's definitely not elegy

exotic dune
#

while in blackmoth it's mostly the nail charms that are changed?

young walrus
#

your nail doesn't do anything in blackmoth. So charms and abilities were changed to augment your dash in different ways

compact sedge
#

in blackmoth all the nail charms do what they also do in the vanilla game but they ALSO affect your dash

#

it's just the nail does 1 dmg

versed anvil
#

Wait is it only spells or do you bodyslam everything?

compact sedge
#

you can use spells

#

they're normal

#

and you get soul by dashing through stuff

versed anvil
#

Ok

flat forum
#

Ok

#

Gonna start the balancing on NewFotF

compact sedge
#

pfft balance

flat forum
#

Currently it's only balanced for Pure Nail

compact sedge
#

isn't it percentage based?

flat forum
#

Currently no

#

right now it gives a Nail upgrade per mask lost

#

So you can end up with Pure Nail level damage at the start of the game

#

which

#

isn't really fair

compact sedge
#

yeah

flat forum
#

So, first

#

what was the notch cost thing?

compact sedge
#

I just have hooks on ModHooks.Instance.BeforeSavegameSaveHook and ModHooks.Instance.SavegameSaveHook

#

the before one sets the value to the normal one so that if you were to delete the mod your nail wouldn't become permanently strong. the after one sets it back to the value that it should be

flat forum
#

and the actual notches? What's the hook for them?

compact sedge
#

ModHooks.Instance.CharmUpdateHook is every time a charm is added or removed

flat forum
#

mhm

compact sedge
#

as for the cost of the charm itself I just do PlayerData.instance.charmCost_40 = notchesCost where notchesCost is any integer

flat forum
#

I think someone mentioned it earlier (and I planned to use it for the VeryLongNail thing)

#

so,

 public void BeforeSaveGame
Notches = Normal
 public void SaveGame
Notches = whatever I want
#

?

compact sedge
#

you'd set the playerdata.instance value to the normal one and whatever you want one

#

not just a variable named notches

#

so PlayerData.instance.charmCost_69

#

idk the charm that corrisponds to FotF

flat forum
#

YeahYeah I mean is that the way the beforeSaveGame and SaveGame should work?

compact sedge
#

pretty much

#

those 3 functions basically describe it

flat forum
#

wait

#

what does ruinCharmCost do?

compact sedge
#

it sets the charm cost to my value that isn't the base game value

flat forum
#

so, is that the SaveGame thing?

compact sedge
#

so it "ruins" the save file because if you were to save like that it would have the wrong notch cost. But then I restore it right before savin

#

basically the whole purpose of this code in the first place and why I do it and why you should as well is to make it so if someone loads your mod, and then uninstalls it, their save game file will still work properly

#

you don't have to

#

lightbringer doesn't

#

neither does hardmode

flat forum
#

welp

compact sedge
#

but you absolutely should

#

trust me

flat forum
#

I don't want to break save files

#

(SaveGameData data)?

#

I'll just leave that like it is

compact sedge
#

it needs that variable but I don't use it

flat forum
#

will it work without that in the brackets?

#

just private void restoreCharmCost()

compact sedge
#

if you add the hooks, and then press ctrl + . visual studio will make the functions for you

#

and no

#

but if you let VS make the functions for you it will make them with the proper variables

#

just add the hook, and over the part of code that has an error, which will be the function name, press ctrl + .

#

and it will suggest making a function

flat forum
#
ModHooks.Instance.BeforeSavegameSaveHook += BeforeSaveGame;
ModHooks.Instance.SavegameSaveHook += SaveGame;
private void SaveGame()
        {    
                PlayerData.instance.charmCost_6 = 3;
        }

        private void ruinCharmCost(int id)
        {
            ruinCharmCost();
        }

        private void BeforeSaveGame(SaveGameData data)
        {
                PlayerData.instance.charmCost_6 = 2;
        }
compact sedge
#

I have 2 savegame functions, one with an int as input and one with nothing and I call the second one from the first one.

#

the int one is called by the savegame hook and the other one is called by me manually when loading into the game for the first time

#

because in addition to after saving you also want the charm costs to be set right when you load in for the first time

#

since the save file will have the old, default, costs set

solemn rivet
#

Another way would be to do what bonfire does

#

Save the default values on the first run

#

And reset the variables to then on disable

#

That, however, doesn't reset on simply removing the mod

compact sedge
#

you can do that too but that requires manually disabling the mod to restore the values

#

I used to have that in grimmchild upgrades

solemn rivet
#

So AA's is better

compact sedge
#

but I was unhappy with that solution because of that

solemn rivet
#

Yeah

#

I'll prolly add that change to bonfire when I have the time

#

But since you're only changing nailDamage, there's an easier way which doesn't require any of that

#

Which is what blackmoth does

compact sedge
#

yeah just edit nail damage on the attack hook

leaden hedge
#

Technically you could hook the take damage functions

flat forum
#

So

#

for some reason this broke

#
PlayerData.instance.SetInt("nailDamage",

                    PlayerData.instance.GetInt("nailDamage") *

                    (1 + 2 * ((PlayerData.instance.GetInt("maxHealth") - PlayerData.instance.GetInt("health"))/ PlayerData.instance.GetInt("maxHealth"))));
#

it wasn't broken (it changed the damage) before adding the divided part

#

but it scaled off way too quickly

compact sedge
#

cast it to a float before you divide

#

or actually a double

#

do / (double) PlayerData.instance.GetInt("maxHealth")

flat forum
#

I just type the (double) like that?

#

lemme google what it is

#

to not screw stuff up

rain cedar
#

double precision float

flat forum
#
PlayerData.instance.SetInt("nailDamage",

                    PlayerData.instance.GetInt("nailDamage") *

                    (1 + 2 * ((PlayerData.instance.GetInt("maxHealth") - PlayerData.instance.GetInt("health"))/ (double) PlayerData.instance.GetInt("maxHealth")
)));

?

compact sedge
#

yes

#

probably

flat forum
#

so, double

compact sedge
#

probably also want to do 2.0

flat forum
#

allows for 1.X?

compact sedge
#

instead of 2

flat forum
#

I will

compact sedge
#

1 + 2.0

rain cedar
#

Just the one double should be good but it doesn't hurt

flat forum
#

If it won't hurt let's do it

#

best slogan ever

#

Could also be a sex thing, but don't pay attention to this

#

Argument 2: cannot convert from 'double' to 'int'

#

it says line 73 tho

#

which is this

#

PlayerData.instance.GetInt("nailDamage")

rain cedar
#

It's all one line

flat forum
#

I just set these all to a single line?

copper nacelle
#

no

rain cedar
#

Put (int) in the set

copper nacelle
#

^

compact sedge
#

(int) (1 + 2.0 * ((PlayerData.instance.GetInt("maxHealth") - PlayerData.instance.GetInt("health"))/ (double) PlayerData.instance.GetInt("maxHealth"))

#

try this

copper nacelle
#

^

flat forum
#

worked

#

now let's test it

compact sedge
#

has anyone played around with audio in unity or c#?

copper nacelle
#

boop mod

compact sedge
#

what format is sound in? A giant array of floats representing pitch? or is it bytes or ints or some other data type?

flat forum
#

So

#

This happens now

#

up to 4 lost health masks damage doesn't change

#

from after that it doubles

#

so

#

it gets rounded down

compact sedge
#

(int) (PlayerData.instance.GetInt("nailDamage") * (1 + 2.0 * ((PlayerData.instance.GetInt("maxHealth") - PlayerData.instance.GetInt("health"))/ (double) PlayerData.instance.GetInt("maxHealth")))

leaden hedge
#

You can make audio from unity asset bundles

compact sedge
#

this should fix it

leaden hedge
#

They are arrays of pitch

#

If you really want to edit from code

compact sedge
#

arrays of floats where the float is pitch

#

or the float is a number from 0-1 that represents a pitch from 0 to 20000 or something

flat forum
#

are there things applied to music?

#

so

#

the music file is one thing

#

and the one that plays in the game is different

leaden hedge
#

-1 to 1 iirc

flat forum
#

(Collector fight and Trap Bench)

compact sedge
#

I'm trying to procedurally generate and play audio.

leaden hedge
#

Good luck with that

#

I'd recommend messing around with it in the editor

flat forum
#

Ok

#

Sooo

#

it's now, even at full health 441

#

damage

leaden hedge
#

Yes there are filters applied to audio

flat forum
#

2.0 is considered 20?

#

instead if

#

2

#

?

compact sedge
#

no 2.0 is 2.0

#

did you reset PlayerData.instance.GetInt("nailDamage")

#

or is it multiplicitvely getting increased

#

every time

flat forum
#

then why is it set to 441, which is 20*21+21

#

It gets reset at the start of the attack

#

and 441 is constant

compact sedge
#

did you actually write 20 and not 2.0

flat forum
#

it doesn't become 441 on one attack and 462 on the next

#

Lemme see

#

it's 2.0

#

but damage seems to be calculated as *20?

compact sedge
#

quit and reopen hk the way you have been and see if the number is still 441

flat forum
#

Wait nevermind

#

I'm stupid and forgot to delete one of the multiplication lines

#

it got multiplied twice

compact sedge
#

can you make mods in the editor KDT? or are you recommending I play with audio in the editor for the fun of it.

flat forum
#

Rebalancing: Done

compact sedge
#

I'm gonna assume the latter but if I'm procedurally making sound I don't see the editor helping me imo

flat forum
#

So

#

Mod's fixed

compact sedge
#

cool

flat forum
#

should I consider this an official release and set Mod Version to 1.0.0?

#

it's 0.0.1 rn

compact sedge
#

does 1.0.0 mean official release?

#

Mine are still sub 1.0

flat forum
#

Hm

#

yeah IMO

#

Alpha and Beta are Sub1

#

imo

#

I dunno

#

official release, version 1.0.0

compact sedge
flat forum
#

with base nail you get 1 damage per lost mask

compact sedge
#

and it's been indev for like 20 years

flat forum
#

at Pure Nail you get 4

#

Well

#

I'll consider mine a 1.0.0 as an official release

compact sedge
#

ok

flat forum
#

x.x.X
is bug fixes
x.X.x
is balancing and other changes
X.x.x
is content addition

#

as far as I know

#

that's at least the system I'm going off of

compact sedge
#

well whatever works for you I guess

flat forum
#

Ok

#

I'm not saying I'm right tho

compact sedge
#

there's no right way to do it

flat forum
#

I just saw that system of updating mentioned somewhere

#

and it looked good for me

compact sedge
#

just look as Windows versioning

#

basically version 6.0 for 15 years and now they're on version 10.0

flat forum
#

YouTube version 14.7.3.BlahBlahManyNumbersThat'sStupid

#

quoted from my friend when we were trying to figure out what each part of an update number means

#

will the mod be added to the GDrive?

#

I think it requires

#

API

#

now

#

does it require Modcommon I don't really know

#

I think only API tho

compact sedge
#

are you using the Modcommon namespace? do you have Modcommon added to your references?

#

if so and if you remove it from your references does it still compile?

flat forum
#

lemme see what I'm using

#
using System.Reflection;
using GlobalEnums;
using Modding;
compact sedge
#

ok and is modcommon in your references??

flat forum
#

Assembly-CSharp, PlayMaker, UnityEngine is all I think

compact sedge
#

ok

#

so no modcommon then

flat forum
#

no modcommon

#

just API

#

Ok

#

pls add the mod to the GDrive

#

Good Night =D

compact sedge
flat forum
exotic dune
#

i bet the problem is that i don't even get iframes in blackmoth

solemn rivet
#

wut u mean

#

also, hi, I'm back

exotic dune
#

there isn't invincibility after a hit, which might be intentional but it also means i can get knocked in the same direction someone's going and get hit by them twice

#

or thrice

solemn rivet
#

wut

#

I didn't change that

exotic dune
#

weird, bc it doesn't feel like it was that way in vanilla

#

doesn't look like anything changed it on github either. weird

copper nacelle
#

i just made the most unreadable regex I've ever made

#

\r\n(?([^\r\n])\s)*{\r\n(?([^\r\n])\s)*get\r\n(?([^\r\n])\s)*{\r\n(?([^\r\n])\s)*return (?<name>.*);\r\n(?([^\r\n])\s)*}\r\n(?([^\r\n])\s)*}

compact sedge
#

uhh actually I have the opposite problem with blackmoth

exotic venture
#

i think i just died a littlle inside

copper nacelle
#

don't worry it makes the code way more readable

compact sedge
#

nice

#

wtf does it do

copper nacelle
#

you do
Find:
\r\n(?([^\r\n])\s)*{\r\n(?([^\r\n])\s)*get\r\n(?([^\r\n])\s)*{\r\n(?([^\r\n])\s)*return (?<name>.*);\r\n(?([^\r\n])\s)*}\r\n(?([^\r\n])\s)*}
replace:

$` => $1;
compact sedge
#

no I mean

copper nacelle
#

and it auto does this

compact sedge
#

what are you searching for with that regex

#

what does it match

copper nacelle
#

read only properties that i can turn into expression bodied members

#

see: image

compact sedge
#

eww people write code like above

copper nacelle
#

the get return or the expression bodied member

compact sedge
#

why not just do public readonly override string Texture

#

why do you need the whole get part

copper nacelle
#

dunno

#

i asked that

compact sedge
#

anyway you get too many iframes with blackmoth

#

imo

solemn rivet
#

m8 u turbo

copper nacelle
#

^

#

oh it's cause of the override

compact sedge
#

I'm tempted to patch turbo and another bug. I know how, but it requires testing and I'm gonna finish my thing first

copper nacelle
#

having it do a get return or => is required otherwise it won't compilee

compact sedge
#

oh huh

#

or I could make shitmothst where just holding the dash button causes it to turbo, and other improvements

pearl sentinel
#

work on room randomizer if you wanna do a mod, imo

#

i can send you my half working janky prototype code

compact sedge
#

but shitmothst

#

also room randomizer sounds like actual hell

#

inb4 first room is radiance dream

pearl sentinel
#

so the progression of things is item randomizer, enemy randomizer, then room randomizer

#

then we can have a hollow knight roguelike

#

i mean, TC did the hard work of making a world class for us

#

so we have all the scenes

#

then i made some code to shuffle entrances

#

it just has a few bugs to work out

young walrus
#

and mapping to do

#

to do it "right"

pearl sentinel
#

well, yes

exotic dune
#

There's a Link to the Past entrance randomizer, you could research what they did
that game has an overworld tho so it'd probably be super different in practice

pearl sentinel
#

but that can come after the code algorithm for shuffling rooms is done

#

the main difference between something like alttp rando is that hk is a platformer and has many entrances that aren't gated based on just a fixed item/key

exotic dune
#

That as well. Maybe it could shuffle by region but I feel like that wouldn't work as well

young walrus
#

^

#

no it wont

#

b/c platforming is a thing

#

we need to map every individual room and come up with requirements to get from each transition to each other one

#

even in the starting area, there's a ton of requirements

#

if you just shuffle entrances like they do in ALTTP, you'll get softlocked all the time in HK

exotic dune
#

Like maybe you have to get VS to go through the door to Greenpath and that leads to some totally different entrance to some totally different region. Dependent on the logic ofc

young walrus
#

again, you'd get softlocked

#

a lot

pearl sentinel
#

best i came up with was to use a pathfinding algorithm to map out all the rooms in the game

young walrus
#

we just need to finish the work of mapping each room

pearl sentinel
#

i just never had the time to run through and finish the project

#

(the pathfinding is done and works fine)

#

but making all the cases for "a path that has double jump"

#

etc

young walrus
#

but doesn't account for any skips, like we've talked about before.

pearl sentinel
#

this is true

young walrus
#

it would be much better to have runners do it

#

but it's a ton of work

#

not hard work

#

but a lot of it

pearl sentinel
#

skips would be something you'd add in addition to the pathfinding, imo

#

use the computer to solve the basics

solemn rivet
#

put a reward on it, like nail1 no upgrades/spells fluke

young walrus
#

i mean, you still have to do the mapping anyways

#

so it's just double work at that point

#

even with the algorithm

pearl sentinel
#

not entirely double

exotic dune
#

yeah, the movement b/t rooms is too involved in this game

#

if it's granular by regions it's still the same work

#

so that doesn't really help the problem at all

young walrus
#

yeah. so may as well just get a bunch of people to map out the game.

#

if a bunch of people all take one area of the game, it'd be done pretty quick

#

took me 2 hours to map crossroads

compact sedge
#

too lazy sry

rain cedar
#

Two hours feels like 10 when you're doing mind-numbingly boring tasks

compact sedge
#

2 hours feels like 10 minutes when you're building audio files.

#

uhh so super important question

#

if I pass an array in a function

#

does it pass the whole array

#

or just a pointer to the first element

#

it took 30 seconds to generate 32 seconds of sound so I'm mildly worried it's the first one.

pearl sentinel
#

in c#?

#

everything is by reference (pointer) in c#, unless it's a struct

compact sedge
#

so private float[] normalizeVolume (float[] fx)
just passes pointers

pearl sentinel
#

basically

#

if you edit the fx in that function it will edit the source fx

compact sedge
#

geeze really? it's taking quite a lot of cpu power to generate then.

#

oh wait I know why

pearl sentinel
#

are you messing with unity audio sources?

compact sedge
#

I'm calling Math.sin
818496000 times

#

that's why

#

and the joke is I'm not even sure that's enough

pearl sentinel
#

here's a piece of code i wrote to save/load audiosources

#

if you want it

compact sedge
#

honestly might be a good idea. Maybe I'll procedurally generate audio once and save it.

#

esp since it will probably take around a minute on a decently high end machine to do it

#

probably gonna wanna figure out multithreading

pearl sentinel
#

        [XmlIgnore]
        float[] cachedClipData;

is the main interesting part for you probably

compact sedge
#

can I dump the clips as wav or something

#

so I can also listen to them outside the game

pearl sentinel
#

it should

#

with some tweaking

#

the data id dumps should be enough for wavs

compact sedge
#

what's the assembly for component data

#

also have you tried this with unity mono?

#

or just regular .net?

pearl sentinel
#

not much

#

    [XmlRoot("ComponentData")]
    public class ComponentData
    {
        public virtual void Serialize(Component c)
        {
            Behaviour mb = c as Behaviour;
            if(mb != null)
            {
                enabled = mb.enabled;
            }
            else
            {
                enabled = true;
            }
        }

        public virtual void Deserialize(Component c)
        {
            Behaviour mb = c as Behaviour;
            if(mb != null)
            {
                mb.enabled = enabled;
            }
        }

        [XmlIgnore]
        public GameObjectData owner;

        [XmlElement("assemblyName")]
        public string assemblyName;

        [XmlElement("typeName")]
        public string typeName;

        [XmlElement("enabled")]
        public bool enabled;
    }
#

in unity yep

#

this is part of my unity object serializer i was working on

compact sedge
#

where is GameObjectData?

pearl sentinel
#

mm

#

let me just give you all the source

#

i was working on seralizing fsms to file

compact sedge
#

thanks

pearl sentinel
#

using unity objects test the serialization

compact sedge
#

actually if you can somehow finish that work that would be like the best but even if not that's still pretty awesome

pearl sentinel
#

i want to at some point, because it would make enemy randomizer able to remove the load times

#

and do a lot of other amazing things

#

i mean, the hard part is done, you could finish it with a bit of work (not even hard work)

compact sedge
#

one more thing. is there a way to load in a new/custom scene in c#?

I wanna make a simple loading screen for the first time you run the mod.

pearl sentinel
#

oh yeah

#

super easy to load scenes

#

best thing is to make an asset bundle in unity using the same version of unity as hollow knight

#

then in hk, load the asset bundle and w/e it contains

compact sedge
#

meh if that's the best way to do it I'll just add a loading bar to the main menu scene.

copper nacelle
#

angle thinks assets are illegal

compact sedge
#

is tru

copper nacelle
#

colorized, 2018

pearl sentinel
#

well, asset bundle = how you add things to a unity game at runtime

compact sedge
#

ok

pearl sentinel
#

all scenes are turned into asset bundles that unity loads implicitly when you build a project

compact sedge
#

I'll make a fake scene then with a giant black rectangle and a loading bar

pearl sentinel
#

but yeah, loading asset bundles is how i did the menu stuff for my first version of enemy rando

flat forum
#

Wait

#

Why do you need a fake scene like that?

#

Loading screen?

compact sedge
#

for generating sound effects

#

depending on how high quality they are

#

I'm estimating 1-4 cpu seconds per second of audio

flat forum
#

Interesting idea

#

And where's tge latest versipn of Charming (Heavy Broken)

compact sedge
#

github I think

flat forum
#

(Whose was the mod?I can't find it by searching the name so I'll search the creator)

#

Oh wait

#

I found it

compact sedge
#

huh why am I getting a null ref?

copper nacelle
#

cause

#

n u l l

compact sedge
#

but I do this why would it be null soundFXClip[1] = AudioClip.Create("fireball2", AUDIO_SAMPLE_HZ * 5, 1, AUDIO_SAMPLE_HZ, false, generateFBSound);

copper nacelle
#

u created a null

#

or the array was null

compact sedge
#

AudioClip[] soundFXClip = new AudioClip[4];

#

Array shouldn't be null

#

it's not null

copper nacelle
#

is one of the args null

flat forum
#

this checks for both charms, right?
if (PlayerData.instance.GetBool("equippedCharm_6") && PlayerData.instance.GetBool("equippedCharm_25"))

copper nacelle
#

yes

flat forum
#

and this will set damage to x2.5

PlayerData.instance.SetInt("nailDamage",

                    ((int)(PlayerData.instance.GetInt("nailDamage") * (double)2.5)));
copper nacelle
#

if you broadcast the fsm event yes

flat forum
#

Yeah, I have it broadcasted

copper nacelle
#

but that'll keep multiplying

flat forum
#

PlayMakerFSM.BroadcastEvent("UPDATE NAIL DAMAGE");

copper nacelle
#

21 * 2.5 * 2.5 * 2.5 * 2.5 * 2.5

flat forum
#

no

copper nacelle
#

unless you set it back after attack

flat forum
#

it gets reset at the start of the attack and then changed

copper nacelle
#

or something

#

yeah that'd work

flat forum
#

it's like
OnAttack
Damage = normal
Damage = newDamage

compact sedge
#

my code:

soundPlayer = GetComponent<AudioSource>();
                soundFXClip[1] = AudioClip.Create("fireball2meme", AUDIO_SAMPLE_HZ * 5, 1, AUDIO_SAMPLE_HZ, false, generateFBSound);
                soundPlayer.clip = soundFXClip[1];
                soundPlayer.Play();

Unity example code:

AudioClip myClip = AudioClip.Create("MySinusoid", samplerate * 2, 1, samplerate, true, OnAudioRead, OnAudioSetPosition);
        AudioSource aud = GetComponent<AudioSource>();
        aud.clip = myClip;
        aud.Play();```

all the types are the same but I get null ref in mine when running the equivalent of aud.clip = myClip;
#

actually I think I have one thing I can test first

flat forum
#

did the unity example run well?

compact sedge
#

oh god I know the problem

copper nacelle
#

?

compact sedge
#

even though there's a hook function that has an arbitrary length float as input it runs this many times for one audio file

flat forum
#

can someone send the Bonfire GitHub?

compact sedge
#

ayugradow

#

too lazy to link but that's the github page

steep sail
#

All repos are marked

#

What about makeing code convention for modders? Making united code style will be useful for working

compact sedge
#

hahahaha no

copper nacelle
#

^

flat forum
#

how do you make it overcharm?

rain cedar
#

As long as everyone changes to my conventions and I don't have to do anything I'm ok with it

flat forum
#

is there an overcharm = true thing?

rain cedar
#

Big think

flat forum
#

Oh

#

Um

#

didn't check for that

compact sedge
#

yeah every just write code the way I do. /s

flat forum
#

you have an overcharming thing?

rain cedar
#

As long as nobody wants to use tabs instead of spaces or put brackets like this it won't be too bad

if (x) {
}```
#

But if people want that

#

I die inside

copper nacelle
#

they die instantly

#

brackets belong on the next line

#

and spaces are better than tabs

#

imo

compact sedge
#

stop making one line bracketless if statements

#

they bug me

copper nacelle
#

no

rain cedar
#

I don't like those either but sometimes I'll do it anyway

#

The real evil is

if (x)
     thing();
copper nacelle
#

reee

#

if (x) thing(); imo

rain cedar
#

Yeah that's not too bad

floral furnace
#

but naming conventions like boolean isItNotTrue is perfectly readable /s

compact sedge
#

56 ur naming conventions give me cancer

copper nacelle
#

thank u

compact sedge
#

not naming names or anything

copper nacelle
#

hey those are only for temporary vars

#

while I'm doing shitty dev

#

i usually make them actual names

#

instead of x and y and v and z

floral furnace
#

i mean unless its for loops, ive seen guys putting
int currentIteration = 0; currentIteration < 10; currentIteration++
someArrayThingHere[currentIteration]

copper nacelle
#

w h y

compact sedge
#

// magic number don't change
for (int The_VariableYouPlanONLOOPING = 0; The_VariableYouPlanONLOOPING < 132 ; The_VariableYouPlanONLOOPING++)

floral furnace
#

dunno just saw it on my classmates* examples back then

rain cedar
#
for (int iterationVariable = 10;;)
{
     iterationVariable--;
     if (iterationVariable <= 2) break;
}```
#

Idk if that would even compile

#

But it's bad

copper nacelle
#

wtf is that why

floral furnace
#

fucking hell

copper nacelle
#

that took me like two minutes to figure out

rain cedar
#

We good visual studio shows no errors on it

compact sedge
#

no Warning: you are an effing moron. error?

rain cedar
#

Too bad

#

I wanted this to work

copper nacelle
#

call the lambda expression

#

return false; }()}

dusk marsh
#

where can I download the hooks?

copper nacelle
#

for what

dusk marsh
#

for EnemyHPBar

rain cedar
#

I tried that already 56

copper nacelle
#

oof

compact sedge
#

holy crap python saving my ass

#

just gotta say it's so good

#

I know uncontroversial opinion

rain cedar
#

Python is pretty cool yeah

compact sedge
#

I love kerr but it's made it so I don't have to struggle to handle his data

#

well my data from a thing he recommended/gave to me

copper nacelle
#

hey

#

that was painful to write

#

honestly

rain cedar
#

Very nice

compact sedge
#

you disgust me

copper nacelle
#

thank u

floral furnace
#

but why

compact sedge
#

is appending to a string not a O(n) operation?

floral furnace
#

isnt it just O(1)

flat forum
#

Is being constantly overcharmed, but dealing 70 damage per hit balanced?

copper nacelle
#

no

flat forum
#

Indeed

compact sedge
#

ur going for balance?

#

haha

#

stop

#

it's impossible

flat forum
#

I will eventually balance stuff

floral furnace
#

assignment operators and if statements should be O(1)

#

i mean, Heavy Blow isnt balanced so.....

copper nacelle
#

i should make that switch statement worse

floral furnace
#

can you not

#

i looked long and hard on it and i thought i was another kind of C# statement that i havent heard of

copper nacelle
#
            switch (((Func<bool>)(() => { if (PlayerData.instance.GetBoolInternal("poop")) return false; else return true; }))())
            {
                default:
                    break;
            }
floral furnace
#

ban imo

compact sedge
#

ok so the array is length ~880000
and each element when converted to a string is ~12 chars.

#

any estimate on how long that SHOULD take

copper nacelle
#

u need to stop

#

i need to continue

#

i got to make that switch statement O(n^3)

compact sedge
floral furnace
#

Empirical boi, just test it manually

rain cedar
#

Why are you even converting 880000 things to string?

compact sedge
#

because I can't parse a binary file full of floats

#

numpy reads it wrong

#

and I can't figure out how to read it right

rain cedar
#

You'll figure it out

compact sedge
#

yeah by doing something hacky like this and leaving my PC for 15 minutes

#

while it runs

rain cedar
#

Just use cheat engine to speedhack the program

compact sedge
#

darn why didn't I think of that

#

is there a System.CPU.TimeScale

copper nacelle
rain cedar
#

That for loop doesn't even do anything

copper nacelle
#

i know

compact sedge
#

it gets optimized out

#

is what he means

copper nacelle
#
            switch (((Func<bool>)(() => { while (true && true) { for (int i = 0; i == 0; i += i * i + i) { if (PlayerData.instance.GetBoolInternal("poop")) return false; else return true; } } return true || false; }))())
            {
                default:
                    break;
            }
#

but the point is to cause death

rain cedar
#

That's not what I meant

compact sedge
#

oh well that's what I mean

copper nacelle
#

you see

#

if you look at it

#

there's a 0% chance of you figuring it out within 10 seconds

#

now convert all your ifs to this

#

u win

rain cedar
#

Anyone could tell instantly this does nothing

floral furnace
#

This should be the type of shit given as answers on stackoverflow

rain cedar
#

No cases

#

Add cases

copper nacelle
#

true

compact sedge
#

10 cpu minutes and still running. gonna go grab a bite to eat.

copper nacelle
#

gonna make the cases more lambdas

compact sedge
#

adding to string is def not O(n)

floral furnace
#

it isnt?

compact sedge
#

probably O(n^2)

#

idk

#

it shouldn't take this long

#

if it was

floral furnace
#

how is adding to strings worth n^2 (actually i think it is considering the string length)

copper nacelle
#

fuck

#

it said a constant value is expected

#

was gonna do this

#
                case ((((Func<bool>)(() => { while (true && true) { for (int i = 0; i == 0; i += i * i + i) { if (!PlayerData.instance.GetBoolInternal("poop")) return false || PlayerData.instance.GetBoolInternal("poop"); else return true; } } return true || false; }))())): break;
rain cedar
#
case (BitConverter.ToInt32(new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 }, 3) % 2 <= Convert.ToInt32(BitConverter.ToString(new byte[] { 0x12, 0x56 })))
copper nacelle
#

yes

rain cedar
#

I just put random bytes so BitConverter might fail

copper nacelle
#

a constant value is expected

rain cedar
#

Wow bs that is constant

copper nacelle
#
            switch (((Func<bool>)(() => { while (true && true) { for (int i = 0; i == 0; i += i * i + i) { if (PlayerData.instance.GetBoolInternal("poop")) return false; else return true; } } return true || false; }))())
            {
                case true:
                    if (BitConverter.ToInt32(new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 }, 3) % 2 <= Convert.ToInt32(BitConverter.ToString(new byte[] { 0x12, 0x56 })))
                    {
                        return false;
                    }
                    break;
                case false:
                    if (((((Func<bool>)(() => { while (true && true) { for (int i = 0; i == 0; i += i * i + i) { if (!PlayerData.instance.GetBoolInternal("poop")) return false || PlayerData.instance.GetBoolInternal("poop"); else return true; } } return true || false; }))())))
                    {
                        if (BitConverter.ToInt32(new byte[] { 0xAB, 0xCD, 0xCC, 0x19, 0xF4 }, 3) % 2 <= Convert.ToInt32(BitConverter.ToString(new byte[] { 0x12, 0x56 })))
                        {
                            return true;
                        }
                        break;
                    }
                    break;


            }
#

@floral furnace this is good code

floral furnace
#

Time to post it on stackoverflow the next time someone asks for it /s

#

Now i actually forgot the original intention of the code

rain cedar
#

I don't think there's any question where this could be a response

#

The original intention was to make fucked up code

#

There's no purpose here

floral furnace
#

Well congrats 56, you fucking did it

copper nacelle
#

i mean it'll take a minute or two

#

but this is readable

#

eventually

floral furnace
#

might as well remove the brackets on the single if statements

#

oh wait that would fuck up the break tho would it? (actually it wont since its just attached to the next single line anyway )

flat forum
#

checking if a variable is below a certain number in an if statement goes like?

#

if(A < 2)?

#

because

#

there was the == thing

floral furnace
#

thats for equals tho, so it will only check if its exactly equal to the value, < allows you to check values that are lower than it

flat forum
#

so, just <

no << stuff

floral furnace
#

yup, << will be an error as far as i know

rain cedar
#

<< and >> are bitwise shifts

flat forum
#

Ok

compact sedge
#

still running but I made a better solution

copper nacelle
compact sedge
copper nacelle
compact sedge
#

this took so effing long to dump

#

now to figure out how to do it faster

#

and ya know make it sound like an explosion

rain cedar
#

That's a decent cicada noise

#

Terrible for explosions

compact sedge
#

procedural cicadas wooo

#

idk what I'm doing

#

I've never worked with audio before

copper nacelle
floral furnace
#

So do you have to generate the sound again everytime you create an explosion?

compact sedge
#

windows doesn't support wav wtf

#
Jormungandr /tmp/grimm $ file cool.wav 
cool.wav: RIFF (little-endian) data, WAVE audio, mono 44100 Hz```
flat forum
#

So

#

just a quick question

#

what numbers is double about?

#

and what numbers is int about?

floral furnace
#

whole numbers and decimal points

#

and they hold far more than a standard int does

copper nacelle
#

opened in vlc

floral furnace
#

25, 64.74, 30 can all be held by double

compact sedge
#

vlc plays everything

flat forum
#

So, int rounds down the the nearest whole number?

compact sedge
#

right

copper nacelle
#

yes

floral furnace
#

yes

#

but you have to cast it or else youll get an error

#

iirc int value then placing it in a double shouldnt give you one

compact sedge
#

nice cicada noise bypasses game volume settings :)

floral furnace
#

but double to int will

compact sedge
#

alright need advice on building explosion sound

#

Currently I have a function I wrote to add sine waves at a given volume and pitch to my audio file

#

calculus says that should be enough to generate any sound in the universe

#

also I have a function that will add sine waves from frequency x to frequency y.

#

or at least I think they're sine waves

rain cedar
#

I think you're gonna be on your own here

#

Pretty unique problem to solve

compact sedge
#

how does sound waves work

#

I only know what physics class taught me