#archived-modding-development
1 messages ยท Page 477 of 1
outdated example mods
i might write something if i am bored
that don't even work
do they compile
they compile but they don't work
well as long as they compile and are loaded by the api
hell mod is a decent example
with settings and fsm changing and all
its still pretty much a usuable example
beyond getting your dll loaded into the game
nothing else is really relevant
okay then make your example mod print "hello world" to the console then if that's all that is relevant
just steal twitchmod at this point, it has so much useless shit i copied from people
pretty much is
except few that i wrote myself
like if set darkness mod as an example
how the fuck does darkness mod help you program anything else
unless you can actually look through the games code, and figure out how stuff works, no amount of hand holding is going to let you make something novel and good
unless you just get someone else to code stuff for you
she do be speaking facts tho
you can lie by only telling truths
so where is the dash code and is there a quick search for it currently i'm here
ctrl shift k
i understand the code has been shown here but i'm not looking for the code i'm looking for how to find it
thank you
its in the hero controller
so how would i hook it would it be
//
internal static dashmod Instance;
public override void Initialize(){
ModHooks.Instance.DashVectorHook += function;}
void function()
{OrigDashVector.vector2 = new Vector2(2,2)}
?
are you hooking it with On. ?
no
doesn't it return a vector 2
it should be
that's what dnspy says
oh wait youre not doing it in visual studio, youre directly coding with dnspy? no idea then
i am doing it with visual studio
just needed to reinstall it
ok so i tried
using Modding;
using UnityEngine;
namespace dash_vector_modding
{
public class vector2mod : Mod
{
internal static vector2mod Instance;
public override void Initialize()
{
ModHooks.Instance.DashVectorHook += function;
}
void function()
{ new Vector2(2, 2); }
}
}
but doing this means the overload doesn't match the delegate DashVelocityHandler
do i need a scondary value for change or something?
you need a Vector2 varnamewtv in your function
also like Katie said it returns a Vector2 object
so it should be
Vector2 function(Vector2 myVector){
//put shitcode here on how you wanna change that vector
return myVector;
}
that error shows up when you dont match the hook's required parameters
a vector2
change void function to vector2 function
thank you
methods are like
<access type> <return type> <methodname> (<parameters>)
right now your return type is void
hehe, void, he he
ohhhh i seee
so i need to check both the mod api and the original code to know what the acsess type is called?
i find it odd that the player position is stored with a vector3
access type is shit like private, public etc
afaik you dont really need to give a shit for now (personally i dont but dont shit on me for that) and just set most of them to public, unless you want certain classes being unable to see that method
uhh i think Vec2 can translate to Vec3 easily? and besides theyre only dealing with the Knights movement in a 2d space anyway
yeah
if you dont set it i iirc itll automatically set it as internal or was it protected?
i'm sorry i didn't understand the question
if you dont set it i iirc itll automatically set it as internal or was it protected?
ahhh ok
and vector3 is a vector2 with an extra numver
yeah its Internal, if you dont set the access modifier itll automatically set it as Internal
so
void weary() is gonna be internal void weary()
like it's litterally a list of 3 numbers
yeah
i wonder where they change the z axis on him though
its mostly for visual and positioning and afaik they dont
the game is still in a 3d space for the parallax anyway, unless they do it whenever the knight is walking forward no idea
ramain esk mechanic of going in to the background and forground would be cool
they do do it with paralax not code using a free cam shows you that it's actually pretty close (at least thats the foliage)
idk about the normal background in all senarios
how do you get the vector2 controls from the player? i'm used to unity's new input system
can i see it in dnspy?
you could
ight just gotta find it XD
HeroController.instance.transform.position
position should be the vector2 of where the Knight is currently in the worldspace, if thats what you meant
ah no
If im an idiot (which i probably misunderstood your question) and youre actually looking for how the game controls the Knight, you should still read HeroController
i'm not good at explaining to be honest XD
i mean when you tilt a control stick ie xbox left stick you get a vector2 how do I read that?
uhh ok ok might still be wrong, but you wanna check what inputs are being held/or used... right???
the vector a control is being held pressed in for movement ye
like up right on a xbox controler (or wd on keybord) would be a Vector2(1,1)
ahhh not sure honestly, my only recommendation is you check either HeroController or InputHandler classes in dnspy and see if they touch those
I havent really dived into how the inputs work other than when checking whats being pressed or not, sorry
how do i check what wasd is pressed?
well theres
InputHandler.Instance.inputActions
for example
//is a boolean that shows if the attack is being held down
InputHandler.Instance.inputActions.attack.WasPressed
//if pressed once, returns false if being held down after
heldAttack = InputHandler.Instance.inputActions.attack.IsPressed;
just replace attack with something else, theres tons of it
i can't see it in dnspy
not in the InputHandler class?
ahh no just check for InputHandler
or inputActions
honestly sorry dude i cant help you much here, i personally never dived into inputs too much
i think i found it
public delegate PlayerAction hook_ActionButtonToPlayerAction(InputHandler.orig_ActionButtonToPlayerAction orig, InputHandler self, HeroActionButton actionButtonType);
yeah thats an On. hook
if you know those hooks, then yeah
i have no idea
theyre not too difficult to go with, the only finicky part is knowing what overloads but you can let VS do it for you if you autocomplete
heres my example
// initalize this on start
On.NailSlash.StartSlash += OnSlash;
public void OnSlash(On.NailSlash.orig_StartSlash orig, NailSlash self){
orig(self); //return the control back to the original method you intercepted, so it continues normally
}
oh well there you have it
under public static InputHandler Instance;
just gotta work out how to referance it
would it be Instance.inputx ?
InputHandler.Instance.inputHandler.inputx i guess
this is the part where sid comes in and says "np"
he's asleep afaik
he didn't say it earlier either XD
it doesn't work
also diables the keyboard
did you auto complete it?
return orig(self)?
because yeah itll disable your keyboard since youre technically overriding the controls
using UnityEngine;
namespace dash_vector_modding
{
public class vector2mod : Mod,ITogglableMod
{
internal static vector2mod Instance;
public override void Initialize()
{
Instance = this;
ModHooks.Instance.DashVectorHook += function;
}
public void Unload()
{
Instance = null;
ModHooks.Instance.DashVectorHook -= function;
}
Vector2 function(Vector2 change)
{ new Vector2(InputHandler.Instance.inputX, InputHandler.Instance.inputY);
return change;
}
}
}```
lets me use the xbox controller but not keyboard
i tried changing it new error though
changed the variable name rebuilt it and it didn't work
please a little help
sorry i did shit
try changing your lasPos var name
it probably has naming issue with another variable with the same name i think
using UnityEngine;
namespace dash_vector_modding
{
public class vector2mod : Mod,ITogglableMod
{
public Vector2 currentdirection = new Vector2(0, 0);
public Vector2 lastposition = new Vector2(0, 0);
public void Fixedupdate()
{
Vector2 currentpos = HeroController.instance.transform.position;
Vector2 currentdirection = (currentpos - lastposition).normalized;
Vector2 lastpos = HeroController.instance.transform.position;
}
internal static vector2mod Instance;
public override void Initialize()
{
Instance = this;
ModHooks.Instance.DashVectorHook += function;
}
public void Unload()
{
Instance = null;
ModHooks.Instance.DashVectorHook -= function;
}
Vector2 function(Vector2 change)
{ new Vector2(currentdirection.x, currentdirection.y);
return change;
}
}
}```
im guessing its also because of this
public Vector2 currentdirection = new Vector2(0, 0);
and another
Vector2 currentdirection = (currentpos - lastposition).normalized;
inside the method, remove the Vector2 in the Fixedupdate method
also remember it has to be FixedUpdate, thats the correct method spelling if youre gonna override it
setting a value before runtime shouldn't cause errors and which Vector2 inside the FixedUpdate methord?
no wait hold on my understanding of local variables might be fucked up
idk how they work entirley but i know declearing the variable before runtime works in the game i'm making
yeah it should
it might be an issue with how i referance the player's position
idk
how do i referance the player gameobject if it isn't Herocontroller
uhh yeah im wrong with the global stuff btw sorry about that
just to get this straight are you still getting errors? or is it just not working?
is it not showing up on the upper left corner when you load the game?
it is showing up
then it should be working hold on
it shows up i can enable and disable but the functionality is non existant
the keyboard still won't work either
nvm keybord is working
forgot you use arrow keys
this code is your ENTIRE mod right?
Vector2 function(Vector2 change)
{
new Vector2(currentdirection.x, currentdirection.y);
return change;
}
i think this is the problem, youre making a new Vector2 object but, youre not doing anything with it
so essentially change is being untouched right now with 0 changes
it's ment to referance the global variable which is being changed by Vector2 currentdirection = (currentpos - lastposition).normalized; and is Vector2(0,0) by defult in this mod meaning if nothing was happening dash shouldn't work unless the modding api works differantly here
or conflicting names or something
youre trying to change the dash vector right?
right now the value you want to change is not being changed at all
it should be something like return new Vector2(currentdirection.x, currentdirection.y);
or something
the hook is basically just returning the same DashVector untouched
ohhhh that makes sence
i really need to learn about methord groups and the return funtion
i tried testing it the game crashed
so this "function" you have is being called everytime you dash right? youre basically saying "woah woah game before you finish executing this method, let me hijack it and let me modify it"
the return is essentially you saying "use this value instead", right now the game is passing the original Vector2 value... and your returning it back again with 0 changes
if youre crashing you might need to use exception catches, itll stop that method from working but at least you have an idea why its crashing
restarted with no issues
aight
well progress dashing makes me freeze in place so currentdirection isn't being updated
remember to use modlogs when you can
using static Modding.Logger
then you can easily show logs with Log("my message here")
useful if you wanna check whats the value in your currentdirection is
thank you
it should accept Vector2 as an overload so you dont have to manually do it like Log(myVector2Object.x + " " + myVector2Object.y);
yeah
oh yeah and ; at the end of that import
just dont put it in your fixed update ofc, since it runs every other frame
unless you want an endless stream of logs
putting it on DashVectorHook aka "function" should be good enough
thank you ๐
We are planning on making a custom charm extension for exaltation and want to add extra charms to 'glorify'. But to do that we need more charm designs. Who want to help us and make some designs for us?
where does log print to?
lower left corner
it does
modlog in your saves folder
You can just also see it in game if you enable that
ahh how do i enable it?
didnt you already enabled it in your global json file in your save?
i think so but i can't see it
show json
hey 56 can you fix the bug in bindings where you can't get lifeblood masks?
can you read hitboxes of enimies without assigning it as they are spawned?
wdym
like can you say the area the player will get hurt if they touch this is [hitbox of enimies in real time]
ahh so only show the hitbox of stuff that hits you
thanks
yes but also output that data
For enemies which are spawned after scene load I'd use the modhook for collider create
Otherwise you can just do it after scene load
doesn't collider create get called tooo often?
also i did
{ "BoolValues": { "_keys": ["ShowDebugLogInGame"], "_values": [] },
but it didn't show up in game
"_values": [true]
you can check for a HealthManager component
ahh ok thank you
i'd be very interested in a mari/o for the knight
i wonder what it would think (insert abitray code exicution here)
too many variables, not gonna work
what would your fitness function look like ? it's a game with a lot of backtracking
fitness is how quickly you can get the defeat the absolute radiance with the flower ending
except you'll never reach that point
you could input human input as training data and then consider the current tas speedrunning strat then set fitness as the quickest way to do from point a to point b
isn't that easy.
otoh you could do PoP with a simple proximity to scene exit trigger fitness function
but I don't know if there's an easy way to simulate it faster than normal without rendering frames or skipping logic
you don't need to afaik you can just run multiplue version of the same game
*versions
and on top of that it doesn't nesicarily need to be genirational learning
bruh I'm not a millionnaire imagine how much it would cost to get any results by running the game realtime
player input as starting training data
i have seen it done it ranks the play's inputs like it was a genoration then lets the ai use it as a base line
current direction seems to equal my position at all times and i don't know why
{
Vector2 currentpos = HeroController.instance.transform.position;
Vector2 currentdirection = (currentpos - lastposition).normalized;
Vector2 lastpos = HeroController.instance.transform.position;
Log(currentdirection);
i set laspos in the code and globally at the begining like i did for current direction
public Vector2 lastposition = new Vector2(0, 0);```
how do i get the rigidbody is it under the hero controler referance?
lastpos isn't lastposition
and HeroController.instance.GetComponent<Rigidbody2D>()
thank you and it should be as when the next frame is called the public variable will be the same as last frame as it is called after the maths
also what is the magnitude of the dash?
idk off the top of my head
.velocity
is it something like
HeroController.instance.GetComponent<Rigidbody2D>().velocity?
How far does modding go?
idk
Like, total overhaul where you play as PK in a new story based around building the kingdom far?
afaik
@rose berry very far, far, not far, and nowhere all at the same time
I just have no clue how to mod and dont have compiter
puter
I posted some of my idea in discussion
you technically don't need a pc just a very strong android phone/switch/something
true
i can't remember if hk is on linux but if it isn't you can run windows on vm ware
it's on linux
nice
hollow knight pc mods on switch would be cool
i mean both with and without modding
owo vessel i can teach you the very little i know and you can try from there
I'll see if I can even run linux on my switch if I mod it
yeah
goodluck if you have a newer model though they really don't want you cracking that thing thouh if you overload it with mario kart ds via using a spindrift on the top of the stairs on the luigi's mansion map you can start running arbitary code you can't pirate with it but you can backup using and sd card unless they patched that i doubt it though
honestly though i highly suggest traditional methords
.
.
what using lets you use rigidbody2d?
UnityEngine but you need a ref to 2d physics
ahhh was missing the ref
thank you
my code doesn't seem to work the currentdirection updates to Vector2 currentdirection = HeroController.instance.GetComponent<Rigidbody2D>().velocity.normalized * 5; but when i call
Vector2 function(Vector2 change) { return new Vector2(currentdirection.x, currentdirection.y); } by dashing i dash on the spot
does it freeze you for a moment before dashing or am i missing something
If current direction is a field it's just going to be set at the start
And then be 0
using UnityEngine;
using static Modding.Logger;
namespace dash_vector_modding
{
public class vector2mod : Mod,ITogglableMod
{
public Vector2 currentdirection;
public void OnHeroUpdate()
{
Vector2 currentdirection = HeroController.instance.GetComponent<Rigidbody2D>().velocity.normalized * 5;
Log(currentdirection);
}
internal static vector2mod Instance;
public override void Initialize()
{
Instance = this;
ModHooks.Instance.DashVectorHook += function;
ModHooks.Instance.HeroUpdateHook += OnHeroUpdate;
}
public void Unload()
{
Instance = null;
ModHooks.Instance.DashVectorHook -= function;
ModHooks.Instance.HeroUpdateHook -= OnHeroUpdate;
}
Vector2 function(Vector2 change)
{
return new Vector2(currentdirection.x, currentdirection.y);
}
}
}```
it updates every frame
but when i dash nothing happens
like i just freeze
bro
?
i have the debug log though it changes when i move
no
you're making a local variable
and then logging it
but that doesn't change the field

*** o h*** sorry i didn't realize a
oof
it hurts being this stupid i'll get it eventually i'm sure
well good news it works bad news 5 is NOT the magnitude you need to multiply by
be funny if i didn't need to normalize or something
wait
almost the answer
What you trying to do
Because this would make the current velocity * 5 the dash vector
and you can just get the velocity in the vector function
don't need per-frame
like this? return currentdirection = HeroController.instance.GetComponent<Rigidbody2D>().velocity.normalized * 15;
you don't need the variable at all
Are you trying to make dash go in the direction you're moving
or just change the magnitude
because if it's the latter you just do return 15 * change
There's no need to get the velocity
i'm normaizing the vector i'm moving in then setting the speed
will that apply to the y axis?
yeah
if you just want to change the magnitude
change the vector you're given
because that's the direction the dash was going to originally go in
you can normalize that instead
well i feel stupid
i spent all day on that
i bet someone has already done this mod idea as well
15 * change does not apply to the players current y axis movement
- 15 was fast ass hech like this XD
do you want it to?
yes
Oh
then yeah just get the velocity
But also you might want to make the x default to the one given by change if the x is zero
because otherwise if you're not already moving you'll just dash in place
yeah
i did HeroController.instance.GetComponent<Rigidbody2D>().velocity.normalized * 15; that works but the camera acts differantly going up feels disoriantaty the first few times
If you want the normal dash magnitude you can just get it off change
like * change.magnitude or w/e
that's awesome
return HeroController.instance.GetComponent<Rigidbody2D>().velocity.normalized.x * change + HeroController.instance.GetComponent<Rigidbody2D>().velocity.normalized.y * change;
wait
You can multiply vectors by a scalar
just do .velocity.normalized * change.magnitude
return HeroController.instance.GetComponent<Rigidbody2D>().velocity.normalized * change.magnitude
ye
thank you for the help ๐
np
haha nice
epic timing
i was just looking the gifs and missclicks
i read this topic every 2 or 3 days to check the multiplayer mod progress and other mods, i wish i could help but i dont know anything about programming and my english is terrible xD. Only i want u to know that y admire u guys and ur work. Keep going and thanks!
trust me i suck as well
i'd love to test the multiplayer mod but everyone is trying to test it at 1am bst
jngo tested at 4 am today xD
still too early XD
hey 56 do you know why the play's position is set to a vector3 for some stuff?
thank you
can i change the private dath length?
you mean dash?
the private field?
You can use reflection to do that
There's a ReflectionHelper class you use which makes it easier and faster
reflectionhelper?
i see it but i can't find dash
*dash length
like for for how long the dash lasts?
dash length is rng
how do i edit it in the mod?
and why are there two dash step ques?
thank you
what is speed sharp?
sharp shadow?
i think that is public float SHADOW_DASH_SPEED;
ok
?
yay
then waht's the other one
is the other one just the normal shadow dash?
yay I am smart
then why two seperate speeds? they seem to be the same speed
ahhh makes sence
so an api thing?
intersesting
i also noted that the knight's position is tracked in 3d no idea why though
but in some cases it is referanced in 2d
dispite 3d not being needed in some places
what are the que dash steps and why are there 2 of them?
Is there anybody have test the CustomTrail MOD? when I write a lot in the .jml file, the game will crash in preloading phase.
I check the code and find it will pull all the gameobjects in the list I write.
I guess the gc heap is overflow because of too many object loaded. So, is there other way to load a boss gameobject except preloading in game start
two for dash and shadow dash but not sharp?
CustomTrial is abandoned
so sad to heard that
how's the multiplayer progress?
going
Wait theres a multiplayer mod for hollow knight?
yes
multiplayer
multiplayer
you can get it in github
wait really?
also where can i get the mod installer thingy?
ah
bob is developing it now
if i knew that i'd be looking at the 2 knight's code to see how far it got
like i'd love to see what they can and can't do so far it's interesting for me ๐
sometimes people get to test it
yeah like when it was 4am for me
i saw the client dll
fyi one look ath the code and i felt like i couldn't read like i couldn't understand the code XD
I don't understand it either
i thought you were making it
i remember some have made a stand-alone server with C code. is it still update?
no
doing HeroController.instance.DASH_SPEED = 1; doesn't work what's the correct way?
i put it in instalize
oh do i put it in a start methord?
you can start a coroutine, and wait until the HeroController != null
how?
Emmm
is a coroutine these void things?
you can use GameManager.Instance.StartCoroutine(functionname)
I dont remeber auctually ... you can refer custom knight mod
the skin mod?
A coroutine is an IEnumerator
it can yield return commands like WaitWhile()
so that the code executes when it is ready, and does not block the game
so like
functionname{
WaitWhile(HeroController = null)
HeroController.instance.DASH_SPEED = 1;}
to do HeroController.instance.DASH_SPEED = 1 when HeroController != null
GameManager.Instance.StartCoroutine(functionname);
IEnumerator functionname{
yield return new WaitWhile(HeroController.instance == null);
HeroController.instance.DASH_SPEED = 1;
}
IEnumerator functionname{
yield return new WaitWhile(HeroController.instance.GetComponent<Rigidbody2D>().velocity.normalized * change.magnitude == new vector2 (0,0) && HeroController.instance.cState.onGround);
log("this is the peek of your jump");
}```?
would this work?
Nah that would run when you had velocity on the ground
and where would you put GameManager.Instance.StartCoroutine(functionname); so it fires at start as it doesn't have a definition for instance
Not the peak of jumps
Does anyone know how to instantiate the dreamshield with it's original functionality? Every time I instantiate it it just sits in the spot it is summoned in.
I think it is a fsm, but Orbit Shield
I think the main problem is I can't access the control for it
yeah it's an fsm
I get a null reference when I try to do anything there
does it instatiate straight away i know earlier i needed a corutine to wait for the hero.controller to load before i tried editing it might be a similar error
I do it in charm update
i'm not sure i know you can force equip it and remove the cost of equiping it if that helps
I can try that, but I want to make two float around the player
i'm just trying to figure out how it works to be honest
ok
from dnspy
{
add
{
HookEndpointManager.Add<CaptureAnimationEvent.hook_EquipCharm>(MethodBase.GetMethodFromHandle(methodof(CaptureAnimationEvent.EquipCharm(int)).MethodHandle), value);
}
remove
{
HookEndpointManager.Remove<CaptureAnimationEvent.hook_EquipCharm>(MethodBase.GetMethodFromHandle(methodof(CaptureAnimationEvent.EquipCharm(int)).MethodHandle), value);
}
}```
should I summon the extra shield with this?
i'm not sure
I don't think that i'm summoning it at the wrong time
isn't that for making the charm list?
yeah, I know
public int charmCost_38; is the cost thing
yeah, I saw that when making an update to dreamshield coop
ah nice
I'm trying to make exaltation use every charm since I updated it to work with the current version
i wonder if you could edit the ui and force equip 2 of the same charm with 0 cost
maybe, but I have seen multiple of the same charm equipped, and it doesn't seem to do anything
well that's one idea
here is what I use to summon the shield
GlorifiedShield = UnityEngine.GameObject.Instantiate(churm.LocateMyFSM("Spawn Orbit Shield").GetAction<SpawnObjectFromGlobalPool>("Spawn", 2).gameObject.Value.FindGameObjectInChildren("Shield"), HeroController.instance.transform.position, default(Quaternion));
GameObject churm = GameObject.Find("Charm Effects");
put the 2 messages in reverse
i have no idea how fsm works
the dnspy keeps going to the fsm
I have been using fsm viewer since dnspy didn't help me much when updating dreamshield coop
that's fair how do you veiw the fsms?
if i'm understanding correctly it is just following you right?
no, there are about 4 fsms related to the shield
oh
I think i need to edit a value in each one to make it go faster
i can't remeber if unity has it's own methord for instantiating duplicates because if it does you can code the following behavour use a function to make it go in circle with input being in fixedtime.deltatime then just dupelicate the object with fixedtime.deltatime - float
that's as far as my brain goes without fsms
2 has got to be do-able though
I can do 15.... except none of them follow the player
what does it say in events when is the position updated?
wdym
do they spin around a spot
i mean where it says set position there is a fsmowner i wonder when it sets the new position
here is what I think makes them spin(at least the main part) yes I think there is a fsmowner
I don't think thats the problem
oh
I get a null reference when I do anything in there
any just reprogram the object
how?
how?
like rewriting where it'll be with a rotation funtion based of off fixedtime.deltatime?
no just implement the entire thing yourself
in c#
its just a sprite that rotates around the player with a hitbox on it with some class that deletes projectiles
pretty sure it is a fsm that detects the projectiles
I think it is just a different gameobject or something because the fsm's for "shield" work, but the ones for "Orbit Shield" don't
public void Show() { if (this.pickedUp) { return; } this.SetActive(true); DreamPlantOrb.plant.AddOrbCount(); this.spreadRoutine = base.StartCoroutine(this.Spread()); }
also a referance to dreamplant orb in dnspy
ok
i think i found it!!!!!
??
{
while (this.spawnedOrbs > 0)
{
yield return null;
}
this.completed = true;
if (this.playerdataBool != string.Empty)
{
GameManager.instance.SetPlayerDataBool(this.playerdataBool, true);
}
GameManager.instance.SendMessage("AddToDreamPlantCList");
yield return new WaitForSeconds(1f);
PlayMakerFSM.BroadcastEvent("DREAM AREA DISABLE");
if (this.activatedParticles)
{
this.activatedParticles.Stop(true, 1);
}
if (this.completeGlowFader)
{
this.completeGlowFader.Fade(true);
}
if (this.audioSource && this.growChargeSound)
{
this.audioSource.PlayOneShot(this.growChargeSound);
}
if (this.completeChargeParticles)
{
this.completeChargeParticles.gameObject.SetActive(true);
}
yield return new WaitForSeconds(1f);
if (this.completeChargeParticles)
{
this.completeChargeParticles.Stop(true, 1);
}
if (this.audioSource && this.growSound)
{
this.audioSource.PlayOneShot(this.growSound);
}
if (this.anim)
{
this.anim.Play("Complete");
}
if (this.whiteFlash)
{
this.whiteFlash.SetActive(true);
}
if (this.completeGlowFader)
{
this.completeGlowFader.Fade(false);
}
if (this.growParticles)
{
this.growParticles.gameObject.SetActive(true);
}
GameCameras gameCams = UnityEngine.Object.FindObjectOfType<GameCameras>();
if (gameCams)
{
gameCams.cameraShakeFSM.SendEvent("AverageShake");
}
if (this.dreamDialogue)
{
this.dreamDialogue.SetActive(true);
}
yield break;
}```
yay
while (this.spawnedOrbs > 0)
now modding can go further
maybe setting to > 1 will work
idk
hopefully!
i hope that works and doesn't barke like spawning two knights does or some weird classiforcation meaning it counts the other dreamsheild as an enimey bullet or something
are you sure it involves the dreamshield? it looks like it has something to do with the orbs that are summoned when you dreamnail a tree
damit!
forgot about thouse
public PlayMakerFSM fsm_orbitShield; from dnspy
this is the one it uses i think
Oh yeah!!! I forgot that was a PlayMakerFSM
there's a differance?
I was trying to find the shield at one point and saw that and didn't use it because it wasn't a gameobject, and then I remembered incorrectly that it was one, and now I think that I need the fsm
ahhhh fair enough i'm just confused tbh
i'm just going to edit the original shield, then go from there
just playing around
epic
nice
I cant believe jngo is stealing my next indie crossover boss ๐
didn't you give up on it tho
I did
that's why I picked it up
thank you
I wanted to add more bosses to the indie crossover mod but not cagney necessarily
fucker has so many sprites
yea but katie did them all for me 
I would give the unity project but I dont think they would be useful for tk2d stuff
agony
damn my aseprite build is broken
how do i see and use an fsm?
Use the FSMViewer

oof
texture scaling down 
I think you can edit the unity editor
apparently loading a custom scene with 8 sprites in it takes up enough memory to crash the game
bgs for mugman
<2000 pixels horizontal
I'm just doing something wrong ig
the scene's assetbundle should be separate from the other sprite's assetbundle
it is
strange
hmm
make sure qol is updated
there was a hook on unity's logging and that was dying when memory usage was high
idk why
so i yeeted it
Might want to call a GC collect before it
Which is shitty
But for like enemy rando you literally had to
why did that raise memory usage
It seemed to, usually it crashed at 50% usage
this time it crashed at 54%
spriterenderers
I'll send the dll once I finish dinner
tk2d is effectively the same as spriterenderer
spriterenderer is just a wrapper for a flat mesh
like tk2d
there's a gateway to the left of the HoG bench, or press V
Where does it go though
it's still gonna crash with the fix but
yep, just tried it now with a scene from when I was testing out custom scenes
does unity version matter?
I uh
made the scene in 2018
Oof
bruh jngo
bruh jngo
bruh jngo

did it get fixed?
somehow my UI used to work by using an "Image" Component, but I realized it was missing the sortingOrder property to allow me to render them in a specific order to make sure everything shows up in the proper manner on top of eachother, so I've now decided to use SpriteRenderers instead. But now the UI fails to appear at all and I am not sure if I am missing something to make it render properly
it did
All the assets are loaded but they somehow don't show up and I am not sure why. I checked all of the gameObject's names along with the name of the sprite I assigned to them and it all shows up in ModLog
//Set the corruption bar container image
_corruptionRectImage = _corruptionRect.AddComponent<SpriteRenderer>();
_corruptionRectImage.sprite = ab2.LoadAsset<GameObject>("CustomUI").transform.Find("UI_Border").GetComponent<SpriteRenderer>().sprite;
_corruptionRectImage.color = new Color(212, 212, 212, 255);
_corruptionRectImage.flipX = false;
_corruptionRectImage.flipY = false;
_corruptionRectImage.material = new Material(Shader.Find("Sprites/Default"));
_corruptionRectImage.drawMode = SpriteDrawMode.Simple;
//_corruptionRectImage.sortingLayerID = SortingLayer.GetLayerValueFromID(0);
_corruptionRectImage.sortingOrder = 1;
_corruptionRectImage.maskInteraction = SpriteMaskInteraction.None;
I also noticed that the shader I'm looking for isn't the one I have in my Sprite Renderer
it is looking for Sprites/Default whereas my own is named "Sprites-Default"
thanks, and without sortingorder I guess I have to use the rect transform's Z position to make them show up in the right order one on top of another?
i think its just how its aligned in the tree
So I guess I have to set sibling index
i would just mess around with ui stuff in unity editor
and see what you have to do, to make it correct
Yeah I did that for my initial set-up but then I used spriterenderers to get my images in the asset bundle but now I realize the convenience of sortingorder came at a price
found a pretty elegant way to handle music

nice
managed to get a little UI in the game, I'll have to figure out how to make it fade when paused/map is opened (it might just be on the wrong layer)
You can change the alpha on it it'll be the images 4th "color" component if you use unity's thing you could use smooth damp to make it fade in and out whithin a hook
@jade willow
nice, any hook to the pause?
you can use on,
Oh yeah I need to look into On
GameManager should have a function for the game being paused and the current state its in
i wouldnt use a hook though
just call a coroutine from the on
Makes sense, so by checking the state of the pause I can trigger the fade when the game is paused, thanks Katie!
nice that would be helpful
its called CanvasGroup
and it comes with a property called alpha
just put it on the parent and it affects all children
nice :D
you can probably do if (Time.timescale = 0F) as well it's easy
note changing Time.timescale will not change how the gui menus works but will make anything in the physics slower
you know
i'm always listening here at #archived-modding-development
if i'll listen enough i'll become a modder from listening
fair XD
how do i see the fsm of an object?
with your eyes
FSM viewer is pinned
sorry to break it to you, but you won't
created a simple hex to rbg converter
the_object_you_want.color = new colour32(value_one_in_the_hex * 16 + value_two_in_the_hex,value_three_in_the_hex * 16 + value_four_in_the_hex,value_five_in_the_hex * 16 + value_six_in_the_hex,alpha_from_zero_through_to_255);
hope it's useful but i doubt it will be
bro
bro
bro
bro
?
but did I do something wrong or? i'm just confused
holy moly
There's also built in hex convertors
bro
how does your tool even work ? for 0-9 maybe but A-F it shits the bed ?
nope
well yeah but it's assumming you type in 15 not F
probably should of said that in the first place
it's assumming you type in 15 not F
nobody does that
you can just do parseInt("FF",16);
although in csharp its Parse("FF", NumberStyles.Hex) for some reason
Well it is always good practice to try and make a tool by yourself
tried to add the ground vines in phase 2 of cagney but that's making the game crash again
needeth more info
memory usage stuff again
Ground Vines is an initially inactive child of the main boss gameobject and I activate it when phase 2 starts
I wonder if it's bc I have an Animator and tk2d components on it, the Animator being used to animate a box collider 2d
now it's just crashing at scene load 
ah, bc I set the vines active, so it's still a problem with those
so yeeting the Animator worked, guess it's not compatible with tk2d components?
that means I have to modify all 19 frames of box collider offset and sizes in code
i think hk has a component for it
that just locks the camera to a certain area when you're in that area
I think the scene might be too small to fit within the screen's borders
zoom 
yeah that's what I was thinking
might be disorienting for players who are used to hk's more distant camera but oh well

zoom time
Is there anything I might be missing?
GameObject cameraLockZones = GameObject.Find("_Camera Lock Zones");
GameObject cameraLockZone = cameraLockZones.FindGameObjectInChildren("Camera Lock Zone");
var area = cameraLockZone.AddComponent<CameraLockArea>();
var col = cameraLockZone.GetComponent<BoxCollider2D>();
Bounds bounds = col.bounds;
area.cameraXMin = bounds.min.x;
area.cameraXMax = bounds.max.x;
area.cameraYMin = bounds.min.y;
area.cameraYMax = bounds.max.y;
area.preventLookDown = true;
area.preventLookUp = true;
CameraController cameraCtrl = GameCameras.instance.cameraController;
cameraCtrl.LockToArea(area);
cameraCtrl.SetMode(CameraController.CameraMode.LOCKED);
the camera keeps locking to the upper right of the scene
So nice that i have no idea about mods
But if the mod worth it, i will sacrifice my pc just to play it
Quicc question
Where are u going to fight em
at ur mum's house
well it locks to an an area closer to where I want it at least
does this scene view look right?
hold on I may be stupid
alright nvm there was boxcollider instead of a boxcollider2d on the camera lock zone but changing it didn't fix anything
it does say it's LOCKED
I looped through all CameraLockAreas and it's empty
no, just FindObjectsOfType<CameraLockArea>()
let me see what this returns
also empty
silly me I set it to locked, but of course nothing's changed when I removed that code
both
I appreciate the help tho
how do you add assets in to hollow knight like this?
assetbundling
is it possable to get it to work with unity 2019.3.13f1 instead of Unity 2017.4.10f1
I dont believe so
some features might work, some might not
The 2018 version was working for jngo but then it broke when he tried to bundle a new scene
i'll try and play it safe thank you for your help
might be too late but you couple probably just put some sidebars to fill the void around the level instead of having to zoom the camera, maybe some curtains or whatever would fit the cuphead look (I don't know cuphead soz)
I realized that by changing my UI'd alpha I would end up causing additive blending instead of it looking like a single object becoming transparent
now that I think of it, the alpha doesn't change when paused it just turns darker (unless I'm wrong)
I can't remember I think it does go darker
You could just up all the rbg values in the color32 vector4
Smoothlerp will probably help
Yeah that's what I ended up doing
Neat
I'll probably have to check some examples of uses of the On namespace as I'd like to trigger the lerp when the pause menu is opened or when the map is shown and make it completely disappear when the inventory screen is opened like it does for the soul orb and health
I think you could just use an event trigger
the only way I managed to get stuff to occur so far was through hooks by following the methods seen on radiance.host, I've got some learning to go through it seems
Unity event trigger that is not the api version though there might be an api method
I know roughly how to use dnspy I'd be happy to help
I know how to use dnspy pretty well
I think the "On" namespace is supposed to help me with that but I'm not sure if I'm meant to use it as a function/method or within another function
thanks
I think it's a method like how classes work but I'm not certain
maybe I could check how others have used it in other mods too, to at least figure out the expected implementation
I've only dabbled a tiny bit in dnspy so far
I accidentally made my first mod in dnspy
My current understanding is it is a way to group classes so names from pubic classes dont get confused
.
I might be wrong I'll look in to it
Yeah I heard that was the original way to do it, but it makes it incompatible with other mods since you're changing the base code everything else would run on
thanks a lot btw
That and namespace.class can be a reference functioning like a hook
I managed to find UIManager.GoToPauseMenu which seems to be the event I'd want to listen to and change my UI lightness when it is called
Ok
If you are looking for a way I suggest the unity docs on event listeners
I don't understand it but I'm sure it'll help you ๐
thanks :D
i feel like there might be a way with the API to do it
but I can try with eventlisteners
On.UImanager.hook_GoToPauseMenu Mabe?
it's tracking the hero now at least
I've seen it use return
Yes that's what I think is gonna be the hook for it
Yeah not sure if you need to return this.orig.function though
I'm stumped here to be honest
the lock area I put in the scene is getting added to lockZoneList but camerController isn't being set to LOCKED
oh wait I just realized it already has a hook for it
I can of course force it to locked with SetMode but it still follows the player
Epic
How do I find an fsm and how it works i have the viewer do i tell it to look at a scene or?
trying to figure out how to actually make the hook for it though, I've only used hooks from the Modhooks class, not made one for something that wasn't already "hooked up"
something like this?
On.UIManager.GoToPauseMenu += MyFunc;
i was just typing that guess
On.UImanager.hook_GoToPauseMenu
Has anyone thought of a planetiod gravity mod?
Sounds cool
I know how to already done it in 3d
Just gotta add a sprit and collider in for the plannet XD
if i work out how
i'll do it
oh wow okay it's that ease, nice :D I'll give it a shot soon tm thanks!!
putting those magic numbers in the CameraLockArea fields made the camera successfully lock, just at the wrong offset
get better magic beans
might just be the way the zoom scales making the offset seem weird
oh no the game now crashes when I pause
what did you change?
What hook did you use
Those set up in my initialize
On.UIManager.UIGoToPauseMenu += UIManager_UIGoToPauseMenu;
On.UIManager.UIClosePauseMenu += UIManager_UIClosePauseMenu;```
And this code running in them
private void UIManager_UIClosePauseMenu(On.UIManager.orig_UIClosePauseMenu orig, UIManager self){
Log("Closed");
}
private void UIManager_UIGoToPauseMenu(On.UIManager.orig_UIGoToPauseMenu orig, UIManager self){
Log("Opened");
}
so under my logs I should add orig(self)? or somewhere else
Under
ยฏ_(ใ)_/ยฏ
Why am I late
wonder if I should disable double jump for this fight, it's kinda op
trust me it's a burden as well double jump in to a seed? your dead
a heath nurf would kinda make sence but how will you shoot continuously at him?
just say it in a readme jngo, that's what I did with propeller knight
well ik how to disable it, it's just a simple hook
what about the range?
I meant, it gives the player the freedom to choose
I was going to have it be an option on the statue but got bored
that works too
I should make him do 3 masks of damage so he kills you in 3 hits like in cuphead
With all equipment or will i just have to use debug
why not just disable the wing?
Yeah 3 mask dmg seems like a good idea
agreed
I also have to lower the ceiling so you can't just pogo cagney
tbh sally stageplay would've been a better boss to do cause stationary bosses in hk are just kinda eh
bossmodcore?
ah
they supply the statue?
that should be it.
Will you be setting the name of the gate?
yield return null; normally solves half the world's problems
would a dict be more useful?
ahhhh gottchu
quick question what is the knight's jump height with gravity considered?
thank you
is there a debug mod for that stuff?
should asset bundling be done in a 2d unity or 3d? (2d makes sence but the knight uses 3d to store his position sometimes)
epic
hopeful waiting
Has anyone made an Uumuu mod?
seems like starting a coroutine from the UIGoToPauseMenu hook crashes the game
Oof
I probably am just doing something very wrong
i don't think it can pause something running on the update methord try making a new methord for waiting and have it return before returning to self, orig
i might be 100% wrong though
I removed every bit of actual code from the coroutine I created in another, I couldn't start the coroutine from the base mod class so I called a function to start a coroutine in another class
yes, it seems like it is allergic to startcoroutine (or I'm not using it right)
could a public static help?
wait that's a thing?
why is it tied to game manager i thought it was a c# thing
I'm guessing its a way to start coroutines from within a class that isn't tied to MonoBehaviour (avoiding the workaround I was going through basically)
still breaks when using the game manager instance startcoroutine
that makes sense
so it starts the coroutine in a place where it won't pause the game?
Oh!
?!
maybe that's part of my issue, but I don't think Time.time would be affected by the game being paused
unless it sets timescale to 0
I just thought coroutine meant that it wouldn't stop my other script's execution, but it seems like it gets stuck
as war as i know corotine is tied to the monobehavour it is used it I REALLY need to reaserch
would you happen to know if asset bundling for hk works with unity 2d or 3d?
assetbundling only requires prefabs as far as I know, so that could also be 3d models
ah i'm just trying to get a circle with a collider to use as a planet
make a new game object with a sprite renderer and a circle collider and bundle that, should be able to get it in the game this way
oh right, but he'd need to bundle his visuals, no?
that's neat
huh?
i don't understand
how do i get it to use custom sprite and why would new GameObject() make a circle and collider?
please a little help
add a circle collider component my guy
GameObject myGO;
myGO = new GameObject("TheNameYouWant");
CircleCollider myCircleCollider = myGO.AddComponent<CircleCollider>();
myCircleCollider.someParameterYouWantToAdjust = someValueYouWantItToBe;
//you can just skip assigning the collider to a variable
thank you
would i do onsceneload or something?
i found https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager-sceneLoaded.html but was confused by how to read what scene is loaded
to make it show up on specific scenes you'll need to hook some stuff to the ActiveSceneChanged (at least that's how I dealt with it)
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += ActiveSceneChanged;
if(arg1.name == "Tutorial_01"){
//spawn your stuff in there
}
}```
or at least something along those lines
I'm getting scene names from HKEdit personally, but I'm sure they can be found somewhere else too
I know level6 is Tutorial_01 iirc
do you know dirtmouth?
scene name is like another parameter that's set in it
ouch
I'm guessing it'll be level7 with the name "Town"
i didn't realize what it was
so how should I make my UI fade if I can't call a coroutine from my UIManager_UIGoToPauseMenu hook?
that's taken care of in the coroutine using Color.Lerp
but I can't seem to call the coroutine at all
when the game is paused I want to fade the colors of my custom UI (I got the hook to work and I can set its color directly and it works alright), but I wanted to slowly fade it using a coroutine where I could check for Time.time to make sure it takes a specified amount of time to complete.
But at the moment as soon as I call a coroutine, the game dies
well soft-locks is a more proper term
/*float t = (Time.time - start);
while(t<lerpTime)
{
img.color = Color.Lerp(img.color, to, (t/lerpTime));
yield return null;
}
img.color = new Color(to.r, to.g, to.b, to.a);
*/
yield return null;
}```
I basically commented out all of it
why not just do if (inmenu and colour >= colour32(r,b,g,a)) colour32 += Vector4 (r*fixedtime.delta time,b*fixedtime.delta time,g*fixedtime.delta time,a*fixedtime.delta time)
or is that dumb i'm not sure how it works
i hope i'm right
that's the next thing to try, but I'd like to make coroutine work if I can first, just as a matter of habit
to be fair I haven't made stuff in unity in a long while so I'm just remembering stuff as I'm going
1px sprite
also in case I'm not using this right
StartCoroutine(IE_AnimateColorLerp(img, to, lerpTime,startTime));
gamemanager.yourcode?
GameManager.instance.StartCoroutine(corruptionAnimClass.IE_AnimateColorLerp(imageList[0], new Color(0.1f, 0.1f, 0.1f, 1f), 5f, Time.time));
trying both ways
using the GameManager.instance I manage to see the game go into pause state
but it then sort of locks itself right after
can you use log to see where it brakes?
testing something real quick
i don't know how to help but i hope i figure out how to help others reach a knowledge i cannot possess yet ๐
oh wait I think for some reason now it works
epic codin skills
Well this is the worst feeling but that's how 3/4 of my issues end up resolving themselves
I guess now it works, now to make it fade properly
also I can't use Logs in classes that aren't of type Mod, right?
you can but you need the debug.console and turn it on for the actual build somehow
do i need a referance to get Scene to be seen as a virable in the code you gave me earlier?
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += ActiveSceneChanged;
.
.
if(arg1.name == "Tutorial_01"){
//spawn your stuff in there
}
}```
@jade willow
oh
SceneManagement
i'm stupid sorry for the ping
is it scene capture?
not using powers of 2 sized textures