#Automatic Buy Cost

1 messages · Page 1 of 1 (latest)

dim atlas
#
    set {_cost} to {@first-genBuyCost} 
    if (size of {{@variable-prefix}::Generators::*}) < 1:
        return {@first-genBuyCost}

    else if (size of {{@variable-prefix}::Generators::*}) > 1:
        return # Formula Here

I'm trying to make a automatic genBuyCost setter, I don't know what formula to use. Here is the options I made.

options:
    variable-prefix: gens
    default-GenSlots: 20
    default-Multiplier: 1

    first-genBuyCost: 100    
    first-genDropValue: 50

I need to know what formula I should use?

Full Code:

    variable-prefix: gens
    default-GenSlots: 20
    default-Multiplier: 1

    first-genBuyCost: 100    
    first-genDropValue: 50
    
on first join:
    set {{@variable-prefix}::GenSlots::%player's uuid%} to {@default-GenSlots}
    set {{@variable-prefix}::Multiplier::%player's uuid%} to {@default-Multiplier}

function registerGenerator(block: block-type, drop: item-type): # Coming Soon

function genBuyCost():
    set {_cost} to {@first-genBuyCost} 
    if (size of {{@variable-prefix}::Generators::*}) < 1:
        return {@first-genBuyCost}

    else if (size of {{@variable-prefix}::Generators::*}) > 1:
        return # Formula Here
dim atlas
#

update, Turns out I need to find an upgrade formula.

b = Current Gen Buy Cost
u = Next Gen Upgrade Cost
x = buy cost

Buy Cost Formula:
b + u = x

meager valley
#

what the heck is {@variable-prefix} for

#

this code is really weird

#

im not sure what's your issue

dim atlas
#

Easier to change

meager valley
#

Okay but why