diff --git a/luprex/cpp/core/world-accessor.cpp b/luprex/cpp/core/world-accessor.cpp index 8fba0bda..c43b4d52 100644 --- a/luprex/cpp/core/world-accessor.cpp +++ b/luprex/cpp/core/world-accessor.cpp @@ -900,6 +900,21 @@ LuaDefine(print, "obj1, obj2, ...", 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", "|Print documentation for specified function.") { World *w = World::fetch_global_pointer(L); diff --git a/luprex/lua/login.lua b/luprex/lua/login.lua index 6ef8285b..526b5c7a 100644 --- a/luprex/lua/login.lua +++ b/luprex/lua/login.lua @@ -25,30 +25,10 @@ function login.cb_becomeplayer(actor, place, dialog) tangible.animate(actor,{action="warp",plane="main",x=0,y=0,z=0}) 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) - nopredict() - print(1) - wait(1) - print(2) - wait(1) - print(3) - end - -function gosomewhere() +function bechar() local a = tangible.actor() - tangible.animate(a, {plane="somewhere"}) - end - -function mkt() - return tangible.build{class="login", animstate={plane="somewhere", xyz={1,2,3}}} + tangible.animate(a, nil, {bp="TangibleCharacter", xyz={0,0,90}}) end makeclass("engio") @@ -59,7 +39,8 @@ function engio.myfunction(actor, place, a, b, c) pprint("C:", c) end -function engio.moveto(actor, place, action, xyz) +function engio.move(actor, place, action, xyz) -- todo: sanity check the action and xyz. + dprint("engio.move ", action, " ", xyz) tangible.animate(actor, nil, {action=action, xyz=xyz}) end