SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.02k stars 358 forks source link

loop-value counting as loop-value-1 #6816

Closed EquipableMC closed 5 days ago

EquipableMC commented 1 week ago

Skript/Server Version

[22:17:45 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[22:17:45 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[22:17:45 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[22:17:45 INFO]: [Skript] Server Version: git-Purpur-1985 (MC: 1.19.4)
[22:17:45 INFO]: [Skript] Skript Version: 2.9.0-beta1 (skriptlang-github)
[22:17:45 INFO]: [Skript] Installed Skript Addons: 
[22:17:45 INFO]: [Skript]  - skript-placeholders v1.6.0 (https://github.com/APickledWalrus/skript-placeholders)
[22:17:45 INFO]: [Skript]  - skript-gui v1.3 (https://github.com/APickledWalrus/skript-gui)
[22:17:45 INFO]: [Skript]  - DiSky v4.17.3
[22:17:45 INFO]: [Skript]  - skript-yaml v1.5
[22:17:45 INFO]: [Skript]  - skript-reflect v2.4-for-2.9-beta (https://github.com/SkriptLang/skript-reflect)
[22:17:45 INFO]: [Skript]  - SkBee v3.5.4 (https://github.com/ShaneBeee/SkBee)
[22:17:45 INFO]: [Skript]  - SkJade v1.4.4-dev (https://www.github.com/Ankoki-Dev/SkJade)
[22:17:45 INFO]: [Skript]  - skript-citizens v1.0.0
[22:17:45 INFO]: [Skript] Installed dependencies: 
[22:17:45 INFO]: [Skript]  - Vault v1.7.3-b131
[22:17:45 INFO]: [Skript]  - WorldGuard v7.0.8+33cdb4a

Bug Description

So I have a loop inside a loop. I used loop-value in the first one, and I used loop-value-1 in the second loop. It errored saying I needed to it. So I tried surrounding it in parathesis and it said it did not understand this condition/effect. I tried changing it to loop-value-2 and it worked, but it shouldn't of. it should accept loop-value in the first loop and loop-value-1 in the 2nd.

Expected Behavior

Accept the usage of loop-value-1 and not count loop-value as loop-value-1

Steps to Reproduce

    trigger:
        loop 16 times:
            set {_v::*} to circle({_loc}, 2, 1, (loop-value * (360/16)), -90)
            loop {_v::*}:
                draw 1 of flame at {_loc} ~ loop-value-1 with extra 0 with force

# Basic circle. step-size is in degrees.
# yaw/pitch can be used to tilt the circle in various ways
function circle(center: location, radius: number, step-size: number = 10, yaw: number = 0, pitch: number = 0) :: locations:
    # refernce vector for rotation around
    set {_reference} to vector from yaw {_yaw} + 90 and pitch 0
    # vector to get locations with
    set {_v} to spherical vector with radius {_radius}, yaw 0, pitch 0

    # 360 degrees / step size = number of steps needed
    loop floor(360 / {_step-size}) times:
        # copy vector for rotation
        set {_temp-v} to {_v}
        # rotate if necessary
        if {_pitch} is not 0:
            rotate {_temp-v} around {_reference} by {_pitch}
        # store location and move a step
        set {_locs::%loop-number%} to {_center} ~ {_temp-v}
        add {_step-size} to yaw of {_v} 

    # return list of locations
    return {_locs::*}

Errors or Screenshots

image image

Other

No response

Agreement

sovdeeth commented 5 days ago

Well it shouldn't accept loop-value-1, as loop-value-1 is a number, not a vector. The issue here is the content of the error message, not that it's erroring.