Coder Social home page Coder Social logo

moehero's People

Contributors

actboy168 avatar chouun avatar sumneko avatar zhongying1995 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moehero's Issues

使用lua引擎的问题

使用了lua引擎是否可以保存游戏,装载多人模式存档,如果现在没有,有什么方法可以实现吗

部分引用找不到

1:资源保护.lua里13行,fs变量不存在。对应的是bee.filesystem,我手动引入了一下可以成功运行脚本。

2:create_army.lua里27行,根据名称创建单位,ac.lni.unit[name]。ac存在,ac.lni存在,ac.lni.unit不存在。

3:map_shop.lua里10行,unit:set_size(4),提示unit不存在,这个从语法上看是没问题的,不存在不知道为什么。

4:creep_create.lua里58行,根据名称创建单位,local data = ac.lni.unit[name],问题同第二个问题。拿不到数据。

5:把以上创建单位的代码都注释掉之后在运行,成功进入到游戏,选择了一个单位,模型被替换成了步兵(因为手动引用了文件系统),但是取消单位选择会报错,报错参数u为nil的错误,但是不会崩溃。对应代码位置是select.lua里,23行的函数参数。

因为同时出现这么多变量没有赋值的情况,所以我在思考不是代码写错了,这些变量应该是代码生成的。但是我这里却没有。
所以我希望作者能解惑一下这个问题,这个单纯是没引用函数还是打包流程有问题。如果是我打包流程出现问题,希望能说一下打包的准备工作应该做哪些。

BUG反馈:最新分支无法通过YDWE 1.31.8进行基于VSCode Lua Debug的Debug

在此版本下fork后执行Task“运行”无法进入地图(会启动游戏但仅在开始界面)。
直接使用命令 ydweconfig.exe -launchwar3 -loadfile "d:\moehero\moehero.w3x" -debugger 4278 亦无法进入地图,修改为 ydweconfig.exe -launchwar3 -loadfile "d:\moehero\moehero.w3x" 后可启动地图,但无法使用VSCode进行Debug。

注:运行前已执行“生成”命令。

双击make.bat无法生存正确的地图

显示以下信息:

找不到 C:\Users\Administrator\Desktop\MoeHero-master\map\lua\currentpath.lua
C:\Users\Administrator\Desktop\MoeHero-master\tools\bin\lua.exe: ...sers\Administrator\Desktop\MoeHero-master\tools\make.lua:8: module 'utility' not found:
no field package.preload['utility']
no file 'C:\Users\Administrator\Desktop\MoeHero-master\tools\bin\lua\utility.lua'
no file 'C:\Users\Administrator\Desktop\MoeHero-master\tools\bin\lua\utility\init.lua'
no file 'C:\Users\Administrator\Desktop\MoeHero-master\tools\bin\utility.lua'
no file 'C:\Users\Administrator\Desktop\MoeHero-master\tools\bin\utility\init.lua'
no file 'C:\Users\Administrator\Desktop\MoeHero-master\tools\bin..\share\lua\5.3\utility.lua'
no file 'C:\Users\Administrator\Desktop\MoeHero-master\tools\bin..\share\lua\5.3\utility\init.lua'
no file '.\utility.lua'
no file '.\utility\init.lua'
no file 'C:\Users\Administrator\Desktop\MoeHero-master\tools\bin..\w3x2lni\script\utility.lua'
no file 'C:\Users\Administrator\Desktop\MoeHero-master\tools\bin\utility.dll'
no file 'C:\Users\Administrator\Desktop\MoeHero-master\tools\bin..\lib\lua\5.3\utility.dll'
no file 'C:\Users\Administrator\Desktop\MoeHero-master\tools\bin\loadall.dll'
no file '.\utility.dll'
no file 'C:\Users\Administrator\Desktop\MoeHero-master\tools\bin..\w3x2lni\bin\utility.dll'
stack traceback:
[C]: in function 'require'
...sers\Administrator\Desktop\MoeHero-master\tools\make.lua:8: in main chunk
[C]: in ?

模拟投射物会造成异步吗

目前只能定位到这块代码导致异步

function mt:range_attack_start(data)
	--发射一个弹道
	local target = data.target
	local size = self:get_size()
	local start = self:get_launch_point()
	local speed = self.missile_speed or (self.weapon and self.weapon['弹道速度']) or self:get_slk('Missilespeed_1', 0)
	local arc = self.weapon and self.weapon['弹道弧度'] or self:get_slk('Missilearc_1', 0)
	local mover_data = ac.mover.target
	{
		source = self,
		start = start,
		target = target,
		path = true,
		speed = speed,
		model = self.missile_art or (self.weapon and self.weapon['弹道模型']) or self:get_slk 'Missileart_1',
		height = self:get_point() * target:get_point() * arc,
		damage = data.damage,
		size = size,
		skill = false,
		need_elevation = self:is_type('英雄'),
	}

	-- 弹道击中目标时造成伤害
	function mover_data:on_finish()
		if self.target:is_alive() then
			data.missile = mover_data.mover
			self.source:attackDamage(data)
		end
	end

	if speed <= 0 then
		mover_data.mover:set_position(target:get_point(), true)
		mover_data.mover:set_high(mover_data.target_high)
		mover_data:on_finish()
		mover_data:remove()
	end
end

希望能补全一下文件

Executing task: "chcp 65001 && "C:\War3\demo\201904/tools/w3x2lni/bin/w3x2lni-lua.exe"" .\tools\运行.lua C:\War3\demo\201904 <

Active code page: 65001
C:\War3\demo\201904/tools/w3x2lni/bin/w3x2lni-lua.exe: .\tools\运行.lua:1: module 'bee.filesystem' not found:
no field package.preload['bee.filesystem']
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\lua\bee\filesystem.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\lua\bee\filesystem\init.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee\filesystem.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee\filesystem\init.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\share\lua\5.3\bee\filesystem.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\share\lua\5.3\bee\filesystem\init.lua'
no file '.\bee\filesystem.lua'
no file '.\bee\filesystem\init.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee\filesystem.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\lib\lua\5.3\bee\filesystem.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\loadall.dll'
no file '.\bee\filesystem.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\lib\lua\5.3\bee.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\loadall.dll'
no file '.\bee.dll'
stack traceback:
[C]: in function 'require'
.\tools\运行.lua:1: in main chunk
[C]: in ?
终端进程已终止,退出代码: 1

终端将被任务重用,按任意键关闭。

Executing task: "chcp 65001 && "C:\War3\demo\201904/tools/w3x2lni/bin/w3x2lni-lua.exe" -e "package.cpath=package.cpath..';'..[[C:\War3\demo\201904/tools/?.dll]]"" .\tools\语法检查.lua C:\War3\demo\201904 --watch <

Active code page: 65001
C:\War3\demo\201904/tools/w3x2lni/bin/w3x2lni-lua.exe: .\tools\语法检查.lua:1: module 'bee.filesystem' not found:
no field package.preload['bee.filesystem']
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\lua\bee\filesystem.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\lua\bee\filesystem\init.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee\filesystem.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee\filesystem\init.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\share\lua\5.3\bee\filesystem.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\share\lua\5.3\bee\filesystem\init.lua'
no file '.\bee\filesystem.lua'
no file '.\bee\filesystem\init.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee\filesystem.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\lib\lua\5.3\bee\filesystem.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\loadall.dll'
no file '.\bee\filesystem.dll'
no file 'C:\War3\demo\201904/tools/bee\filesystem.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\lib\lua\5.3\bee.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\loadall.dll'
no file '.\bee.dll'
no file 'C:\War3\demo\201904/tools/bee.dll'
stack traceback:
[C]: in function 'require'
.\tools\语法检查.lua:1: in main chunk
[C]: in ?
终端进程已终止,退出代码: 1

终端将被任务重用,按任意键关闭。

Executing task: "chcp 65001 && "C:\War3\demo\201904/tools/w3x2lni/bin/w3x2lni-lua.exe"" .\tools\运行.lua C:\War3\demo\201904 <

Active code page: 65001
C:\War3\demo\201904/tools/w3x2lni/bin/w3x2lni-lua.exe: .\tools\运行.lua:1: module 'bee.filesystem' not found:
no field package.preload['bee.filesystem']
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\lua\bee\filesystem.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\lua\bee\filesystem\init.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee\filesystem.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee\filesystem\init.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\share\lua\5.3\bee\filesystem.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\share\lua\5.3\bee\filesystem\init.lua'
no file '.\bee\filesystem.lua'
no file '.\bee\filesystem\init.lua'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee\filesystem.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\lib\lua\5.3\bee\filesystem.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\loadall.dll'
no file '.\bee\filesystem.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\bee.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin..\lib\lua\5.3\bee.dll'
no file 'C:\War3\demo\201904\tools\w3x2lni\bin\loadall.dll'
no file '.\bee.dll'
stack traceback:
[C]: in function 'require'
.\tools\运行.lua:1: in main chunk
[C]: in ?
终端进程已终止,退出代码: 1

在哪里看打包的错误日志

Active code page: 65001
完毕,用时 4.590 秒
100%[====================]
1 个错误,0 条警告

Press any key to close the terminal.

同步函数问题

MoeHero/scripts/types/sync.lua文件下的sync函数为何限制只能36个同时运行,有什么特殊的说法吗,我想改成无限制的,会出现什么问题

求助如何调试地图

vs 检查语法提示

Executing task: """chcp 65001 && "D:\War Dev\Map\MoeHero-master\tools\w3x2lni\bin\w3x2lni-lua.exe"" .\tools\语法检查.lua "D:\War Dev\Map\MoeHero-master""" <

Active code page: 65001
文件名、目录名或卷标语法不正确。
终端进程已终止,退出代码: 1

终端将被任务重用,按任意键关闭。
win10

git submodule update --init --recursive 执行完毕还是有问题

Executing task in folder MoeHero: 'chcp 65001 && "D:\war3_project\MoeHero/tools/w3x2lni/bin/w3x2lni-lua.exe"' .\tools\运行.lua D:\war3_project\MoeHero <

/usr/bin/bash: chcp 65001 && "D:\war3_project\MoeHero/tools/w3x2lni/bin/w3x2lni-lua.exe": No such file or directory
终端进程已终止,退出代码: 127

终端将被任务重用,按任意键关闭。

点击运行终端显示 也检查过是否存在这个程序

老图中使用lua调用cj部分关键函数魔兽程序崩溃

@sumneko 我把 MoeHero 项目的一部分代码加入了一张slk优化过的老图中

  • scripts/main.lua
local function main()
    require 'war3.id'
    require 'war3.api'
    require 'util.log'
    -- 当导入这个模块里面导入的 'ac.timer' 模块 85行调用cj的计时器函数发生了崩溃
    require 'ac.init'
    require 'util.error'
   -- 我自定义的触发
    require 'test.main'
end
  • scripts/test/main.lua
local CJ = require 'jass.common'
local message = require 'jass.message'

local trig = CJ.CreateTrigger()
local g = require 'jass.globals'

CJ.TriggerRegisterPlayerEvent(trig,CJ.Player(0),g.EVENT_PLAYER_END_CINEMATIC)
-- ESC 调用时崩溃
CJ.TriggerAddCondition( trig,
    CJ.Condition(
        function()
            print("test")
            return true
        end
    )
)
CJ.TriggerAddAction(trig,function()
    local x, y = message.mouse()
        print(x, y)
    end
)

一开始我以为是那行代码引起的问题,当我把require 'ac.init'注释后,此时可以进游戏了,但当我调用自己编写的触发函数时发现一样会崩溃,确定了问题出在当我调用 'jass.common' 模块中 计时器和触发事件动作就会发生崩溃。

1

这个崩溃问题只在一张老图中出现,图本身是加密过的,我是通过注入部分文件实现lua功能,但是我在ydwe中新创建的地图注入同样的代码并不会发生程序崩溃。

  • jass.globals 全局函数全部能读取说明接口是没问题的
  • Player(n) 之类的函数也能用

以下三个函数都会崩溃

TimerStart
TriggerRegisterPlayerEvent
TriggerAddAction

好像出现问题的地方都是因为使用了匿名函数,能力有限不知道具体原因是什么。

2020.6.19

经过多次排查最后发现问题是发生在 war3map.j 文件中的主入口 mian 函数里面的

  • war3map.j
mian
   xxx
   call Cheat("exec-lua:lua.base")
   call InitGlobals()
   // 问题出在这里 初始化游戏触发
   call InitCustomTriggers()
   xxx

最后定位到崩溃的地方,是在初始化触发中的一个很普通的触发函数体内,里面的一句call TriggerRegisterPlayerEvent引发的报错,但这句代码本身没有问题。我测试过即便是我重新定义的触发器也会报错。
会不会是触发数量过多导致下标溢出?初始化触发的数量大概140+ 左右。

出现0血怪或无敌怪的bug问题

之前听说你处理了无敌状态,但是问题不是无敌的问题 而是这框架有个bug

在types\unit.lua里 当一个单位被 杀死后 假如的身上带有物品 会先执行
unit:remove() 再响应 war3触发器 例如 丢弃物品事件 此时因为已经被remove了 而lua中关于该单位的handle的数据信息都被完全清空了,这时丢弃物品事件再次传进这个handle 会生成一个 新的lua unit对象 而 该handle则被魔兽回收,直到魔兽重新创建一个 handle 与之前相同的 单位出来 此时就会响应这个bug

lua表中储存着一个无效的 handle 的unit对象
此时创建单位传进一个handle 被认为是已创建的旧对象 而不会响应 单位-创建 事件
而导致该单位没有注册伤害事件, 所以独立于伤害系统之外,故此 是无敌怪

而0血怪也是相同 是 重新创建的时候 被旧的单位对象的生命值属性 刷新 到了新的单位之上

处理方法 当 remove 单位的时候 把这个handle 放入到一个 无效的handle表里
当 CreateUnit的时候 将handle 从无效表中排除
当 init_unit的时候 判断 handle是否在无效表中 是则 return nil 即可

正常模式无法加载到lni.dll模块

项目打包之后单机模式无法运行,提示找不到应用程序 lni.dll
但是在YDWE的测试环境是可以加载到lni.dll的

尝试把 YDWE配置程序-系统关联-注册表-允许魔兽读取本地文件 功能关闭之后
凡是涉及到单位的加载问题都会报错

关于dll签名dll.sign的问题

因为要在lua层实现网络访问,需要加载socket库的core.dll,发现在19年1月2号的commit里有调用debugger.dll的地方
照葫芦画瓢发现好像需要给dll签名生成dll.sign才可以调用,tools文件夹里找到了rsa的签名工具,但是不知道使用的私钥和公钥需要在哪里生成以及公钥怎么导入到地图里

魔法书释放问题

目的:可以使用message释放魔法书里的技能,让魔法书里的通魔技能瞬态模拟释放
遇到了释放魔法书里的技能时,message函数无效

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.