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.

UScript question: setting team spawn locations

Discussion in 'Programming' started by Plaguelord, Sep 3, 2001.

  1. Plaguelord

    Plaguelord Unreal/Deus Ex mapper

    Joined:
    Sep 3, 2001
    Messages:
    15
    Likes Received:
    0
    Chimeric's supposed to be THE spot for UScript gurus, so I'll get the ball rolling here...

    I've coded a little mutator in UScript which basically forces all team games to become Humans vs. Bots (REALLY fun at a Lan parties). I use the ModifyPlayer function to change a player's team depending on whether he's human or bot... human = blue team, bot = red team.

    There's only one little problem, it's that when players want to change teams, they respawn in their new team but their spawn point is still in their previous team. So you can basically change from Blue to Red, and spawn in the Blue team's base as a Red guy.

    Here's my code for bots:

    if ((Other.IsA('Bot')) && (Other.PlayerReplicationInfo.Team != 0))
    {
    Level.Game.ChangeTeam(Other, 0);

    // The following lines don't work...!!!
    StartSpot = Level.Game.FindPlayerStart(Other, 0);

    if (StartSpot != None)
    Other.SetLocation(StartSpot.Location);
    }


    Any help would be appreciated.... thanks!
     
  2. mr.s-d

    mr.s-d CHiMERiC Moderator

    Joined:
    Aug 30, 2001
    Messages:
    65
    Likes Received:
    0
    If you look in the TeamGameInfo class, there's a bool variable bSpawnInTeamArea which when set to True forces player's to only spawn at PlayerStart's with the same team number as them.
     
  3. Plaguelord

    Plaguelord Unreal/Deus Ex mapper

    Joined:
    Sep 3, 2001
    Messages:
    15
    Likes Received:
    0
    Ok, how do I set that value to True? I get compiler errors when I type "bSpawnInTeamArea = True;" ... I run into the same problem when I want to set bBalanceTeams to False, because Balance Teams overrides my mutator for some reason...

    if you could help me with this that'd be great.
     
  4. TaoPaiPai

    TaoPaiPai Commisaire Van Loc

    Joined:
    Jun 13, 2000
    Messages:
    1,626
    Likes Received:
    0
    I think you have to put these in the defaultProperties section,at the end of the script ,withou semicolon at the end.

    BTW I Hope your mutator will be out soon,I want to play that :)
     
  5. Plaguelord

    Plaguelord Unreal/Deus Ex mapper

    Joined:
    Sep 3, 2001
    Messages:
    15
    Likes Received:
    0
    Ok, I got it to work!! I guess I just got a little impatient with UScript, hehe.... uh. I actually used the PreBeginPlay() function as opposed to defaultproperties, so now it overrides Balance Teams, and even overrides Force Balance Teams for multiplayer games...

    Once I test it with another human, I'll release it on my website Industrial Deconstruction (maybe as early as today)...
     

Share This Page