1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

How do I write a mod with 3 teams?

Discussion in 'Programming' started by Co11, Sep 18, 2004.

  1. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
    Porkmanii -- So, from what I've been reading up on the mutant mode, should I start with extending from the teamdeathmatch game mode and then "add" the 3rd member just like the mutant game mode?
    Here are the files I'm thinking i need to edit:
    xMutantPawn - creates the pawn
    xMutantGame - Creates the actual game and such
    MutantScoreboard - Creates the scoreboard
    MutantGameReplicationInfo - Not sure what this does
    MapListMutant - Creates the maplist... although doesn't this seem redundant? (no?)

    What do you guys think?
     
  2. Grobut

    Grobut Комиссар Гробут

    Joined:
    Oct 27, 2004
    Messages:
    1,822
    Likes Received:
    0
    I'd say you need to expand Teamdeathmatch, and then use some mutant code to single out one member of one team who is to be protected/hunted, and ofcourse you need to add a new scoreboard so players know who the Hunted is, and possibly some Assault code to switch which team has to do the hunting/protecting.

    Its allot of work youre getting into ;)
     
  3. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
    This is a school project that is due in April 2006... I am prepared for this work :)
     
  4. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
    also, you guys are smart... :)

    and I'm totally getting this... I just need to know more about the process of how each game mode is getting done.
     
  5. porkmanii

    porkmanii New Member

    Joined:
    Sep 9, 2004
    Messages:
    129
    Likes Received:
    0
    TeamGame only allows for 2 teams. There's quite a lot of "if not red then blue" logic (those aren't my words, by the way) making adding a third team very difficult. As I said before, it would be much easier to have the protected player on the team that is protecting him/her (and seperating him/her on the score board and HUD) than making an extra team. If the protected player is on the team protecting him/her, you don't need any extra code to tell the protecting team not to attack the protected player, and the other team to attack the protected player.

    First of all, xMutantPawn is not necessary to your game type. It says up the top of the xMutantPawn class:
    Code:
    //  New pawn class. Allows for Mutant skin/particles etc.
    Unless you want the mutant skin/particles, you don't need that class.

    Secondly, I think you would be better off making your own classes, even if you were to copy most of them from the mutant classes (and not extending mutant classes, which you couldn't do if you wanted teams). There would probably be a fair bit of Mutant code doing things you don't want in your game type (such as the Bottom Feeder, although you may want that).

    Map lists aren't necessary, but having a map list allows you to set up the default maps (at least, it did in UT'99). If you don't have one the map list will be, by default, empty.
     
    Last edited: Oct 29, 2004
  6. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
    Are you saying I should extend the xDeathMatch class? or something similar?


    I know, I've not extended any of the Mutant code. But I am trying to sift through and read up on some of the functions that create spawning and AI and stuff... I'm having trouble trying to spawn my first player... am I looking at "super.initgame" and the pregame and post game stuff?

    I figured out the maplist thingy, it's the same as ut 99
     
    Last edited: Oct 29, 2004
  7. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
  8. Zur

    Zur surrealistic mad cow

    Joined:
    Jul 8, 2002
    Messages:
    11,702
    Likes Received:
    4
    How about contacting Dark Pulse ? He seems to be heading the CTF4 project and probably knows how to have more than 2 teams in-game.
     
  9. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
    I just might if I get stuck more so than I am...
     
  10. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
    so, I came up with a worthy solution and wanted to run it by everybody..
    I feel that I'm not figuring this out because I'm going about it the wrong way..

    What if I did 2 teams, with classes?

    Think about this, I can set up each class with their own attributes, then set up the AI to look at each team... (really Team Death Match with classes) what does everybody think?
     
  11. Grobut

    Grobut Комиссар Гробут

    Joined:
    Oct 27, 2004
    Messages:
    1,822
    Likes Received:
    0
    Well, if you want classes that fine, but its not an easy solution.

    The easiest way to do this, as far as i can see, is expand TeamDeathMatch, use mutant code to single out a hunted player, and use Assault code to switch between what team has to do the hunting.

    Adding classes ontop of this seems a whole world of hurt..
     
  12. porkmanii

    porkmanii New Member

    Joined:
    Sep 9, 2004
    Messages:
    129
    Likes Received:
    0
    If this "team of one" has only one player and is going to basically be on the same side as one of the other teams, why is a third team necessary?

    Not at all. What I'm saying is TeamGame was coded with only 2 teams in mind, so if (and I stress if because I don't think this is necessary) you were to create a third team, it would probably be better to extend DeathMatch and recode all the team stuff (base it on TeamGame) to take into consideration more than 2 teams. xDeathMatch is basically the same as DeathMatch, but it precaches a whole lot of textures and static meshes that DeathMatch does not.

    I feel like I am repeating myself without anyone actually understanding, so do you understand what I am saying?

    Edit- didn't notice that second page-
    It seems to me like Grobut is also of the opinion a third team is not necessary.
    Does the "team of one" have one player on it? Would that one player be "it" the whole match? Or could the "team of one" simply be an AI that spawns (like a monster in Invasion) and not actually be on any team?
     
    Last edited: Oct 31, 2004
  13. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
    ok, I'll flesh out some more details on this..
    This team of one, is going to be a melee armed player (its always a player). He cannot pick up any other weapons (at this time, I might change it to see how the balances are... Maybe he can only pick up weapons from players he kills).... The idea is to lead the player directly to a zoned off area in the map. Now, to help him get to the area there will be a team guarding him and a team trying to eliminate him...

    Now, once he gets to the zone the team scores a point... if he's killed, then the other team gets a point. Play to the pre-set amount of points, and the teams don't change automatically, however the one melee armed player will... he changes randomly....

    I'm liking the mutant code.. that's a great start (honestly I didn't think about it)

    realistically, how long do you think coding in the BASIC features? not doing the scorebaords and what not...
     
  14. Zur

    Zur surrealistic mad cow

    Joined:
    Jul 8, 2002
    Messages:
    11,702
    Likes Received:
    4
    Sounds like a nice idea. Bodyguards vs hitmen or something of the genre.
     
  15. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
    yup... I'm still fleshing out the story
     
  16. porkmanii

    porkmanii New Member

    Joined:
    Sep 9, 2004
    Messages:
    129
    Likes Received:
    0
    If the "team of one" keeps changing, how are you going to balance the other two teams (when one player is taken off a team to become "it")? The way I'd do it is have a random player become "it" and stay on the team they are on, so their team would defend them and the other one would attack. Then you could use the "Red/Blue Team on Offense/Defense" announcements.

    I made a mod for UT'99 that worked in a similar way to what I just described, but it was (originally) based on (Team) Pop A Cap (from Perfect Dark), so the "Cap" didn't have to actually go anywhere (they just had to survive) and could pick up weapons.

    The way I did the AI was to always have every player seek the Cap (except while covering another player or holding a position), so players on the Cap's team would find and defend it, while enemy players would find and attack it.
     
  17. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
    So, if it's easier I don't have to make the tame of 1 change...
     
  18. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
    What are the basic requirements to get a team to spawn?
     
  19. Co11

    Co11 New Member

    Joined:
    Feb 5, 2004
    Messages:
    49
    Likes Received:
    0
    Code:
    : AgentDown AD-co11.AgentDown (Function UnrealGame.TeamGame.PostBeginPlay:009A) Attempt to assign variable through None
    Warning: AgentDown AD-co11.AgentDown (Function UnrealGame.TeamGame.PostBeginPlay:00AC) Accessed None 'Teams'
    this is the error I've been getting.... what's going on here? am I supposed to assign a variable somewhere? if so, why does the ctf mode get away with it?
     
    Last edited: Nov 2, 2004
  20. porkmanii

    porkmanii New Member

    Joined:
    Sep 9, 2004
    Messages:
    129
    Likes Received:
    0
    The part that says "(Function UnrealGame.TeamGame.PostBeginPlay:00AC)" tells us that the accessed none occurred in the TeamGame class (not yours). Looking at TeamGame.PostBeginPlay, The first part that could access none 'Teams' is right after Teams[0] and Teams[1] are initialized by setting them to GetRedTeam() and GetBlueTeam(), respectively. Have you overridden GetRedTeam or GetBlueTeam? If so, I think it's likely that, for some reason, they are returning None (meaning Teams[0] and/or Teams[1] are initialized to None).

    If you need help figuring out where it goes wrong, just post GetRedTeam, GetBlueTeam, and PostBeginPlay in your AgentDown class (unless, of course, you haven't overridden them). I assume AgentDown extends TeamGame (directly)?
     

Share This Page