#how do i better optimize my attacks?

1 messages · Page 1 of 1 (latest)

fleet notch
#

currently, the way i have my attacks layed out is they are all in a single modulescript which has a type definition and certain functions i use for many attacks, but i know this isnt the best method of doing it, any suggestions?

#

my first thought was moving the attacks so that they each have their own module script, but how would i access the functions and type definition in those

sterile tendon
#

Or was it obvious whike testing

fleet notch
#

not worried about current performance, its fine, moreso worried about how poor itd get later down the line when theres 30+ unique attacks

sterile tendon
#

although this is just my opinion on jt

fleet notch
#

elaborate as im confused on what you mean

sterile tendon
# fleet notch elaborate as im confused on what you mean

something i would do in alot of things that can do allat but only needs to be called once, an example is like

--pretend this is a module

function bleh.Start(...)
end

-- pretend this one is another module

function bleh2.Start(...)
end

so i only need to call .Start(...) than suffering

#

although not sure if this is what u mean though

#

cause imnsleepy as fuck and im on mobile

fleet notch
#
local module:{attacka} = { 
    NOLM1 = {
        size = Vector3.new(5,8,6),
        offset = CFrame.new(0,0,-3),
        damage = 20,
        Cooldown = "M1",
        CdTime = 2,
        Chain=6,
        onHit = function(Humanoid:Humanoid)

        end,
    },
}
#

this is what my current attack module script looks like

#

just with alot more than this one

sterile tendon
fleet notch
#

all the data is then used by another script

sterile tendon
#

lowk i think Pyro-Fire might be more helpful since im charliekirkeuinly sleepy and j cant understand SHIT on that

#

I just hope he aint sleepin rn

fleet notch
#

also ignore how some things are capitalized and others arent i cant seem to chose

sterile tendon
#

😔

fleet notch
#

i should really go through the code and change them all to the same casing tho lol

sterile tendon
#

Naaa

#

well

#

its ur choice

fleet notch
#

imagine someone else goes through this and trys calling OnHit because CdTime is capitalized like that lmao

#

or vise versa

#

(im that someone)

sterile tendon
#

💔

fleet notch
#

the attack code in general is just a mess

#

mainly cuz its all running a function that was originally made just for hitboxes

sterile tendon
fleet notch
#

yea

sterile tendon
#

atp maybe u need to like

#

r*code it

fleet notch
#

split the hitboxes into their own thing, and redo the attack code so that its cleaner

#

cuz ive just been throwing everything in when ive needed it

flat belfry
fleet notch
#

organization

flat belfry
#

For my combat system I just coded a state machine tbh, it ain’t perfect but it does the job well

#

It’s definitely an option to split up your attacks into different module scripts as well