개인 자료란 (JE)

  서버 커뮤니티

Profile 스크립터브혼 스크립트 전문가

Vhone dc73ee51d49946dabf4f634c6e3ce5c6

Profile

강좌 자바 에디션(JE) 플러그인 개발

[함수] 두 좌표로 영역 가져오기

2019.12.31 조회 수 410 추천 수 0
분야 스크립트 
장르 개발자 툴 
게임버전 모든버전 
API 스피곳, 페이퍼 
자료글 https://github.com/SkriptLang/Skript 

function getLocations(start:location, end:location) :: locations:
    set {_v} to vector between {_start} and {_end}
    set {_c::*} to x of {_v} and y of {_v}, z of {_v}
    set {_abs::*} to abs( {_c::1} ) and abs( {_c::2} ), abs( {_c::3} )
    set {_size::*} to {_abs::1} + 1 and {_abs::2} + 1, {_abs::3} + 1
    set {_drt::*} to {_c::1} / {_abs::1} and {_c::2} / {_abs::2}, {_c::3} / {_abs::3}
    
    set {_l} to {_start}
    loop {_size::1} times:
        loop {_size::2} times:
            loop {_size::3} times:
                set {_loc::%{_l}%} to {_l}
                add {_drt::3} to z-coord of {_l}
            set z-coord of {_l} to z-coord of {_start}
            add {_drt::2} to y-coord of {_l}
        set y-coord of {_l} to y-coord of {_start}
        add {_drt::1} to x-coord of {_l}
        
    return {_loc::*}


두 대각꼭지점 좌표로 직육면체 영역의 좌표를 가져오는 함수입니다.

기본 함수 asb와 표현식 vector가 사용되었습니다.

 

코드 보시고 분석해 보시라고 설명은 하지않겠습니다.

질문은 언제나 환영입니다 ㅎ

 

 

* 해당 코드의 질문은 덧글로,

* 다른 스크립트 질문은 [이곳]에 올려주세요.




1개의 댓글

YTgodcheon
2023.06.10

1.19.2 , 2.6.4 버전인데요. 가져온 좌표를 다른 변수에 집어 넣고 싶은데 어떻게해야할까요?

 

뉴스 및 창작물
/files/thumbnails/840/589/003/262x150.crop.jpg?20230916014456

건축

경복궁 -미완성-

동양건물건축유저

2023-09-16

0

/files/thumbnails/367/585/003/262x150.crop.jpg?20230906194231

애니메이터

허니츄..러스? 2

GlassesFilm

2023-09-06

4

/files/thumbnails/482/578/003/262x150.crop.jpg?20230828074501

건축

경복궁(25%) 4

KHC

2023-08-28

2

/files/thumbnails/221/570/003/262x150.crop.jpg?20230818130957

업데이트

마인크래프트 1.20.2 스냅샷 23w33a

BMlight

2023-08-18

0

/files/thumbnails/886/566/003/262x150.crop.jpg?20230816180528

레드스톤

마인크래프트 노트블럭으로 만든 『 I’m Your Treasure Box 』 1

Sonttukk

2023-08-14

4

/files/thumbnails/663/566/003/262x150.crop.jpg?20230820093830

소식

마이그레이션 피싱 메일

sejinjin

2023-08-14

3

/files/thumbnails/034/562/003/262x150.crop.jpg?20230809105714

모드

Modrinth 앱 출시 4

BMlight

2023-08-09

3