Page 1 of 1

Domination`

PostPosted: Thu Jun 29, 06 7:42 pm
by Alex
Sorry for the inactiveness :)
Ok... I made this a while ago, some of you might have seen it ;)
Code: Select all
//=============================================================================
// ControlPoint. Made by Alex, visit http://www.dxalpha.com/
//=============================================================================
class ControlPoint extends DeusExDecoration;

var int PlayerTeam;
var Pawn Controller;
var bool bFirst;
// Make it var(), so it's editable in SDK
var() string ControlPointName;

/*
Texture's used:
Neutral:
FireTexture'Effects.UserInterface.WhiteStatic'
NSF:
FireTexture'Effects.liquid.Virus_SFX'
Unatco:
FireTexture'Effects.Fire.Wepn_Prifle_SFX'
*/

function PostBeginPlay()
{
      SetTimer(30.0, true);
}

function Frob(Actor Frobber, Inventory frobWith)
{
   if(DeusExPlayer(Frobber) != None)
   {
      if(DeusExPlayer(Controller) == None)
      {
         Controller = DeusExPlayer(Frobber);
         PlayerTeam = DeusExPlayer(Frobber).PlayerReplicationInfo.Team;
         BroadCastMessage("ControlPoint"@ControlPointName@"has been taken over by"@DeusExPlayer(Frobber).PlayerReplicationInfo.PlayerName);
         if(DeusExPlayer(Frobber).PlayerReplicationInfo.Team == 0)
         {
            MultiSkins[1]=FireTexture'Effects.Fire.Wepn_Prifle_SFX';
            LightSaturation=0;
            LightHue=80;
         } else {
            MultiSkins[1]=FireTexture'Effects.liquid.Virus_SFX';
            LightSaturation=0;
            LightHue=0;
         }
      } else {
         if(DeusExPlayer(Controller).PlayerReplicationInfo.Team == DeusExPlayer(Frobber).PlayerReplicationInfo.Team)
         {
            DeusExPlayer(Frobber).ClientMessage("|p2This control point already belongs to your team.");
         } else {
            Controller = DeusExPlayer(Frobber);
            PlayerTeam = DeusExPlayer(Frobber).PlayerReplicationInfo.Team;
            BroadCastMessage("ControlPoint"@ControlPointName@"has been taken over by"@DeusExPlayer(Frobber).PlayerReplicationInfo.PlayerName);
            if(DeusExPlayer(Frobber).PlayerReplicationInfo.Team == 0)
            {
               MultiSkins[1]=FireTexture'Effects.Fire.Wepn_Prifle_SFX';
               LightSaturation=0;
               LightHue=80;
            } else {
               MultiSkins[1]=FireTexture'Effects.liquid.Virus_SFX';
               LightSaturation=0;
               LightHue=0;
            }
         }
      }
   }
}

function Timer()
{
   if(bFirst != True)
   {
      bFirst = True;
      if(DeusExPlayer(Controller) != None && DeusExPlayer(Controller).PlayerReplicationInfo.Team == PlayerTeam)
      {
      } else {
         Controller=None;
         MultiSkins[1]=FireTexture'Effects.UserInterface.WhiteStatic';
         LightHue=0;
         LightSaturation=255;
      }
   } else {
      if(DeusExPlayer(Controller) != None && DeusExPlayer(Controller).PlayerReplicationInfo.Team == PlayerTeam)
      {
         Controller.PlayerReplicationInfo.Score += 1;
      } else {
         Controller=None;
         MultiSkins[1]=FireTexture'Effects.UserInterface.WhiteStatic';
         LightHue=0;
         LightSaturation=255;
      }
      bFirst = False;
   }
}

defaultproperties
{
     ControlPointName="Control Point"
     bInvincible=True
     bPushable=False
     bCanBeBase=True
     bFlammable=False
     ItemName="Control Point"
     bBlockSight=True
     Mesh=LodMesh'DeusExDeco.BarrelAmbrosia'
     MultiSkins(1)=FireTexture'Effects.UserInterface.WhiteStatic'
     CollisionRadius=16.000000
     CollisionHeight=28.770000
     LightType=LT_Steady
     LightEffect=LE_WateryShimmer
     LightBrightness=96
     LightSaturation=255
     LightHue=0
     LightRadius=4
     Mass=80.000000
     Buoyancy=12.000000
}

Just look at it, and ask questions if desired. Do not be ashamed if you don't get something!

PostPosted: Thu Jun 29, 06 7:48 pm
by MainMan
So the only time a player can get a score point, is 30 seconds after the game starts? :?

PostPosted: Thu Jun 29, 06 7:49 pm
by Alex
Code: Select all
      SetTimer(30.0, true);

It has true as second variable. It loops ;)
And actually... it gives points every 60 seconds. Just look in the timer() ;)

PostPosted: Thu Jun 29, 06 8:11 pm
by MainMan
Ahh yeah, I didn't notice that.

This is ugly though:
Code: Select all
      if(DeusExPlayer(Controller) != None && DeusExPlayer(Controller).PlayerReplicationInfo.Team == PlayerTeam)
      {
      }




You should just use:
Code: Select all
      if( (DeusExPlayer(Controller) == None) || DeusExPlayer(Controller).PlayerReplicationInfo.Team != PlayerTeam) )
      {
             <Set neutral skin here>
      }

PostPosted: Thu Jun 29, 06 8:18 pm
by Allan
It's really good, but you could save the trouble of having to actually click it by making it into function Touch (Or whatever the old UT way of doing it was) instead of function Frob. Some people are lazy bastards after all XD

PostPosted: Thu Jun 29, 06 9:19 pm
by DarkKnight
Allan wrote:It's really good, but you could save the trouble of having to actually click it by making it into function Touch (Or whatever the old UT way of doing it was) instead of function Frob. Some people are lazy bastards after all XD


Touch / Bump.

PostPosted: Thu Jun 29, 06 9:39 pm
by Alex
~MainMan~ wrote:Ahh yeah, I didn't notice that.

This is ugly though:
Code: Select all
      if(DeusExPlayer(Controller) != None && DeusExPlayer(Controller).PlayerReplicationInfo.Team == PlayerTeam)
      {
      }




You should just use:
Code: Select all
      if( (DeusExPlayer(Controller) == None) || DeusExPlayer(Controller).PlayerReplicationInfo.Team != PlayerTeam) )
      {
             <Set neutral skin here>
      }

Yea I know. I made that bit on the last end, and I was kinda lazy :roll: