You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example is more complicated and should be able to cover many usage conditions. If this example can be debugged, many examples will be debugged.
More special points.
Directory problem, the debug directory structure is as follows.
The compiled exe is in the Debug directory, and the script is loaded as the upper-level directory of the exe.
Calling method
The calling method in C++ is as follows.
CRole* poRole = CRoleMgr::Instance()->CreateRole();
poRole->SetName("andy");
poRole->SetHp(9999);
poRole->SetMp(9999);
unsigned int dwTaskID = 100;
LResultINT oResult(-1);
oDMLuaEngine.Call("script.task.task.AcceptTask", poRole, dwTaskID, &oResult);
seeall
The seeall attribute is set in the script. I don't know if it will affect it.
module (..., package.seeall)
Your help is very much needed.
The text was updated successfully, but these errors were encountered:
if role:AcceptTask(taskid) then
ret.value = 0
print("AcceptTask ret = " .. math.ceil(ret.value))
else
ret.value = -1
print("AcceptTask ret = " .. math.ceil(ret.value))
end
print("###################################")
end
function FinishTask(role, taskid)
print("==================================")
print("Player Name = " .. role:GetName())
print("FinishTask taskid = " .. taskid)
print("==================================")
role:FinishTask(taskid)
end
I've improved file path search in the extension, but script names in your application (for example, .\script\task\task.lua) cannot be found relative the the executable (in .\bin\Debug) or relative to the launch working directory (.\build)
In the upcoming v0.9.6 update, you can use 'Show Script list' menu item to see the issue:
You should add lua_dkm_debug.json file with additional search path, for example:
{
"ScriptPaths": [
"../bin/"
]
}
The debugger will then be able to link scripts to files:
Hello, the problem has been solved. Thank you very much.
I still have a small question here. Can this be customized globally for the search path? Just don’t use each Each project is to set the way to retrieve the path.
In addition, if the plug-in can obtain the search path of Lua, wouldn't it be more convenient. Because as long as it can be compiled and run, the Lua file can definitely be retrieved. Of course, I may not know the details of the implementation. It is for reference only.
Case address: https://github.com/brinkqiang/dmlua
This example is more complicated and should be able to cover many usage conditions. If this example can be debugged, many examples will be debugged.
More special points.
The compiled exe is in the Debug directory, and the script is loaded as the upper-level directory of the exe.
Calling method
The calling method in C++ is as follows.
CRole* poRole = CRoleMgr::Instance()->CreateRole();
poRole->SetName("andy");
poRole->SetHp(9999);
poRole->SetMp(9999);
unsigned int dwTaskID = 100;
LResultINT oResult(-1);
oDMLuaEngine.Call("script.task.task.AcceptTask", poRole, dwTaskID, &oResult);
seeall
The seeall attribute is set in the script. I don't know if it will affect it.
module (..., package.seeall)
Your help is very much needed.
The text was updated successfully, but these errors were encountered: