diff --git "a/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/Lua-\345\257\274\345\205\245\345\244\226\351\203\250\350\204\232\346\234\254.w3x" "b/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/Lua-\345\257\274\345\205\245\345\244\226\351\203\250\350\204\232\346\234\254.w3x" index e617077be..18096786c 100644 Binary files "a/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/Lua-\345\257\274\345\205\245\345\244\226\351\203\250\350\204\232\346\234\254.w3x" and "b/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/Lua-\345\257\274\345\205\245\345\244\226\351\203\250\350\204\232\346\234\254.w3x" differ diff --git "a/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/Lua-\350\256\241\346\227\266\345\231\250-\345\234\243\345\205\211.w3x" "b/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/Lua-\350\256\241\346\227\266\345\231\250-\345\234\243\345\205\211.w3x" index dd8d6ec71..a01e1ab80 100644 Binary files "a/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/Lua-\350\256\241\346\227\266\345\231\250-\345\234\243\345\205\211.w3x" and "b/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/Lua-\350\256\241\346\227\266\345\231\250-\345\234\243\345\205\211.w3x" differ diff --git "a/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/blizzard.lua" "b/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/blizzard.lua" index 9659f9ffe..e84df558b 100644 --- "a/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/blizzard.lua" +++ "b/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/blizzard.lua" @@ -1,6 +1,6 @@ -- 简易的blizzard.lua,若需要完整的blizzard.lua,可以使用jass2lua工具,自行转换。 -local CJ = jass +local CJ = require "jass.common" local BJ = {} BJ.bj_MAX_PLAYER_SLOTS = 16 diff --git "a/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/main.lua" "b/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/main.lua" index 6282add15..9054fc239 100644 --- "a/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/main.lua" +++ "b/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/main.lua" @@ -1,4 +1,4 @@ -local CJ = jass +local CJ = require "jass.common" local BJ = require "blizzard.lua" local trig = CJ.CreateTrigger() diff --git "a/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/runtime_init.lua" "b/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/runtime_init.lua" index cce7067fd..cfcb2300d 100644 --- "a/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/runtime_init.lua" +++ "b/Development/Editor/Component/example(\346\274\224\347\244\272\345\234\260\345\233\276)/JAPI/lua/runtime_init.lua" @@ -1,11 +1,13 @@ +local runtime = require "jass.runtime" + -- 寮鍚竴涓皟璇曠獥鍙o紝鐢ㄤ簬鏄剧ず璋冭瘯淇℃伅锛屾寮忕殑鐗堟湰璇峰幓鎺夈 -- 娉細鑻ュ湪鏈枃浠跺唴鏈夎娉曢敊璇紝杩欒浠g爜灏变笉浼氳鎵ц锛岃娉曢敊璇篃鏃犳硶鏄剧ず銆傛墍浠 -- 闇瑕佸湪涓鍒囬兘寮濮嬪墠锛屾墽琛屽畠锛涘苟纭繚鏈枃浠跺唴娌℃湁閿欒銆 -jass_ext.runtime.console = true +runtime.console = true -- 娉ㄥ唽閿欒鍥炶皟鍑芥暟锛屽綋鎵цlua鍙戠敓閿欒鏃讹紝浼氳皟鐢ㄦ鍑芥暟銆 -- 娉細娉ㄥ唽姝ゅ嚱鏁颁細鐣ュ井澧炲姞杩愯鏃舵秷鑰楋紙鍗充娇娌℃湁鍙戠敓閿欒锛夈 -function jass_ext.runtime.error_handle(msg) +function runtime.error_handle(msg) print("---------------------------------------") print(" LUA ERROR ") print("---------------------------------------") @@ -15,7 +17,7 @@ function jass_ext.runtime.error_handle(msg) end -- --- 璁惧畾璋冪敤cj鍑芥暟杩斿洖鐨刪andle鐨則ype銆(榛樿鍊间负1) +-- 璁惧畾璋冪敤cj鍑芥暟杩斿洖鐨刪andle鐨則ype銆(榛樿鍊间负2) -- 瀹夊叏鎬т緷娆¢掑锛屽悓鏃舵晥鐜囦篃浼氫緷娆′笅闄嶃 -- 0锛 杩斿洖number銆 ---- 娌℃湁浠讳綍棰濆鐨勫畨鍏ㄦф帶鍒躲 @@ -28,9 +30,15 @@ end ---- lua鎸佹湁handle鏃朵細澧炲姞handle鐨勫紩鐢ㄨ鏁帮紝骞跺湪__gc鍏冩柟娉曚腑閲婃斁handle銆 ---- 0涓嶅啀鑳借闅愬紡杞崲涓簄il锛屽搴攋ass閲岀殑null璇蜂娇鐢╪il銆 -- -jass_ext.runtime.handle_level = 1 +runtime.handle_level = 2 -- 寮鍚椤(榛樿寮鍚)锛岃皟鐢╦ass.xxx/japi.xxx鍙戠敓宕╂簝鏃讹紝浼氱敓浜т竴涓猯ua閿欒锛屽苟蹇界暐杩欎釜宕╂簝銆 -- 浣犲彲浠ユ敞鍐宩ass_ext.runtime.error_handle锛屾潵鑾峰緱杩欎釜閿欒銆 -- 娉細寮鍚椤逛細鐣ュ井澧炲姞杩愯鏃舵秷鑰楋紙鍗充娇娌℃湁鍙戠敓閿欒锛夈 -jass_ext.runtime.catch_crash = true +runtime.catch_crash = true + +-- 姝ら」榛樿涓哄紑鍚俢ommon.j涓寘鍚玸leep鎿嶄綔鐨勫嚱鏁版湁4涓紝TriggerSleepAction/TriggerSyncReady +-- /TriggerWaitForSound/SyncSelections銆傚綋姝ら」涓篺alse鏃讹紝lua寮曟搸浼氬拷鐣ヨ繖4涓嚱鏁扮殑璋冪敤锛屽苟缁 +-- 浜堣繍琛屾椂璀﹀憡銆傚綋姝ら」涓簍rue鏃讹紝杩4涓嚱鏁板皢浼氬緱鍒版纭殑鎵ц銆 +-- 娉細寮鍚椤逛細澧炲姞杩愯鏃舵秷鑰楋紝鍗充娇浣犳病鏈変娇鐢ㄨ繖4涓嚱鏁般 +runtime.sleep = true diff --git a/Development/Editor/Component/plugin/YDTrigger/YDTrigger.h b/Development/Editor/Component/plugin/YDTrigger/YDTrigger.h index b9446cb36..06f81d659 100644 --- a/Development/Editor/Component/plugin/YDTrigger/YDTrigger.h +++ b/Development/Editor/Component/plugin/YDTrigger/YDTrigger.h @@ -41,13 +41,13 @@ # include # define YDWEGetObjectProperty(object_type, object_id, property) \ YDTRIGGER_COMMON_SWITCH(YDWE_GET_OBJECT_PROPERTY_ ## object_type, ( \ - EXExecuteScript("slk.ability[" + I2S(object_id) + "]." + property), \ - EXExecuteScript("slk.buff[" + I2S(object_id) + "]." + property), \ - EXExecuteScript("slk.unit[" + I2S(object_id) + "]." + property), \ - EXExecuteScript("slk.item[" + I2S(object_id) + "]." + property), \ - EXExecuteScript("slk.upgrade[" + I2S(object_id) + "]." + property), \ - EXExecuteScript("slk.doodad[" + I2S(object_id) + "]." + property), \ - EXExecuteScript("slk.destructable[" + I2S(object_id) + "]." + property), \ + EXExecuteScript("(require'jass.slk').ability[" + I2S(object_id) + "]." + property), \ + EXExecuteScript("(require'jass.slk').buff[" + I2S(object_id) + "]." + property), \ + EXExecuteScript("(require'jass.slk').unit[" + I2S(object_id) + "]." + property), \ + EXExecuteScript("(require'jass.slk').item[" + I2S(object_id) + "]." + property), \ + EXExecuteScript("(require'jass.slk').upgrade[" + I2S(object_id) + "]." + property), \ + EXExecuteScript("(require'jass.slk').doodad[" + I2S(object_id) + "]." + property), \ + EXExecuteScript("(require'jass.slk').destructable[" + I2S(object_id) + "]." + property), \ )) # define YDWEGetObjectPropertyInteger(type, id, prop) S2I(YDWEGetObjectProperty(type, id, prop)) # define YDWEGetObjectPropertyReal(type, id, prop) S2R(YDWEGetObjectProperty(type, id, prop))