Add dprint function, add engio.move

This commit is contained in:
2024-02-13 16:49:24 -05:00
parent 21a1cf688f
commit 3c1df4ebb9
2 changed files with 19 additions and 23 deletions

View File

@@ -900,6 +900,21 @@ LuaDefine(print, "obj1, obj2, ...",
return 0; return 0;
} }
LuaDefine(dprint, "obj1, obj2, ...",
"|Print object or objects on the debug console.") {
std::ostringstream oss;
LuaCoreStack LS(L);
int n = lua_gettop(L);
for (int i = 1; i <= n; i++) {
LuaSpecial root(i);
atomic_print(LS, root, false, &oss);
if (i < n) oss << " ";
}
oss << std::endl;
util::dprintview(oss.str());
return 0;
}
LuaDefine(doc, "function", LuaDefine(doc, "function",
"|Print documentation for specified function.") { "|Print documentation for specified function.") {
World *w = World::fetch_global_pointer(L); World *w = World::fetch_global_pointer(L);

View File

@@ -25,30 +25,10 @@ function login.cb_becomeplayer(actor, place, dialog)
tangible.animate(actor,{action="warp",plane="main",x=0,y=0,z=0}) tangible.animate(actor,{action="warp",plane="main",x=0,y=0,z=0})
end end
function login.cb_p123(actor, place, dialog)
print(1)
wait(1)
print(2)
wait(1)
print(3)
end
function login.cb_p123_nopredict(actor, place, dialog) function bechar()
nopredict()
print(1)
wait(1)
print(2)
wait(1)
print(3)
end
function gosomewhere()
local a = tangible.actor() local a = tangible.actor()
tangible.animate(a, {plane="somewhere"}) tangible.animate(a, nil, {bp="TangibleCharacter", xyz={0,0,90}})
end
function mkt()
return tangible.build{class="login", animstate={plane="somewhere", xyz={1,2,3}}}
end end
makeclass("engio") makeclass("engio")
@@ -59,7 +39,8 @@ function engio.myfunction(actor, place, a, b, c)
pprint("C:", c) pprint("C:", c)
end end
function engio.moveto(actor, place, action, xyz) function engio.move(actor, place, action, xyz)
-- todo: sanity check the action and xyz. -- todo: sanity check the action and xyz.
dprint("engio.move ", action, " ", xyz)
tangible.animate(actor, nil, {action=action, xyz=xyz}) tangible.animate(actor, nil, {action=action, xyz=xyz})
end end