Skip to content

ExprMidpoint #7888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: dev/feature
Choose a base branch
from

Conversation

Absolutionism
Copy link
Contributor

@Absolutionism Absolutionism commented May 22, 2025

Problem

Currently is no quick and easy route of getting the center location from two locations.
The only current way I know to achieve this, is
set {_center} to {_loc1} ~ ((vector from {_loc1} to {_loc2}) / vector(2,2,2))

Solution

Adds ExprMidpoint that does this.

Testing Completed

ExprMidpoint.sk


Completes: none
Related: none

@Absolutionism Absolutionism requested a review from a team as a code owner May 22, 2025 17:28
@Absolutionism Absolutionism requested review from cheeezburga and erenkarakal and removed request for a team May 22, 2025 17:28
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label May 22, 2025
@ShaneBeee
Copy link
Contributor

Just going to throw my 2 cents in here.
This in my opinion seems like bloat.

Skript should focus on the language and the Bukkit API itself.

Skript shouldn't be putting on focus on doing math that a Skript user could do themselves.
This feels more like something meant for an addon.

Again, I repeat, just my opinion.

@sovdeeth
Copy link
Member

sovdeeth commented May 22, 2025

I'm kind of ambivalent on this, since it seems like a really easy thing to do with existing tools. It's a bit clunky since you have to get a vector or do math on x/y/z, though, so i see the appeal of a simpler manner. I don't mind it either way.

That said, I'm strongly against calling it the center point. I think that muddles the waters between the existing center expression (and could cause syntax conflicts as is currently written). I would stick entirely to the term midpoint for this.

I'd like to comment that the pr template does ask you to argue why the given problem needs solving, and I think just the fact that no QOL expression exists is not reason enough. I'd like to see some arguments as to why it needs to be added and why it's better than whatever you can currently do.

This is also missing any documentation of testing completed.

@Absolutionism
Copy link
Contributor Author

So you want only [the] midpoint (between|of) %location% and %location% + from ... to ...

@sovdeeth
Copy link
Member

sovdeeth commented May 22, 2025

So you want only [the] midpoint (between|of) %location% and %location% + from ... to ...

well midpoint from x to y doesn't make much sense, but the between/of seems fine, yes
(also fyi you can divide the vector by 2 directly, instead of using a vector of 2s)

@sovdeeth sovdeeth added the feature Pull request adding a new feature. label May 22, 2025
@Absolutionism Absolutionism requested a review from sovdeeth May 22, 2025 20:58
@Absolutionism Absolutionism changed the title ExprCenterLocations ExprMidpointLocations May 24, 2025
@Absolutionism Absolutionism requested a review from sovdeeth May 25, 2025 14:02
@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label May 28, 2025
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label May 28, 2025
@Absolutionism Absolutionism requested a review from sovdeeth May 30, 2025 03:15
@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label May 30, 2025
@Absolutionism Absolutionism requested a review from sovdeeth May 30, 2025 17:29
Copy link
Contributor

@Fusezion Fusezion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this to remove my requested review, I don't see anything that stands out to me anymore

@skriptlang-automation skriptlang-automation bot added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label May 30, 2025
@sovdeeth sovdeeth moved this to In Review in 2.12 Release Jun 3, 2025
@erenkarakal
Copy link
Member

checks failing

@erenkarakal erenkarakal moved this from Awaiting Merge to In Review in 2.12 Release Jun 5, 2025
@erenkarakal erenkarakal moved this from In Review to Awaiting Merge in 2.12 Release Jun 5, 2025
@Absolutionism Absolutionism changed the title ExprMidpointLocations ExprMidpoint Jun 5, 2025
Copy link
Member

@Efnilite Efnilite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests failing

@github-project-automation github-project-automation bot moved this from Awaiting Merge to In Review in 2.12 Release Jun 8, 2025
@skriptlang-automation skriptlang-automation bot removed the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull request adding a new feature.
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

7 participants