#archived-modding-development
1 messages · Page 108 of 1
woo now we have much higher pitched cicadas plus a beating heart underlying it
((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'
Clean that shit up my dude
It's getting close to unreadable
it gave me this mid-way cleaning
you have to cast it like
int intVar = (int)(5 * 2.3)
theres no need to cast 1.25 into a double
anyone have adobe audition on their computers?
I need a very simple favor
I'll ask in meme
why not
Ok an explosion looks like this apparently https://cdn.discordapp.com/attachments/319652494093320194/451991492819550208/Screenshot_2.png
So make that
👌
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
tag didn't work?
wtf
try tagging me
@flat forum sup
left server duh
rip
why not A Procedural Cicada?
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
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
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
Uhh im guessing its the waves he needs to pitch the sound and shit
are you trying to code a sound? or would a sound file be needed?
the brilliant part is sines are cosines so yeah just sines
sines are cosines shifted 90 degrees
well, yeah, but
iirc the Fourier series for a periodic function does differ between sines and cosines
hmm probably
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)
wiki delivers
wut
transparent png
ffs
SinA=Cos(90-A)
yeah, I know
That's jist for triangles?
I'm just saying you can treat all cosines as sines when you're approximating functions via Fourier series
(In #297468195026239489 if you want ti)
that's why sines and cosines are basically the same thing but shifted as far as the numbers they produce
over a large interval
math is a meme to some people
Because the fact I understanding nothing is meme
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...
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.
Folding all you have to know is trigonometry and calculus is for dungos 
how so AA?
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
also, Papers, there's this very nice video by 3blue1brown https://www.youtube.com/watch?v=spUNpyF58BY
An animated introduction to the Fourier Transform, winding graphs around circles. Puzzler at the end by Jane Street: https://janestreet.com/3b1b Funding for ...
I mean it is easy but only if the series of float only has 1 frequency in it
Thanks =D
yeah, I getcha
I don't conceptually understand the code I'm using for a lowpass filter
but I conceptually understand 100% of my image generation code
I mean
I mean I understand it on a basic line by line case
I literally study maths for a living and I can't for the life of me understand how to work with sounds
do you HAVE to understand how filters work?
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
okay, but why not just run an audio file asset?
instead of building the sound in the code?
oh
I want to have a really small modfile
you literally want procedural sfx
so why not just transform the asset?
like it's a challenge to me
like how Kerr did with my Boop
but yeah, Mick makes a fair point
my starting asset is white noise and I am transforming it
why not modify the asset "randomly" during runtime?
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
like, sure, do your white -> 8x lowpass -> explosion
I wanna reuse this code for a nuke mod because why not, and lasers, and all sorts of things
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
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
couldn't you assemble that into your mod file?
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
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
shrugs as long as you're okay with that and it works, i guess
If all of them are like this one It's understandable
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
What fractal dimension is, and how this is the core concept defining what fractals themselves are. Patreon page: https://www.patreon.com/3blue1brown Special ...
fracals
F R A C A L S
@compact sedge what's RainbowPos for
basically it cycles through the color wheel
and that's the current position of it in that cycle
1.2.2.1
10 different versions
what's up with lightbringer? (laugh track)
what's drm-free
I remember when the lightbringer trailer first released
light ringer
I was going through hollow knight videos for “just uploaded”
so do i get drm free or not
is that the game version you have?
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????
what does it even mean
DRM free is non-steam
do you have a non-steam version of the game
i got it on steam
so then no. drm-free wouldn't work for you
Yes. But lifebringer is not api, so it will only work with itself
1.2.2.1
Well the number beside it is the patch
oh
Kinda hard to miss
i know pretty much nothing about modding
i thought it might've been the mod version
Well I mean.... It is that too
so is it possible to revert to an older version or should i not bother
what version is 1.2.2.1
grimm troupe?
It's one of the grimm troupe patches yes
ok
Yeah you can
Ask your parents to enable it

uhh
Same
regedit to bypass the block
whatever
Who is the admin?
i just wont use the mod
Are you on a school computer or some shit?
no
Work computer?
no
why do you even need regedit
pretty sure you can do that without regedit
Some people have had problems with downpatching from lifeblood without clearing HK registry values
Not me
was that with moving data over?
Sometimes you don't wake up at benches
Sometimes your opening cutscenes don't even load
Sometimes the game crashes
Things can just happen
well i got 1.2.2.1 but now it's just a black screen
no team cherry logo or anything
And welcome to the reason for clearing regedit
Why cant you open the run window as admin?
Whoever the admin of the computer you're using is can give you access
could make a mod that just cleans the registry for hk
doesn't require admin controls
with empty HK entries
or i could just not use lightbringer
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
just dont ask
its personal stuff
stuff i would prefer not to share with strangers i dont know
speculate all you want but im not confirming anything
you wouldn't download a graphics card
(but I totally would)
(GPUs are so expensive)
Just download more ram
just make a vm with 128gb of ram and a SLI 1080ti
why do mantis lords have 4 control fsms
well one is the stagger fsm
no
and the other 3 are for the mantises
mantis lords don't stagger 🤔
that doesn't matter
all bosses have stagger fsms afaik
its just they have their stagger value set to 9999 hits or something
if there is one then it's not in either of the fsm dumps
scene dump and just fsm mod
ree use modcommon dump
oh you don't just mean the giant rar file with all the scenes in it?
i do
ok well it's cool but lacks the useful variables
It has enough
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
is it possible to make Lightbringer an API mod?
Thats what 56 is doing
it's on haitus for mantis gods
wouldn't mind
would also want to try making a God Vessel Mod for Broken Vessel sometime
lost kin, but the mobs have 20 hp and spawn every second
3 seconds
Half second
3 or nothing
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
probably some weird-ass implementation quirk
b/t cutting off sound within a file vs. at the end
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
Is there any way to view what the internal unity calls actually do?
Looking at the Unity dll in dnspy you just get a lot of extern functions
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
but is grimm2 NKG?
trying to understand how NGG spawns 2 Grimms in the first Grimm fight
so it copies it right away, then nulls it until the final phase?
I'd guess it's null until the final phase where, if it's null it gets unnulled?
If you look here it actually looks more like it sets the grimm2 GameObject one frame after it finds the initial grimm https://github.com/KayDeeTee/HK-NGG/blob/master/src/BossFinder.cs#L58
grimm2 is active the whole time but
gfsm is grimm2
and it gets set back to normal here
https://github.com/KayDeeTee/HK-NGG/blob/master/src/BossFinder.cs#L205
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
That's just telling it to wait a frame
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
Coroutines are cool but letting Unity handle them gives you way too little control
Should update them yourself using MoveNext()
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
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
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
Not through Unity
ok
huh ok
so if I'm building my own gameobject, should I use playmaker at all
or should I avoid it like the plague
well
like I have no idea what the right approach for this is
I'm not sure an FSM would be the easiest way to program it though
No, I mean Playmaker won't affect the game as much, considering it's already purely made out of Playmaker
Basically I'm trying to spawn a sprite that moves according to some simple movement code, and that, on hitting an enemy, damages it.
mmhm
you tell me how I should do that
well, I don't have much experience in adding objects to the game
because I have no effing clue
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
I hadn't touched code until about I started making the mod
only had some basic knowledge
also nice but I'm doubtful is if anyone has some code I can look at that does something vaguely similar
Yeah
It will need some kind of collider for the DamageEnemies to work
Movement idk depends on what you want it to do
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
Put a Rigidbody2D on it and set its gravityScale to something
And call AddForce with whatever force you want
I can't tell what you're doing either from that screenshot
(nor am I, that's why I ask a billion questions)
cool figured it out:
FireballsGO[i] = new GameObject("redwingFB" + i, typeof(DamageEnemies), typeof(SpriteRenderer), typeof(Rigidbody2D));
(what's the mod called?)
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
I think so
children game objects move with the parent yes
thanks I got lazy
physics = new Rigidbody2D();
physics.mass = 1.0f;
why does this second thing cause a null ref exception?
physics.mass is a float
You can't create components like that
physics = someGameObject.AddComponent<Rigidbody2D>();
oh the game object already has the component added
Then use GetComponent
Neato
Where can I find the info on the Broken Vessel fight?
What do you mean by info?
There's some info for ya http://hollowknight.wikia.com/wiki/Broken_Vessel
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
Oh you mean a dump of the fsm
Well there's a tool for it in ModCommon
all my code runs but the fireballs don't spawn. I'll just figure it out tomorrow tho
Here's a dump of the whole scene the boss is in
Or not
Guess I can't upload from archives
?
Same
That's good
HOW
Well you see it's probably because you downloaded enough stuff to fill it
How big is your hard drive?
Well there's your problem
it's also full of Blue Folders for some reason
D IS indeed larger
Ok
maybe some time
the .txt file is the whole info from that 1 room Broken Vessel's in
Yes
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?
Looks like it
infected_knight_room_0004_2?
Dunno
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
also the 2nd grimm doesn't just do nothing
I made its control fsm constantly select spikes
yes
and the first fight?
it too spawns 2 Grimms
and each functions like a normal separate Grimm
it is
so that you fight twice as many
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
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?)
God Kin
Lost God
Lord Vessel is more pun-y
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
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)
(I meant how do you activate each one)
triple click fireball
they could be powerups you pick up in game
or they could require some special kind of Soul (kinda Metroid Prime Echoes-esque)
your DD turns into a Lightning, your shriek ice and your... nowmal Soul bullet - fire
nowmal
maybe
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
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
thing.scale = new Vector3(stuff)
new Vector3(ScaleX()*[number], ScaleY()*[number], ScaleZ())?
you can just do
Sean said I can do *= instead of =
Vector3.Scale(thing.scale, vectorToScale)
but that didn't work
*= will multiply every coordinate of thing.scale by something
but if you do
thing.scale = Vector3.Scale(thing.scale, new Vector3(2,0,0));
it will only change length?
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
no, 0 will multiply by 0
Vector3.Scale is vector multiplication but done coordinate-wise
so I make those 1s instead of 0s so I keep the original size?
yup
Wasup
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!
but in that case, it's easier to do


I'm trying to understand the code to resize the nail
thing.scale = Vector3.Scale(thing.scale, 2 * Vector3.right);
but I want to only change length
should work, yeah
should double your nail x coordinate
no, that's how vector3 works
and thing.scale is a vector3
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
The EnemyHPBar mod doesn't work properly
the old one is OK
The old EnemyHPBar mod is OK
hmm
Yes.The QoL mod needs the new modcommon
what do you mean "old enemyHpBar"?
😱 I can't find the health bars even if I lower or raise my resolution a little bit.
This one updated on Apr.21. The old one means it.
The new one updated on May 22.
send modlog and outputlog please
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
That's a pity.
I'm going to sleep
I tried it today.Inoki asked me to test the mod
I haven't find any question.
So
The FieldInfo thing
How can I get to on CharmUpdate?
Possibly with an if statement
Well
The whole code thing
Has the private static thing
So it's an activation the way public void OnAttack is
what
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
}
}
yes
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
Modding.ModHooks.Instance.CharmUpdateHook += yourfunc;
then it'll run your function
on charmupdate
CharmUpdate is called when you sit on a bench
And on changing charms?
using UnityEngine imo
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;
needs args
the private static public void things?
CharmUpdate needs args re
CharmUpdate(PlayerData data, HeroController controller)
I understand very little ree 
hooks take functions with certain required arguments
your function is missing the required arguments
change CharmUpdate() -> CharmUpdate(PlayerData data, HeroController controller)
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
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)
I added those to the CharmUpdate thing at the bottom
So whenever you use that hook, you must do so with a method with no arguments and no return
and it seemed to fix?
But why did it say those have to be added at the other line?
cause they're required?
^
Ok
here, lemme show it to you
what is modcommon
dependency for a bunch of other mods
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
it has code they all use
so i need to install api and common for rando
yes
ok
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
i just throw the two things into this
^
@flat forum read my explanation above
show us the line
thing.scale = UnityEngine.Vector3.Scale(thing.scale, new UnityEngine.Vector3(1.5, 1, 1));
it's the 1.5 thing probably
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
just do as you did with the nail
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
ok installing mods is hella easy
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
just public int counter;
I can easily add an INT
the thing is how do I make sure I use it when it hasn't been used before?
what do you mean?
ints start at 0, so that should work
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
well, defaultScale should be a Vector3, right?
not an int
so I don't see the issue
yeah
oh ok
Show code
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
am back

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
the second attack has a different name, no? it's slash and alt slash.
really?
it shouldn't matter since he's dealing with the slashComponent directly
not that it should affect your code depending on how you hook it
yeah shalsComponent should apply to both
shals
well
so altering that should alter all instances of it
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
nope, it should work
it won't work
Ok
NailSlash is a class in the assembly
slashComponent is of type nailslash
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));
}
}
AA's assumption seemed like a good reason for it to break
I meant
even though it was scaling to infinity
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
(I may have not made that part clear enough, sorry)
because if that's the case then you're gonna have to deal with slash, altSlash, upSlash, downSlash
Welp
all of them are instances of NailSlash
upslashing and downslashing didn't get affected either
And applying a resize on the X scale would just make them wider, no?
dunno
probably but they could also have just been rotated and resizing x on rotated objects could make them taller
I think
well, I'll just resize each one separately so I can get Up and Down on the Y scale
alternative
I don't touch things I don't quite understand for the next 8 hours, as I will be sleeping
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?
not bad at all
cuz normally all the original functions seem to be called
but not for
ModHooks.Instance.DashPressedHook
well
if I add this hook, which has no returns or inputs
it stops the original from being called
that's the only override, afaik
is that literally because of your mod
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
ok makes sense
I mean
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

so if you want to call the orig function as well, you can just add it to the list
I agree with that behavior but knowing that is very helpful to me
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
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
imo just require blackmoth
I'm going to in the XML file
so when people download it with modmanager it will
unless
y'all get recommended mods added
and then run blackmoth's dash in ur dash ez
run it with reflection large thonk
but if I use reflection then I won't require that mod
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
now that I think of it
bonfire's levelling system should have been a component to the Hero object
...
meh
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
oh I see
you probably could have done it with 3 lines of code tbh via line renderers
and 2 of them would have been init
wut
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?
I use them in berserk
ok
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
good call since they're still not appearing
what are you currently doing
I'm trying and struggling to spawn custom gameobjects whenever the player dashes
i mean what code do you have
everything runs because the log at the end works
but my intended result is a bunch of fireballs that spawn in
whats fireballLength
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
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
anything I need to change about the linerenderer to get it to show up
like if I add it with: typeof(LineRenderer)
hell maybe that's what I forgot about my sprite
and SetPositions( new Vector3(0,0,1), new Vector3(1,1,1));
SetPositions takes an array but w/e
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
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
and also copy over 1200 lines of procedural texture generation code too I presume
well that shouldnt depend on anything related to hollow knight
no
2d
unity has no concept of 2d or 3d
all it changes is the default camera from perspective to orthographic
debug.log



