Need Help Simplifying

Hey, Can someone help me figure out a way to simplify this script?
Smol Template for You! script pic
It seems really big and run-on to me.

Well, the + (0) is completely useless, as well as x (1), since those don't change the values at all. I also noticed that you do (((Timer) - (Start Time)) / (Overall Time) quite often, so you could store that in a script variable and use that instead.

Alright, that's a start.

What does this do?

Okay so it looks to me like you are using
(((Time) - (start time)) / (overall time))
A lot
So consider putting that into a variable and then calling it
Because over half of the math operations are that just calculate it once and then reuse the value
Otherwise I don’t think you can really make it more simple

Oh I found one, use some of the vardradic math blocks so that “sin of” could instead of being multiple “() x ()” would just be 1 vardric one

It reports sort of an elastic offset from a certain position.

Well wouldn’t it make moser sense to be a reporter block and use an upvar

Well, it's not really a reporter, more like a setter

Well then you could use “Ignore []” and then just use the upvar

Yep, this works. Thank you!

Ur welcome
What’s the final one look like? I wanna see it

It's fine.
Smol Template for You! script pic (1)

That’s a lot more readable now :slight_smile:

Yeah, definitely.

Wait a second is the “[1] - (time)” only there to make it negative?
If so you could use “neg of” or make a negative block

Well, sometimes the Time variable gets set to less than 1, so that's why it's like that.
Thanks for the suggestion tho.

The subthread here about command vs. operation was triggered, I think, by the use of the word "get" in the name of the block. It would be much less confusing if that were "set."

Also, six inputs? Users of the block will never remember the order. The title text should label them:

set offset from bounce, old offset: (offset) , overall time: (overall time) , start time: (start time) , ...

That'll make the block way bigger, but you can control that by using $nl in the title text to break it into sensible lines.

Ohh, yeah, that could work!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.