#how do I get a name of a method

1 messages · Page 1 of 1 (latest)

gentle lintel
#

function client:hello_world()
    print("hello world")
end```

here is some example code how would I get the name of method with only the function
violet tapir
gentle lintel
#

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

violet tapir
#

Is there a specific reason why you need the name of the callback? Do you need an identifier for it or something?

gentle lintel
#

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

violet tapir
#

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?

gentle lintel
#

idk man I think your overstating it

gentle lintel
#

knit is so useful

violet tapir
#

State management library, networking library, serialization library, data management library, etc

gentle lintel
#

💀

#

half thoses word I don't understand what they mean

violet tapir
gentle lintel
#

client server communication

#

like I said tho

#

im adding my own shit

violet tapir
cunning ventureBOT
#

studio** You are now Level 1! **studio

gentle lintel
violet tapir
gentle lintel
#

nah

#

but like ngl this is more to build more coding skills

violet tapir
#

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

gentle lintel
#

why not just use rojo

#

and connect to git typeshit

violet tapir
gentle lintel
# gentle lintel im adding my own shit

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

violet tapir
#

Source control tracks changes to your code, state management is your game state, like player positions, npc health

#

Whatnot

gentle lintel
violet tapir
violet tapir
gentle lintel
#

is there a good yt vid for this shit

#

rn im just grinding slietnick's vids

violet tapir
#

It’s on github

gentle lintel
#

👍

#

what does charms do again?

violet tapir
violet tapir
gentle lintel
#

👍

#

do you mind forwarding me a bunch of reasources

gentle lintel
#

Imma try and recreate it

violet tapir
#

Look into roblox open source like charm, red, bytenet, jecs, Lyra

gentle lintel
#

👍

#

will do ty

violet tapir
#

You can find roblox open source on a site called wally

#

It’s a Roblox package manager

gentle lintel
violet tapir
#

Or join the OSS discord

gentle lintel
#

should I just quit what im working on rn or lock and complete this project by the morning

violet tapir
gentle lintel
#

yea yea

violet tapir
#

Yes

#

Knit is not it, it’s just a weird abstraction that doesn’t really do much of anything

gentle lintel
#

yea but like

#

i aint that good at coding

#

so like

#

recreating knit is good pratice is it not

#

typeshit

violet tapir
#

It’s a good way to learn but I think the concept of Knit is fundamentally flawed

cunning ventureBOT
#

studio** You are now Level 2! **studio

violet tapir
#

So I wouldn’t try to recreate that

gentle lintel
#

broo

#

im spent 5 hours on this shit

#

nooooooooooo

#

what do you recommed I recreate then?

violet tapir
#

Maybe an ECS framework

gentle lintel
#

googling ts

violet tapir
#

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

gentle lintel
#

👍

#

from what im reading on wiki

#

like

#

nvm ill get back to you when i've read it all

violet tapir
#

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

gentle lintel
#

my guy im barely understanding the wiki article im reading

#

what's the easy shit you can give me

violet tapir
#

Look at Jecs docs on github

gentle lintel
violet tapir
#

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

gentle lintel
#

so like traditionally

#

data is constantly being updated between server and client?

#

esc also tries to prevent recursion?

violet tapir
#

What is chat gpt saying 💀

gentle lintel
#

and add more abstraction to oop?

violet tapir
#

ECS doesn’t have anything to do with server / client or networking

violet tapir
gentle lintel
#

imma just watch yt video on it

#

some indian dude gonna clutch

violet tapir
#

So you know how objects have both data and logic

gentle lintel
#

yea

violet tapir
#

Like properties and functions

gentle lintel
#

👍

violet tapir
#

ECS separates all your game data into components and entities, and all this is stored in one data structure (usually called the world)

gentle lintel
#

see idk what you mean by entities

violet tapir
#

And then there’s systems which run each frame and update all the data into your world

violet tapir
#

It’s like an empty object that you can add components to

gentle lintel
violet tapir
#

For example, health would be a component

violet tapir
gentle lintel
#

like if you change a compent why are we having to update stuff

violet tapir
#

One frame is 1 loop of your game

gentle lintel
#

like if I change a variable

#

this computer changes the stuff in the memory

#

????????

#

im cooked 💀

violet tapir
#

Are you talking about components?

gentle lintel
#

if I change an object's data is that shit not changed?

violet tapir
#

A component is just a type of data like health, the entity is the object that has components associated to it

violet tapir
gentle lintel
#

yea yea

#

im just confused

#

like why we are having to update compents

#

like uh

#

why are they not already updated?

violet tapir
cunning ventureBOT
#

studio** You are now Level 3! **studio

gentle lintel
#

like yk when I change a variable

#

it's updated

violet tapir
#

Mhm

gentle lintel
#

how is chaning a component differnt

violet tapir
#

So it is the same

gentle lintel
#

so wdym by updating every frame

violet tapir
#

Although they aren’t stored like a normal variable is

violet tapir
gentle lintel
#

👍

violet tapir
#

If you connect a function to heartbeat, that’s a system that runs each frame

gentle lintel
#

👍

violet tapir
#

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

gentle lintel
#

so when you say update you are simply calling a method on the entity

violet tapir
#

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)

gentle lintel
#

👍

#

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

gentle lintel
#

aight

#

bro so like

#

ecs