• 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!

C++ move the monster back to own spawn position

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,480
Solutions
9
Reaction score
211
Hello, I'm trying make the monsters walk back to the spawn positiion when the target list is empty
I'm using the function from @Marcelo Druida
Code:
https://otland.net/threads/creature-moveto-position.237960/
AS BASE to try move the monsters
then in monster.cpp
void onThink()
Code:
           } else if (targetList.empty() && randomSteping) {
                std::cout << "TEST" << std::endl;
                FindPathParams fpp;
                fpp.minTargetDist = masterPos.x;
                fpp.maxTargetDist = masterPos.y;
                fpp.fullPathSearch = true;
                fpp.clearSight = true;
                fpp.maxSearchDist = 150;

                std::forward_list<Direction> dirList;
                if (getPathTo(masterPos, dirList, fpp)) {
                    hasFollowPath = true;
                    startAutoWalk(dirList);
                    std::cout << "TEST 2" << std::endl;
                }
            }
the try print TEST works but the TEST 2 don't
 
Last edited:
Have you tried to stop the random dances from happening before hand? See Monster::getNextStep function.
 
Have you tried to stop the random dances from happening before hand? See Monster::getNextStep function.
I guess that it solve what you're talking about
Code:
randomSteping = false;
I'm not sure, but seems that randomSteping handle with it
 
Back
Top