#archived-modding-development

1 messages · Page 108 of 1

rain cedar
#

Good question

#

I can ask my sister

#

She has a degree in linguistics

compact sedge
#

woo now we have much higher pitched cicadas plus a beating heart underlying it

flat forum
#
((double)((int)(PlayerData.instance.GetInt("nailDamage") * (double)1.25) + ((int)(PlayerData.instance.GetInt("nailDamage") * (1 + 2.0 * ((PlayerData.instance.GetInt("maxHealth") - PlayerData.instance.GetInt("health")) / (double)PlayerData.instance.GetInt("maxHealth")))))) * (double) 0.75));

regarding which part of that is this thing?

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

rain cedar
#

Clean that shit up my dude

flat forum
#

yeah

#

trying to

rain cedar
#

It's getting close to unreadable

flat forum
#

it gave me this mid-way cleaning

floral furnace
#

you have to cast it like
int intVar = (int)(5 * 2.3)

#

theres no need to cast 1.25 into a double

compact sedge
#

anyone have adobe audition on their computers?

#

I need a very simple favor

#

I'll ask in meme

#

why not

rain cedar
#

So make that

pearl sentinel
#

👌

compact sedge
#

oh thanks that's literally what I was looking at and uh totally helpful....

#

found a great pink noise generator though

#

well in c++, so I copied it to c# and uh it mostly works

solemn rivet
#

@Nicolas239#4540 we don't use hooks anymore. Try ModCommon

#

wut

flat forum
#

tag didn't work?

solemn rivet
#

wtf

flat forum
#

try tagging me

solemn rivet
#

@flat forum sup

flat forum
#

Ok

#

this works

#

but that one didn't

#

hm

solemn rivet
#

well

#

they're not in the channel anymore anyways

hollow pier
#

left server duh

compact sedge
#

rip

solemn rivet
#

why not A Procedural Cicada?

compact sedge
#

I actually sorta figured out explosions

#

white noise

speed up

low pass

speed up

low pass

etc.

#

don't touch signal generators. I was really proud of making a sine wave thingy and later a sawtooth one but they make the cicada noises

solemn rivet
#

huh

#

you need more Fourier m8

compact sedge
#

I actually mentioned that when I started

#

in theory I can do everything with a sine wave thingy

#

but in practice I know calculus BC so I only know that it's possible in theory and not how to actually do it

solemn rivet
#

well

#

you need sines and cosines

#

but yeah

#

tbh I'm not much into that area of maths, only did basic undergrad courses on that stuff

#

so, idk

#

I do know that any continuous function can be approximated as much as you'd like by a polynomial

#

the Stone-Weierstrass theorem

flat forum
#

Sines and cosines

#

How do those function in circles?

floral furnace
#

Uhh im guessing its the waves he needs to pitch the sound and shit

young walrus
#

are you trying to code a sound? or would a sound file be needed?

compact sedge
#

the brilliant part is sines are cosines so yeah just sines

#

sines are cosines shifted 90 degrees

solemn rivet
#

well, yeah, but

compact sedge
#

you do need to have some shifting

#

you can't do it with just sines at the origin

solemn rivet
#

iirc the Fourier series for a periodic function does differ between sines and cosines

compact sedge
#

hmm probably

solemn rivet
#

I think it has something to do with the coefficients of the expansion

#

like, all sine functions have a certain coefficient, and all cosines have another (and those coefficients can be functions themselves)

#

wut

#

transparent png

#

ffs

flat forum
#

SinA=Cos(90-A)

solemn rivet
#

yeah, I know

flat forum
#

That's jist for triangles?

solemn rivet
#

I'm just saying you can treat all cosines as sines when you're approximating functions via Fourier series

flat forum
#

I know there's something about circles

#

Explain pls

solemn rivet
#

nah, sin t = cos (90 - t) is always true

#

for all values of t

flat forum
solemn rivet
#

why mem, this is Modding related

compact sedge
#

that's why sines and cosines are basically the same thing but shifted as far as the numbers they produce

#

over a large interval

young walrus
#

math is a meme to some people

flat forum
#

Because the fact I understanding nothing is meme

solemn rivet
#

Papers, the Wiki article is a good place to start

#

In mathematics, a Fourier series (English: ) is a way to represent a function as the sum of simple sine waves. More formally, it decomposes any periodic function or periodic signal into the sum of a (possibly infinite) set of simple oscillating functions, namely sines and cos...

compact sedge
#

It's weird to me how generating pictures is simple algebra with a tiny bit of trig. Generating sound is calculus and linear algebra by comparison.

floral furnace
#

Folding all you have to know is trigonometry and calculus is for dungos hollowface

solemn rivet
#

how so AA?

compact sedge
#

the required math knowledge to build functions that do many of the effects is much higher

#

because like frequencies aren't real things

#

for example

#

I mean they are

#

but it's not easy to go from a series of floats to frequencies

solemn rivet
compact sedge
#

I mean it is easy but only if the series of float only has 1 frequency in it

flat forum
#

Thanks =D

compact sedge
#

if it has many

#

and you wanna isolate one

#

then it's hard

solemn rivet
#

yeah, I getcha

compact sedge
#

I don't conceptually understand the code I'm using for a lowpass filter

#

but I conceptually understand 100% of my image generation code

solemn rivet
#

I mean

compact sedge
#

I mean I understand it on a basic line by line case

solemn rivet
#

I literally study maths for a living and I can't for the life of me understand how to work with sounds

young walrus
#

do you HAVE to understand how filters work?

compact sedge
#

Well I want to

#

because I don't want to have to copy code if I can help it

#

and also knowing the how means understanding how to modify it to get the effect you want

young walrus
#

okay, but why not just run an audio file asset?

#

instead of building the sound in the code?

compact sedge
#

because I want each one to sound unique

#

and also

solemn rivet
#

oh

compact sedge
#

I want to have a really small modfile

solemn rivet
#

you literally want procedural sfx

young walrus
#

so why not just transform the asset?

compact sedge
#

like it's a challenge to me

young walrus
#

like how Kerr did with my Boop

solemn rivet
#

but yeah, Mick makes a fair point

compact sedge
#

my starting asset is white noise and I am transforming it

solemn rivet
#

why not modify the asset "randomly" during runtime?

young walrus
#

yeah, but you're trying to transform it like.... 8 times

#

why not have an explosion asset, then transform that randomly with 1 transform

#

or 2

#

instead of 8-10

compact sedge
#

fair point

#

But I'm hoping the end result is much more modular

solemn rivet
#

like, sure, do your white -> 8x lowpass -> explosion

compact sedge
#

I wanna reuse this code for a nuke mod because why not, and lasers, and all sorts of things

solemn rivet
#

but record the output and use it as a basis for new sounds

#

oh

young walrus
#

i mean, i could just make you sounds like that in 5 minutes in ableton

#

then you could use an arppegiation transform to randomly assign pitches

#

especially for like, lasers

compact sedge
#

well the other half of the coin is I don't want any assets in my mod file.

#

why not? IDK I've never included assets in any of my code and I don't see why that should end now.

#

I don't make games

#

I do coding stuff for me

young walrus
#

couldn't you assemble that into your mod file?

compact sedge
#

yes

#

you can just add pictures and sound to your mod file

young walrus
#

i mean, if you don't wanna do that, you don't wanna do that

#

i just think you're working too hard, personally

#

lol

compact sedge
#

yes I am

#

I'm putting in probably an extra 30 hours that I shouldn't need to

#

but I'm having fun with it

#

and actually learning a lot about procedural generation

young walrus
#

shrugs as long as you're okay with that and it works, i guess

flat forum
#

By the way, Gradow

#

The vid's really interesting

#

Thanks for sending it =)

solemn rivet
#

np

#

I really like this guy's vids

flat forum
#

If all of them are like this one It's understandable

compact sedge
#

3 blue 1 brown is a great youtuber. He makes stuff I never understood in math make perfect sense.

#

He made a great video on fracals but it's super long

hollow pier
#

fracals

flat forum
#

F R A C A L S

copper nacelle
#

@compact sedge what's RainbowPos for

compact sedge
#

basically it cycles through the color wheel

#

and that's the current position of it in that cycle

copper nacelle
#

o

#

ty

burnt laurel
#

what's up with lightbringer

#

i downloaded it

#

and there's like

copper nacelle
#

1.2.2.1

burnt laurel
#

10 different versions

compact sedge
#

what's up with lightbringer? (laugh track)

burnt laurel
#

what's drm-free

supple sigil
#

I remember when the lightbringer trailer first released

copper nacelle
#

light ringer

supple sigil
#

I was going through hollow knight videos for “just uploaded”

burnt laurel
#

so do i get drm free or not

young walrus
#

is that the game version you have?

supple sigil
#

Then there was this trailer with this cool charm on the front

#

0 views at the time

#

I was like wats this

#

Hk has mods????

burnt laurel
#

what does it even mean

young walrus
#

DRM free is non-steam

burnt laurel
#

oh ok

#

so i'd want normal

young walrus
#

do you have a non-steam version of the game

burnt laurel
#

i got it on steam

young walrus
#

so then no. drm-free wouldn't work for you

burnt laurel
#

so do i just download it like i would any other mod

#

just merge hollow_knight_data

young walrus
#

Yes. But lifebringer is not api, so it will only work with itself

copper nacelle
#

1.2.2.1

young walrus
#

No other mods can run at the same time

#

And ya. Doesn't work on lifeblood

burnt laurel
#

oh

#

would've been nice to know that

young walrus
#

Well the number beside it is the patch

burnt laurel
#

oh

young walrus
#

Kinda hard to miss

burnt laurel
#

i know pretty much nothing about modding

#

i thought it might've been the mod version

young walrus
#

Well I mean.... It is that too

burnt laurel
#

so is it possible to revert to an older version or should i not bother

#

what version is 1.2.2.1

#

grimm troupe?

rain cedar
#

It's one of the grimm troupe patches yes

burnt laurel
#

ok

young walrus
copper nacelle
burnt laurel
#

well thats a problem

#

i cant use regedit

rain cedar
#

Yeah you can

burnt laurel
#

uhh

#

no i cant

rain cedar
#

Ok

#

Why?

burnt laurel
#

i pressed win + r and entered "regedit"

#

and it's been blocked

#

disabled

rain cedar
#

Ask your parents to enable it

copper nacelle
burnt laurel
#

uhh

rain cedar
#

Same

burnt laurel
#

hmm

#

the thing is

#

they arent the administrators

leaden hedge
#

regedit to bypass the block

burnt laurel
#

whatever

rain cedar
#

Who is the admin?

burnt laurel
#

i just wont use the mod

rain cedar
#

Are you on a school computer or some shit?

burnt laurel
#

no

rain cedar
#

Work computer?

burnt laurel
#

no

rain cedar
#

I could keep guessing

#

But I won't

#

So you should just say

leaden hedge
#

why do you even need regedit

burnt laurel
#

cause i need it to revert my version

#

supposedly

leaden hedge
#

pretty sure you can do that without regedit

rain cedar
#

Some people have had problems with downpatching from lifeblood without clearing HK registry values

#

Not me

burnt laurel
#

was that with moving data over?

young walrus
#

Sometimes you don't wake up at benches

#

Sometimes your opening cutscenes don't even load

#

Sometimes the game crashes

#

Things can just happen

burnt laurel
#

well i got 1.2.2.1 but now it's just a black screen

#

no team cherry logo or anything

young walrus
#

And welcome to the reason for clearing regedit

burnt laurel
#

welp

#

there goes that mod

young walrus
#

Why cant you open the run window as admin?

burnt laurel
#

i can

#

but i cant access regedit

rain cedar
#

Whoever the admin of the computer you're using is can give you access

leaden hedge
#

could make a mod that just cleans the registry for hk

compact sedge
#

why would that be a mod

#

just make a .reg file people can double click

leaden hedge
#

doesn't require admin controls

compact sedge
#

with empty HK entries

leaden hedge
#

and you could make it edit stuff specifically

#

like permadeath and screens

burnt laurel
#

or i could just not use lightbringer

rain cedar
#

I don't get why you're so reluctant to just ask for help

#

Unless this is a computer you're not supposed to be gaming on

#

But you already said it's not a work or school computer

burnt laurel
#

just dont ask

#

its personal stuff

#

stuff i would prefer not to share with strangers i dont know

leaden hedge
#

he pirated his pc

#

confirmed

burnt laurel
#

speculate all you want but im not confirming anything

compact sedge
#

you wouldn't download a graphics card

#

(but I totally would)

#

(GPUs are so expensive)

young walrus
#

Just download more ram

leaden hedge
#

just make a vm with 128gb of ram and a SLI 1080ti

copper nacelle
#

why do mantis lords have 4 control fsms

compact sedge
#

well one is the stagger fsm

copper nacelle
#

no

compact sedge
#

and the other 3 are for the mantises

copper nacelle
#

mantis lords don't stagger 🤔

compact sedge
#

that doesn't matter

#

all bosses have stagger fsms afaik

#

its just they have their stagger value set to 9999 hits or something

copper nacelle
#

if there is one then it's not in either of the fsm dumps

#

scene dump and just fsm mod

compact sedge
#

ree use modcommon dump

copper nacelle
#

scene dump is from modcommon

#

large think

compact sedge
#

oh you don't just mean the giant rar file with all the scenes in it?

copper nacelle
#

i do

compact sedge
#

ok well it's cool but lacks the useful variables

rain cedar
#

It has enough

compact sedge
#

it lacks actual numbers though

#

It's decent for state names and nice to have something you can just download but kinda limited in actual uses.

#

and I think kdt agrees with me because he was at one point working on a full game object serializer

#

and aside from just the scene dump, kerr also has a tool to make those dumps with actual numbers

#

in modcommon

flat forum
#

is it possible to make Lightbringer an API mod?

floral furnace
#

Thats what 56 is doing

flat forum
#

really?

#

why didn't anyone tell me?

compact sedge
#

it's on haitus for mantis gods

flat forum
#

wouldn't mind

#

would also want to try making a God Vessel Mod for Broken Vessel sometime

rain cedar
#

Lost kin but with no staggers and faster spawn rate

#

That's really all you need

flat forum
#

well

#

I want to try adding something to his down attack

young walrus
#

lost kin, but the mobs have 20 hp and spawn every second

flat forum
#

3 seconds

rain cedar
#

Half second

flat forum
#

3 or nothing

compact sedge
#

anyone know why a sound pops right at the end and how to get rid of that?

#

wow literally padding it with 0.75 seconds of silence fixes it

#

ok

#

explain that atheists

flat forum
#

I

#

I can't

#

it's impossible

exotic dune
#

probably some weird-ass implementation quirk

#

b/t cutting off sound within a file vs. at the end

compact sedge
#

I had 0.25 seconds of padding

#

but apparently I need 0.75

#

and also to change the audio type to steaming

#

mmm steamed audio

#

from cached in ram

rain cedar
#

Is there any way to view what the internal unity calls actually do?

compact sedge
#

idk I'm just using boop mod code

#

I guess disassemble the unity dll

rain cedar
#

Looking at the Unity dll in dnspy you just get a lot of extern functions

compact sedge
#

actually this is dumb but here's what I figured out. I can't use streaming type audio

#

so the only way to get audio to not pop, is to change the audiosource volume

#

but currently I'm doing it through the boop mod so that's probably gonna break stuff

flat forum
#
  if( grimm2 == null )
#

what is this?

compact sedge
#

if that GameObject is not set to anything

#

or if it's inactive

flat forum
#

but is grimm2 NKG?

compact sedge
#

that's the second grimm that spawns in in NGG

#

in the second phase

flat forum
#

trying to understand how NGG spawns 2 Grimms in the first Grimm fight

compact sedge
#

it takes the first one and makes a copy of it

#

storing that copy in grimm2

flat forum
#

but that one there is NKG #2, right?

#

or is it just the 2nd Grimm that spawns

young walrus
#

so it copies it right away, then nulls it until the final phase?

flat forum
#

I'd guess it's null until the final phase where, if it's null it gets unnulled?

young walrus
#

....that's literally what i just said

#

lol

flat forum
#

Ooops

#

somehow misread the UNTIL as IN

#

I'm appaerently stoopid and dislexic

rain cedar
compact sedge
#

grimm2 is active the whole time but

#

gfsm is grimm2

#

when you do yield return null; where does the coroutine resume from?

#

is it at the start

#

oh nvm it starts right where it left off

rain cedar
#

That's just telling it to wait a frame

compact sedge
#

ok I need to do that in some code. actually I need to do it in more of my code instead of just dumping crap in Update

rain cedar
#

Coroutines are cool but letting Unity handle them gives you way too little control

#

Should update them yourself using MoveNext()

compact sedge
#

Coroutines run on their own thread?

#

I kinda wanna generate sounds and stuff in the background

#

instead of just pausing the game for about 8 seconds when they click load save

rain cedar
#

It's kinda like fake threading

#

It just runs the routine until the next yield at some point

#

Probably at the end of every frame

compact sedge
#

is there any good way to do real threading or rather to run something async on a separate thread so that it doesn't slow down everything else

rain cedar
#

Not through Unity

compact sedge
#

ok

rain cedar
#

But C# supports it

#

Obviously

compact sedge
#

huh ok

#

so if I'm building my own gameobject, should I use playmaker at all

#

or should I avoid it like the plague

flat forum
#

well

compact sedge
#

like I have no idea what the right approach for this is

flat forum
#

Use it, game's already made out of PlaymakerFSMs

#

another one won't hurt?

compact sedge
#

I'm not sure an FSM would be the easiest way to program it though

flat forum
#

No, I mean Playmaker won't affect the game as much, considering it's already purely made out of Playmaker

compact sedge
#

Basically I'm trying to spawn a sprite that moves according to some simple movement code, and that, on hitting an enemy, damages it.

flat forum
#

mmhm

compact sedge
#

you tell me how I should do that

flat forum
#

well, I don't have much experience in adding objects to the game

compact sedge
#

because I have no effing clue

flat forum
#

so

#

do what you understand and find easiest

#

and then thinnk about refining it

compact sedge
#

Literally I haven't touched game engine code until about 1 month ago

#

so idk what I'm doing

#

not even a little

#

I need a thing I can read to tell me what I'm supposed to do here

#

have anything like that

flat forum
#

I hadn't touched code until about I started making the mod

#

only had some basic knowledge

compact sedge
#

also nice but I'm doubtful is if anyone has some code I can look at that does something vaguely similar

rain cedar
#

Make a GameObject with a DamageEnemies component

#

And a SpriteRenderer

compact sedge
#

should I do that for each sprite?

#

and also how do I control it's movement

rain cedar
#

Yeah

#

It will need some kind of collider for the DamageEnemies to work

#

Movement idk depends on what you want it to do

compact sedge
#

I just need it to follow the game's laws of gravity and newtonian physics but also to pass through walls.

#

I know how to do the second part

#

actually lets start simple

#

I just need it to follow the game's laws of gravity

#

and have an initial velocity

rain cedar
#

Put a Rigidbody2D on it and set its gravityScale to something

#

And call AddForce with whatever force you want

compact sedge
#

idk what I'm doing sorry

#

oh typeof

#

right

#

?

rain cedar
#

I can't tell what you're doing either from that screenshot

flat forum
#

(nor am I, that's why I ask a billion questions)

compact sedge
#

cool figured it out:
FireballsGO[i] = new GameObject("redwingFB" + i, typeof(DamageEnemies), typeof(SpriteRenderer), typeof(Rigidbody2D));

flat forum
#

(what's the mod called?)

compact sedge
#

redwing

#

also if I add these gameobjects as a child of another game object they get that gameobject's position right?

#

I might make an empty position gameobject so they move relative to it

rain cedar
#

I think so

charred parrot
#

children game objects move with the parent yes

compact sedge
#

thanks I got lazy

young walrus
#

wow. look at this lazy ass MF

#

just showing up

compact sedge
#
physics = new Rigidbody2D();
physics.mass = 1.0f;

why does this second thing cause a null ref exception?

physics.mass is a float

rain cedar
#

You can't create components like that

#

physics = someGameObject.AddComponent<Rigidbody2D>();

compact sedge
#

oh the game object already has the component added

rain cedar
#

Then use GetComponent

compact sedge
#

should I just uncomment the new line

#

yeah that fixed it

#

thanks

rain cedar
#

Neato

flat forum
#

Where can I find the info on the Broken Vessel fight?

rain cedar
#

What do you mean by info?

flat forum
#

well, a while back someone had sent me a .json file with the code for the THK fight

#

it had attack names and other stuff

rain cedar
#

Oh you mean a dump of the fsm

flat forum
#

I guess?

#

haven't dumped FSMs before

rain cedar
#

Well there's a tool for it in ModCommon

compact sedge
#

all my code runs but the fireballs don't spawn. I'll just figure it out tomorrow tho

rain cedar
#

Here's a dump of the whole scene the boss is in

#

Or not

#

Guess I can't upload from archives

flat forum
#

?

rain cedar
flat forum
#

Wait, this Laptop can't download anything

#

What?

#

How?

#

Why?

#

What the FUCK

rain cedar
#

Same

flat forum
#

Ok

#

worked

#

apparently

#

Disc C is gone

#

no space on it whatsoever

rain cedar
#

That's good

flat forum
#

HOW

rain cedar
#

Well you see it's probably because you downloaded enough stuff to fill it

flat forum
#

I haven't downloaded anything

#

It's probably the stupid Windows

rain cedar
#

How big is your hard drive?

flat forum
#

here

#

Disc C has 5 MB out of 99.9 GB free

rain cedar
#

Well there's your problem

flat forum
#

it's also full of Blue Folders for some reason

rain cedar
#

100 GB is basically nothing

#

D is much larger, switch your OS to that disk

flat forum
#

D IS indeed larger

#

Ok

#

maybe some time

#

the .txt file is the whole info from that 1 room Broken Vessel's in

rain cedar
#

Yes

flat forum
#

there's a separate info thing for every single object in the room, Background, Foreground, enemies...

#

each thing has a layer number

#

what layer is the Knight's one?

#

11?

rain cedar
#

Looks like it

flat forum
#

infected_knight_room_0004_2?

rain cedar
#

Dunno

flat forum
#

This appears to be the arena

#

and you can't set Dream Gates in boss arenas

#

so it's a separate thing?

#

By the way, I found the Boss Part

leaden hedge
#

also the 2nd grimm doesn't just do nothing

#

I made its control fsm constantly select spikes

flat forum
#

so

#

the 2nd Grimm that doesn't appear for most the time is the one spamming spikes?

leaden hedge
#

yes

flat forum
#

and the first fight?

#

it too spawns 2 Grimms

#

and each functions like a normal separate Grimm

leaden hedge
#

probably has a different fsm

#

so it doesn't get overrode

flat forum
#

mhm

#

trying to understand if it's possible to do the same for the Watcher Knight

leaden hedge
#

it is

flat forum
#

so that you fight twice as many

solemn rivet
#

make it so that lost kid spawns copies of himself instead of those ghosties

#

they have little health, but explode on death, like the enemies on infected crossroads

#

DEW EET

flat forum
#

I'll try

#

maybe

#

just spawn the ghosts

#

but they have a bit more health (so that the defender's crest cheese won't work)

#

and they explode on death

#

YES

#

(Should the mod be called God Vessel?)

solemn rivet
#

no

#

it should be called the Lord Vessel

flat forum
#

but

#

they tradition of calling hard-mode bosses Gods

floral furnace
#

God Kin

flat forum
#

Lost God

solemn rivet
#

Lord Vessel is more pun-y

flat forum
#

Hmmm

#

But first

#

I'll get home

#

and finish the GodKiller Weapons mod

solemn rivet
#

tbf

#

my first mod idea, before making blackmoth even

#

like, when lightbringer had just come out

#

was to make elemental spells

#

ice, thunder and fire

flat forum
#

Interesting idea

#

how would they function tho

solemn rivet
#

like

#

ice would freeze enemies (high burst damage), thunder could chain enemies and scale damage based on the amount of enemies in the chain (low base damage, but high if chaining multiple enemies), fire would burn enemies (med base damage + burn damage)

flat forum
#

(I meant how do you activate each one)

solemn rivet
#

oh

#

well

copper nacelle
#

triple click fireball

solemn rivet
#

they could be powerups you pick up in game

#

or they could require some special kind of Soul (kinda Metroid Prime Echoes-esque)

flat forum
#

your DD turns into a Lightning, your shriek ice and your... nowmal Soul bullet - fire

copper nacelle
#

nowmal

solemn rivet
#

maybe

flat forum
#

nowmal

#

hewwo

solemn rivet
#

or maybe make them all have elemental versions you can cycle through

#

I never got too much into that idea once I realized how hard it would be to implement

flat forum
#

press some button to change to next version

#

yeah it'd be hard

#

so, Seanpr sent a thing that shoul be about resizing the nail

#
private static FieldInfo whatever = typeof(HeroController).GetField("slashComponent", BindingFlags.NonPublic | BindingFlags.Instance);

void Func()
{
    NailSlash thing = (NailSlash)whatever.GetValue(HeroController.Instance);
    thing.scale = something;
}
#

now, the nail scale is a Vector3 thing

#

so just setting a number didn't work

copper nacelle
#

thing.scale = new Vector3(stuff)

flat forum
#

new Vector3(ScaleX()*[number], ScaleY()*[number], ScaleZ())?

solemn rivet
#

you can just do

flat forum
#

Sean said I can do *= instead of =

solemn rivet
#

Vector3.Scale(thing.scale, vectorToScale)

flat forum
#

but that didn't work

solemn rivet
#

*= will multiply every coordinate of thing.scale by something

#

but if you do

#

thing.scale = Vector3.Scale(thing.scale, new Vector3(2,0,0));

flat forum
#

it will only change length?

solemn rivet
#

it'll scale the x coordinate by 2

#

and the other's by zero

#

so the new vector becomes (2*thing.scale.x, 0, 0)

#

it's just an example, tho

flat forum
#

0s won't change the thing, right?

#

and not

#

break it and make it a line

solemn rivet
#

no, 0 will multiply by 0

#

Vector3.Scale is vector multiplication but done coordinate-wise

flat forum
#

so I make those 1s instead of 0s so I keep the original size?

solemn rivet
#

yup

pearl sentinel
#

Wasup

flat forum
#
private static FieldInfo whatever = typeof(HeroController).GetField("slashComponent", BindingFlags.NonPublic | BindingFlags.Instance);

void Func()
{
    NailSlash thing = (NailSlash)whatever.GetValue(HeroController.Instance);
    thing.scale = Vector3.Scale(thing.scale, new Vector3(2, 1 , 1));
}
#

hey Kerr!

solemn rivet
#

but in that case, it's easier to do

copper nacelle
pearl sentinel
flat forum
#

I'm trying to understand the code to resize the nail

solemn rivet
#

thing.scale = Vector3.Scale(thing.scale, 2 * Vector3.right);

flat forum
#

but I want to only change length

solemn rivet
#

oops

#

nvm

#

forget that

#

what I said is wrong

flat forum
#

Ok

#

and the code I sent there?

solemn rivet
#

should work, yeah

flat forum
#

is that the way the thing.scale should work?

#

Ok

solemn rivet
#

should double your nail x coordinate

#

no, that's how vector3 works

#

and thing.scale is a vector3

flat forum
#

yeah yeah

#

I meant will the thing.scale that didn't work before work now

#

also, can I put this entire thing in an if statement

#

which if statement activates whenever there's a CharmUpdate

#

so

OnCharmUpdate
if(EquippedCharm_Mop)
ThatWholeThing
lucid pond
flat forum
#

Hmm

#

everything seems to be up to date

#

I don't think it required anything else

lucid pond
#

the old one is OK

young walrus
#

Wat

#

You aren't on the beta branch are you?

lucid pond
flat forum
#

hmm

young walrus
#

Is your mod common up to date?

#

I don't know what current version is of modcommon

lucid pond
#

Yes.The QoL mod needs the new modcommon

solemn rivet
#

what do you mean "old enemyHpBar"?

lucid pond
#

😱 I can't find the health bars even if I lower or raise my resolution a little bit.

solemn rivet
#

send modlog and outputlog please

lucid pond
#

wait a minute,please

flat forum
#

But

#

You need ModLog

#

Which is a txt file wih your saves

#

Right?

lucid pond
young walrus
#

The seed was removed from the overlay

#

Because of how many setting options there are now, it doesn't really tell you much. Because that seed will mean something else if you change one of the custom settings

lucid pond
#

That's a pity.

young walrus
#

Just add it yourself

#

Use a text element of OBS

#

Write it on there each time

lucid pond
#

😂 Inoki said the same words

#

I see.Thanks!

copper nacelle
#

wow someone's actually using QoL

#

nice

lucid pond
#

mylajoy I'm going to sleep

#

I tried it today.Inoki asked me to test the mod

#

I haven't find any question.

flat forum
#

So

#

The FieldInfo thing

#

How can I get to on CharmUpdate?

#

Possibly with an if statement

copper nacelle
#

?

#

wdym

flat forum
#

Well

#

The whole code thing

#

Has the private static thing

#

So it's an activation the way public void OnAttack is

copper nacelle
#

what

flat forum
#

Ok

#

Gonna get on my computer in a sec

#
private static FieldInfo whatever = typeof(HeroController).GetField("slashComponent", BindingFlags.NonPublic | BindingFlags.Instance);

void Func()
{
    NailSlash thing = (NailSlash)whatever.GetValue(HeroController.Instance);
    thing.scale = Vector3.Scale(thing.scale, new Vector3(2, 1 , 1));
}

This is the code I'm talking about

#

adding an IF statement should be like this

#
void Func()
{
    if (CharmEquipped_Something)
    {
      Stuff
    }
}
copper nacelle
#

yes

flat forum
#

when does the effect take action?

#

is what I don't understand

#

the way OnAttack begins it's effect... On Attacking

#

because I want the effect to take action CharmUpdate

copper nacelle
#

Modding.ModHooks.Instance.CharmUpdateHook += yourfunc;

#

then it'll run your function

#

on charmupdate

solemn rivet
#

CharmUpdate is called when you sit on a bench

flat forum
#

And on changing charms?

solemn rivet
#

Not only then, but that's the most common use

#

Yeah, possibly

flat forum
#

Ok

#

also, just Vector3 didn't work it needed UnityEngine.Vector3

copper nacelle
#

using UnityEngine imo

flat forum
#

so, it should look like this?

private static FieldInfo whatever = typeof(HeroController).GetField("slashComponent", BindingFlags.NonPublic | BindingFlags.Instance);

        void CharmUpdate()
        {
            if (PlayerData.instance.GetBool("equippedCharm_18"))
            {
                NailSlash thing = (NailSlash)whatever.GetValue(HeroController.instance);
                thing.scale = UnityEngine.Vector3.Scale(thing.scale, new UnityEngine.Vector3(2, 1, 1));
            }
        }
#

No overload for 'CharmUpdate' matches delegate 'CharmUpdateHandler'

regarding Modding.ModHooks.Instance.CharmUpdateHook += CharmUpdate;

copper nacelle
#

needs args

flat forum
#

the private static public void things?

copper nacelle
#

CharmUpdate needs args re

#

CharmUpdate(PlayerData data, HeroController controller)

flat forum
#

I understand very little ree sadgrub

copper nacelle
#

hooks take functions with certain required arguments

#

your function is missing the required arguments

#

change CharmUpdate() -> CharmUpdate(PlayerData data, HeroController controller)

solemn rivet
#

Papers it's sorta like this: as you know, methods have arguments. A hook is kinda like a "generic" method. So in the game's code there's a method called CharmUpdate and we make the CharmUpdateHook. Since you're hooking to CharmUpdate, the method you use to do so must have the same arguments

#

And must have the same return type as well

flat forum
#

mhm

#

Ok

solemn rivet
#

So HeroUpdateHook, for instance, hooks into the HeroController.Update method which has no arguments and has return type void (that is, it doesn't return a value)

flat forum
#

I added those to the CharmUpdate thing at the bottom

solemn rivet
#

So whenever you use that hook, you must do so with a method with no arguments and no return

flat forum
#

and it seemed to fix?

solemn rivet
#

Yup

#

Because those are the arguments of the original CharmUpdate

flat forum
#

But why did it say those have to be added at the other line?

copper nacelle
#

cause they're required?

solemn rivet
#

^

flat forum
#

Ok

solemn rivet
#

here, lemme show it to you

hollow pier
#

what is modcommon

copper nacelle
#

dependency for a bunch of other mods

solemn rivet
#
    public void CharmUpdate()
    {
        if (this.playerData.equippedCharm_26)
        {
            this.nailChargeTime = this.NAIL_CHARGE_TIME_CHARM;
        }
        else
        {
            this.nailChargeTime = this.NAIL_CHARGE_TIME_DEFAULT;
        }
        if (this.playerData.equippedCharm_23 && !this.playerData.brokenCharm_23)
        {
            this.playerData.maxHealth = this.playerData.maxHealthBase + 2;
            this.playerData.MaxHealth();
        }
        else
        {
            this.playerData.maxHealth = this.playerData.maxHealthBase;
            this.playerData.MaxHealth();
        }
        if (this.playerData.equippedCharm_27)
        {
            this.playerData.joniHealthBlue = (int)((float)this.playerData.maxHealth * 1.4f);
            this.playerData.maxHealth = 1;
            this.playerData.MaxHealth();
            this.joniBeam = true;
        }
        else
        {
            this.playerData.joniHealthBlue = 0;
        }
        if (this.playerData.equippedCharm_40 && this.playerData.grimmChildLevel == 5)
        {
            this.carefreeShieldEquipped = true;
        }
        else
        {
            this.carefreeShieldEquipped = false;
        }
        this.playerData.UpdateBlueHealth();
    }```
#

this is the orig charmupdate

copper nacelle
#

it has code they all use

hollow pier
#

so i need to install api and common for rando

copper nacelle
#

yes

hollow pier
#

ok

solemn rivet
#

it has return type void and has no arguments

#

public void CharmUpdate()

#

as you can see here

#

so whenever you do

ModHooks.Instance.CharmUpdateHook += MyMethod;

#

your method MyMethod must begin just like CharmUpdate, that is

hollow pier
solemn rivet
#

void MyMethod()

#

yup, ptkyr

#

and merge when asked to

copper nacelle
#

^

solemn rivet
#

@flat forum read my explanation above

flat forum
#

reading it

#

by the way

#

it says it can't convert from double to float

solemn rivet
#

show us the line

flat forum
#
thing.scale = UnityEngine.Vector3.Scale(thing.scale, new UnityEngine.Vector3(1.5, 1, 1));
#

it's the 1.5 thing probably

solemn rivet
#

1.5f

#

that should do it

flat forum
#

It worked

#

what does the f stand for?

solemn rivet
#

float

#

whenever you're working with floats, just put f beside the value

flat forum
#

Ok

#

time to test how it works

#

Ok

#

Forgot to reset it

#

now size scales endlessly

#

this is incredibly fun and stupid

#

I need to fix this

#

probably

solemn rivet
#

just do as you did with the nail

flat forum
#

so, I need to store the original value

#

Yeah

solemn rivet
#

save the original scale when you first run the code

#

the simplest way to do that is to make a counter that counts whenever the code runs

#

and only save if it hasn't run yet

hollow pier
#

ok installing mods is hella easy

solemn rivet
#

that's ugly, but it works and is easy to understand

#

something like

#
if (counter > 0)
{
    defaultScale = thing.scale;
}
#
private static FieldInfo whatever = typeof(HeroController).GetField("slashComponent", BindingFlags.NonPublic | BindingFlags.Instance);
        void CharmUpdate()
        {
if (counter == 0)
{
    defaultScale = thing.scale;
}
counter ++;
thing.scale = defaultScale;
            if (PlayerData.instance.GetBool("equippedCharm_18"))
            {
                NailSlash thing = (NailSlash)whatever.GetValue(HeroController.instance);
                thing.scale = UnityEngine.Vector3.Scale(thing.scale, new UnityEngine.Vector3(2, 1, 1));
            }
        }```
#

actually

#

there

#

ofc you need to create the counter and defaultScale fields

flat forum
#

defaultScale I already made

#

the counter

solemn rivet
#

just public int counter;

flat forum
#

I can easily add an INT

#

the thing is how do I make sure I use it when it hasn't been used before?

solemn rivet
#

what do you mean?

flat forum
#

Oh wait

#

yeah

#

but shouldn't that be if (counter == 0) or something?

solemn rivet
#

oops

#

yeah

flat forum
#

that threw me off a bit

#

ok, so

solemn rivet
#

ints start at 0, so that should work

flat forum
#

if it's 0 default scale is set to the scale

#

it gets added to every time you sit on a bench

#

I think thing hasn't been defined at that moment

#

so I need the NailSlash thing = (NailSlash)whatever.GetValue(HeroController.instance); line before that?

#

Ok, changed that

#

it says it can't convert between Vector3 and int and the other way around

solemn rivet
#

well, defaultScale should be a Vector3, right?

#

not an int

#

so I don't see the issue

flat forum
#

yeah

solemn rivet
#

push the code

#

I'll see what I can do

flat forum
#

yeah

#

I had set it as an INT

#

stupid mistake on my part

solemn rivet
#

oh ok

flat forum
#

works

#

every 2nd attack

#

?

#

Why does it work every 2nd attack?

solemn rivet
#

Show code

flat forum
#

that's the whole thing regarding the size

#
private static FieldInfo whatever = typeof(HeroController).GetField("slashComponent", BindingFlags.NonPublic | BindingFlags.Instance);

        void CharmUpdate(PlayerData data, HeroController controller)
        {
            NailSlash thing = (NailSlash)whatever.GetValue(HeroController.instance);

            if (counter == 0)
            {
                defaultScale = thing.scale;
            }
            counter++;
            thing.scale = defaultScale;
            if (PlayerData.instance.GetBool("equippedCharm_18"))
            {
                
                thing.scale = UnityEngine.Vector3.Scale(thing.scale, new UnityEngine.Vector3(2, 1, 1));
            }
        }
#

any idea why it'd work only every 2nd attack?

#

Ok

#

tested it again

#

it worked every first attack

#

but the 2nd

#

(which is like a little different)

#

isn't rescaled

flat forum
#

By the way

#

The FotF/Strength combo is now almost balanced

solemn rivet
#

am back

copper nacelle
flat forum
#

with that you get the super strength attack whenever you're at max health (NewFragileStrength) and 2 health and below (FotF)

#

hey Gradow

#

so, after I balance that and fix the nail-resize

compact sedge
#

the second attack has a different name, no? it's slash and alt slash.

flat forum
#

really?

solemn rivet
#

it shouldn't matter since he's dealing with the slashComponent directly

compact sedge
#

not that it should affect your code depending on how you hook it

#

yeah shalsComponent should apply to both

copper nacelle
#

shals

solemn rivet
#

each slash is an instance of slashComponent

#

and slashComponent is the base class

flat forum
#

well

solemn rivet
#

so altering that should alter all instances of it

flat forum
#

the resizing it this about this

#
NailSlash thing = (NailSlash)whatever.GetValue(HeroController.instance);
#

which is NailSlash

#

if there's NailAltSlash

#

it won't be affected I guess

solemn rivet
#

nope, it should work

flat forum
#

should I replace NailSlash with Slashcomponent?

#

just as a test

solemn rivet
#

it won't work

flat forum
#

Ok

solemn rivet
#

NailSlash is a class in the assembly

copper nacelle
#

slashComponent is of type nailslash

solemn rivet
#

SlashComponent is-

#

^

flat forum
#

Then what's the problem?

Also, here, have it again to not have to scroll up

private static FieldInfo whatever = typeof(HeroController).GetField("slashComponent", BindingFlags.NonPublic | BindingFlags.Instance);

        void CharmUpdate(PlayerData data, HeroController controller)
        {
            NailSlash thing = (NailSlash)whatever.GetValue(HeroController.instance);

            if (counter == 0)
            {
                defaultScale = thing.scale;
            }
            counter++;
            thing.scale = defaultScale;
            if (PlayerData.instance.GetBool("equippedCharm_18"))
            {
                
                thing.scale = UnityEngine.Vector3.Scale(thing.scale, new UnityEngine.Vector3(2, 1, 1));
            }
        }
solemn rivet
#

dunno

#

only optimization I can think of is just setting a bool instead of counting

flat forum
#

AA's assumption seemed like a good reason for it to break

solemn rivet
#

yeah

#

but you said it was working before

flat forum
#

I meant

solemn rivet
#

even though it was scaling to infinity

flat forum
#

it was working for only 1 of the slashes

#

and it was scaling to infinity on only 1 of the slashes

#

it always affected only the 1st slash

solemn rivet
#

maybe that's it then

#

but that sucks

flat forum
#

(I may have not made that part clear enough, sorry)

solemn rivet
#

because if that's the case then you're gonna have to deal with slash, altSlash, upSlash, downSlash

flat forum
#

Welp

solemn rivet
#

all of them are instances of NailSlash

flat forum
#

if I have to

#

I will

solemn rivet
#

so

#

there's a simpler way

#

which requires more tools

flat forum
#

upslashing and downslashing didn't get affected either
And applying a resize on the X scale would just make them wider, no?

solemn rivet
#

dunno

compact sedge
#

probably but they could also have just been rotated and resizing x on rotated objects could make them taller

#

I think

flat forum
#

well, I'll just resize each one separately so I can get Up and Down on the Y scale

solemn rivet
#

what I would do is

#

use monomod detour

#

???

#

profit

flat forum
#

alternative

I don't touch things I don't quite understand for the next 8 hours, as I will be sleeping

compact sedge
#

ok but that is probably the easiest and best way of doing it

#

Speaking of assumptions and hooks I have to ask: is it a bad assumption that the original function is always called at some point when you use a Modding API hook?

solemn rivet
#

not bad at all

compact sedge
#

cuz normally all the original functions seem to be called

#

but not for

ModHooks.Instance.DashPressedHook

solemn rivet
#

well

compact sedge
#

if I add this hook, which has no returns or inputs

#

it stops the original from being called

solemn rivet
#

that's the only override, afaik

compact sedge
#

is that literally because of your mod

solemn rivet
#

so unless you hook the original function to DashPressedHook as well, it's not getting called

#

well, yeah

#

at the time, hooks were just starting to be created

#

the API was a new thing

#

and I asked sean to do it for me

#

and he delivered

compact sedge
#

ok makes sense

solemn rivet
#

I mean

flat forum
#

Ok, I'll see what I can do, but tommorow

solemn rivet
#

the way he did it is the best way I can think of doing that tbh

#

because as it is, it creates an invoke list

compact sedge
solemn rivet
#

so if you want to call the orig function as well, you can just add it to the list

compact sedge
#

I agree with that behavior but knowing that is very helpful to me

solemn rivet
#

my only suggestion would be to add a bool isOverride

#

and if it's false, it would run the original HeroDash before the hook

#

or after

#

whatever

#

hm... That won't work

#

nvm

compact sedge
#

My plan for redwing was to implement a very shitty version of blackmoth that only has multidirectional dash and slightly reduced cooldowns if they didn't have yours installed.

#

because my fireball attack requires up dashing

copper nacelle
#

imo just require blackmoth

compact sedge
#

I'm going to in the XML file

#

so when people download it with modmanager it will

#

unless

#

y'all get recommended mods added

copper nacelle
#

and then run blackmoth's dash in ur dash ez

compact sedge
#

which needs to happen

#

no. I'm not linking against blackmoth. I'm using reflection

copper nacelle
#

run it with reflection large thonk

compact sedge
#

but if I use reflection then I won't require that mod

copper nacelle
#

If you have blackmoth

#

then run the method using reflection

#

e z

compact sedge
#

if I have blackmoth, the method will be run automatically

#

by the hook

#

and if not then it will add my component which does just 8 directional dash

solemn rivet
#

now that I think of it

#

bonfire's levelling system should have been a component to the Hero object

#

...

#

meh

copper nacelle
#

wait

#

I should've done that

#

components on the lords

#

ree

compact sedge
#

pfft I've never done that

#

maybe I should

#

what advantages does it have

solemn rivet
#

well, it made my life SO much easier in enemyhpbars

#

at first I had a huge class with a list of all active enemies and a drawing a bar for each one of them

#

so it was hard to keep track of positioning, when an enemy had died etc.

#

I had to listen to HitInstance and check if the fsm that was hit belonged to one of the enemies on the scene

#

if it did, then I did the hp calculations

#

it was a right mess

compact sedge
#

oh I see

solemn rivet
leaden hedge
#

you probably could have done it with 3 lines of code tbh via line renderers

#

and 2 of them would have been init

solemn rivet
#

wut

compact sedge
#

Coding in a nutshell is learning there's always a solution that's 10 times easier than the way you did it

#

so uh speaking of sprites has anyone done any code with SpriteRenderer?

solemn rivet
#

I use them in berserk

compact sedge
#

ok

leaden hedge
#

what about them

#

theres nothing weird about them

compact sedge
#

ok my sprites weren't appearing and I was wondering why and after looking at your code I suspect because I forgot sprite.enabled = true

solemn rivet
#

could be

#

check if color is not black

compact sedge
#

good call since they're still not appearing

leaden hedge
#

what are you currently doing

compact sedge
#

I'm trying and struggling to spawn custom gameobjects whenever the player dashes

leaden hedge
#

i mean what code do you have

compact sedge
#

everything runs because the log at the end works

#

but my intended result is a bunch of fireballs that spawn in

leaden hedge
#

whats fireballLength

compact sedge
#

it's the width of the actual fireball that I want to appear

#

it's different from the sprite width

#

for now

#

probably gonna set them the same at some point

leaden hedge
#

sprite.create rect is the position of the subtexture

#

i.e. if you had 4 16x16 sprites in a 2x2, 16,16,16,16 would give you the bottom right one

compact sedge
#

ok

#

ok just set the texture size to 150x150

#

but they are still not appearing

leaden hedge
#

try putting another renderer on it

#

like a line renderer

compact sedge
#

anything I need to change about the linerenderer to get it to show up

#

like if I add it with: typeof(LineRenderer)

leaden hedge
#

yeah

#

you'll need to do useWorldSpace = true

compact sedge
#

hell maybe that's what I forgot about my sprite

leaden hedge
#

and SetPositions( new Vector3(0,0,1), new Vector3(1,1,1));

#

SetPositions takes an array but w/e

compact sedge
#

alright done and done

#

not seeing anything :(

leaden hedge
#

have you tried running your code in unity editor

#

so you can actually debug it

compact sedge
#

wha what?

#

where do I even start for that? my game object is made entirely in code for one and for two I'm using a playmakerFSM object

#

and three I'm setting its position based on the knight transform

leaden hedge
#

none of that stuff matters

#

make a dummy object in editor called "knight"

#

and use that instead of the knight

#

and just make it spawn your fireballs based off that objects position as soon as you press play

compact sedge
#

and also copy over 1200 lines of procedural texture generation code too I presume

leaden hedge
#

well that shouldnt depend on anything related to hollow knight

compact sedge
#

no

#

3d template then?

#

since hk is in 3d?

leaden hedge
#

no

#

2d

#

unity has no concept of 2d or 3d

#

all it changes is the default camera from perspective to orthographic

compact sedge
#

what do I use instead of Modding.Logger.Log

#

for logging stuff

leaden hedge
#

debug.log