#scale

1 messages · Page 1 of 1 (latest)

opal mason
#

I've spent like idk 5-6 hours trying to make this work but atp i give up, i've tried myself, chatgpt, grok and now i'm hoping to find someone here willing to help. It's basically a system where you don't get size too fast, this current version is just broken i guess. If anyone has a single clue on what to do please ping me, thanks!
https://pastebin.com/3rTyCjXT

proven quest
#

after 6h of debugging you dont even know where the issue is?

quick perch
cerulean cometBOT
#

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

quick perch
#

"just broken" doesn't really help

opal mason
#

and sometimes just doesn't

#

its all just weird and idk

opal mason
#

i've got no clue

proven quest
opal mason
#

i've even tried finding a script like this online

#

like where size doesn't get increased in the same amount

#

do yk a fix?

unreal lynx
#

@opal mason Do you get any output errors or you tried to debug to see where your code stops?

quick perch
quick perch
unreal lynx
quick perch
#

its bc they're dividing by scale units (hipheight)

#

so it's just going to cause crazy multipliers. they should pick size brackets and calculate within their desired range

opal mason
#

i legit tried

#

i've done that

#

i only used chatgpt later on

#

i know how to do some basic things in lua

#

im trying to find a formula

#

either i go too big or too small

#

i had a working one but it would make the players size go to the max

#

which i set in a var

#

mainly i just need a formula that works

#

to replace my own

opal mason
#

most likely

unreal lynx
#

I think it’s because you're counting the scale via HipHeight and dividing the huge size by almost zero values, plus in half of the conditions the formula is inverted

opal mason
#

yeah thats basically it ig

#

i just don't know any way

#

to do it

unreal lynx
#

Honestly, I think chat GPT should resolve it if you prompt correctly

opal mason
#

i've tried for 3 hours sob

#

with chatgpt

quick perch
opal mason
#

3 other hours myself

opal mason
#

bruh no i dont need the work to be done for me

#

i wanna find a fix

quick perch
#

We have directed you to the right place

opal mason
#

and that is?

opal mason
#

could you give a small example

#

like layout or something idk

#

like what the main issue is

#

wdym by in half conditions

#

formula is inverted

quick perch
#

ur mixing units, "scale" and "hipheight" just aren't comparable. thats why you are getting those huge jumps

you could use lerp to map from size to scale

opal mason
#

wdym by the last line

quick perch
unreal lynx
opal mason
#

wait

#

i've got one more small question

#

nvm

#

im 100% confused but ima just find out what lerp is

unreal lynx
quick perch
#

try this:

local function lerp(a,b,t) return a + (b-a)*t end

local function getScaleFromSize(size)
    local ranges = {
        {0,    1e3,  1,  3},
        {1e3,  1e5,  3,  5},
        {1e5,  1e6,  5,  8},
        {1e6,  1e9,  8, 10},
        {1e9,  1e12, 10, 12},
    }

    for _, r in ipairs(ranges) do
        local minSize, maxSize, minScale, maxScale = unpack(r)
        if size < maxSize then
            local t = math.clamp((size - minSize) / (maxSize - minSize), 0, 1)
            return lerp(minScale, maxScale, t)
        end
    end

    return 12
end

then for the scale you set:

local scale = getScaleFromSize(sizeVal)
BodyHeightScale.Value = scale
BodyWidthScale.Value = scale
BodyDepthScale.Value = scale
HeadScale.Value = scale
unreal lynx
quick perch
#

nice to meet you tiphat

opal mason