• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Function moveCreatureTo(cid,pos[,mindist[,maxdist]])

i never can use with summons mock... and today are a function in tfs named "doSteerCreature" is not the same?
 
It's dont works with summons,

function onUse(cid, item, fromPosition, itemEx, toPosition)
moveCreatureTo(getCreatureSummons(cid)[1], toPosition, 1, 1)
return true
end

My Summon only walk 1 sqm, and isnot a correct sqm.
 
ppl are just retards. of course it dont work with summons. you have FIRST to disable the followup of the summon. This funcion just make a route towards the positions. But if anything cancel the movement it stops. You should try using it with npcs or still creatures
 
ppl are just retards. of course it dont work with summons. you have FIRST to disable the followup of the summon. This funcion just make a route towards the positions. But if anything cancel the movement it stops. You should try using it with npcs or still creatures
omg mock is here!
 
After you commented Streamside everything bugged up in New posts.

64IPr43.png
 
someone can help rewrite this in tfs 1.x?

scratch:
Code:
int32_t LuaScriptInterface::luaMoveCreatureTo(lua_State* L)
{
  //creature:moveCreatureTo(pos)
   Creature* creature = getUserdata<Creature>(L, 1);
   if (!creature) {
     lua_pushnil(L);
     return 1;
   }

   const Position& position = getPosition(L, 2);

   FindPathParams fpp;
   fpp.minTargetDist = getNumber<int32_t>(L, 3, 0);
   fpp.maxTargetDist = getNumber<int32_t>(L, 4, 1);
   fpp.fullPathSearch = getBoolean(L, 5, fpp.fullPathSearch);
   fpp.clearSight = getBoolean(L, 6, fpp.clearSight);
   fpp.maxSearchDist = getNumber<int32_t>(L, 7, fpp.maxSearchDist);

   std::forward_list<Direction> dirList;
   if (creature->getPathTo(position, dirList, fpp)) {
     creature->startAutoWalk(dirList);     
     pushBoolean(L, true);
   }
   else { pushBoolean(L, false); }
   return 1;
}
 
Last edited:
Back
Top