Trying to creal a lastmanstanding mod:

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

Moderator: Forum Guards

Trying to creal a lastmanstanding mod:

Postby bambi » Wed Apr 20, 11 4:17 am

Hi Alpha,

I'm trying to creal (create+steal) a lastmanstanding mod. I have a unrealscript source of a lastmanstanding mod for unreal tournament and now I'm trying to get it to work with Deus ex.

I was wondering. Can I create variables in PlayerReplicationInfo?

Code: Select all
//=============================================================================
// PlayerReplicationInfo.
//=============================================================================
class PlayerReplicationInfo expands ReplicationInfo
   native nativereplication;

var string            PlayerName;      // Player name, or blank if none.


Like, I would need the variables, "bOutOfLifes" and "MaxLifes."
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby Shinobi » Wed Apr 20, 11 4:30 am

So we beat on, boats against the current, borne back ceaselessly into the past.
User avatar
Shinobi
Master
 
Posts: 1503
Joined: Tue Jul 10, 07 12:10 pm
Location: Wales

Postby bambi » Wed Apr 20, 11 4:33 am

brb stealing more code from Hejhuka <----a god

I'll update this shortly, and thanks for the link SHinobi

UPDATE 1.0:
1. I modified his code and I dont' know why its not working. This is the error:
Code: Select all
"Failed to load 'LastManStanding': Can't find Function in file 'Function DeusEx.TeamDMGame.Logout'"


Also, I don't know how to actually use a gametype code. How can I show the lastmanstanding option in the selection list?

Here is the code btw:

Code: Select all
//=============================================================================
// LastManStanding.
//=============================================================================
class LastManStanding extends TeamDMGame;

var() int Lives;
var int NumGhosts;
var bool bNoAmbush;
var PlayerPawn LocalPlayer;
var localized String LivesString;

event InitGame( string Options, out string Error )
{
   local string InOpt;

   Super.InitGame(Options, Error);
   if ( ScoreToWin == 0 )
      Lives = 10;
   else
      Lives = ScoreToWin;

        VictoryCondition = "Frags";
}



event playerpawn Login
(
   string Portal,
   string Options,
   out string Error,
   class<playerpawn> SpawnClass
)
{
   local playerpawn NewPlayer;
   local Pawn P;

   // if more than 15% of the game is over, must join as spectator.
   if ( TotalKills > 0.15 * (NumPlayers) * Lives )
   {
      SpawnClass = class'Spectator';
      if ( (NumSpectators >= MaxSpectators)
         && ((Level.NetMode != NM_ListenServer) || (NumPlayers > 0)) )
      {
         MaxSpectators++;
      }
   }
   NewPlayer = Super.Login(Portal, Options, Error, SpawnClass);

   if ( (NewPlayer != None) && !NewPlayer.IsA('Spectator') )
      NewPlayer.PlayerReplicationInfo.Score = Lives;

   return NewPlayer;
}

event PostLogin( playerpawn NewPlayer )
{
   if( NewPlayer.Player != None && Viewport(NewPlayer.Player) != None)
      LocalPlayer = NewPlayer;

   Super.PostLogin(NewPlayer);
}
 

function bool RestartPlayer( pawn aPlayer )   
{
   local NavigationPoint startSpot;
   local bool foundStart;
        local DeusExPlayer PlayerToRestart;
   local Pawn P;

   if( bRestartLevel && Level.NetMode!=NM_DedicatedServer && Level.NetMode!=NM_ListenServer )
      return true;

   if ( aPlayer.PlayerReplicationInfo.Score <1>= 1) )
            P.PlayerReplicationInfo.Score += 0.00001;
   }

   startSpot = FindPlayerStart(None, 255);
   if( startSpot == None )
      return false;
      
   foundStart = aPlayer.SetLocation(startSpot.Location);
   if( foundStart )
   {
      startSpot.PlayTeleportEffect(aPlayer, true);
      aPlayer.SetRotation(startSpot.Rotation);
      aPlayer.ViewRotation = aPlayer.Rotation;
                aPlayer.GroundSpeed = aPlayer.Default.GroundSpeed;
      aPlayer.Acceleration = vect(0,0,0);
      aPlayer.Velocity = vect(0,0,0);
      aPlayer.Health = aPlayer.Default.Health;
      aPlayer.ClientSetRotation( startSpot.Rotation );
      aPlayer.bHidden = false;
      aPlayer.SoundDampening = aPlayer.Default.SoundDampening;
                aPlayer.DamageScaling = aPlayer.Default.DamageScaling;
      if ( aPlayer.PlayerReplicationInfo.Score <1> 0)
      Other.PlayerReplicationInfo.Score -= 1;
            TotalKills++;
            NotifyDeath = True;
   }
 
        if ((Killer.bIsPlayer) && (Other.bIsPlayer))
        {
            BroadcastDeathMessage(Killer, Other, damageType);
                             
       if (Killer != Other)
       {
       Killer.Spree++;
       if (Killer.Spree > 4)
           NotifySpree(Killer.PlayerReplicationInfo.PlayerName, Killer.Spree);
                 if (Other.Spree > 4)
           EndSpree(Killer.PlayerReplicationInfo.PlayerName, Other.PlayerReplicationInfo.PlayerName);
            Other.Spree = 0;
                 if (( Killer.Health > 0 ) && (Level.TimeSeconds - LastTauntTime > 3))
                 {
                      LastTauntTime = Level.TimeSeconds;
                      Killer.SendGlobalMessage(None, 'AUTOTAUNT', 0, 0);
                 }
       }
            if ( CheckVictoryConditions(Killer, Other, "") )
            {
                 bFreezeScores = True;
                 NotifyDeath = False;
            }
            if ( NotifyDeath )
       HandleDeathNotification( Killer, Other );
   }

        else
        {
       if ( NotifyDeath )
            HandleDeathNotification( Killer, Other );
        }
}

function bool CheckVictoryConditions( Pawn Killer, Pawn Killee, String Method )
{
   local Pawn winner;

   CheckEndGame ( winner );

   if ( winner != None )
   {
      if ( winner.PlayerReplicationInfo.Score >= 1 )
      {
         TeamHasWon( winner.PlayerReplicationInfo.Team, Killer, Killee, Method );
         return True;
      }
   }

   return false;
}

function CheckEndGame ( out Pawn curWinner )
{
   local Pawn PawnLink;
        local Pawn FinalPawn;
        local bool bStillHuman;
   local int StillPlaying;
           
        NumGhosts = 0;
        for ( PawnLink=Level.PawnList; PawnLink!=None; PawnLink=PawnLink.nextPawn )
        {
      if ( PawnLink.bIsPlayer )
      {
         if ( PawnLink.PlayerReplicationInfo.Score < 1 )
            NumGhosts++;
         else
         {
            if ( PawnLink.IsA('DeusExPlayer') )
               bStillHuman = true;
                                StillPlaying++;
         }
      }
        }
           

        if (StillPlaying <2>= 1 )
             curWinner = FinalPawn;
}

function bool PickupQuery( Pawn Other, Inventory item )
{
   if ( Other.PlayerReplicationInfo.Score < 1 )
      return false;
   
   return Super.PickupQuery( Other, item );
}


function AddDefaultInventory( pawn PlayerPawn )
{
      local Weapon weap;
      local class<Weapon> WeapClass;
      local float F;
      local int i;
      local Inventory inv;
      local Ammo20mm ammo;
       
      if( PlayerPawn.IsA('Spectator') )
     return;

      Super.AddDefaultInventory(PlayerPawn);

      GiveWeapon(PlayerPawn, "DeusEx.WeaponPepperGun");
      GiveWeapon(PlayerPawn, "DeusEx.WeaponMiniCrossbow");
      GiveWeapon(PlayerPawn, "DeusEx.WeaponFlamethrower");
      GiveWeapon(PlayerPawn, "DeusEx.WeaponAssaultGun");

      if ( PlayerPawn.IsA('DeusExPlayer'))
      {
           GiveWeapon(PlayerPawn, "DeusEx.WeaponAssaultShotgun");
           GiveWeapon(PlayerPawn, "DeusEx.WeaponRifle");
           GiveWeapon(PlayerPawn, "DeusEx.WeaponPlasmaRifle");
           GiveWeapon(PlayerPawn, "DeusEx.WeaponGEPGun");
      }
     
      for ( inv=PlayerPawn.inventory; inv!=None; inv=inv.inventory )
      {
     weap = Weapon(inv);
     if ( (weap != None) && (weap.AmmoType != None) )
      weap.AmmoType.AmmoAmount = weap.AmmoType.MaxAmmo;
          ammo = Ammo20mm(inv);
          if ( ammo != None )
      ammo.AmmoAmount = ammo.MaxAmmo;
      }     
}   

function bool OneOnOne()
{
   return ( NumPlayers + NumBots - NumGhosts == 2 );
}

function NotifyOut(String OutString)
{
  local Pawn curPawn;

  for ( curPawn = Level.PawnList; curPawn != None; curPawn = curPawn.nextPawn )
      if ( curPawn.IsA('DeusExPlayer') )
           DeusExPlayer(curPawn).MultiplayerNotifyMsg( DeusExPlayer(curPawn).MPMSG_LMSOut, , OutString );
}   

simulated function DrawNameAndScore( GC gc, ScoreElement se, float screenWidth, float yoffset )
{
   local float x, w, h, w2, xoffset, killcx, deathcx;
   local String str;
   
   // Draw Name
   str = se.PlayerName;
   gc.GetTextExtent( 0, w, h, str );
   x = screenWidth * PlayerX;
   gc.DrawText( x, yoffset, w, h, str );

   // Draw Lives
   gc.GetTextExtent( 0, w2, h, LivesString );
   str = int(se.Score) $ "";
   gc.GetTextExtent( 0, w2, h, str );
   x = screenWidth * StreakX;
   gc.DrawText( x, yoffset, w2, h, str );
}

simulated function DrawHeaders( GC gc, float screenWidth, float yoffset )
{
   local float x, w, h, barLen;

   // Player header
   gc.GetTextExtent( 0, w, h, PlayerString );
   x = screenWidth * PlayerX;
   gc.DrawText( x, yoffset, w, h, PlayerString );
   
   // Lives header
   gc.GetTextExtent( 0, w, h, LivesString );
   x = screenWidth * StreakX;
        gc.DrawText( x, yoffset, w, h, LivesString );

   gc.SetTileColorRGB(255,255,255);
   gc.DrawBox( PlayerX * screenWidth, yoffset+h, (x + w)-(PlayerX*screenWidth), 1, 0, 0, 1, Texture'Solid');
}

simulated function ShowVictoryConditions( GC gc, float screenWidth, float yoffset, DeusExPlayer thisPlayer )
{
   local float x, y, w, h;
         
   gc.GetTextExtent( 0, w, h, VictoryConString1 );
   x = (screenWidth * 0.5) - (w * 0.5);
   gc.DrawText( x, yoffset, w, h, VictoryConString1 );
}

Last edited by bambi on Wed Apr 20, 11 8:00 am, edited 3 times in total.
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm

Postby ~DJ~ » Wed Apr 20, 11 9:16 am

..It's just saying that there's no function called 'logout' in TeamDMGame.

You'll experience many types of these errors as DX lacks alot of functions from UT99, in the same way, UT99 lacks alot DX functions too.

It's just a total mess, I'd just recommend to not to stop and keep on going, also.. look carefully on where this original class is extended from, the class which you're <s>stealing</s>, find functions on that motherclass, if it's not on the motherclass, find it on it's super motherclass.. or so.. When you find that function, just copypaste it over your own code.
Last edited by ~DJ~ on Wed Apr 20, 11 9:17 am, edited 1 time in total.
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby Shinobi » Wed Apr 20, 11 9:28 am

Stop stealing Hej's code I didn't give you the fuckin link so you could plagiarise, you tool. I gave you the link so ya didn't have to make your own damn LMS gametype.

That said, best of luck to ya! :)
So we beat on, boats against the current, borne back ceaselessly into the past.
User avatar
Shinobi
Master
 
Posts: 1503
Joined: Tue Jul 10, 07 12:10 pm
Location: Wales

Postby ~DJ~ » Wed Apr 20, 11 9:30 am

It's not hej's code anyway, it's mostly ut99 code itself, hej pretty much converted it from UT99 too.
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby Shinobi » Wed Apr 20, 11 9:40 am

Ah right. I know HardCoreDx is being maintained by Andrievskaya Veronika now, too.

Whoever that is. Actually.... that's the person who compiled the awesome DX editing pack... so kudos!!

I don't care anyway tbh lol LMS bores me in other games it'll bore me in dx. Someone needs to do a co-op mod that works.
So we beat on, boats against the current, borne back ceaselessly into the past.
User avatar
Shinobi
Master
 
Posts: 1503
Joined: Tue Jul 10, 07 12:10 pm
Location: Wales

Postby bambi » Wed Apr 20, 11 5:18 pm

Lol. I will of course give credit to the authors of the code. It will be called HejLMS. If I or anyone can ever get it working.

Also, I realized the logic is wrong. Its still LMS and not team LMS.

Will keep on trying though.
Image
bambi
Regular
 
Posts: 476
Joined: Sun Nov 27, 05 7:26 pm


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 48 guests