[source] | guide_examples [title] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | local errorCode, globalDataStoragePages = _DataStorageService:GetGlobalDataStoragePagesAndWait()
[source] | guide_examples [title] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | local errorCode, sortableDataStoragePages = _DataStorageService:GetSortableDataStoragePagesAndWait()
[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] | 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] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | local globalDataStorage = _DataStorageService:GetGlobalDataStorage("globalDS") local keyValues = {} keyValues["key1"] = "value1" keyValues["key2"] = "value2" keyValues["key3"] = "value3" local errorCode, successKeys = globalDataStorage:BatchSetAndWait(keyValues)
[source] | guide_examples [title] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | local transactDs = _DataStorageService:GetGlobalDataStorage(self.TransactionTestDsName) local t1 = {} t1["key1-1"] = "value1" t1["key1-2"] = "value2" t1["key1-3"] = "value3" local t2 = {} t2["key2-1"] = "value1" t2["key2-2"] = "value2" t2["key2-3"] = "value3" local callback = function (code, key
[source] | guide_examples [title] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | log("# Test_DataStorage_TransactDelete") local transactDs = _DataStorageService:GetGlobalDataStorage(self.TransactionTestDsName) local keys1 = {"key1-1", "key1-2", "key1-3"} local keys2 = {"key2-1", "key2-2", "key2-3"} local code1, resultKeys1 = transactDs:TransactDeleteAndWait(keys1) log("code1: ".
[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] | guide_examples [title] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | local globalDataStorage = _DataStorageService:GetGlobalDataStorage("globalDS") local keyInfo = DataStorageKeyInfo() keyInfo.Key = "Key" keyInfo.Version = "Version1" globalDataStorage:SetByInfoAndWait(keyInfo, "Value") -- 기존 버전의 "Value" 값을 덮어 쓰는 대신 새로운 버전을 만들어 저장합니다. keyInfo.Key = "Key" keyInfo.V
[source] | guide_examples [title] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | local globalDataStorage = _DataStorageService:GetGlobalDataStorage("globalDS") keyInfo = DataStorageKeyInfo() keyInfo.Key = "Key" keyInfo.Version = "Version1" globalDataStorage:SetByInfoAndWait(keyInfo, "Value") -- 기존 버전의 "Value" 값을 덮어 쓰는 대신 새로운 버전을 만들어 저장합니다. keyInfo.Key = "Key" keyInfo.Version
[source] | guide_examples [title] | DataStorage 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=692 [code] | local globalDataStorage = _DataStorageService:GetGlobalDataStorage("globalDS") -- 4월 20일부터 5월 20일까지의 버전 목록만 가져옵니다. local minDate = DateTime(2022, 4, 20) local maxDate = DateTime(2022, 5, 20) local errorCode, pages = globalDataStorage:GetVersionsAndWait("Key", SortDirection.Ascending, minDate, ma
[source] | guide_examples [title] | 스프라이트 색상을 픽셀 단위로 설정하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=693 [code] | [client only] void ResetColorsTest() { local newWidth = _UtilLogic:RandomIntegerRange(8, 32) local newHeight = _UtilLogic:RandomIntegerRange(8, 32) local colors = {} for i=1, newWidth * newHeight do local r = _UtilLogic:RandomDouble() local g = _UtilLogic:
[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=693 [code] | [client only] void ResetColorTest() { local newWidth = _UtilLogic:RandomIntegerRange(8, 32) local newHeight = _UtilLogic:RandomIntegerRange(8, 32) local r = _UtilLogic:RandomDouble() local g = _UtilLogic:RandomDouble() local b = _UtilLogic:RandomDouble() -- ResetW
[source] | guide_examples [title] | 스프라이트 색상을 픽셀 단위로 설정하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=693 [code] | [client only] void SetAlphaTest() { local a = _UtilLogic:RandomDouble() -- SetAlpha를 사용하여 스프라이트 전체의 알파 값을 변경합니다. self.Entity.PixelRendererComponent:SetAlpha(a) }
[source] | guide_examples [title] | 스프라이트 색상을 픽셀 단위로 설정하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=693 [code] | [client only] void GetPixelsTest() { -- GetPixels을 사용해 SetPixelTest 전체의 픽셀 값을 받아옵니다. local getPixels = self.Entity.PixelRendererComponent:GetPixels() -- 위에서 받아온 값을 SetPixels를 사용해 CheckGetEntity에 표시합니다. self.PRCheck.PixelRendererComponent:SetPixels(getPixels) }
[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=719 [code] | [server only] void OnBeginPlay() { log("test_info") log_warning("test_warning") log_error("test_error") }
[source] | guide_examples [title] | Callback [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=745 [code] | Property: [Sync] number Power = 0 Method: [server only] void OnBeginPlay () { local data = _DataStorageService:GetGlobalDataStorage("data") self.Power = 20 local callBack = function (errorcode, key) log("Power is saved") end data:SetAsync("Power", tostring
[source] | guide_examples [title] | TweenLogic을 활용해 엔티티 제어하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=746 [code] | number Ease(number startValue, number endValue, number duration, EaseType type, number tweenTime)
[source] | guide_examples [title] | 충돌 그룹 만들기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=754 [code] | Event Handler: [server only] [self] HandleTriggerEnterEvent(TriggerEnterEvent event) { -- Parameters local TriggerBodyEntity = event.TriggerBodyEntity -------------------------------------------------------- if not TriggerBodyEntity.PlayerComponent then return end }
[source] | guide_examples [title] | 엔티티에 물리 적용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=761 [code] | Method: void Jump() { self.Entity.PhysicsRigidbodyComponent:ApplyLinearImpulse(Vector2(0,10)) } Event Handler: [service: InputService] HandleKeyDownEvent(KeyDownEvent event) { --------------- Native Event Sender Info ---------------- -- Sender: InputService -- Space: Client ----
[source] | guide_examples [title] | 루아 프로파일러를 활용하여 최적화하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=762 [code] | void Function1(string arg1) { profiler.beginscope("FirstLoop") for i = 1, 10000 do local en = self.Entity end profiler.endscope() profiler.beginscope("SecondLoop") for i = 1, 10000 do local en = self.Entity end profiler.endscope() }
[source] | guide_examples [title] | 공동 제작 팁 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=766 [code] | if _UserService.LocalPlayer.Name == "CreatorName" then TestComponent.Enable = true end
[source] | guide_examples [title] | 아바타 애니메이션 제어하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=820 [code] | local body = self.Entity.AvatarRendererComponent:GetBodyEntity() local event = ActionStateChangedEvent("walk1", "walk1", 1, SpriteAnimClipPlayType.Loop, 1, 2) body:SendEvent(event)
[source] | guide_examples [title] | 아바타 애니메이션 제어하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=820 [code] | local body = self.Entity.AvatarRendererComponent:GetBodyEntity() local event = ActionStateChangedEvent("walk1", "walk1") -- 재생 속도, 재생 타입, 시작 프레임, 종료 프레임은 생략할 수 있습니다. -- ActionStateChangedEvent("walk1", "walk1", 1, SpriteAnimClipPlayType.Loop, 0, 종료 프레임)과 같은 의미입니다. body:SendEvent(event)
[source] | guide_examples [title] | 아바타 애니메이션 제어하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=820 [code] | local body = self.Entity.AvatarRendererComponent:GetBodyEntity() local event = ActionStateChangedEvent("walk1", "walk1", 1, SpriteAnimClipPlayType.Loop, -1, 4) -- 프레임값으로 양수를 넣어야 하는데 위와 같이 startFrameIndex로 음수를 넣으면 "0"으로 보정됩니다. -- endFrame이 "3"인데 endFrameIndex로 "4"를 잘못 넣었다면 "3"으로 보정됩니다. -- 결과적으로 Acti
[source] | guide_examples [title] | 아바타 애니메이션 제어하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=820 [code] | local event = BodyActionStateChangeEvent() event.ActionState = MapleAvatarBodyActionState.Fly event.needResetAction = true event.startFrameIndex = 1 event.endFrameIndex = 2 self.Entity:SendEvent(event)
[source] | guide_examples [title] | 아바타 애니메이션 제어하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=820 [code] | ActionStateChangedEvent("fly", "fly", 1, SpriteAnimClipPlayType.Loop, 1, 2)
[source] | guide_examples [title] | 타이머 만들기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=821 [code] | Property: [None] Entity CardSpawnRoot = /ui/CardPairGameUI/UI_Board/UI_Blocks/UI_Block_Group [None] Card SelectedCard = nil [None] Entity TimeText = /ui/CardPairGameUI/UI_Board/Background/Title/Timer_Background/UI_Time/UI_Time_Text Method: [client only] void OnUpdate (number delta) { self:Updat