Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Multiple Filters

Open EquipableMC opened this issue 1 year ago • 6 comments

Suggestion

There should be a way to use filter multiple times in skript and not strictly one time.

Why?

SkJade has this, but SkJade is outdated, and it would be easier to have in Skript just so I don't have to depend upon another addon solely for that feature.

Other

I expect this to be up for debate and/or be a controversial suggestion

Agreement

  • [X] I have read the guidelines above and affirm I am following them with this suggestion.

EquipableMC avatar Jul 04 '24 23:07 EquipableMC

I don't really get the point of this. You can already stack filters since the output of a filter is still a list. If you want to have multiple conditions in a single filter you can make a local function in that script and have it return a boolean based on whatever checks you want to run. What are you actually suggesting to add here?

Phill310 avatar Jul 04 '24 23:07 Phill310

I don't really get the point of this. You can already stack filters since the output of a filter is still a list. If you want to have multiple conditions in a single filter you can make a local function in that script and have it return a boolean based on whatever checks you want to run. What are you actually suggesting to add here?

What I am suggesting is, "where [input is not a player && input's y-coordinate is x]" (something like this. Using functions is quite literally annoying and not a workaround I want to do

EquipableMC avatar Jul 05 '24 00:07 EquipableMC

this is probably possible with the new whether thing, but if this did happen i think it'd work better as a section, although you cant have a section mid effect, but i guess another thing could be

loop all players:
   add loop-player to {_players::*}
filter {_players::*} to where:
   input is not a player
   input's y coordinate is 87
send "woah" to {_players::*}

&& isn't really Skript like, and this is probably a good alternative

Asleeepp avatar Jul 05 '24 00:07 Asleeepp

a proper filter stacking is still something that should be added, currently in order to do it you have to do

(((({_list} where [input is blah]) where [input is blah]) where [input is blah]) where [input is blah])

As you could probably guess it doesn't look very intended nor efficient, tho I believe another issue is opened atm suggesting a better system + efforts are being made.

As per what Asleeepp said, that's basically what a skript version would look like either using it or something similar as the team really like "IT" whenever they talked about this before

# if we're still against "into {_blah::*}" adding it as a entry is an option
filter all players into {_blah::*}:
    variable: {_blah::*}
    rules: # optionally "predicate" also works here but rules sounds better and more understandable imo
      it is a player
      it's y coordinate > 87
      it's z coordinate is between -10000 and 10000
      it's x coordinate is between -10000 and 10000

additionally last filter results is a possible expression in place of variable storage

Fusezion avatar Jul 05 '24 00:07 Fusezion

I would rather it be more like the new sort effect

filter {var::*} where [all|any]:
    condition 
    Condition 

send "test" to {var::*}

sovdeeth avatar Jul 05 '24 04:07 sovdeeth

Haven't looked at the new sort effect yet but yeah looks better gives another use to the copy effect I guess since it looks like you want variable manipulation

Fusezion avatar Jul 05 '24 04:07 Fusezion