#how do I get a name of a method
1 messages · Page 1 of 1 (latest)
Why would you even want to do that
like I want to send a method as a callback
and I don't wanna also send over the name of the method
if there's a way to do it it would be alot better than sending over a extra paramatar
Is there a specific reason why you need the name of the callback? Do you need an identifier for it or something?
identifier 👍
basically rn im tryna recreate my own verison of knit
should get me rank 2 scripter
also give me a better understanding of frameworks
also knit is no longer supported so It would be good to have a framework I understand
Knit isn’t really used much anymore, nor is it really useful
Knit didn’t really work for a lot of reasons
If you want to make a framework couldn’t you make something useful?
idk man I think your overstating it
like what
knit is so useful
State management library, networking library, serialization library, data management library, etc
For what?
So like a networking / state management library?
** You are now Level 1! **
tf is state management
Have you ever used charm or rodux?
State management libraries help you store all your game state in one place, this makes it easier to track changes, replicate state, or roll it back
It’s different from source control
like have no clue if this is a good idea but I wanted to serialize every method so then when I connect them to a event, if I connect them twice the module will throw a warn or sum
Source control tracks changes to your code, state management is your game state, like player positions, npc health
Whatnot
would state management be server and client sided?
Each function has an address and you can check if a function is already inside a table by either searching for it or storing it as a key in a table and indexing it with the function
Yeah, state management can be used to sync data between client and server
You can look at charm’s docs
It’s on github
It’s a state management library
shit like this
Imma try and recreate it
Look into roblox open source like charm, red, bytenet, jecs, Lyra
You can find roblox open source on a site called wally
It’s a Roblox package manager
so ive heard
Or join the OSS discord
yea im locked in there
should I just quit what im working on rn or lock and complete this project by the morning
The knit framework you’re trying to make?
yea yea
Yes
Knit is not it, it’s just a weird abstraction that doesn’t really do much of anything
yea but like
i aint that good at coding
so like
recreating knit is good pratice is it not
typeshit
It’s a good way to learn but I think the concept of Knit is fundamentally flawed
** You are now Level 2! **
So I wouldn’t try to recreate that

broo
im spent 5 hours on this shit
nooooooooooo
what do you recommed I recreate then?
Maybe an ECS framework
googling ts
It is pretty complex though, so you don’t have to make a full implementation
But just understanding the concept of how ECS works will make you a better programmer
👍
from what im reading on wiki
like
nvm ill get back to you when i've read it all
You should look into Jecs, it’s an ECS framework meant for roblox
There’s also matter but it’s also a bit older
And it is a bit bloated
my guy im barely understanding the wiki article im reading
what's the easy shit you can give me
Look at Jecs docs on github
im getting chatgpt to decode ts
Or just ask chat gpt to try to explain ECS
GPT is pretty good at explaining stuff but it’s sometimes wrong and for niche stuff it’s almost always wrong
so like traditionally
data is constantly being updated between server and client?
esc also tries to prevent recursion?
What is chat gpt saying 💀
and add more abstraction to oop?
ECS doesn’t have anything to do with server / client or networking
ECS is somewhat similar but also different to OOP
So you know how objects have both data and logic
yea
Like properties and functions
👍
ECS separates all your game data into components and entities, and all this is stored in one data structure (usually called the world)
see idk what you mean by entities
And then there’s systems which run each frame and update all the data into your world
An entity is just an id associated with a field of components
It’s like an empty object that you can add components to
components are just properties?
Yes
For example, health would be a component
why every frame
In a game, all your systems run in one loop
like if you change a compent why are we having to update stuff
One frame is 1 loop of your game
like if I change a variable
this computer changes the stuff in the memory
????????
im cooked 💀
Are you talking about components?
uh huh
if I change an object's data is that shit not changed?
A component is just a type of data like health, the entity is the object that has components associated to it
Components can change
yea yea
im just confused
like why we are having to update compents
like uh
why are they not already updated?
What do you mean?
** You are now Level 3! **
Mhm
how is chaning a component differnt
Components are just variables
So it is the same
so wdym by updating every frame
Although they aren’t stored like a normal variable is
So you know run service right
👍
If you connect a function to heartbeat, that’s a system that runs each frame
👍
Okay so back to it
Think of an entity as an empty object
Let’s say I want to add a health component to an entity
Now, I can create a system called health regen
And loop through every entity with a health component, and update their health
Now I can have lots of things with health
I can have an enemy, a player, a turret, or even a grenade with health
so when you say update you are simply calling a method on the entity
Update as in a system?
The entities themselves don’t contain any functions, all the logic is handled in the systems (like health regen), entities and components are just data (so tables in luau)
👍
so when you mean to update a component every game loop this would only apply to methods changing the data of these entities/components every frame