Game Development Community

onPlayerStopped

by Tim Reinermann · in Torque 3D Professional · 10/08/2009 (3:36 pm) · 5 replies

Hi everyone,

I need to be informed, when my Player stops (and perhaups starts) walking. I want to change some advanced camera settings in these cases.

I was thinking about a Callback to Console from Players onProcessTick(Move* move), if move is NULL or NullMove. But this would give me callback each tick the player isn't moving.

Has anyone an idea how this could be done in a smart way?

regards

#1
10/08/2009 (4:13 pm)
There should still be a OnReachedDestination callback, would that work?
#2
10/08/2009 (5:09 pm)
A player being controlled by a client will always receive a move, even if you're not moving. You might want to check the player's velocity and the content of the move (to check if the player is inputting directions or not).
#3
10/08/2009 (5:20 pm)
Hi

thx for your replies :)

@Ryan
I think OnReachedDestination is for AI Controlled movement

@Manoel
yes, thats the problem. I would get a onStopped on every tick the player isn't moving. I could do a flag in player that callback was fired and then do not fire it again. When player moves again I could reset that flag, so the callback gets fired nexttime the player stops.

I was kind of hoping there is a better solution out there ...
#4
10/08/2009 (6:16 pm)
DOH!, yep need to read the post better.
#5
10/11/2009 (7:52 pm)
I ended up in Implementing an own Object derived from Player. It analyses the move struct to find out if the player is moving or not, and triggers the callbacks.