CleverNucleus/playerex

Level formula is described, but not defined

Closed this issue · 2 comments

This is an issue with the documentation. The wiki says what levelFormula is but fails to define it. It's not clear where "stairs()" comes from, and it was a process to look up both what arguments it takes or and what it even does. Additionally, while 'x' is probably the current level, that's also not defined. I'm sure it makes sense to you, but as an option an end user would be expected to use or modify there's just not enough information here.

What should be included: the scope this runs. Variables accessible from this scope, at minimum defining relevant variables like "x". And, ideally, a description of the current formula and what it produces. After digging around I found the stairs function in the DataAttributesAPI. While this kind of helps, it's a custom function no one will be familiar with. Since most users will likely just want to make simple edits, a short description of what should be modified to shift the results up or down wouldn't go amiss.

public static double stairs(final double x, final double stretch, final double steepness, final double xOffset, final double yOffset) {
    return steepness * stretch * (x - xOffset) - steepness * Math.sin(stretch * (x - xOffset)) + yOffset;
}

Of course, there's an issue here if that's true. This function takes 5 arguments, and the default in the config provides 6.

stairs(x,0.2,2.4,17,10,25)

Hi there,
Are you sure that you've read the wiki? I feel that it does, in fact, cover all the points you've made. Please see here.
Thanks.

Wow, it is. I apologize. I'm sure I poured over both the original wiki, this wiki and the data attributes but yup, that's precisely what I was looking for. Many thanks.