#archived-modding-development
1 messages ยท Page 69 of 1
Lol
Do they?
I just meant that the new health manager has geo prefabs
And they added utility to fling geo for this as well
they probably do, or an abridged version I'd assume
I added geo to enemies in enemy randomizer, it works well
Oh this also explains why fragile greed is way better for some enemies
The bigger geo pieces dropped the better
Since it's a ceiling
One thing I'm unclear on is how to "INSTA KILL" enemies now
Since the health manager doesn't seem to have that
Die() seems to be the replacement but so far it seems like I'm missing something there
Does it not work?
Not sure. So what my code used to do is take the replaced enemies and hide them and make a pair out of the new and old. Then when you killed the rando replacements, I would call insta kill on the old. I switched that to Die() and in my initial test rando enemies I killed would respawn when I changed scenes and came back, indicating they weren't dead, I think. I need to test it more though. (Afk from pc for tonight)
Check the isDead bool on the original
I think the object still exists after killing them
Ahh, good call
I just want to point out that part of their optimizations includes enemies persisting after death
Fucking funny
Holy shit this wall is so much higher in the new scene
Gonna need patch specific randomizer requirements now
Hooray
Could just add a platform there to keep things consistent idk
You would have an early claw in way more seeds with this high wall
Yeah just add a platform
Super easy to make money spawn now
I just have to cache the geo prefabs at some point
I wonder if it's possible to add an arbitrary function call to an fsm state
Probably not even something that's worth trying
To a state or an action in a state?
You could probably make an action and put it in a state
Yeah, but I think it would in the end be better to make my own pickup class instead
The only thing is how to deal with all the unique looking pickups like ddark and shade soul
But yeah I'll probably end up doing something like attempting to cache the prefabs on every scene load until it works
Then if you somehow get to a pickup after loading in without seeing a single enemy just add the geo directly
Idk if you saw my timing, but loading about 70 scenes for enemy rando takes under a minute now
The update made it about 3x faster
So if you need to preprocess some scenes like I do it would go fast
I don't really think that's necessary
Just saying
You'd have to do some stupid shit to purposefully get the fail condition like quit out at the shade soul bench and completely restart the game
And it's not like it would just break everything at that point
Oh wait I think I misunderstood what you're referring to
Yeah it might be worth it to grab the unique pickup objects
It's honestly almost freakishly fast compared to what it was
Although it's not like I would be wanting to stick the ddark rock in another scene
So whatever class ends up needing that I could just instantiate on first load of that place
Yeah probably better
I wonder what they did to make it so much faster
It's just Unity scene loading so there's nothing they could have done to optimize that
Must just have made the scenes themselves more efficient
Well they did reduce the amount of fsms with the removal of the health managers
Ah yeah good point
2nd I noticed their scene loading now uses an async version
Yeah makes sense
Because now they've got the little walking dude on the load screen
Can't just freeze everything
Yep
I based my loading hook off your rando code so my mod used unity's scene manager loading hook, so I didn't have to fix much of my stuff other than code that interacted with fsms
Neat
Did you see that new world class they added?
I think with that we could make a nieve entrance rando really easily

I already dumped all the exits a while ago but I just posted it in here and didn't really save it
So it's lost to the ages, I'm sure
Yeah, plus new content will be there for sure
And the new smaller scenes
@young walrus Get to work ya bum https://pastebin.com/vckVJVvt
7k lines lol
Actually mapping this out to where a sane room randomizer is possible is so unrealistic
Yeah, that's why I decided to try the pathfinding
I hope too, but either way, it exists
Man, after the shit I've seen at my work I'd believe it
I feel like if it was automated, it wouldn't output to code
it would have been outputed to xml or something
It's amazing the amount of work people would rather do than write a tool to di it for them
di
Fuck man I'll spend an hour writing code to save me 5 minutes
So, story about this
I'd spend infinite time to avoid doing the same thing for 5 minutes
menial work is literally the worst
My first game at my company, everyone was importing data from the game designers (tables of data) from excel and putting it in c++ header files by hand
w h y
I asked one senior engineer how long it took him every time new data 2as dropped by design to update the game
He said "around 30 minutes to 2 hours depending"
I wrote a tool to automate it and became "the guy who could make builds fast"
But no one else wanted to use it because it wasn't "normal process"
You shouldn't have told them
When you had to do it, just run the script and have a 2 hour break
I didn't, they just noticed when they asked me for changes and it happened same day
But... yeah now 5 years later I keep expectations in line
Famous quote by the CTO of our game engine team a few years back "we don't have time to do it right, we just need to get it done"
Makes sense
famous words before creating a system that has caused over half our senior engineers to quit since then
If I wasn't working in an isolated subsidiary with virtual independence...
/endrant
So hey, if anyone wants to work in Nevada we're hiring 
Not sure, I never had time to sit down and check

lol
Here's geo spawn code if anyone else finds this relevant https://pastebin.com/vwKJ0eP7
Neat
It's untested
But probably works
You need a transform for this to work and I'm just using gameObject.transform since I'm planning to have this on a component
Easy to change that, though
i like how i was skimming through it and went "why doesn't it just subtract the larg, med, and the put remaineder in the small" and then notice that it does just that at the top
nice tho
i like it
Alright
Well
I don't know what went wrong but when I ran this it instantiated so many new prefabs the game ran out of memory and crashed
oof
when did you call it?
I just ran it in HeroController.Attack
So it's not getting called more than once
And I used a small number (69 heh)
hm
This exact method of spawning geo worked when I was just doing a set number of large geos
We're talking 20000 lines of this in the output log btw
Object Pool attached to GlobalPool has run out of Geo Small prefabs, Instantiating an additional one.
oh
wait nvm, hmm
maybe it has to do with the type of object you pass in?
like maybe the gameObject passed in is expected to have a certain component
or fsm
like a personal object pool
That would be strange
I'd expect the function to take an actual object as a parameter if that's the case
Not the transform
I'll check anyway, though
I think this should be fine
Something is clearly wrong with how I'm iterating
This didn't crash this time and spawns ~1.2k
Oh wait I'm just an idiot
I'm looping the number of them and passing that number into the spawn
there's also a hard memory limit they put into IsUnloadAssetsRequired
So I'm spawning num^2
in GameManager.cs
but i don't think that should hit what you're doing?
ah
yeah

wtf
i wrote dumb code
and it worked anyway
the reasonable code fails
but the dumb code works
Story of my life
i moved the updateLord to the earlier if
and it started working
even though p2 isn't ever set by anything else
and even I remove the if part of the else if
it doesn't work
but putting updateLord under the log works
:**: 
Nice
Medium geo is 5
oof
lol
so the scene loading is so fast that i think i might have the new logic load every scene
and remove the fixed list of enemies that i was maintaining
Wow that sounds pretty intense
Would be funny to just go into a boss arena and find a crawler
Ah, boring
my end game is to allow that
but "enhance" things not normally hard so that it fits when randoed
so a crawler, but it has 1000 hp and summons primal aspids or something
neat
Sounds pretty hilarious
really that's kinda my hope
last night i did a randomizer + enemy rando play to test things
i got crystal dash in fury of the fallen's place
and then double jump at salubra
so i went up to where glowing womb was
the ambush scene ended up being those flies that drop orange infection and exlpode + heavy mantis fliers
i died for like an hour until i finally beat it, it was nuts
Oh god the mantis fliers
yeah, i had to do a lot of cheese
that kinda stuff is why i like the combo of randomizers tho
This geo spawn code weights small geo too highly
I mean every medium that doesn't get spawned is 5 more smalls
Gonna change the random to be 1/2 of medium max minimum
Odd sentence
Yeah I think this is much nicer
Not getting lag anymore when spawning 655
No reason to check higher than that, that's the biggest chest in the game
nice
I should actually reverse the order of choosing, though
Small first, then medium, then large
This way it is still technically possible for it to choose to spawn like 300 smalls
Alright this still looks like a nice random geo explosion and reduces the max amount of geo things spawned by like 3x
int smallNum = random.Next(0, amount / 10);
amount -= smallNum;
int largeNum = random.Next(amount / 50, amount / 25 + 1);
amount -= largeNum * 25;
int medNum = amount / 5;
amount -= medNum * 5;
smallNum += amount;```
So how goes? Is modding going to be accessible now?
some is better for sure
Ya Will mentioned to me last night that you guys will like the health manager
health manager >> fsm health_manager_enemy
oh yes, i certainly do
Yeah, and it helps load time hugely
enemy rando load time went from like 5 minutes to under 1
Niice
there's still a few FSMs i wish were gone, but it's already much better
Yeah
Shiny control I really want gone
I'm sure gradow wants sharp shadow fsm gone pretty badly
and it sounds like float is still around (someone was saying)
yeah
oh, @warped sinew the new health manager, SetGeo functions are public, but there's no way to "Get" the geo without some tricky hacks since that stuff is not public
Just make a GetPrivateField thing that caches ones you've asked for already
It'll come in handy for other modding you do I'm sure
well, i just wrote a function that uses reflection to get the private int
but a getter should be trivial for them to add, or just make the int public (shrug)
Yeah, would be easy, but I'm not sure how much this is a thing where we can request changes
yeah
usually when i run into something like this it's just a case of "oh i forgot"
Haha yeah I don't do the glitch testing s
Another tester did and said it was gone but here we are :)
so i figured i'd mention it
bc i know they're a tiny team
so far the bane of my enemy rando has been getting mages to work
I just find bugs/balance and do 106% runs over and over... I dont have to to try and break stuff someone else can
everything else has been pretty easy tho
and the mage fsms still seem to be around so 
something to do with the teleporting
You guys should write out a well formatted list of code issues you have found and stuff. I can then submit it to the guys I'm sure they won't mind.
That would mostly consist of "x FSM is bad" and I'm sure they know that already
Game is still in beta for a reason
i mean, sure thing. i'm sure we can compile a nice google docs list or something
honestly, i bet with a few succinct changes a lot could be easier
Yeah, actually
Like all the places they access playerdata vars directly
Instead of the get/set functions
heck, i bet we could provide code for them to just paste in
๐
but yeah, cool idea graig
I cant promise anything will actually be implemented but it might be. Worth a shot (if you can be bothered)
i know they're probably really busy, but i've put together more for management at work with less possibility of it being looked at ๐
Since I'm in the process of making my own shiny item class I might as well try to get that made "official"
Worst case I just mod it in anyway
and if we do something like google docs it could be an ongoing document that they could just poke at whenever
Now is the best chance to get anything changed as they are still working on the nitty gritty stuff. Pro tip If your change will lower system resources it has a much higher chance of implementation.
Anything that removes an fsm will improve performance
noted! i'm sure any fsm-replacement would do that
their move to unity 5.6 is pretty sweet too btw
5.6 doesn't yet have the experimental support for the new version
that's 2017.whatever
i don't see them upgrading again so soon to release, but 5.6 has stuff like the new line renderers
Ah ok
specifically: Initialize engine version: 5.6.3p2 (b3d7a6428558)
if curious: https://unity3d.com/unity/whats-new/unity-5.6.0
wait can i use unity to mod hollow knight?
O_o
welp time to make a mod that turns hollow knight into a undertale like RPG
oh.
and every fight makes it like hollow knight
fair enough
well, yeah
You can create an asset bundle using unity and load it through a script if you write it into the game. (Asset bundle content does not contain scripts) So technically you could use unity... but all the work we do is modifying/adding/removing c# code that already exists. Very little use of the unity program...
Hi, I was told to ask here: I recently found out that abyss shriek/howling wraiths can damage Grimm and NKG in pufferfish mode. He's supposed to be invincible, right? Can someone look into it?
I'm pretty sure KDT knows NKG inside out by now. If anyone, he would know
shouldn't be damageable at all the pufferfish is a seperate entity, unless this is a lifeblood change
even if you enable the hitbox on it, it still wouldn't hurt him
so you use dnspy for the code, but if you want to add new sprites or something you'd use unity?
no
another program
Ancient version 1.0 screenshot
6639
Unity Assets Bundle Extractor (UABE) is a stylish tool that allows editing asset bundles and .assets. It can export .assets files from bundles, import them back, modify most asset formats with plugins and d...
I don't know the difference
is there any way I can have code using the new health manager w/out it failing on earlier patches
if I use the health manager I get typeload exceptions
would I just use HealthManager there?
Nah that would probably fail
What's the way?
Well it's fucking awful but I'm sure typeof(Activator.CreateInstance(hManager)) would work
Don't do that before trying more stuff
You can use get component with a string instead of a type
GetCompnent("HealthManager")
but i still get the component does not contain a definition for 'hp'
Well I mean, it will return null on versions without the component
Oh, I see why you're saying
You would need to use reflection
Here let me paste u something
public static class HealthManagerExtensions
{
public static int GetGeoSmall( this HealthManager healthManager )
{
FieldInfo fi = healthManager.GetType().GetField("smallGeoDrops", BindingFlags.NonPublic | BindingFlags.Instance );
object temp = fi.GetValue(healthManager);
int value = (temp == null ? 0 : (int)temp);
return value;
}
so if you change the binding flags and the variable name
basically you can use the "string" name and reflection to get/set the variable
Gross, not caching the FieldInfo
yeah i should
i just threw it together in like 2 seconds yesterday to test since health manager doesn't have a getter for geo
Yeah I've got something similar for getting the prefabs

@vagrant leaf no longer breaks on phase 2 w/ beta after dying
and works on beta and 1.2.2.1
Sweet
so i printed a list of all the prefabs (i think) in this build of hk
one thing i noticed is the prefabs for menu styles in the list
lifeblood i assume

yeah, i kinda wanna see what that is
yup, it's just a prefab, i just need to call "Create" on it basically, but i wanna figure out where it's supposed to be put in the game's code
so... ima do that now
:3
send pics if you succeed
ofc
i gotta see that shit
did you see the scene list i posted yesterday?
nope
check out the enemy randomizer folder on the mod drive, there's a scenes.rar in there
it's all the scenes dumped into text form
found it
"Dream_Backer_Shrine.txt" i think is an interesting name for a scene
Shrine of believers
The shrine is two scenes
ohh
You dream nail the thing and get put outside the shrine
Door to go in
What's a loop?
Yeah I doubt it
their cheat engine thing right
It's just in PlayerData
wot
Damn they're trying to steal my job
it does a lot of stuff
if (Application.isEditor || Application.platform == RuntimePlatform.Switch || Debug.isDebugBuild)
Ah yeah in the init
probably just need to fake that it's a debug build
then it'll load
or rather
overload that with monomod
probably easier
Easiest to just remove the if
yea
What do you mean?
so i found the MenuStyles class

just need to figure out where to set it to GG_Style
i meant if you enable the trigger for the debug build (if is met) maybe it'll enable all the dev tools? idk
i don't know jack about modding though so idk
I pressed the thing to enable all stags and now my character is stuck moving left
lol
lol
n i c e
real functionality
right here
who needs the fancy UI of debug mod when you can have
shitty standard unity ui
yeah, who needs basic movement tbh
why are scream and double jump 0/10
I lost all movement control
Then I started a new game and I'm moving right
Idk how this menu is supposed to work
I hate it
lol
*everybody move to the left
everybody move to the right*
Hm, I think they're not using LoadFirstScene anymore
I changed that and it still dropped me into king's pass
they are
but most of the functions in game manager changed slightly
i updated them in my build of the api
example for loadfirstscene
#region LoadFirstScene
[MonoModReplace]
public IEnumerator LoadFirstScene()
{
yield return new WaitForEndOfFrame();
this.OnWillActivateFirstLevel();
this.LoadScene( "Tutorial_01" );
ModHooks.Instance.OnNewGame();
yield break;
//yield return new WaitForEndOfFrame();
//this.entryGateName = "top1";
//this.SetState(GameState.PLAYING);
//this.ui.ConfigureMenu();
//this.LoadScene("Tutorial_01");
//yield break;
}
(comments is old code)
No, they're not using it anymore
The first scene is loaded from OpeningSequence.StartAsync
oh, hmm
Actually hm maybe not
That didn't change anything either
Maybe it's StartSync I need to change
Oh, lovely
while (this.chainSequence.IsPlaying)
{
SkipPromptMode nextSkipMode;
if (this.chainSequence.IsCurrentSkipped || this.skipChargeTimer < this.skipChargeDuration)
{
nextSkipMode = SkipPromptMode.NOT_SKIPPABLE;
}
else
{
nextSkipMode = SkipPromptMode.SKIP_PROMPT;
}
if (GameManager.instance.inputHandler.skipMode != nextSkipMode)
{
GameManager.instance.inputHandler.SetSkipMode(nextSkipMode);
}
yield return null;
}```
Here I was thinking you couldn't skip cutscenes immediately so they could load stuff
But no, they just added an arbitrary timer before you can skip
wtf
Alright yeah OpeningSequence.StartSync controls the first scene now
Neat
wow that's cool
i like it
ACTUAL FIRST LOOK AT GNG
totally spoiled
you should post this in #hk-discussion and bait people
lol
where did that actually come from
i sound the GG menu style in the resources
if you won't i will
go for it, i'll watch
i doubt that
really?
yep
what's the file called
GG_Style
because that seems unlikely
oh wow
thats real cool
you should make a mod that's just exclusively that menu option
could you make the modding api set it to this on boot, or unlock it to be selected?
because i would love to set this as current title screen
it's cooler than the steel soul one
Yeah should be easy
honestly it's trivial to change it
MenuStyles.Instance.SetStyle( i, true, false );
^that, i think 4 is GG
imo start modding
Just set that line of code somewhere
With 4 instead of i
Put it in OnScreenDebugInfo
but how
i might do it in enemy rando, since i liked changing the title screen music
Dnspy
ok let's see how this works out
yeah, they changed the scene orderings
so i'm re-working my scene loading code rn
๐
i kinda want that new boss track as the title music
so i open up Assembly-CSharp right
Yeah
huh, there's specific objects for knight and hornet
and yep, 4 is the GG background
On screen debug info
Could also just override it to always set 4 in MenuStyles
we should tell graig or someone from tc about this next time someone's on
i don't think this is intentional
shut
gey
Like just put index=4 at the start of MenuStyles.SetStyle
How bout we tell TC nothing ever again
Since they don't give a shit about us anyways
May as well keep them from patching everything out
Hey they may hate speedrunners but they like the people over here
inb4 TC lurking in speedrunning channels to find new bugs
Worst kind of Dev TBH be honest
tbh april 1st they reveal it was all a meme and now you can teleport everywhere
Made that change
Anyone know if you can detect FSM events without an FSM?
Want to be able to detect the "START INSPECT" event that gets sent from the inspect region FSM on all the shiny items
Might just have to make code for that too, idk
That's not very appealing
sh
solid black menu screen when
i wrote a component that makes a dictionary of all the fsm states and then keeps track of when they change when it's on
then you can check
pfsm.Fsm.LastTransition != null ) pfsm.Fsm.LastTransition.EventName
when the state changes
Wow that's horrible
I'll just make a component for inspect region as well
wtf the menu styles are supposed to unlock from achievements
really?
some, idk if like classic does or a few others
but like the steel soul one makes sense
i have my initialize set off a coroutine
yield return new WaitForSeconds( 2f );
MenuStyles.Instance.SetStyle( 4, true, false );
neat
hmm
goes back to normal after save and quit tho (probably need to change that 2nd flase to true
I'm pretty confused right now
The FSM mod shows there being an "inspect" FSM on the inspect region objects
But I can't find it at runtime and it's not in kerr's object dump
is it created at runtime?
It would really be something if TC was adding FSMs to shit at runtime
they are added at runtime
theres another fsm that spawns a prefab
with all the inspect stuff on it
w h y
y not
so, I'm finally able to look at the assembly for the beta
what have you guys found already?
yeah
also, any news on fsm dumper for the beta?
they left in the gods and glory one
enemy rando has something which dumps the fsms in a scene
to modlog
hm
do we know that the remaining FSMs (aside from the health manager change) are still basically the same?
The old FSM dumper still works, though
re
wow what a dungjead
For FSMs idk if they're the same
mantis lord fsms were the same
hm k thanks
I'll take a look at sharpshadow and superdash then
fling
oh yeah, there was something about flinging geo?
Fling is normal, it's for the animation on stuff coming from chests and whatnot
Just idk what fling grub/bubble are
Slug has gotta be divine
And yeah it's really easy to spawn geo and fling it around now
Actually grub is probably grubfather
You have a save_fsm folder, right?
Sick
It's because it's not loading 500000 health managers
It's not like it saves every fsm immediately
You had more in the old patch because you used it longer
There's still a lot of fsm
mfw new enemy rando is better than ever
i have a copy where i'm pretty sure I just did the initial dump
and that was 1.06GB
wait, did I miss the release of a beta-compatible api ver?
also, Kerr: NICE
just push CG off the cliff
ggez
I don't think anyone has posted a modding api dll
he knocked me out of room
lol
kek
imo ask kerr for an api copy
if his has all, or most, hooks, I'm in
np
some enemies have disappeared tho, namely the colosseum ones
like zote is gone, i need to find where he went
^
lol
tfw all the watcher knights go randoed
i killed the replacements at the door opened correctly too
do they still die from the chandelier tho
i think so
because the chandelier kills the originals by script
which triggers my tied replacements to die
else apparently i would've had to fight lost kin in here
yep
black knight 2 was replaced by lost kin
nvm, he went down here
lol
nice
well this is awkward
soul master and soul tyrand
tyrant*
and above them
lmao
bossrush but not
no i decided to add everything back into the randomizer
to see what happened with the updates
y e s
most of it works now

it needs some tweaks
Eventually, right now I still need to put some rules in to fix some new softlocks. Like replacing gruz mother is still bad and breaks the gate she's connected to
I think I'm finally gonna move the enemy sets/rules to xml so others can help with development, next time I have time to work on this
I won't be doing a release this weekend, but if someone really wants the current version I can put it up here
imo do it
it's missing a bunch of colosseum enemies and who knows what else is broken in it
thank
Currently finding a game object so I can find another game object it has as a child so I can find an fsm on that game object so I can find a prefab in the fsm to spawn a game object which has the fsm I actually want on it 
<DebugInput>d__24.MoveNext() :::: Dumping Scene to D:/Steam/steamapps/common/Hollow Knight/hollow_knight_Data/Managed/Mods/Hive_01
n i c e
do the different zote tiers count as different enemies for the randomizer? im imagining a room full of zotes
each more magnificient, diligent, etc than the last
blackmoth works, just need to fix a few things
so, hmanager is now a component attached to a game object, correct?
geo prefabs will make increased drops so much simpler in bonfire...
Here, this will make it even simpler https://pastebin.com/ak45vTm0
nice! Thanks sean!
That should be fine for any reasonable amount of geo, just don't try spawning thousands at a time or you'll probably run into lag issues
yeah, that happened when I first messed with geo in bonfire
Also obviously you need to grab geo prefabs from a health manager at some point
5k small geo at once
Well, that should never spawn more than ~10% of the put in amount as small geo
I was just choosing completely random amounts for large/medium then putting the rest in small
Did not work well
now I need to figure a way to check if an enemy was hit, since health_manager is not FSM anymore, so geteventsenderhook won't work
There's a few functions that look promising
There's Hit, NonFatalHit, and TakeDamage in the new HealthManager
yeah, I'm rummaging through the assembly as we speak
Hit is probably what you want
It even tracks the GameObject doing the damage
I copied code exactly from an FSM action and it doesn't work
Fuck me
Ah right this is for dealing damage to other things
Nice
this.hp = Mathf.Max(this.hp - num, -50);
kek
this makes me want to do >50 damage at once, just to see it break
but sadly...
if (this.hp > 0)
{
this.NonFatalHit(hitInstance.IgnoreInvulnerable);
if (this.stunControlFSM)
{
this.stunControlFSM.SendEvent("STUN DAMAGE");
}
}
else
{
this.Die(new float?(hitInstance.GetActualDirection(base.transform)), hitInstance.AttackType, hitInstance.IgnoreInvulnerable);
}```
it won't break

lol
also, this might fix the vanilla bug thingie with sharpshadow not dealing damage
we'll have to see
yeah...
I basically had set that same code in blackmoth as a way to circumvent the vanilla way of sharpshadow dealing damage
and, reportedly, it still broke
I made sharpshadow deal 0 damage and, instead, actively subtracted what I wanted the damage to be on contact
Just fix the FSM
I mean I'm trying to change the crappy 3 fsm item pickup system into a component
3 fsms wtf
Haha yeah
It's an FSM to actually give the item
Then an FSM that spawns another FSM and sends events to it
Then the spawned FSM which controls the marker over the pickup
Current problem is that I can't get the marker into the right position
The code for setting position in the FSM action they call doesn't work
Sorry to interupt but I just wanted too ask if there was an Health Bar mod for the bosses
Can't get the marker into position?
Well I could easily get it into the right position
The problem is programmatically finding the right position
Oh, project up, then project a few raycats down 45 degrees left/right and pick the one with a collision normal pointed up?
I'm trying to emulate the TC code here so I just want it at the position they've got it set to
Just gotta find where in the FSMs that's buried
Oh, gotcha
I think I have an idea
okay, TakeDamage will work
now, I need to make a hook
sigh
actually...
FSMUtility.SendEventToGameObject(base.gameObject, "TOOK DAMAGE", false);
how would I subscribe to that event?
if there is a way...
There's not
Also my idea didn't work
I thought maybe implementing the SetParent FSM call would help because they do one of those
But it turns out they're just parenting it to itself
Idk what that is even meant to do
What if, could we monomod the playmaker dll to add a handler to sub to for events?
That's a bit tricky because you'd end up with a circular dependency
Maybe it could work, though
I feel like, at this point, modding playmaker is what needs to happen
Yeah, but the fsms at leat have a base class. Couldn't be that bad to alter
if I could just turn an fsmevent into an event...
Oh, this is pretty inconvenient
Apparently the logger in the api doesn't just print "null" if you pass it null
It gets a NRE and kills your function
My shit still doesn't work, though
This makes no sense
Both the position values in the FsmAction are null
So it SHOULD get set to 0,0,0
Which is what my code does
But somehow without modding shit it gets set to 18.4, 23.9, 0.2
Does casting something back and forth lose data?
I'm grabbing the FsmAction from an array of those things
Then I cast the right one back to the proper thing (SpawnObjectFromGlobalPool)
I doubt that loses data
fsmstates/actions do some weird shit
I tried manually setting the speed for the cdash (it's a vector2)
it completely ignored my override when I did anything to the y coordinate
Nice
but it accepted it in the x coordinate... As long as it was a simple change from 1 to -1 and vice-versa
changing it to 0 didn't work either
I'm sure there's something happening in the background we're not seeing
dumb question, but when does OnEnter happen? Specifically, TakeDamage.OnEnter(). When is "Enter"?
meh, I give up
I dunno how to do this without hooking into HealthManager
hm...
because that's how the game deals damage now
OnEnter it creates a new HitInstance corresponding to the object which is hitting
and that HitInstance is used in the HealthManager thingies
You could hook the HitInstance creation
Sounds good
I think a TakeDamage hook could be more useful for modding in general
Yeah, probably
Night


That right there is the exact position the spawned marker is supposed to show up at
Must be an argument passed into the FSM event somehow that's getting lost when I look at it at runtime
And that object must be getting created at runtime because it's not in kerr's scene dump
Wonderful
Idk if this works in the general case but I'm looking for a child object named "Prompt Marker"
Works here to get the right position at least
Just need to be able to pull the "Inspect" text and what the pickup actually is from the FSMs now
After that I think I'll have everything to recreate the pickups in code
Ah right and also gotta figure out how they're storing if it's been picked up already
Something in SceneData, I'm sure
the object probably has a persistant bool right?
(a component named something like that)
a list/array of events
and of floats
ofc
time to iterate deeper
before i wrote some helper functions i had this
PlayMakerFSM deleteFSM = null;
for(int i = 0; i < modifiedPrefab.GetComponentsInChildren<PlayMakerFSM>().Length; ++i )
{
PlayMakerFSM fsm = modifiedPrefab.GetComponentsInChildren<PlayMakerFSM>()[i];
foreach( var s in fsm.FsmStates )
{
foreach( var a in s.Actions )
{
}
}
}
i think this will work
Log(string.Join(",", rand.events.Select(x => x.Name).ToArray()));
the loop is probably better for more data tho
so riddle me this, when i loaded colosseum in my loading code and dumped the scene (in the text files i posted even) it was missing most of the colosseum enemies
and still is when i run my loading code
but, when i went there, it had all the enemies in the scene
(i did a manual scene dump when i went there)
the loading code is the same as before when it used to get all the enemies
maybe
but something changed is all i can think
either way it's kinda annoying, bc now i need to figure out how to get them to spawn so i can save them off
oh well, a problem for another day
Decreased boomerangs in the second phase a ton & buffed a few other moves a bit to compensate
Should make the fight not RNG
Alright I just made some more good progress
I've got the pickup taking control, playing an animation, then giving back control when you inspect it
That's one of the hard parts, all that's left there is just regular position checking logic for proper animation
omg, so easy
gah
I added a simple line to make it print whenever something gets a hitinstance
and everything gets a hitinstance 3x
why would they need to iterate it 3 times?
to cause pain
I love dnspy
turning this:
Modding.Logger.Log($@"HitInstance for {base.Owner.name}:
Source: {base.Owner}
AttackType: {(AttackTypes)this.AttackType.Value}
CircleDirection: {this.CircleDirection.Value}
DamageDealt: {this.DamageDealt.Value}
Direction: {this.Direction.Value}
IgnoreInvulnerable: {this.IgnoreInvulnerable.Value}
MagnitudeMultiplier: {this.MagnitudeMultiplier.Value}
MoveAngle: {this.MoveAngle.Value}
MoveDirection: {this.MoveDirection.Value}
Multiplier: {(this.Multiplier.IsNone ? 1f : this.Multiplier.Value)}
SpecialType: {(SpecialTypes)this.SpecialType.Value}
IsExtraDamage: false");```
into this:
Modding.Logger.Log(string.Format("HitInstance for {0}:\r\n\t\t\t\t\\n Source: {1}\r\n\t\t\t\t\\n AttackType: {2}\r\n\t\t\t\t\\n CircleDirection: {3}\r\n\t\t\t\t\\n DamageDealt: {4}\r\n\t\t\t\t\\n Direction: {5}\r\n\t\t\t\t\\n IgnoreInvulnerable: {6}\r\n\t\t\t\t\\n MagnitudeMultiplier: {7}\r\n\t\t\t\t\\n MoveAngle: {8}\r\n\t\t\t\t\\n MoveDirection: {9}\r\n\t\t\t\t\\n Multiplier: {10}\r\n\t\t\t\t\\n SpecialType: {11}\r\n\t\t\t\t\\n IsExrtaDamage: false\r\n\t\t\t\t", new object[]
{
base.Owner.name,
base.Owner,
(AttackTypes)this.AttackType.Value,
this.CircleDirection.Value,
this.DamageDealt.Value,
this.Direction.Value,
this.IgnoreInvulnerable.Value,
this.MagnitudeMultiplier.Value,
this.MoveAngle.Value,
this.MoveDirection.Value,
this.Multiplier.IsNone ? 1f : this.Multiplier.Value,
(SpecialTypes)this.SpecialType.Value
}));```
love it
perfect
i don't have to be a coder to know the top one is better
that's actually my fault
because I had $@ so it interpreted what I wrote literally
and all those indents and linebreaks became \r\n\t\t\t
[INFO]:HitInstance for Gas Explosion L(Clone):
Source: Gas Explosion L(Clone) (UnityEngine.GameObject)
AttackType: Generic
CircleDirection: True
DamageDealt: 9999
Direction: 0
IgnoreInvulnerable: False
MagnitudeMultiplier: 1
MoveAngle: 0
MoveDirection: False
Multiplier: 1
SpecialType: None
IsExrtaDamage: false```
I really like this healthmanager thingie
Source: SD Burst (UnityEngine.GameObject)
AttackType: Generic
CircleDirection: False
DamageDealt: 10
Direction: 0
IgnoreInvulnerable: False
MagnitudeMultiplier: 2
MoveAngle: 0
MoveDirection: False
Multiplier: 1
SpecialType: None
IsExrtaDamage: false```
that cant be good for your helth
[INFO]:HitInstance for SuperDash Damage:
Source: SuperDash Damage (UnityEngine.GameObject)
AttackType: Generic
CircleDirection: False
DamageDealt: 10
Direction: 180
IgnoreInvulnerable: False
MagnitudeMultiplier: 1.5
MoveAngle: 0
MoveDirection: False
Multiplier: 1
SpecialType: None
IsExrtaDamage: false```
interestingly, there's two HitInstances for SuperDash
both deal 10 damage, and both have multiplier 1
but one of them has magnitude 2, while the other has magnitude 1.5
and this is what magnitude is used for:
if (this.recoil != null)
{
this.recoil.RecoilByDirection(cardinalDirection, hitInstance.MagnitudeMultiplier);
}```
now it's so much easier to make bonfire work
