#archived-modding-development
1 messages Β· Page 107 of 1
I don't think so, kerr. Seems like this button is always there, but disabled
just like the gng background and stuff
can you enable it?
ohhh rip
The referenced script on this Behaviour (Game Object 'GGButton') is missing!
Now this - The name 'Instance' does not exist in the current context
regarding ModHooks.Instance.AttackHook += OnAttack;
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?
try printing PlayerData.instance.GetInt("nailSmithUpgrades") to see if you're getting the correct field
is your code updated on github?
update it then I'll check it for you
just make a commit and push it
can I do it with rm?
rm is to remove stuffs
trying to remove the NewFotF.cs from the GitHub site
why?
because I want to upload the new one and don't know if it'll replace the old one
or just create another
it'll replace it
Uploading same file will replace it
Ok
lemme try
Ok
I think it worked
that should be latest vesion
I don't seem to have recieved it?
instead of, say, PlayerData.instance.nailDamage it's better to use PlayerData.instance.GetInt("nailDamage")
for reasons
mhm
so - does it work?
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;
oh
change it to PlayerData.instance.SetInt("nailDamage", defaultNailDamage);
my bad
but does it deal the correct damage?
do you have fotf equipped?
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
NailDamage is 5 at full health and unless I manually do an update to naildamage using Debug mod it's stuck at 5
no, I mean
without the mod
how many upgrades do you have?
what's the damage supposed to be at?
weird
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
try nailsmithUpgrades instead of nailSmithUpgrades
shouldn't work, but
OH
I got it
I'll submit a pr
what does -39991 damage look like
LET'S SEE
Looks like nothing
not doing anything at al
I expected to heal enemies
I was like
Are you hurt? Maybe I can help
but nothing at all happened
i dont think they even implemented a health increase mechanic
sent it
also, as it is, the game won't update your nailDamage when you upgrade the nail
just sayin
The left-hand side of an assignment must be a variable, property or indexer
again, replacing that thing with the one you sent earlier
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
like I said
but it looks fine, what's broken?
let me ask you this
imagine you're reading the code
and I told you that nailSmithUpgrades has changed
mhm
what would change?
in this thing?
defaultNailDamage = 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades");
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)
(Also, I can't thank you enough for explaining things and helping me out)
then, it gets to if (defaultNailDamage == 0)
and it sets the damage to the NailUpgrades thing
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
So, we reset it back at the end?
or do a
if (defaultNailDamage != 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades"))
{
defaultNailDamage = 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades");
}
will that work?
just check if nailDamage is 5 + 4 * PlayerData.instance.GetInt("nailSmithUpgrades")
yeah, what you said would work
(also, it's != and not !==)
oops
so you have two possible solutions
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
yup
=)
and ! is negative
so !(a == b) is logically equivalent to a != b
so the second is just shorthand
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
First - see if the fotf buff is working
Then try getting an upgrade and see if it scales with it
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
ok, let's take a look
(This single line has become equal to a horror movie to me)
(Me: Half-Assing Homework.png
Dad: ok, let's take a look)
I'll try compiling it myself
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);
}```
done, it works
Yay
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
dash into them
i know that much
but as soon as 2 attack i'm overwhelmed and cant heal at all
and yes
do you have mothwing cloak at least
re wtf
π ±oi
Β―_(γ)_/Β―
mantis lords seems reasonable in blackmoth, hornet 1 is the one i have trouble with

hornet 1 was super easy for me
is blackmoth still broken
idk something about that fight means i have to fight her like a turtle or i get fucked
can you actually cancel dive with dash
it's probably not that hard and i'm just an idiot lol
π
any charm recommendations?
for this fight
right now i got the lifeblood charm and dashmaster equipped
5 charm notches
if you're not planning on cheating don't take long slash
longnail might help but you get mop right after that fight so
longnail = fly off and hit the spikes
unless you're cheating
then it's really good
i barely have any geo and i only have a few charms
you could get joni's maybe, if you can't heal
i mean, knowing mantis lords you can
ur bad
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
wtf
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
^
It's probably just #297468195026239489 only
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
that's cause it is
are you dashing up/diagonally?
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
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
why go on the wall
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
double boomerangs
ok
also 2 heals between phases
1 -> 2
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
i'm going to have the best trigger finger after i beat blackmoth some time in the 2200s
i'm at a point where i can almost do the entire phase 1 (the first mantis lord) without getting hit
Ok
It works now
so
Here, NewFotF.dll
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))
can i habe a lightbringer latest version pleas
π
^^^^^^^^
so is lightbringer basically blackmoth but with the elegy instead of dashing
or am i thinking of the wrong mod
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
while in blackmoth it's mostly the nail charms that are changed?
your nail doesn't do anything in blackmoth. So charms and abilities were changed to augment your dash in different ways
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
Wait is it only spells or do you bodyslam everything?
Ok
pfft balance
Currently it's only balanced for Pure Nail
isn't it percentage based?
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
yeah
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
and the actual notches? What's the hook for them?
ModHooks.Instance.CharmUpdateHook is every time a charm is added or removed
mhm
as for the cost of the charm itself I just do PlayerData.instance.charmCost_40 = notchesCost where notchesCost is any integer
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
?
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
YeahYeah I mean is that the way the beforeSaveGame and SaveGame should work?
it sets the charm cost to my value that isn't the base game value
so, is that the SaveGame thing?
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
welp
I don't want to break save files
(SaveGameData data)?
I'll just leave that like it is
it needs that variable but I don't use it
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
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;
}
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
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
you can do that too but that requires manually disabling the mod to restore the values
I used to have that in grimmchild upgrades
So AA's is better
but I was unhappy with that solution because of that
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
yeah just edit nail damage on the attack hook
Technically you could hook the take damage functions
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
cast it to a float before you divide
or actually a double
do / (double) PlayerData.instance.GetInt("maxHealth")
double precision float
PlayerData.instance.SetInt("nailDamage",
PlayerData.instance.GetInt("nailDamage") *
(1 + 2 * ((PlayerData.instance.GetInt("maxHealth") - PlayerData.instance.GetInt("health"))/ (double) PlayerData.instance.GetInt("maxHealth")
)));
?
so, double
probably also want to do 2.0
allows for 1.X?
instead of 2
I will
1 + 2.0
Just the one double should be good but it doesn't hurt
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")
It's all one line
I just set these all to a single line?
no
Put (int) in the set
^
(int) (1 + 2.0 * ((PlayerData.instance.GetInt("maxHealth") - PlayerData.instance.GetInt("health"))/ (double) PlayerData.instance.GetInt("maxHealth"))
try this
^
has anyone played around with audio in unity or c#?
boop mod
what format is sound in? A giant array of floats representing pitch? or is it bytes or ints or some other data type?
So
This happens now
up to 4 lost health masks damage doesn't change
from after that it doubles
so
it gets rounded down
(int) (PlayerData.instance.GetInt("nailDamage") * (1 + 2.0 * ((PlayerData.instance.GetInt("maxHealth") - PlayerData.instance.GetInt("health"))/ (double) PlayerData.instance.GetInt("maxHealth")))
You can make audio from unity asset bundles
this should fix it
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
are there things applied to music?
so
the music file is one thing
and the one that plays in the game is different
-1 to 1 iirc
(Collector fight and Trap Bench)
I'm trying to procedurally generate and play audio.
Yes there are filters applied to audio
no 2.0 is 2.0
did you reset PlayerData.instance.GetInt("nailDamage")
or is it multiplicitvely getting increased
every time
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
did you actually write 20 and not 2.0
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?
quit and reopen hk the way you have been and see if the number is still 441
Wait nevermind
I'm stupid and forgot to delete one of the multiplication lines
it got multiplied twice
can you make mods in the editor KDT? or are you recommending I play with audio in the editor for the fun of it.
Rebalancing: Done
I'm gonna assume the latter but if I'm procedurally making sound I don't see the editor helping me imo
cool
should I consider this an official release and set Mod Version to 1.0.0?
it's 0.0.1 rn
Hm
yeah IMO
Alpha and Beta are Sub1
imo
I dunno
official release, version 1.0.0
Official Release of my First Mod - now completely Balanced
https://github.com/mamedev/mame MAME is on version 0.197
with base nail you get 1 damage per lost mask
and it's been indev for like 20 years
ok
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
well whatever works for you I guess
there's no right way to do it
just look as Windows versioning
basically version 6.0 for 15 years and now they're on version 10.0
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
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?
ok and is modcommon in your references??
Assembly-CSharp, PlayMaker, UnityEngine is all I think


i bet the problem is that i don't even get iframes in blackmoth
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
weird, bc it doesn't feel like it was that way in vanilla
doesn't look like anything changed it on github either. weird
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)*}
uhh actually I have the opposite problem with blackmoth
i think i just died a littlle inside
don't worry it makes the code way more readable
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;
no I mean
eww people write code like above
the get return or the expression bodied member
why not just do public readonly override string Texture
why do you need the whole get part
m8 u turbo
I'm tempted to patch turbo and another bug. I know how, but it requires testing and I'm gonna finish my thing first
having it do a get return or => is required otherwise it won't compilee
oh huh
or I could make shitmothst where just holding the dash button causes it to turbo, and other improvements
work on room randomizer if you wanna do a mod, imo
i can send you my half working janky prototype code
but shitmothst
also room randomizer sounds like actual hell
inb4 first room is radiance dream
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
well, yes
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
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
That as well. Maybe it could shuffle by region but I feel like that wouldn't work as well
^
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
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
best i came up with was to use a pathfinding algorithm to map out all the rooms in the game
we just need to finish the work of mapping each room
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
but doesn't account for any skips, like we've talked about before.
this is true
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
skips would be something you'd add in addition to the pathfinding, imo
use the computer to solve the basics
put a reward on it, like nail1 no upgrades/spells fluke
i mean, you still have to do the mapping anyways
so it's just double work at that point
even with the algorithm
not entirely double
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
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
too lazy sry
Two hours feels like 10 when you're doing mind-numbingly boring tasks
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.
so private float[] normalizeVolume (float[] fx)
just passes pointers
geeze really? it's taking quite a lot of cpu power to generate then.
oh wait I know why
are you messing with unity audio sources?
I'm calling Math.sin
818496000 times
that's why
and the joke is I'm not even sure that's enough
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
[XmlIgnore]
float[] cachedClipData;
is the main interesting part for you probably
can I dump the clips as wav or something
so I can also listen to them outside the game
what's the assembly for component data
also have you tried this with unity mono?
or just regular .net?
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
where is GameObjectData?
mm
let me just give you all the source
i was working on seralizing fsms to file
thanks
using unity objects test the serialization
actually if you can somehow finish that work that would be like the best but even if not that's still pretty awesome
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)
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.
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
meh if that's the best way to do it I'll just add a loading bar to the main menu scene.
angle thinks assets are illegal
is tru
colorized, 2018
well, asset bundle = how you add things to a unity game at runtime
ok
all scenes are turned into asset bundles that unity loads implicitly when you build a project
I'll make a fake scene then with a giant black rectangle and a loading bar
but yeah, loading asset bundles is how i did the menu stuff for my first version of enemy rando
for generating sound effects
depending on how high quality they are
I'm estimating 1-4 cpu seconds per second of audio
github I think
(Whose was the mod?I can't find it by searching the name so I'll search the creator)
Oh wait
I found it
huh why am I getting a null ref?
but I do this why would it be null soundFXClip[1] = AudioClip.Create("fireball2", AUDIO_SAMPLE_HZ * 5, 1, AUDIO_SAMPLE_HZ, false, generateFBSound);
AudioClip[] soundFXClip = new AudioClip[4];
Array shouldn't be null
it's not null
is one of the args null
this checks for both charms, right?
if (PlayerData.instance.GetBool("equippedCharm_6") && PlayerData.instance.GetBool("equippedCharm_25"))
yes
and this will set damage to x2.5
PlayerData.instance.SetInt("nailDamage",
((int)(PlayerData.instance.GetInt("nailDamage") * (double)2.5)));
if you broadcast the fsm event yes
Yeah, I have it broadcasted
but that'll keep multiplying
PlayMakerFSM.BroadcastEvent("UPDATE NAIL DAMAGE");
21 * 2.5 * 2.5 * 2.5 * 2.5 * 2.5
no
unless you set it back after attack
it gets reset at the start of the attack and then changed
it's like
OnAttack
Damage = normal
Damage = newDamage
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
did the unity example run well?
oh god I know the problem
?
even though there's a hook function that has an arbitrary length float as input it runs this many times for one audio file
can someone send the Bonfire GitHub?
All repos are marked
What about makeing code convention for modders? Making united code style will be useful for working
hahahaha no
^
how do you make it overcharm?
As long as everyone changes to my conventions and I don't have to do anything I'm ok with it
is there an overcharm = true thing?
yeah every just write code the way I do. /s
you have an overcharming thing?
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
they die instantly
brackets belong on the next line
and spaces are better than tabs
imo
no
I don't like those either but sometimes I'll do it anyway
The real evil is
if (x)
thing();
Yeah that's not too bad
but naming conventions like boolean isItNotTrue is perfectly readable /s
56 ur naming conventions give me cancer
thank u
not naming names or anything
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
i mean unless its for loops, ive seen guys putting
int currentIteration = 0; currentIteration < 10; currentIteration++
someArrayThingHere[currentIteration]
w h y
// magic number don't change
for (int The_VariableYouPlanONLOOPING = 0; The_VariableYouPlanONLOOPING < 132 ; The_VariableYouPlanONLOOPING++)
dunno just saw it on my classmates* examples back then
for (int iterationVariable = 10;;)
{
iterationVariable--;
if (iterationVariable <= 2) break;
}```
Idk if that would even compile
But it's bad
wtf is that why
fucking hell
that took me like two minutes to figure out
We good visual studio shows no errors on it
no Warning: you are an effing moron. error?
where can I download the hooks?
for what
for EnemyHPBar
I tried that already 56
oof
holy crap python saving my ass
just gotta say it's so good
I know uncontroversial opinion
Python is pretty cool yeah
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
Very nice
you disgust me
thank u
but why
is appending to a string not a O(n) operation?
this has been running for about 3 minutes
isnt it just O(1)
Is being constantly overcharmed, but dealing 70 damage per hit balanced?
no
Indeed
I will eventually balance stuff
assignment operators and if statements should be O(1)
i mean, Heavy Blow isnt balanced so.....
i should make that switch statement worse
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
switch (((Func<bool>)(() => { if (PlayerData.instance.GetBoolInternal("poop")) return false; else return true; }))())
{
default:
break;
}
ban imo
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
5 minute mark
Empirical boi, just test it manually
Why are you even converting 880000 things to string?
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
You'll figure it out
yeah by doing something hacky like this and leaving my PC for 15 minutes
while it runs
Just use cheat engine to speedhack the program
meme
That for loop doesn't even do anything
i know
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
That's not what I meant
oh well that's what I mean
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
Anyone could tell instantly this does nothing
This should be the type of shit given as answers on stackoverflow
true
10 cpu minutes and still running. gonna go grab a bite to eat.
gonna make the cases more lambdas
adding to string is def not O(n)
it isnt?
how is adding to strings worth n^2 (actually i think it is considering the string length)
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;
case (BitConverter.ToInt32(new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 }, 3) % 2 <= Convert.ToInt32(BitConverter.ToString(new byte[] { 0x12, 0x56 })))
yes
I just put random bytes so BitConverter might fail
a constant value is expected
Wow bs that is constant
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
Time to post it on stackoverflow the next time someone asks for it /s
Now i actually forgot the original intention of the code
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
Well congrats 56, you fucking did it
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 )
checking if a variable is below a certain number in an if statement goes like?
if(A < 2)?
because
there was the == thing
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
so, just <
no << stuff
yup, << will be an error as far as i know
<< and >> are bitwise shifts
Ok
still running but I made a better solution
check #297468195026239489
if it's stupid and it works??????
check #297468195026239489 when
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
So do you have to generate the sound again everytime you create an explosion?
windows doesn't support wav wtf
Jormungandr /tmp/grimm $ file cool.wav
cool.wav: RIFF (little-endian) data, WAVE audio, mono 44100 Hz```
So
just a quick question
what numbers is double about?
and what numbers is int about?
opened in vlc
25, 64.74, 30 can all be held by double
vlc plays everything
So, int rounds down the the nearest whole number?
right
yes
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
nice cicada noise bypasses game volume settings :)
but double to int will
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

