Temporarily disable player on server
by Fredrik Aron Riktor · in Torque 3D Professional · 12/28/2011 (11:30 am) · 2 replies
Hi.
I am trying to create a menu screen for the client. On this screen, the client should be able to view the player's current appearance (effectively a preview).
At the same time, the player should be completely inactive on server.
My current situation is this:
The client is connected with no control object
The associated player exists on the server (and they reference eachother as %client.player and %player.client).
The player is hidden using (from ShapeBase) %player.SetHidden(false);
I need a means to display this player on the client, either directly, or by setting up a model in a preview that mimics all its features. (Shape files/datablock, skin, mesh visibility and perhaps other things, but those are all I can think of right now.)
I have a "GuiObjectPreview" class which would allow me to pick a shape file and a skin. I need to access the meshes as well, and I can't find support for it.
Do you have any advice or solutions for me?
I can make changes on C++ level if it is necessary. I'm decent with the language, but not with graphics/models. Thought I'd see if anybody could save me a lot of trouble and perhaps direct me to a better solution than what I can pull off.
Random observation: I am being asked to enter 5 characters. Has GarageGames had a lot of trouble with logged in users posting automated garbage?
Whooa: TWICE I didn't get the captcha right? And still it looks exceedingly clear and correct. What am I missing? Why should posting be so hard? ... It keeps happening. I normally get through captchas. Unfortunate unfriendly forum mechanism.
I am trying to create a menu screen for the client. On this screen, the client should be able to view the player's current appearance (effectively a preview).
At the same time, the player should be completely inactive on server.
My current situation is this:
The client is connected with no control object
The associated player exists on the server (and they reference eachother as %client.player and %player.client).
The player is hidden using (from ShapeBase) %player.SetHidden(false);
I need a means to display this player on the client, either directly, or by setting up a model in a preview that mimics all its features. (Shape files/datablock, skin, mesh visibility and perhaps other things, but those are all I can think of right now.)
I have a "GuiObjectPreview" class which would allow me to pick a shape file and a skin. I need to access the meshes as well, and I can't find support for it.
Do you have any advice or solutions for me?
I can make changes on C++ level if it is necessary. I'm decent with the language, but not with graphics/models. Thought I'd see if anybody could save me a lot of trouble and perhaps direct me to a better solution than what I can pull off.
Random observation: I am being asked to enter 5 characters. Has GarageGames had a lot of trouble with logged in users posting automated garbage?
Whooa: TWICE I didn't get the captcha right? And still it looks exceedingly clear and correct. What am I missing? Why should posting be so hard? ... It keeps happening. I normally get through captchas. Unfortunate unfriendly forum mechanism.
#2
01/05/2012 (3:00 pm)
I've been a bit too busy with real work (the kind that gets me money) to look at this. Thanks for the answer. I think I'll be looking at using preloaded shapes from datablocks from the server and an extension of the GUI object view. However, I haven't got the time and energy to try in the near future, so I don't know if it is a feasible approach.
Torque Owner Daniel Buckmaster
T3D Steering Committee
You should be able to copy most of the functionality from that function and its siblings and apply them to GuiObjectView, along with some console methods.
The one snag you might run into is that GuiObjectView does not store a Resource<Shape> to call findObject on. If you look at
You can see where the model is loaded. You might want to store that Resource as an object member, or take some other approach. (Maybe see if TSShapeInstance has a method to get the shape resource it uses.)
If you don't like the sound of that, consider just using your actual server-side Player object as the 'preview'. If you can spawn all your players in their own separate areas, you can set up a small piece of level to be your 'player setup' location with a fixed camera. Use a GUI to send commandToServer calls to change the Player options, and then when the user is done, you can just teleport them and their Player to where they 'spawn'.
(Not sure what's going on with the captchas... we have had a bit of bot spam recently.)