Game Development Community

playThread animation

by Jake london · in Torque 3D Beginner · 11/28/2010 (3:12 pm) · 18 replies


I'm attempting to play some small animation with the below code:

%test1.playThread(0,spinwheel);

Its a basic animation which spins a wheel attached to a wall to whoever is within scope. The strange part is that it works when one client is connected to a dedicated server, but when the second client connects, the newly connected player sees the animation alright, but the animation will not work for the first connected player..

once the second client disconnects, the first player is able to see the animation..

its confusing, pleaseeee help

#1
11/28/2010 (9:07 pm)
What is %test1?
Are you using something like this:
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
   %player = ClientGroup.getObject(%i).player;
   .
   .
   .
}
#2
11/30/2010 (7:49 pm)
%test1 is an object derived from a shapebase. I've searched some articles and it seems that unpackupdate() has some issue with playThread.

thanks for the reply :)
#3
11/30/2010 (11:26 pm)
Ok, and you're trying to show the animation only to certain clients? How are you doing that?
#4
12/01/2010 (5:50 pm)
no to all clients.. thats the issue. I thought that playThread would trigger an animation to all clients within scope.. but its not.. it just sends it to one client and there is no pattern to it.

So my understanding is/was that to play an animation to all clients for object Id 1234 where 1234 = %test1..

.. id need to run %test1.playThread(0,spinwheel); on the server. Works fine, but when second client connects, first one sees nothing, upon disconnection of second, first client gets to see the animation working again.

Thanks!!

#5
12/01/2010 (5:56 pm)
.. any clients within scope obviously.
#6
12/01/2010 (11:31 pm)
Are you calling playThread on the server-side?
#7
12/02/2010 (8:50 am)
yes i am.

tnx
#8
12/03/2010 (7:04 am)
Jonathan, any ideas pls?
#9
12/03/2010 (9:59 am)
it seems that the last client to connect gets to see the animation.. once the last client disconnects, the first is able to see the animation :s
#10
12/03/2010 (11:24 pm)
I remember having this problem before, but I'm not sure what I did to fix it. Try instead calling commandToClient and play the animation on each client individually.
#11
12/05/2010 (9:51 am)
hm.. the problem with that is i would not be able to avail from the scoping functionality.. i.e. if someone is not within scope, I wouldnt want to send that command too. And also it sounds like a dirty hack :(

Any idea if the fix is within the unpack update or not?

thanks
#12
12/05/2010 (5:04 pm)
I'm not sure about the unpack update.
Is your goal to only play the animation to certain clients? If so, I think commandToClient is the best way to do that.
#13
12/06/2010 (5:57 pm)
Hi Jonathan, ...my goal is to play animation to all clients within scope. I wouldn't have imagined it to be so complicated and that playThread would have done the trick :(
#14
12/07/2010 (1:13 am)
You keep saying within scope, what do you mean by that?
#15
12/07/2010 (5:34 pm)
any client who is meant to see the animation.. i.e. any client within "proximity"..isnt that how ghosting works?
#16
01/19/2011 (7:38 pm)
nothing :(?
#17
01/19/2011 (8:01 pm)
Greetings!

It sounds like you're being bitten by a bug I recently reported here. Only one connection (the first to be processed) will correctly see a script-based animation play.

- Dave
#18
01/22/2011 (8:58 am)
You're the man!!!! would have never figured it out.

Thanks a million!