Joined: February 7th, 2013, 5:04 am Posts: 207
Title: Skid
INTRODUCTION
Hello!
If you ever tried to play Chinese maps from Netease platform, then you already know that it's impossible to play them outside of their platform, even in the Singleplayer. It's exactly because of the DzAPI natives in war3map.j file. In this Guide, I'll try to explain how exactly DzAPI "works" and how to disable/remove it. To be honest with you, it's very easy and very hard at the same time, I'll explain why I think so a little bit later.
REQUIREMENTS
Depending on the map, you'll need to be able to at least READthe JASS code and UNDERSTAND how some functions work.
JassCraft (click here) to edit war3map.j & check for syntax errors in the JASS code, if you make any.
NATIVES & FUNCTIONS
At the bottom of this section you'll be able to find 2 lists. First one is the list of DzAPI natives, they only exist on Netease platform and they're also the reason why maps don't work on other platforms. And a second one, that is the list of DzAPI natives that were already converted to functions, for your convenience, of course.
Spoiler for List of Natives converted to Functions:
function DzTriggerRegisterMouseEventByCode takes trigger trig,integer btn,integer status,boolean sync,code funcHandle returns nothing return endfunction function DzTriggerRegisterKeyEventByCode takes trigger trig,integer key,integer status,boolean sync,code funcHandle returns nothing return endfunction function DzTriggerRegisterMouseWheelEventByCode takes trigger trig,boolean sync,code funcHandle returns nothing return endfunction function DzTriggerRegisterMouseMoveEventByCode takes trigger trig,boolean sync,code funcHandle returns nothing return endfunction function DzGetTriggerKey takes nothing returns integer return 100 endfunction function DzGetWheelDelta takes nothing returns integer return 100 endfunction function DzIsKeyDown takes integer iKey returns boolean return true endfunction function DzGetTriggerKeyPlayer takes nothing returns player return null endfunction function DzGetWindowWidth takes nothing returns integer return 100 endfunction function DzGetWindowHeight takes nothing returns integer return 100 endfunction function DzGetWindowX takes nothing returns integer return 100 endfunction function DzGetWindowY takes nothing returns integer return 100 endfunction function DzTriggerRegisterWindowResizeEventByCode takes trigger trig,boolean sync,code funcHandle returns nothing return endfunction function DzIsWindowActive takes nothing returns boolean return true endfunction function DzExecuteFunc takes string funcName returns nothing return endfunction function DzGetUnitUnderMouse takes nothing returns unit return null endfunction function DzSetUnitTexture takes unit whichUnit,string path,integer texId returns nothing return endfunction function DzSetMemory takes integer address,real value returns nothing return endfunction function DzSetUnitID takes unit whichUnit,integer id returns nothing return endfunction function DzSetUnitModel takes unit whichUnit,string path returns nothing return endfunction function DzSetWar3MapMap takes string map returns nothing return endfunction function DzGetLocale takes nothing returns string return null endfunction function DzGetUnitNeededXP takes unit whichUnit,integer level returns integer return 100 endfunction function DzGetTriggerSyncPlayer takes nothing returns player return null endfunction function DzFrameHideInterface takes nothing returns nothing return endfunction function DzFrameEditBlackBorders takes real upperHeight,real bottomHeight returns nothing return endfunction function DzFrameGetPortrait takes nothing returns integer return 100 endfunction function DzFrameGetMinimap takes nothing returns integer return 100 endfunction function DzFrameGetCommandBarButton takes integer row,integer column returns integer return 100 endfunction function DzFrameGetHeroBarButton takes integer buttonId returns integer return 100 endfunction function DzFrameGetHeroHPBar takes integer buttonId returns integer return 100 endfunction function DzFrameGetHeroManaBar takes integer buttonId returns integer return 100 endfunction function DzFrameGetItemBarButton takes integer buttonId returns integer return 100 endfunction function DzFrameGetMinimapButton takes integer buttonId returns integer return 100 endfunction function DzFrameGetUpperButtonBarButton takes integer buttonId returns integer return 100 endfunction function DzFrameGetTooltip takes nothing returns integer return 100 endfunction function DzFrameGetChatMessage takes nothing returns integer return 100 endfunction function DzFrameGetUnitMessage takes nothing returns integer return 100 endfunction function DzFrameGetTopMessage takes nothing returns integer return 100 endfunction function DzGetColor takes integer r,integer g,integer b,integer a returns integer return 100 endfunction function DzFrameSetUpdateCallback takes string func returns nothing return endfunction function DzFrameSetUpdateCallbackByCode takes code funcHandle returns nothing return endfunction function DzCreateFrame takes string frame,integer parent,integer id returns integer return 100 endfunction function DzCreateSimpleFrame takes string frame,integer parent,integer id returns integer return 100 endfunction function DzDestroyFrame takes integer frame returns nothing return endfunction function DzLoadToc takes string fileName returns nothing return endfunction function DzFrameSetAbsolutePoint takes integer frame,integer point,real x,real y returns nothing return endfunction function DzFrameClearAllPoints takes integer frame returns nothing return endfunction function DzFrameSetEnable takes integer name,boolean enable returns nothing return endfunction function DzFrameSetScript takes integer frame,integer eventId,string func,boolean sync returns nothing return endfunction function DzFrameFindByName takes string name,integer id returns integer return 100 endfunction function DzSimpleFrameFindByName takes string name,integer id returns integer return 100 endfunction function DzSimpleFontStringFindByName takes string name,integer id returns integer return 100 endfunction function DzSimpleTextureFindByName takes string name,integer id returns integer return 100 endfunction function DzClickFrame takes integer frame returns nothing return endfunction function DzSetCustomFovFix takes real value returns nothing return endfunction function DzEnableWideScreen takes boolean enable returns nothing return endfunction function DzFrameGetText takes integer frame returns string return null endfunction function DzFrameSetTextSizeLimit takes integer frame,integer size returns nothing return endfunction function DzFrameGetTextSizeLimit takes integer frame returns integer return 100 endfunction function DzFrameSetTextColor takes integer frame,integer color returns nothing return endfunction function DzGetMouseFocus takes nothing returns integer return 100 endfunction function DzFrameSetAllPoints takes integer frame,integer relativeFrame returns boolean return true endfunction function DzFrameSetFocus takes integer frame,boolean enable returns boolean return true endfunction function DzFrameSetModel takes integer frame,string modelFile,integer modelType,integer flag returns nothing return endfunction function DzFrameGetEnable takes integer frame returns boolean return true endfunction function DzFrameGetAlpha takes integer frame returns integer return 100 endfunction function DzFrameSetAnimate takes integer frame,integer animId,boolean autocast returns nothing return endfunction function DzFrameSetAnimateOffset takes integer frame,real offset returns nothing return endfunction function DzFrameSetScale takes integer frame,real scale returns nothing return endfunction function DzFrameSetTooltip takes integer frame,integer tooltip returns nothing return endfunction function DzDestructablePosition takes destructable d,real x,real y returns nothing return endfunction function DzSetMousePos takes integer x,integer y returns nothing return endfunction function DzSetUnitPosition takes unit whichUnit,real x,real y returns nothing return endfunction function DzFrameCageMouse takes integer frame,boolean enable returns nothing return endfunction function DzFrameGetValue takes integer frame returns real return 99. endfunction function DzFrameSetMinMaxValue takes integer frame,real minValue,real maxValue returns nothing return endfunction function DzFrameSetStepValue takes integer frame,real step returns nothing return endfunction function DzGetTriggerUIEventFrame takes nothing returns integer return 100 endfunction function DzGetTriggerUIEventPlayer takes nothing returns player return null endfunction function DzFrameSetScriptByCode takes integer frame,integer eventId,code funcHandle,boolean sync returns nothing return endfunction function DzFrameSetPoint takes integer frame,integer point,integer relativeFrame,integer relativePoint,real x,real y returns nothing return endfunction function DzFrameShow takes integer frame,boolean enable returns nothing return endfunction function DzSyncData takes string prefix,string data returns nothing return endfunction function DzGetTriggerSyncData takes nothing returns string return null endfunction function DzTriggerRegisterSyncData takes trigger trig,string prefix,boolean server returns nothing return endfunction function DzTriggerRegisterWindowResizeEvent takes trigger trig,boolean sync,string func returns nothing return endfunction function DzTriggerRegisterMouseMoveEvent takes trigger trig,boolean sync,string func returns nothing return endfunction function DzTriggerRegisterMouseWheelEvent takes trigger trig,boolean sync,string func returns nothing return endfunction function DzTriggerRegisterKeyEvent takes trigger trig, integer key, integer status, boolean sync, string func returns nothing return endfunction function DzTriggerRegisterMouseEvent takes trigger trig,integer btn,integer status,boolean sync,string func returns nothing return endfunction function DzGetGameUI takes nothing returns integer return 100 endfunction function DzFrameSetText takes integer frame,string text returns nothing return endfunction function DzFrameSetAlpha takes integer frame,integer alpha returns nothing return endfunction function DzFrameSetTexture takes integer frame,string texture,integer flag returns nothing return endfunction function DzFrameSetValue takes integer frame, real value returns nothing return endfunction function DzFrameSetSize takes integer frame,real w,real h returns nothing return endfunction function DzCreateFrameByTagName takes string frameType,string name,integer parent,string template,integer id returns integer return 100 endfunction function DzFrameSetVertexColor takes integer frame,integer color returns nothing return endfunction function DzOriginalUIAutoResetPoint takes boolean enable returns nothing return endfunction function DzFrameSetPriority takes integer frame,integer priority returns nothing return endfunction function DzFrameSetParent takes integer frame,integer parent returns nothing return endfunction function DzFrameGetHeight takes integer frame returns real return 99. endfunction function DzFrameSetFont takes integer frame,string fileName,real height,integer flag returns nothing return endfunction function DzFrameGetParent takes integer frame returns integer return 100 endfunction function DzFrameSetTextAlignment takes integer frame,integer align returns nothing return endfunction function DzFrameGetName takes integer frame returns string return null endfunction function DzGetMouseTerrainX takes nothing returns real return 99. endfunction function DzGetMouseTerrainY takes nothing returns real return 99. endfunction function DzGetMouseTerrainZ takes nothing returns real return 99. endfunction function DzIsMouseOverUI takes nothing returns boolean return true endfunction function DzGetMouseX takes nothing returns integer return 100 endfunction function DzGetMouseY takes nothing returns integer return 100 endfunction function DzGetMouseXRelative takes nothing returns integer return 100 endfunction function DzGetMouseYRelative takes nothing returns integer return 100 endfunction function DzAPI_Map_Ladder_SetPlayerStat takes player whichPlayer,string key,string value returns nothing return endfunction function DzAPI_Map_GetServerValueErrorCode takes player whichPlayer returns integer return 100 endfunction function DzAPI_Map_MissionComplete takes player whichPlayer,string key,string value returns nothing return endfunction function DzAPI_Map_GetLadderLevel takes player whichPlayer returns integer return 100 endfunction function DzAPI_Map_GetMatchType takes nothing returns integer return 100 endfunction function DzAPI_Map_GetActivityData takes nothing returns string return null endfunction function DzAPI_Map_GetPublicArchive takes player whichPlayer,string key returns string return null endfunction function DzAPI_Map_UseConsumablesItem takes player whichPlayer,string key returns nothing return endfunction function DzAPI_Map_SavePublicArchive takes player whichPlayer,string key,string value returns boolean return true endfunction function DzAPI_Map_GetMapConfig takes string key returns string return null endfunction function DzAPI_Map_GetGameStartTime takes nothing returns integer return 100 endfunction function DzAPI_Map_IsBlueVIP takes player whichPlayer returns boolean return true endfunction function DzAPI_Map_GetLadderRank takes player whichPlayer returns integer return 100 endfunction function DzAPI_Map_IsRedVIP takes player whichPlayer returns boolean return true endfunction function DzAPI_Map_GetMapLevelRank takes player whichPlayer returns integer return 100 endfunction function DzAPI_Map_OrpgTrigger takes player whichPlayer,string key returns nothing return endfunction function DzAPI_Map_IsRPGLadder takes nothing returns boolean return false endfunction function DzAPI_Map_GetServerArchiveEquip takes player whichPlayer,string key returns integer return 100 endfunction function DzAPI_Map_GetServerArchiveDrop takes player whichPlayer,string key returns string return null endfunction function RequestExtraStringData takes integer dataType,player whichPlayer,string param1,string param2,boolean param3,integer param4,integer param5,integer param6 returns string return null endfunction function RequestExtraRealData takes integer dataType,player whichPlayer,string param1,string param2,boolean param3,integer param4,integer param5,integer param6 returns real return 99. endfunction function DzAPI_Map_GetPlatformVIP takes player whichPlayer returns integer return 100 endfunction function DzAPI_Map_Ladder_SetStat takes player whichPlayer,string key,string value returns nothing return endfunction function DzAPI_Map_GetGuildRole takes player whichPlayer returns integer return 20 endfunction function DzAPI_Map_GetGuildName takes player whichPlayer returns string return null endfunction function RequestExtraBooleanData takes integer dataType,player whichPlayer,string param1,string param2,boolean param3,integer param4,integer param5,integer param6 returns boolean return false endfunction function RequestExtraIntegerData takes integer dataType,player whichPlayer,string param1,string param2,boolean param3,integer param4,integer param5,integer param6 returns integer return 0 endfunction function DzAPI_Map_IsRPGLobby takes nothing returns boolean return true endfunction function DzAPI_Map_GetMapLevel takes player whichPlayer returns integer return 5 endfunction function DzAPI_Map_HasMallItem takes player whichPlayer,string key returns boolean return false endfunction function DzAPI_Map_SaveServerValue takes player whichPlayer,string key,string value returns nothing endfunction function DzAPI_Map_GetServerValue takes player whichPlayer,string key returns string return null endfunction function DzAPI_Map_Stat_SetStat takes player whichPlayer,string key,string value returns nothing endfunction
HOW-TO
Basically, you just change natives to functions, like I did in NATIVES & FUNCTIONS section. You can also copy & paste already converted natives from my list above.
General idea:
If native returns boolean, then function will return false/true If native returns integer, then function will return #, where # is any number. If native returns string, then function will return null, check NOTICE If native returns player, then function will return null If native returns real, then function will return #, where # is any REAL number, for e.g. 99. If native returns nothing, then function will return nothing
NOTICE – you'll need to check each function by yourself, if it does something in the code, then you might need to change some of them to return something else, instead of my values. See example below.
Here's an example:
BEFORE AFTER
That's it. You can now play your map on other platforms.
BUT Sometimes maps use a lot of functions of DzAPI, for example:
DzAPI_Map_GetMapLevel – I can't say for sure what exactly is Map Level means on Netease platform, but as you can see in the code above, it checks if it's <= 8 & if it's, then it will execute code below. DzAPI_Map_StoreInteger – Stores selected data (in our case POINTS) on their servers in SQL.
As you can already see, there's a system with points in our example, which means that you can spend those points somewhere, but since we removed/disabled all DzAPI stuff, how can the map save them for the future use? And the answer is – it can't.
There's few solutions to this problem:
1) You unlock everything locked behind the points system, for e.g. ITEM requires 50 POINTS, then you just remove 50 POINTS condition or replace 50 with 0, etc. 2) You make your own save/load system and tie all those points to it. And so on, you got the idea.
Overall, you'll need to check almost EVERY DzAPI function and see if it does anything else in the code & if it does, then you'll need to fix it. Otherwise, you'll not be able to play the map properly (like earning points to unlock stuff) or you might even encounter desync in the multiplayer match, because it saves points to the system that doesn't exist.
CONCLUSION
As you might have noticed, it's VERY EASY to remove/disable DzAPI, but it may be VERY HARD to fix various systems in the map that relied on DzAPI. There's a chance that I'll update this guide later, like more examples, etc. But I included every single native I was able to find, so you shouldn't have any problems at all.
Joined: March 22nd, 2014, 8:48 am Posts: 51 Location: Garena
Hello , ill check this guide today when i have time , please check that thread too , map in it have some natives which somehow activate map files with LUA script and they somehow can work http://forum.wc3edit.net/deprotection-c ... 37231.html
But even just by looking at your war3map.j I can already see that map also relied on DzAPI a lot, so if you don't know JASS, then you won't be able to fix it completely (not really talking about skills, skills probably don't work because of what I mentioned earlier)
But even just by looking at your war3map.j I can already see that map also relied on DzAPI a lot, so if you don't know JASS, then you won't be able to fix it completely (not really talking about skills, skills probably don't work because of what I mentioned earlier)
Thank you. I created new function with LUA calls but there another problem , it thinks that lua is wrong but its not and i dont know LUA Guide helped too
Image of error
Spoiler:
Attachment:
111.jpg
You do not have the required permissions to view the files attached to this post.
Joined: February 7th, 2013, 5:04 am Posts: 207
Title: Skid
No idea about LUA, since I don't know it too.
But have you tried to just use lua-engine with your old war3map.j that you included in your other thread?
Quote:
The following software is an extension for Warcraft 3 which can let it execute lua script. You can just click 'launchwar3.bat' to lauch Warcraft 3 with this extension.
Maybe the reason why spells work is because Chinese platform already includes support for LUA scripts and you're trying to play the map via ordinary warcraft 3 that doesn't support them? I was talking about that, try to play your map with lua-engine enabled (you can DL it from the Hiveworkshop link).
Joined: March 22nd, 2014, 8:48 am Posts: 51 Location: Garena
Arakunido wrote:
No idea about LUA, since I don't know it too.
But have you tried to just use lua-engine with your old war3map.j that you included in your other thread?
Quote:
The following software is an extension for Warcraft 3 which can let it execute lua script. You can just click 'launchwar3.bat' to lauch Warcraft 3 with this extension.
Maybe the reason why spells work is because Chinese platform already includes support for LUA scripts and you're trying to play the map via ordinary warcraft 3 that doesn't support them? I was talking about that, try to play your map with lua-engine enabled (you can DL it from the Hiveworkshop link).
Map drops to lan when i tried to do it with old jass without edits . I think author of lua-engine from hiveworkshop must update his program because last time he edit it in 2014
Users browsing this forum: No registered users and 3 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum