NI的wiki对函数的解释对新手不是特别友好,比如ni.objects的参数实在是看不懂
[Lua] 纯文本查看 复制代码 The object manager also features a set of functions and special way to provide an object oriented type programming for the lua. All of the way to access this feature is via . Functions, variables and examples are as follows:ni.objects
[Lua] 纯文本查看 复制代码 local tar = ni.objects["target"];
if tar:exists() then
print(tar.guid) --Would print the GUID of the target
end
上图代码中的ni.objects["target"]是指当前目标,就没有别的参数吗?
我看了下贾维斯的挂机通用脚本,他是通过事件来获取尸体的guid,然后写入表中,离开战斗后对表中尸体的guid进行互动(拾取)
我想写一个拾取物品的功能,按理说ni.objects就是周围所有对象,应该包括尸体,遍历这个表应该就能找到,但是苦于不知道这个函数怎么用,望指点一二 |