[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local testArray = {"A", 1.234} table.insert(testArray, "C") testArray[#testArray+1] = "D" log(testArray[3]) -- C log(testArray[4]) -- D
[source] | guide_examples [title] | FastVector3을 활용한 월드 최적화 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=1300 [code] | local newPositionFast = FastVector3(0, 0, 0) newPositionFast.x = 1 newPositionFast.y = 2 self.Entity.TransformComponent.Position = newPositionFast
[source] | guide_examples [title] | 영상 재생시키기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=539 [code] | [Service: InputService] HandleKeyDownEvent(KeyDownEvent event) { --------------- Native Event Sender Info ---------------- -- Sender: InputService -- Space: Client --------------------------------------------------------- -- Parameters -- local key = event.key -----
[source] | guide_examples [title] | mLua [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=1287 [code] | @AttributeName(인수)
[source] | examples [title] | TouchReceiveComponent [page] | apiReference/Components/TouchReceiveComponent [code] | Property: [None] table<integer> Index [None] any Handler = nil Method: [client] void Move (any screenholdEvent) { local touchId = screenholdEvent.TouchId local touchPoint = screenholdEvent.TouchPoint local string for i =1, #self.Index do if self.Index[i] == touchId then self.Entity.Tran
[source] | guide_examples [title] | 로그 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=719 [code] | [server only] void OnBeginPlay() { log("Hello Maple World") }
[source] | guide_examples [title] | 스프라이트 색상을 픽셀 단위로 설정하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=693 [code] | [client only] void FillColorTest() { local r = _UtilLogic:RandomDouble() local g = _UtilLogic:RandomDouble() local b = _UtilLogic:RandomDouble() -- FillColor를 사용하여 스프라이트 전체 색상을 변경합니다. self.Entity.PixelRendererComponent:FillColor(Color(r,g,b,1)) }
[source] | guide_examples [title] | 날짜와 시간 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=691 [code] | local date = DateTime(2022, 4, 10) log(date:ToFormattedString("d")) -- 04/10/2022 log(date:ToFormattedString("d", "en-US")) -- 4/10/2022
[source] | examples [title] | SideviewbodyComponent [page] | apiReference/Components/SideviewbodyComponent [code] | Property: [None] table WallTile = {} Method: [client only] table GetWallTile () { return self.WallTile } Event Handler: [client only] [self] HandleRectTileCollisionBeginEvent (RectTileCollisionBeginEvent event) { ----------------- Native Emitter Info ------------------ -- Emitter: Kinematicbod
[source] | guide_examples [title] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | local sortableDataStorage = _DataStorageService:GetSortableDataStorage("sortableDS") -- 최솟값 0, 최댓값 100 사이에 있는 값들만 정렬하여 가져옵니다. local errorCode, pages = sortableDataStorage:GetSortedAndWait(SortDirection.Ascending, 0, 100) while true do local items = pages:GetCurrentPageDatas() for _, it
[source] | examples [title] | InventoryComponent [page] | apiReference/Components/InventoryComponent [code] | Event Handler: [self] HandleInventoryItemAddedEvent (InventoryItemAddedEvent event) { -- Parameters local Entity = event.Entity local Items = event.Items -------------------------------------------------------- if self:IsServer() then return end log("[Get Item]") } [self] HandleInven
[source] | guide_examples [title] | ExtendedScriptFormat [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=1166 [code] | method void TestMethod(float parameter)
[source] | guide_examples [title] | 어노테이션 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=824 [code] | ---@param testParamA Entity ---@param testParamB integer local function TestFunction(testParamA, testParamB) end
[source] | examples [title] | WeldJointComponent [page] | apiReference/Components/WeldJointComponent [code] | Method: [server] void Connect (Entity target) { self.Entity.WeldJointComponent:AddJoint(target, Vector2(0, -1), Vector2.zero) } Event Handler: [self] HandlePhysicsContactBeginEvent (PhysicsContactBeginEvent event) { --------------- Native Event Sender Info ---------------- -- Sender: PhysicsColl
[source] | examples [title] | CreatorDataStorage [page] | apiReference/Misc/CreatorDataStorage [code] | local ds = _DataStorageService:GetCreatorDataStorage() local minDate = DateTime(2023, 03, 09, 20, 20, 0, 0) local maxDate = DateTime(2023, 03, 09, 22, 20, 0, 0) -- 값을 저장할 때 버전 값을 함께 지정한 경우에만 조회할 수 있습니다. local getResultCode, pages = ds:GetVersionsAndWait("Key", SortDirection.Ascending, minDate, m
[source] | guide_examples [title] | Command Console 명령어 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=1195 [code] | echo message [-out stream] [-err stream]
[source] | examples [title] | RigidbodyClimbableAttachStartEvent [page] | apiReference/Events/RigidbodyClimbableAttachStartEvent [code] | Method: [server] void ChangedChildSortingLayer (Entity attachedEntity) { for i, j in ipairs(self.Entity:GetChildComponentsByTypeName("SpriteRendererComponent")) do j.Entity.SpriteRendererComponent.SortingLayer = attachedEntity.ClimbableSpriteRendererComponent.SortingLayer end } Event Handl
[source] | guide_examples [title] | 엔티티를 탐색하는 EntityService [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=201 [code] | void GetEntityExample() { local bulletEntity = _EntityService:GetEntityByPath("/maps/map01/Bullet") local bulletEntityId = bulletEntity.Id local bulletEntityById = _EntityService:GetEntity(bulletEntityId) if bulletEntity == bulletEntityById then log(bulletEntity.Id)
[source] | guide_examples [title] | 실행 제어 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=210 [code] | [ServerOnly] void CallPlaySoundEffect() { self:PlaySoundEffect() -- 어떤 공간에서든 같은 공간의 함수를 호출하듯이 사용할 수 있다. } [client] --각 함수별로 어떤 공간에서 호출하고 실행할지를 설정할 수 있다. void PlaySoundEffect() { --코드 작성 공간입니다. }
[source] | examples [title] | ClimbableComponent [page] | apiReference/Components/ClimbableComponent [code] | Method: [server] void ChangeBoxSize (Vector2 boxSize) { local entity = _EntityService:GetEntityByPath(EntityPath) entity.ClimbableComponent.BoxSize = boxSize } [client] void ChangeSpeedVector (Vector2 speedVector) { local entity = _EntityService:GetEntityByPath(EntityPath) entity.ClimbableCompo
[source] | guide_examples [title] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | local globalDataStorage = _DataStorageService:GetGlobalDataStorage("globalDS") local errorCode, grade = globalDataStorage:GetAndWait("Grade") -- 이전에 저장된 "A" 값 반환
[source] | guide_examples [title] | MSW 기본 이벤트 함수 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=163 [code] | -- ComponentA Property: [Sync] string B = "" Method: [server only] void OnInitialize() { self.B = "Hello" log(self.B) } -- ComponentC Property: Method: [Server Only] void OnBeginPlay() { local myEntity = self.Entity local componentA = myEntity.ComponentA log(componentA.B)
[source] | guide_examples [title] | 행동 트리 노드 만들기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=1155 [code] | [server only] void OnBeginPlay() { --CREATE NODE local sequence = SequenceNode("sq") local actionA = self:CreateNode("ActionA") local actionB = self:CreateNode("ActionB") local actionC = self:CreateNode("ActionC") local actionD = self:CreateNode("ActionD") --SET TREE sequence:AttachChild(a
[source] | guide_examples [title] | 포맷에 맞게 로컬라이징하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=968 [code] | -- 언어 설정 영어 : formatter argument의 개수가 필요한 개수와 다른 경우 log(_LocalizationService:SmartFormat("I have {0:plural:one}.", 1)) -- 결과 : 원문 출력 (영어 plural은 2개의 formatter argument를 받기 때문) -- 언어 설정 영어 : formatter argument를 공백으로 둘 때 log(_LocalizationService:SmartFormat("I have {0:plural:|}.", 1)) -- 결과 : 정상 출력 (
[source] | examples [title] | BackgroundComponent [page] | apiReference/Components/BackgroundComponent [code] | Method: [server only] void ChangeBackgroundExample ( ) { local background = self.Entity.BackgroundComponent background:ChangeBackgroundByTemplateRUID("794ad8421e2543d8a6d2c70307637450") background:ChangeBackgroundBySolidColor(Color.white) background:ChangeBackgroundByWebUrl("Http://WebUrl") }
[source] | guide_examples [title] | 날짜와 시간 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=691 [code] | local date = DateTime(2022, 8, 29, 19, 27, 15, 023) log(date:ToFormattedString("%H")) -- 19
[source] | guide_examples [title] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | local errorCode, userDataStoragePages = _DataStorageService:GetUserDataStoragePagesAndWait()
[source] | guide_examples [title] | 날짜와 시간 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=691 [code] | local date = DateTime(2022, 8, 29, 19, 7, 5, 023) log(date:ToFormattedString("tt")) -- PM
[source] | guide_examples [title] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | local errorCode, globalDataStoragePages = _DataStorageService:GetGlobalDataStoragePagesAndWait() while true do local globalDataStorages = globalDataStoragePages:GetCurrentPageDatas() --GetCurrentPageDatas()로 현재 페이지의 목록을 가져올 수 있습니다. for _, globalDataStorage in pairs(globalDataStorages)
[source] | guide_examples [title] | InputService를 활용한 입력과 액션 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=209 [code] | [service: InputService] HandleScreenTouchReleaseEvent(ScreenTouchReleaseEvent event) { --------------- Native Event Sender Info ---------------- -- Sender: InputService -- Space: Client --------------------------------------------------------- -- Parameters -- local Touc