Game Development Community

dev|Pro Game Development Curriculum

Team Based Character Selection (Post Game Connect)

by Jon Jorajuria · 01/19/2006 (10:37 pm) · 27 comments

The following resources must be completed and functioning properly prior to implementing this resource:

Teams Implementation
guiObjectView

I am just a novice programmer trying to give back to the Garage Games community. I am sure there are easier and less convoluted ways of implementing this type of game functionality, and I welcome any and all comments to streamline my work. The team based character selection expands on the work of Xavier "eXoDuS" Amado and C2. Originally I was going to add this to C2
Page «Previous 1 2
#1
01/22/2006 (4:54 pm)
Great resource!
#2
01/22/2006 (8:22 pm)
One of the best methods of player selection i've seen, where would we be without RealmWars : p
#3
01/23/2006 (4:17 pm)
Could someone help me use this resource for vehicle selection.

Thanks
#4
01/23/2006 (4:44 pm)
Yes I shamelessly plugged this :P

@Timothy Aste-Thank you, it means a lot coming from somebody as respected as you.

@Tim Heldna-Thanks. You're right, I forgot to give mention to RW.

@Stephen-I would look at the games.cs of the racing demo. Look at the following functions and see how you can adapt:

function GameConnection::spawnCar(%this)
function GameConnection::createCar(%this, %spawnPoint)

Other than that the implementation should be pretty much the same.
#5
01/26/2006 (5:03 pm)
Has anybody actually used this?

When you do sound effects, it is good when the audience makes no comments. That means your sound effects sounded natural and were accepted as reality. Is that the same case here?
#6
01/26/2006 (8:43 pm)
I really like the resource. The only thing I have a problem with is forcing the team select dialog all of the time. I want to be able to host non-team missions as well sucha as good old deathmatch free for all.
#7
01/27/2006 (3:53 pm)
Nice, two of my resources used for another kick ass one, cheers :)
#8
01/29/2006 (6:15 pm)
Has anyone got this working?

I was able to get Xavier's Team implementation to work, and the guiObjectView resource to compile, but after adding this resource, I get the choose teams Gui, but when I press either team, it does nothing.

I've double checked everything, but I could have missed something so I will check everything again.
#9
01/29/2006 (8:03 pm)
Can you paste your teamSelectDLG.gui command codes?
#10
01/29/2006 (8:47 pm)
I copied and pasted your code above for teamSelectDLG.gui. I'm not sure what you mean by command codes.

I'm going to revert back to just before where I added Xavier's scripts and code and start over. I noticed that there's a new GuiObjectView resource. Do you think that will work with this code?
#11
01/29/2006 (9:36 pm)
The new GuiObjectView resource has not been tested with this resource. Have you tested that Xavier's resources are working in your game prior to implementing this resource? I have just tested it and everything is working for me.
#12
01/29/2006 (9:49 pm)
The Team implementation works well, and the GuiObject view files compiled, but I didn't test the GUIobjectView in any way. I probably made a mistake somewhere and am starting over.

Thanks for the prompt replies. :)

[edit]I've changed my resource rating to a 1 because all the code has been taken down, I'll raise it if the code is ever replaced. I came here looking to add it again, but it was removed.
#13
01/30/2006 (7:32 am)
if you zip up your files and send them to me, I will take a look at them.
#14
02/01/2006 (8:03 am)
I haven't used this resource but skimming through your code i may have found an error.

In teamBSetupGui.cs you have the following function...

function teamBSP_setModel()
{
   echo( "Model Name set ---> " @ $pref::Player::Armor );

   // Set main object
   teamBView.setObject("modelA", " starter.FPS/data/shapes/teamB/" @ $pref::Player::Armor @ ".dts", "", 0); // set the model that should be showing

   teamBView.loadDSQ("modelA ", " starter.FPS/data/shapes/animations/player_root.dsq"); //load an animation

   teamBView.setSequence("modelA ", "root", "1"); //play the animation
    
}

Shouldn't all references to modelA be changed to modelB???

Edit:

Also the spaces in the filenames in all instances isn't a good thing.

E.g.
%filename = " starter.FPS/data/shapes/teamB/*.dts";
should be
%filename = "starter.fps/data/shapes/teamB/*.dts";
2nd Edit:

Found a typo. In teamASetupGui.cs at the bottom you have the following function...
function jointeamA[b]s[/b]()
{
   commandtoserver('jointeam', 1, $pref::Player::Armor);
   Canvas.setContent(playGui); 
   Canvas.popDialog(teamASetupGui);   
}
it should read...
function jointeamA()
{
   commandtoserver('jointeam', 1, $pref::Player::Armor);
   Canvas.setContent(playGui); 
   Canvas.popDialog(teamASetupGui);   
}

(The 's' at the end of function name being the error)
#15
02/01/2006 (4:06 pm)
@ Tim-thank you

"Shouldn't all references to modelA be changed to modelB???"
No, all references to modelA should be changed to your_player_model_name

I thought I caught the typos, but you are correct with them, thank you. Should be fixed now.
#16
02/01/2006 (8:32 pm)
Hey Jon,

Quote:
"Shouldn't all references to modelA be changed to modelB???"
No, all references to modelA should be changed to your_player_model_name
That's kind of what i meant. In your example you say:

In starter.FPS/server/scripts/player.cs remove all data and replace it with execs that reflect your model.cs files.
exec("starter.FPS/server/scripts/characters/modelA.cs");
exec("starter.FPS/server/scripts/characters/modelB.cs");

So one would assume that as you have 2 scripts called modelA.cs & modelB.cs the corresponding *.dts files for the model should be named modelA.dts & modelB.dts

Therefore i believe (going by your resource instructions) all instances of modelA should be changed to modelB in your teamBSetupGui.cs file.

It just avoids confusion for newer Torque users & limits the chance of error. Also if one were to follow your resource instructions to the letter calling modelA from the teamBSetupGui.cs file is an error.

Secondly, i have my own method of player selection which differs from your method a fair bit, but seems to work well. However, i'm always interested to see how others do the same thing so i chucked this resource in.

I have some issues:

1) When you die you won't respawn. Console reports errors deriving from game.cs in the createPlayer function.
2) One of my characters refuses to die. If i try to suicide or fall off a high drop or whatever he just wont take damage.
3) Seemingly random crashing of the game if i force the chooseteam dialog up and respawn as a different character a few times.

Have you ever experienced any of the above problems?

One last note, just to keep things tidy & making sense shouldn't this section of serverConnection.cs
if (Canvas.getContent() != PlayGui.getId())         
Canvas.PushDialog(TeamSelectDlg);
read like this?
if (Canvas.getContent() != TeamSelectDlg.getId())         
Canvas.PushDialog(TeamSelectDlg);
#17
02/02/2006 (7:08 am)
Hey Tim,

I am redoing this on a totally clean installation of 1.3. I did a lot of customization in my "clean" base build that may have fixed some of the issues you are having. I appologize for the inconvience, and I will get an update to you hopefully by EOD today. I really do appreciate what you are finding, makes me learn even more.
#18
02/02/2006 (9:26 am)
Not a problem, great resource by the way. Many people would find this useful as character selection seems to be very popular and in demand.

I do disagree with how you've done some things. Like the folder setup, where all animations are in the same folder. Also, it seems like you have to add a lot of script code to add new players in (ie choose between 6 players instead of 2). RealmWars have an interesting system that loads a player info.cs file that is unique for each of your players and holds a $modelNo value. As you press through the next & previous buttons the appropriate info.cs script is executed loading the $modelNo into memory and this is what determines which player to spawn (from the switch statement in game.cs). This way all of your player data is stored in seperate folders and the only place you have to add code to add more players is within game.cs in the function GameConnection::createPlayer section.
#19
02/07/2006 (1:12 am)
Ok I figured out the issue...you need to create a player superlass structure. You would have a baseplayer.cs with multiple player specific cs files. That is why you are having that problem with the damage, death, and respawn. I have adapted the RW code to do the same function as this resource, I will update it in the next day or two. Real work has been taking its toll on me.
#20
03/12/2006 (10:29 pm)
ok for some odd reason my post keeps getting dropped..

anyways I am having trouble connecting..

get this error
Mapping string: jointeam to index: 3
Set::add: Object "" doesn't exist
starter.fps/server/scripts/game.cs (358): Unable to find object: '' attempting to call function 'setTransform'
starter.fps/server/scripts/game.cs (359): Unable to find object: '' attempting to call function 'setShapeName'
starter.fps/server/scripts/game.cs (362): Unable to find object: '' attempting to call function 'getEyeTransform'
Mapping string: MsgClientJoinTeam to index: 13
Mapping string: %1 joined the %2 to index: 14

and here are the relevant files..

home.comcast.net/~toons2005/question.zip
Page «Previous 1 2