橙光2016是基于flash實(shí)現(xiàn)的安疗,2017改為html5實(shí)現(xiàn),它的本地執(zhí)行功能不再依賴OrangeSim.exe,而是基于electron開發(fā)的本地瀏覽器AVG_Web_Browser雁乡。
對于橙光2017而言,其實(shí)并不存在破解,只要搞清楚它的運(yùn)行參數(shù)就可以了。
不同于rpgmake MV使用的是nw-js框架蛤虐,基本就是一個(gè)瀏覽器,生成的index.html直接就可以運(yùn)行肝陪。
electron的執(zhí)行原理要復(fù)雜一些驳庭。弄了幾天,沒搞明白氯窍,先中止了饲常。
通過分析,可以通過寫一個(gè)run.cmd來給AVG_Web_Browser.exe傳參來指定運(yùn)行的游戲參數(shù)狼讨。
也可以直接修改main.js來設(shè)定參數(shù)贝淤。
main.js在C:\Program Files (x86)\橙光制作工具2017\2.4.7.0716\interpreter\H5\resources\app 目錄
查看man.js可以了解參數(shù)的基本構(gòu)成
string=`{"OpenWindow":{"Width":"962","Height":"571","Pathname":"C%3a%5cProgram%20Files%20(x86)%5c%e6%a9%99%e5%85%89%e5%88%b6%e4%bd%9c%e5%b7%a5%e5%85%b72017%5c2.4.7.0716%5cinterpreter%5cH5%5cbin%2Findex.html%3Fmark%3Dpc","Local":"True","Protocol":"file:","Slashes":"True","ProjectName":"我的作品1","TitleBarStyle":"","SkipTaskbar":"False","Guid":"","Uid":"0","Gindex":"0","SessionID":"","MSource":"10","AlwaysOnTop":"False","OpenGame":{"ProjectWidth":960,"ProjectHeight":540,"MapID":1,"ProjectPath":"C%3a%5cUsers%5czynb0411%5cDocuments%5cAvgMakerOrange%5c%e6%88%91%e7%9a%84%e4%bd%9c%e5%93%811","FilePath":"C%3a%5cProgram%20Files%20(x86)%5c%e6%a9%99%e5%85%89%e5%88%b6%e4%bd%9c%e5%b7%a5%e5%85%b72017%5c2.4.7.0716%5cinterpreter%5cH5%5cUserData"}}}`;
可以看到當(dāng)輸入?yún)?shù)為.時(shí), 會(huì)默認(rèn)一個(gè)參數(shù)政供,是一個(gè)json字符串.
這里面有4個(gè)比較重要的參數(shù)播聪,為了防止中文亂碼,所有參數(shù)需要通過urlencode編碼布隔。犬耻,
這個(gè)可以借助在線工具進(jìn)行轉(zhuǎn)換
http://www.jsons.cn/urlencode/
Pathname: 這個(gè)是安裝程序所在目錄。解碼串為:""C:\Program Files (x86)\橙光制作工具2017\2.4.7.0716\interpreter\H5\bin/index.html?mark=pc"
ProjectName: 這個(gè)是你工程名字执泰。不用編碼。
ProjectPath: 這個(gè)是你的工程目錄渡蜻。解碼串為:C:\Users\zynb0411\Documents\AvgMakerOrange\我的作品1
FilePath: 這是是存檔目錄术吝,不修改的話,就是“C:\Program Files (x86)\橙光制作工具2017\2.4.7.0716\interpreter\H5\UserData”
了解了這些茸苇,就很簡單了
可以修改以上4個(gè)參數(shù)為你的項(xiàng)目的所在目錄(記得通過上述網(wǎng)站編碼)
在C:\Program Files (x86)\橙光制作工具2017\2.4.7.0716\interpreter\H5目錄下新建一個(gè)cmd文件run.cmd
內(nèi)容為AVG_Web_Browser .
執(zhí)行run.cmd就可以直接執(zhí)行本地的項(xiàng)目了排苍。
如果有多個(gè)項(xiàng)目的話,上面的方法就不方便了学密√匝茫可以再新建一個(gè)cmd文件,run1.cmd
參數(shù)或許你可以猜到腻暮,就是以下字符串的urlencode
{"OpenWindow":{"Width":"962","Height":"571","Pathname":"C%3a%5cProgram%20Files%20(x86)%5c%e6%a9%99%e5%85%89%e5%88%b6%e4%bd%9c%e5%b7%a5%e5%85%b72017%5c2.4.7.0716%5cinterpreter%5cH5%5cbin%2Findex.html%3Fmark%3Dpc","Local":"True","Protocol":"file:","Slashes":"True","ProjectName":"我的作品1","TitleBarStyle":"","SkipTaskbar":"False","Guid":"","Uid":"0","Gindex":"0","SessionID":"","MSource":"10","AlwaysOnTop":"False","OpenGame":{"ProjectWidth":960,"ProjectHeight":540,"MapID":1,"ProjectPath":"C%3a%5cUsers%5czynb0411%5cDocuments%5cAvgMakerOrange%5c%e6%88%91%e7%9a%84%e4%bd%9c%e5%93%811","FilePath":"C%3a%5cProgram%20Files%20(x86)%5c%e6%a9%99%e5%85%89%e5%88%b6%e4%bd%9c%e5%b7%a5%e5%85%b72017%5c2.4.7.0716%5cinterpreter%5cH5%5cUserData"}}}
也就是
%7b%22OpenWindow%22%3a%7b%22Width%22%3a%22962%22%2c%22Height%22%3a%22571%22%2c%22Pathname%22%3a%22C%253a%255cProgram%2520Files%2520(x86)%255c%25e6%25a9%2599%25e5%2585%2589%25e5%2588%25b6%25e4%25bd%259c%25e5%25b7%25a5%25e5%2585%25b72017%255c2.4.7.0716%255cinterpreter%255cH5%255cbin%252Findex.html%253Fmark%253Dpc%22%2c%22Local%22%3a%22True%22%2c%22Protocol%22%3a%22file%3a%22%2c%22Slashes%22%3a%22True%22%2c%22ProjectName%22%3a%22%e6%88%91%e7%9a%84%e4%bd%9c%e5%93%811%22%2c%22TitleBarStyle%22%3a%22%22%2c%22SkipTaskbar%22%3a%22False%22%2c%22Guid%22%3a%22%22%2c%22Uid%22%3a%220%22%2c%22Gindex%22%3a%220%22%2c%22SessionID%22%3a%22%22%2c%22MSource%22%3a%2210%22%2c%22AlwaysOnTop%22%3a%22False%22%2c%22OpenGame%22%3a%7b%22ProjectWidth%22%3a960%2c%22ProjectHeight%22%3a540%2c%22MapID%22%3a1%2c%22ProjectPath%22%3a%22C%253a%255cUsers%255czynb0411%255cDocuments%255cAvgMakerOrange%255c%25e6%2588%2591%25e7%259a%2584%25e4%25bd%259c%25e5%2593%25811%22%2c%22FilePath%22%3a%22C%253a%255cProgram%2520Files%2520(x86)%255c%25e6%25a9%2599%25e5%2585%2589%25e5%2588%25b6%25e4%25bd%259c%25e5%25b7%25a5%25e5%2585%25b72017%255c2.4.7.0716%255cinterpreter%255cH5%255cUserData%22%7d%7d%7d
不過如果你直接這么執(zhí)行以后彤守,一定會(huì)碰到一個(gè)json錯(cuò)誤。
因?yàn)樵趙indows環(huán)境下哭靖,%,是個(gè)特殊字符具垫,需要轉(zhuǎn)義,就是說凡是一個(gè)%,都要替換成2個(gè)%%
最后的run1.cmd內(nèi)容如下
AVG_Web_Browser %%7b%%22OpenWindow%%22%%3a%%7b%%22Width%%22%%3a%%22962%%22%%2c%%22Height%%22%%3a%%22571%%22%%2c%%22Pathname%%22%%3a%%22C%%253a%%255cProgram%%2520Files%%2520(x86)%%255c%%25e6%%25a9%%2599%%25e5%%2585%%2589%%25e5%%2588%%25b6%%25e4%%25bd%%259c%%25e5%%25b7%%25a5%%25e5%%2585%%25b72017%%255c2.4.7.0716%%255cinterpreter%%255cH5%%255cbin%%252Findex.html%%253Fmark%%253Dpc%%22%%2c%%22Local%%22%%3a%%22True%%22%%2c%%22Protocol%%22%%3a%%22file%%3a%%22%%2c%%22Slashes%%22%%3a%%22True%%22%%2c%%22ProjectName%%22%%3a%%22%%e6%%88%%91%%e7%%9a%%84%%e4%%bd%%9c%%e5%%93%%811%%22%%2c%%22TitleBarStyle%%22%%3a%%22%%22%%2c%%22SkipTaskbar%%22%%3a%%22False%%22%%2c%%22Guid%%22%%3a%%22%%22%%2c%%22Uid%%22%%3a%%220%%22%%2c%%22Gindex%%22%%3a%%220%%22%%2c%%22SessionID%%22%%3a%%22%%22%%2c%%22MSource%%22%%3a%%2210%%22%%2c%%22AlwaysOnTop%%22%%3a%%22False%%22%%2c%%22OpenGame%%22%%3a%%7b%%22ProjectWidth%%22%%3a960%%2c%%22ProjectHeight%%22%%3a540%%2c%%22MapID%%22%%3a1%%2c%%22ProjectPath%%22%%3a%%22C%%253a%%255cUsers%%255czynb0411%%255cDocuments%%255cAvgMakerOrange%%255c%%25e6%%2588%%2591%%25e7%%259a%%2584%%25e4%%25bd%%259c%%25e5%%2593%%25811%%22%%2c%%22FilePath%%22%%3a%%22C%%253a%%255cProgram%%2520Files%%2520(x86)%%255c%%25e6%%25a9%%2599%%25e5%%2585%%2589%%25e5%%2588%%25b6%%25e4%%25bd%%259c%%25e5%%25b7%%25a5%%25e5%%2585%%25b72017%%255c2.4.7.0716%%255cinterpreter%%255cH5%%255cUserData%%22%%7d%%7d%%7d
這樣试幽,只需要對h5目錄打包發(fā)布筝蚕,就可以本地跑起橙光2017的游戲工程了。
當(dāng)然,因?yàn)檫€需要avg_browerser的加載起宽,并不像rmmv的輸出是一個(gè)純的h5工程洲胖,可以直接打包成app.這個(gè)想必也是開發(fā)者有意為之吧。