Game Development Community

Need help with Character Selection - TGE 1.5.2

by SqHd · in Torque Game Engine · 08/22/2007 (9:08 pm) · 8 replies

Hello,

I've been struggling with getting character selection to work in TGE 1.5.2. I've been looking at the way its done in Realm Wars (version 0.0.1 - the only version I could find) and Beaver Patrol (alpha1.3). Unfortunately, when I use a TGE 1.5.2 build (with the latest 'GuiObjectView' from the TGE 1.5.x - Bonus Resource Bundle) the characters don't show up in the menu.
I was wondering if it had to do with these functions:
function SP_setModel
function SP_showPrevModel
function SP_showNextModel

I also noticed in the '.gui' files they used 'GuiPlayerView' instead of 'GuiObjectView'.

I'm new to scripting (I'm one of those artist guys) so I may have missed something obvious.

#1
08/22/2007 (9:14 pm)
GuiPlayerView is the original GUI source that shipped with the engine - I believe the Realm Wars and Beaver guys made their own customizations to the source of that file.

GuiObjectView is a more recent and most likely better version of the GUI control and was submitted by the community.

There are plenty of character selection resources available; a quick search should yield some results for you.
#2
08/23/2007 (9:19 pm)
@Tim - Thanks for the info on the different 'Views'.
I did as you suggested and went back through the resources.
I found one of Dreamer's MMORPG tutorials -
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7695
I was able to create a working character selection gui.
Now I just have to figure out how to get the mission to start and load the player that is selected. (Unfortunately, Dreamer's character selection is complicated in this respect. It is tied to an 'Account Login' gui and stats.)
#3
08/11/2009 (11:43 am)
You ever figure out how to do that?
#4
10/23/2009 (9:56 pm)
Nope...
I'm still trying. I've been attempting to merge the character / weapon selection from the T3D demo (from TGEA) with the Stronghold example (from TGEA). Unfortunately, I do not know enough about scripting.
#5
10/24/2009 (6:34 am)
Is your game single or multi? if it's single there are a few "cheat" ways to make character and weapon selection rather easy, if it's multi it needs to be more secure and network ready, which is a bit harder. I'll help ya out if you lay out a few more details.
#6
10/24/2009 (6:16 pm)
Its multiplayer (I'm using the Stronghold fps example). I've checked out various resources (including Realm Wars), but no luck...
Realm Wars even had teams implemented. I don't know if you've seen the T3D game example from TGEA but they have the character and weapon selection for a single player mission. You choose the character / weapon on a separate gui, click 'apply', go back to the main menu, and then start the mission. I was attempting to get that working with multi player. Any help would be great!
#7
10/24/2009 (9:19 pm)
The easiest way to do it that I found, is a little too easy, and kinda open to cheating if you ship your game with the player being able to access the console and unencrypted files. But I use the preferences to set up player weapon selection.

First I make sure I setInv for all the weapons and ammo, this way won't work if you don't add all the items to inventory.

Now we need to set up out GUI, whichever way you want to do it, guipopupmenuctrl, or a screen similiar to T3D, you need to make it set a preference. I'll assume you're using 3 hotkeys, primary, secondary, and frag, or 1, 2,3 keys. We want to set it up where it sets $pref::weapon::primary, $pref::weapon::secondary, $pref::weapon::tertiary, or whatever you want them to be.

Now the final part is to set our keybinds for the 1, 2 and 3 key to point to the set preferences. to do that we would use a commandtoserver,

moveMap.bindCmd(keyboard,"1", "commandToServer('use',$pref::weapon::primary);","");

moveMap.bindCmd(keyboard,"2", "commandToServer('use',$pref::weapon::secondary);","");

moveMap.bindCmd(keyboard,"3", "commandToServer('use',$pref::weapon::tertiary);","");

Now if you use this method and are worried about people cheating, I feel it's sufficient enough to disable the console on what you ship out, and to encrypt your files so that only torque can read them and the user cannot access them and change the prefs.

There are different ways of accomplishing a weapon selection, but I dont' think any one way is better than another. I prefer this way because I figured it out and it was easy.
#8
10/26/2009 (12:32 pm)
Thanks again. Very useful and not too difficult.