How to use ObjectPickerGui to select players in T3D?
by Summer · in Torque 3D Beginner · 05/24/2012 (4:32 pm) · 5 replies
I am a college student and have been tring to make a FPS game with T3D.Here comes the problem--I don't know how to use ObjectPickerGui to select players,I have tried some ways,but none of them worked.So,Could sombody tell me how to deal with it?or,you can give me some useful suggestions.I would be very thankful~
waiting for help......
waiting for help......
About the author
#2
Could you please give me some other advice?
05/26/2012 (8:31 pm)
Thank you~but,I'm in China,and we can't use YouTube......Could you please give me some other advice?
#3
then press play button
level selection manu will be pushed.basically it searches for mission files (*.mis) from levels folder.for each file it automatically add one bitmap button in lower side of that gui.u can modify it to select your player.
press f10
select ChooseLevelDlg from dropdown menu.select a bitmap and look into it's command properties.what u are seeing is this:
ChooseLevelWindow.previewSelected(ChooseLevelWindow->SmallPreviews->SmallPreview2);
an old torque programmer can imagine what could be it's original function prtotype.
but for you "previewSelected(" is enough.
now open up torsion(u can find demo version in tools section of this site) and serach for "previewSelected(" .do not serach for previewSelected().
try to find out how it is working.
then u have to change it so that it will load your players instead of levels.
that was my style to develop my player selection menu.
may be there are other alternative ways.
but i do not like to work with someone else's code.
do u know what means player in torque 3d?
and are you a programmer?
05/27/2012 (1:31 am)
go to main menu.then press play button
level selection manu will be pushed.basically it searches for mission files (*.mis) from levels folder.for each file it automatically add one bitmap button in lower side of that gui.u can modify it to select your player.
press f10
select ChooseLevelDlg from dropdown menu.select a bitmap and look into it's command properties.what u are seeing is this:
ChooseLevelWindow.previewSelected(ChooseLevelWindow->SmallPreviews->SmallPreview2);
an old torque programmer can imagine what could be it's original function prtotype.
but for you "previewSelected(" is enough.
now open up torsion(u can find demo version in tools section of this site) and serach for "previewSelected(" .do not serach for previewSelected().
try to find out how it is working.
then u have to change it so that it will load your players instead of levels.
that was my style to develop my player selection menu.
may be there are other alternative ways.
but i do not like to work with someone else's code.
do u know what means player in torque 3d?
and are you a programmer?
#4
You will need to have some means of populating the PickerMenu with a list of Player Datablocks. This was done in the TGEa T3D game project within a client-side script function that created a SimSet called PlayerDatasGroup and loaded the various Player Datablocks. The Player Datablock script files would define a datablock as normal and then make a call to add the datablock to the PlayerDatasGroup SimSet.
Example:
I *think* that is all it should take to get it working, but my example is untested.
05/27/2012 (10:15 am)
The ObjectPickerGui is found within the "UnifiedShell" code. This requires some bit of extra coding to make it work in Torque 3D like it did in the old TGEa game project called T3D.You will need to have some means of populating the PickerMenu with a list of Player Datablocks. This was done in the TGEa T3D game project within a client-side script function that created a SimSet called PlayerDatasGroup and loaded the various Player Datablocks. The Player Datablock script files would define a datablock as normal and then make a call to add the datablock to the PlayerDatasGroup SimSet.
Example:
// this should go in a client-side script.
function populatePlayerPickerList()
{
new SimSet(PlayerDatasGroup);
// Load the datablocks for picking a player.
exec("art/datablocks/players/ <yourPlayerDataBlockFileName1> .cs");
exec("art/datablocks/players/ <yourPlayerDataBlockFileName2> .cs");
// and so on...
}After defining each Player Datablock, you add the call to populate the PickerMenu list by adding each Datablock to the PlayerDatasGroup SimSet:// Add this after each Datablock definition: PlayerDatasGroup.add(yourPlayerDataBlockName);You'll also need to make your Menu screen aware of the loadPlayerPickerData() function:
//When loading the MainMenu, or where ever you load the Picker Menu populatePlayerPickerList();
I *think* that is all it should take to get it working, but my example is untested.
#5
And to ahsan's question,I'm just a chollege student,^_^and my major is Digital Media Art.
05/27/2012 (5:26 pm)
Thank you so much~all your suggestions do help me a lot,and problems are almost solved.And to ahsan's question,I'm just a chollege student,^_^and my major is Digital Media Art.
Ahsan Muzaheed
Default Studio Name
but player selection possible with other gui elements.here is a video of my player selection gui:
http://www.youtube.com/watch?v=jV2aP8zt4VM