player login

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

player login

Postby atrey65789 » Wed Jun 12, 13 5:37 pm

So, When making a gametype extending MTLDeathmatch, I am trying to make it to where my player class (SSPlayer) will be the default player class.

It works, however, it works ONLY if the player's nonteam model is set to JC Denton. I need to make it to where no matter what, You will always play as the SSPlayer class..

I know the function in gametypes that determine the player class is Login(), I tried changing things in it, but no luck.


Any help would be much appreciated! :D
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby ~DJ~ » Wed Jun 12, 13 7:28 pm

Create a custom GameInfo, put that in there:
Code: Select all
class SSGameInfo extends GameInfo;
function bool ApproveClass (Class<PlayerPawn> S40)
{
   return True;
}

defaultproperties
{
    DefaultPlayerClass=Class'SSPlayer'
    GameReplicationInfoClass=Class'SSGRI'
}


As you can see, GameReplicationInfoClass is on there, so create a custom one too.

Code: Select all
class SSGRI extends GameReplicationInfo;

defaultproperties
{
     NetPriority=1.100000
}


At your gametype, put this code on:
Code: Select all
event PlayerPawn Login (string Portal, string Z56, out string Z57, Class<PlayerPawn> SpawnClass)
{
   local MTLPlayer Z5B;
   local int Z5C;
   local string Z5D;
   local int i;
   local int k;
   local string inputpass;
   local string checkpass;
   local int x;

   SpawnClass=Class'SSJCDenton';

   Z5B=MTLPlayer(Super(DeusExGameInfo).Login(Portal,Z56,Z57,SpawnClass));

   ChangeOption(Z56,"Class", string(SpawnClass));
   ChangeOption(Z56,"Team","TEAM_NSF");

   Z5B.bAutoActivate = true;

   if ( Z5B != None )
   {
      //Z5B.PlayerReplicationInfo.Team = 1;

      Z5B.ResetPlayerToDefaults();
   }
   SSPlayer(Z5B).Join = true;
   return Z5B;
}

defaultproperties
{
    DefaultPlayerClass=Class'SSJCDenton'
    GameReplicationInfoClass=Class'SSGRI'
    NetPriority=10.00
}


Needs SSJCDenton now, so..

Code: Select all
class SSJCDenton extends SSPlayer
   Config(User);

defaultproperties
{
     CarcassType=Class'DeusEx.JCDentonMaleCarcass'
     JumpSound=Sound'DeusExSounds.Player.MaleJump'
     HitSound1=Sound'DeusExSounds.Player.MalePainSmall'
     HitSound2=Sound'DeusExSounds.Player.MalePainMedium'
     Land=Sound'DeusExSounds.Player.MaleLand'
     Die=Sound'DeusExSounds.Player.MaleDeath'
     Mesh=LodMesh'DeusExCharacters.GM_Trench'
     MultiSkins(0)=Texture'DeusExCharacters.Skins.JCDentonTex0'
     MultiSkins(1)=Texture'DeusExCharacters.Skins.JCDentonTex2'
     MultiSkins(2)=Texture'DeusExCharacters.Skins.JCDentonTex3'
     MultiSkins(3)=Texture'DeusExCharacters.Skins.JCDentonTex0'
     MultiSkins(4)=Texture'DeusExCharacters.Skins.JCDentonTex1'
     MultiSkins(5)=Texture'DeusExCharacters.Skins.JCDentonTex2'
     MultiSkins(6)=Texture'DeusExCharacters.Skins.FramesTex4'
     MultiSkins(7)=Texture'DeusExCharacters.Skins.LensesTex5'
}


Create this too;
Code: Select all
class SSPRI extends MTLPRI;

defaultproperties
{
    NetPriority=1.20
    NetUpdateFrequency=2.00
}


And put this on your SSPlayer's defaultproperties:
Code: Select all
defaultproperties
{
     PlayerReplicationInfoClass=Class'SSPRI'
}


Hopefully that does the trick.
Last edited by ~DJ~ on Wed Jun 12, 13 7:48 pm, edited 3 times in total.
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby atrey65789 » Wed Jun 12, 13 8:01 pm

Works DJ!!!! Thanks man!!!!!!!
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby bambi » Tue Jan 21, 14 6:06 pm

lol atrey, gametypes are so confusing, i will actually upload the code I borrowed, just specifiy your gametype, and from gametype specify your spawnclass to that playerclass.

bam!
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm


Return to Editing issues

Who is online

Users browsing this forum: Google [Bot] and 15 guests