Best way to add team support
by Rob Green · in Technical Issues · 05/10/2005 (8:00 pm) · 3 replies
I would like to add teams into my game similar to that of any team deathmatch or team ctf game.
I looked through how Tribes 1 did it, and see they created a TeamGroup object which seems to either add a team field to all objects of the group or at least set a common team field to all objects of the group.
Since the TeamGroup code for T1 seems to be in C++, I don't have access to it.
Is adding something like TeamGroup the best approach? It seems like it's at least a decent way to go about it, because that way you can just add a bunch of shapes and objects for your team in the mission editor hierarchy.
Also, if that's the best way, how would I go about implementing it? I've kind of looked through how ConsoleObjects/SimObjects work with SimGroups, and was thinking of just having TeamGroup extend SimGroup with a teamId field, but I'm not sure what that will really give me as the point of a TeamGroup would be to have objects 'inherit' the TeamGroup's teamId.
Does SimObject have a team field in Tribes 1? If so, how is that set by way of the TeamGroup? I see in the generated mission code that the teams are referenced by team0 and team1 with no other marking of the team id/number, so does some code just take the last digit of that ref name and set all simobjects in the teamgroup's team field to that value?
Any help/examples would be appreciated here. Thanks!!
I looked through how Tribes 1 did it, and see they created a TeamGroup object which seems to either add a team field to all objects of the group or at least set a common team field to all objects of the group.
Since the TeamGroup code for T1 seems to be in C++, I don't have access to it.
Is adding something like TeamGroup the best approach? It seems like it's at least a decent way to go about it, because that way you can just add a bunch of shapes and objects for your team in the mission editor hierarchy.
Also, if that's the best way, how would I go about implementing it? I've kind of looked through how ConsoleObjects/SimObjects work with SimGroups, and was thinking of just having TeamGroup extend SimGroup with a teamId field, but I'm not sure what that will really give me as the point of a TeamGroup would be to have objects 'inherit' the TeamGroup's teamId.
Does SimObject have a team field in Tribes 1? If so, how is that set by way of the TeamGroup? I see in the generated mission code that the teams are referenced by team0 and team1 with no other marking of the team id/number, so does some code just take the last digit of that ref name and set all simobjects in the teamgroup's team field to that value?
Any help/examples would be appreciated here. Thanks!!
#2
which was helpful for basically scripting in some team support, but it doesn't help much in terms of really defining teams' objects in the mission editor. (btw, could someone tell me how to make that a real link? the 'click here to learn how' in the edit post gave me a blank page)
In Tribes 1, in the mission editor, you'll see a hierarchy like this:
MissionGroup - SimGroup
__Teams - SimGroup
____Team0 - TeamGroup
______DropPoints - SimGroup
______Base - SimGroup
What I like about this, is that for everything you define inside of the Team0 TeamGroup, it automatically assigns the teamId '0' to the object.
I'm trying to figure out how to do that.
I think contrary to what the example I linked to above says, I will want a 'teamId' field on SimObject, thus declaring that every simobject in my game can be assigned to a team. That should allow for me to add logic in the script for damaging other team's stuff but not your own, amongst other things.
The part I don't follow, however, is specifically how to code the TeamGroup to make it show up on the editor as well as to get it to assign the team values to all members and such. I really haven't dug through this as much as I need to to understand it yet, but when I figure it out I'll post my results. Otherwise if anyone knows specifically how to go about doing this, I'd love to hear it.
05/11/2005 (11:24 am)
I found this example In Tribes 1, in the mission editor, you'll see a hierarchy like this:
MissionGroup - SimGroup
__Teams - SimGroup
____Team0 - TeamGroup
______DropPoints - SimGroup
______Base - SimGroup
What I like about this, is that for everything you define inside of the Team0 TeamGroup, it automatically assigns the teamId '0' to the object.
I'm trying to figure out how to do that.
I think contrary to what the example I linked to above says, I will want a 'teamId' field on SimObject, thus declaring that every simobject in my game can be assigned to a team. That should allow for me to add logic in the script for damaging other team's stuff but not your own, amongst other things.
The part I don't follow, however, is specifically how to code the TeamGroup to make it show up on the editor as well as to get it to assign the team values to all members and such. I really haven't dug through this as much as I need to to understand it yet, but when I figure it out I'll post my results. Otherwise if anyone knows specifically how to go about doing this, I'd love to hear it.
#3
05/11/2005 (4:59 pm)
Ok I looked into how Tribes 2 manages team objects with the missions, and interestingly enough there are no TeamGroups. The teams are just SimGroups and each team object just has a dynamic field called team set to the team number.
Torque Owner Mark Storer
Making a team a full-blown script class would also alow you to track things like team color, score, etc.