• 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++ Creature:stopWalk()

River KA

Veteran OT User
Joined
Feb 1, 2010
Messages
529
Solutions
27
Reaction score
328
I was trying to make an function to stop the creature walking on TFS 1.2, but I just can't do that. Nothing works.
I appreciate any help to create a function that stops the creature walking. I am a coder also of C++.

Example:
1. A player clicked to walks to a far point. While walking, you execute this function on player:stopWalk(). It should stop the player and cancel the walking event.
2. A scripted monster walks to a far point (because all movements are coded, not just as normal monsters that are always walking). Then, the same should happen as the player example.

To me, only a Player:stopWalk() is enough, but I would like to be able to use this to scripted monsters also, so it's interesting to have a function Creature:stopWalk() instead.

Note:
I tried of of these already, but none worked properly.
C++:
player->setNextActionTask(nullptr);
player->setNextWalkTask(nullptr);
player->onWalkAborted();
player->stopEventWalk();
player->stopWalk();

The only one that worked almost as I wanted to, was the function creature->stopEventWalk() that really stops the creature and cancel the walking event, but you need to click to move 2 times to make your character move, don't know why.

Thanks in advance.


Regards,
River.
 
Last edited:
I don't need an event for stop the movement, what I need is a function to stop it.
I will use the stop walking function inside another event.
I made an action that, when got error, should stop the player movement.
Did you understand now?

I was trying to make an function to stop the creature walking on TFS 1.2, but I just can't do that. Nothing works.
I appreciate any help to create a function that stops the creature walking. I am a coder also of C++.

If you want that you to implement a code like those I posted, you can use one of those, write your own or wait for someone to update it (once again the bounty).
And the reason is because we don't have any stopMove functions, you might be able to teleport the player to "fromPosition" but that might not stop the auto walk.
 
Back
Top