Page 1 of 1

Melee Bombing Run

Posted: Mon Nov 27, 2006 4:50 am
by lord_kungai
Just needed some help from the experts (where ever they may be...) :D

New BallLuncher:

Code: Select all

class MBallLauncher extends BallLauncher

var int drainTotal

//this function is a modified version of the healing function. Now it drains health from the ball carrier

simulated function ModifyPawn( float dt )
{
    if ( Instigator.Weapon == self && Instigator.PlayerReplicationInfo.HasFlag != None)
    {
	    drainTotal += 1;
	    Instigator.Health -= 1;
    }

    if ( Instigator.Weapon != self && Instigator.PlayerReplicationInfo.HasFlag != None)
    {
        xBombFlag(Instigator.PlayerReplicationInfo.HasFlag).SetHolder( Instigator.Controller );
    }
}

//this function causes the ball carrier to slow down

simulated function BringUp(optional Weapon PrevWeapon)
{
    if ( Instigator.PlayerReplicationInfo.HasFlag == None )
    {
        Instigator.AirControl *= 0.5;
        Instigator.GroundSpeed *= 0.5;
	  Instigator.WaterSpeed *= 0.5;
	  Instigator.AirSpeed *= 0.5;
	  Instigator.JumpZ *= 0.5;
    }
    Super.BringUp();
}

//this function causes the ball carrier to speed up when the ball is thrown or lost and also returns all the health drained, back to the ex-ball carrier

simulated function bool PutDown()
{
    if ( Instigator.PlayerReplicationInfo.HasFlag == None )
    {
        Instigator.AirControl *= 2;
        Instigator.GroundSpeed *= 2;
	  Instigator.WaterSpeed *= 2;
	  Instigator.AirSpeed *= 2;
	  Instigator.JumpZ *= 2;
	  Instigator.Health += drainTotal;
    }
    return Super.PutDown();
}

//def props
defaultproperties
{
	drainTotal=0
}
New ChaosBot:

Code: Select all

class ChaosMBRBot extends ChaosBot

simulated function Bool CheckForMeleeGame()
{
if (level.Game.IsA('MBombingRun') &&  Level.Game.GetPropertyText("WeaponOption") ~= "0")
{
     Return True;
}
else
{
Super.CheckForMeleeGame();
}
}

DefaultProperties
{
}
New Bombing Run Gametype:

Code: Select all

class MBombingRun extends xBombingRun

//copied from ChaosxDeathmatch

event InitGame( string Options, out string Error )
{

    local bool bMFound;

    ForEach AllActors(class'Mutator', MUT)
    {
        If (MUT.IsA('ChaosUT'))
        {
           bMFound=true;
           Break;
        }
    }
    If(!bMFound)
    {
       Level.Game.AddMutator("ChaosGames.ChaosUT");
    }
}

//copied from ChaosxDeathmatch

event PreBeginPlay()
{
    Super.PreBeginPlay();

    Spawn(class'ChaosMeleeInfo');
}

//copied from ChaosxDeathmatch

function AddDefaultInventory( pawn P )
{
	Super.AddDefaultInventory(P);
	if (ChaosPRIBase(P.PlayerReplicationInfo) != None && bMeleeGame)
	   ChaosPRIBase(P.PlayerReplicationInfo).GiveMeleeWeapon(P, ChaosGRIBase(GameReplicationInfo));
}

//copied from ChaosxDeathmatch

event PlayerController Login( string Portal, string Options, out string Error )
{
    local PlayerController NewPlayer;
    local CUTReplicationInfo CUTPRI;

    NewPlayer = Super.Login(Portal, Options, Error);
    if (NewPlayer != None )
      NewPlayer.PawnClass=Class'ChaosGames.ChaosxDeathMatch_Pawn';

	CUTPRI = Spawn(class'CUTReplicationInfo', NewPlayer);
	if ( CUTPRI != None )
		CUTPRI.myPRI = NewPlayer.PlayerReplicationInfo;

    return NewPlayer;
}

//copied from ChaosxDeathmatch

function Bot SpawnBot(optional string botName)
{
    local Bot NewBot;
    local RosterEntry Chosen;
    local UnrealTeamInfo BotTeam;

    BotTeam = GetBotTeam();
    Chosen = BotTeam.ChooseBotClass(botName);

    if (Chosen.PawnClass == None)
        Chosen.Init(); //amb

    NewBot = Spawn(class'ChaosMBRBot');
    if ( NewBot != None )
        InitializeBot(NewBot,BotTeam,Chosen);
    return NewBot;
}

//copied from xBombingRun. Modified to support the new BallLauncher

simulated function ScoreBomb(Controller Scorer, xBombFlag theFlag)
{
    local bool ThrowingScore;
	local int i;
	local float ppp,numtouch,maxpoints,maxper;
	local controller C;

    Bomb = theFlag;

    if( ResetCountDown > 0 )
    {
        //log("Ignoring score during reset countdown.",'BombingRun');
        theFlag.SendHome();
        return;
    }

	// blow up all redeemer guided warheads
	for ( C=Level.ControllerList; C!=None; C=C.NextController )
		if ( (C.Pawn != None) && C.Pawn.IsA('RedeemerWarhead') )
			C.Pawn.Fire(0);

    // are we dealing with a throwing score?
    if (Scorer.PlayerReplicationInfo.HasFlag == None)
        ThrowingScore = true;
    if ( (Scorer.Pawn != None) && Scorer.Pawn.Weapon.IsA('MBallLauncher') )
		Scorer.ClientSwitchToBestWeapon();

	theFlag.Instigator = none;	// jmw - need this to stop the reentering of ScoreBomb due to touch with the base

    // awards for scoring
	IncrementGoalsScored(Scorer.PlayerReplicationInfo);
	OldScore = Scorer.PlayerReplicationInfo.Team.Score;
    if (ThrowingScore)
	{
        Scorer.PlayerReplicationInfo.Team.Score += 3.0;
		Scorer.PlayerReplicationInfo.Team.NetUpdateTime = Level.TimeSeconds - 1;
		TeamScoreEvent(Scorer.PlayerReplicationInfo.Team.TeamIndex,3,"ball_tossed");

		// Individual points

		Scorer.PlayerReplicationInfo.Score += 2; // Just for scoring
		MaxPoints=10;
		MaxPer=2;
		ScoreEvent(Scorer.PlayerReplicationInfo,5,"ball_thrown_final");
	}
    else
	{
  		Scorer.PlayerReplicationInfo.Team.Score += 7.0;
		Scorer.PlayerReplicationInfo.Team.NetUpdateTime = Level.TimeSeconds - 1;
		TeamScoreEvent(Scorer.PlayerReplicationInfo.Team.TeamIndex,7,"ball_carried");

		// Individual points

		Scorer.PlayerReplicationInfo.Score += 5; // Just for scoring
		MaxPoints=20;
		MaxPer=5;
		ScoreEvent(Scorer.PlayerReplicationInfo,5,"ball_cap_final");
	}
	Scorer.PlayerReplicationInfo.NetUpdateTime = Level.TimeSeconds - 1;

	// Each player gets MaxPoints/x but it's guarenteed to be at least 1 point but no more than MaxPer points
	numtouch=0;
	for (i=0;i<TheFlag.Assists.length;i++)
	{
		if ( (TheFlag.Assists[i]!=None) && (TheFlag.Assists[i].PlayerReplicationInfo.Team == Scorer.PlayerReplicationInfo.Team) )
			numtouch = numtouch + 1.0;
	}

	ppp = MaxPoints / numtouch;
	if (ppp<1>MaxPer)
		ppp = MaxPer;

	for (i=0;i<TheFlag>= GoalScore) )
		EndGame(Scorer.PlayerReplicationInfo,"teamscorelimit");
	else if ( bOverTime )
		EndGame(Scorer.PlayerReplicationInfo,"timelimit");

    ResetCountDown = ResetTimeDelay+1;
    if ( bGameEnded )
        theFlag.Score();
    else
        theFlag.SendHomeDisabled(ResetTimeDelay);
}

defaultProperties
{
GameName="MBR"
Description="Each level has a ball that starts in the middle of the playing field.  Your team scores by getting the ball through the enemy team's hoop.  You score 7 points for jumping through the hoop while holding the ball, and 3 points for tossing the ball through the hoop.  The ball can be passed to teammates, and is dropped if the player carrying it is killed. This version of Bombing Run is played only with Chaos UT Melee weapons. Also, the ball carrier has reduced speed and loses health passively."
}
The thing is, I'm still not able to see where I can:

1) Replace the old Ball Launcher with the new one
2) Replace all the weapons with only melee weapons and translocator
3) Put the whole thing together

Posted: Mon Nov 27, 2006 8:24 am
by lord_kungai
Added:

Code: Select all

class MBallShoot extends BallShoot;

simulated function projectile SpawnProjectile(Vector Start, Rotator Dir)
{
    local xBombFlag bomb;
    local vector ThrowDir;

    Bomb = xBombFlag ( Weapon.Instigator.Controller.PlayerReplicationInfo.HasFlag );
    Bomb.PassTarget = BallLauncher(Weapon).PassTarget;
	ThrowDir = 3 * Bomb.ThrowSpeed * vector(Dir);
	bomb.Throw(Start, ThrowDir);
	BallLauncher(Weapon).PassTarget = None;
    return None;
}

defaultproperties
{
    FireRate=0.01
}

In an attempt to make the ball launcher instantfire and really powerful (long range), so that, while the speed factor of the carrier is decreased, the carrier can fire harder...

I'm trying to go in for something like a 30 second rule here. Running with the ball is not encouraged (unless its like for a slam-dunk or something), but passing and volleying is encouraged...

i hope...

Combine that with the melee weps and you've got yourself Unreal UberFootball

Posted: Mon Nov 27, 2006 10:27 am
by lord_kungai
Ok, deleted everything and started again.

I was working from the wrong angle. Now I've extended a xballflag object...

I retained the modded balllauncher, except i changed the code a bit so as to 1) heal and 2) change the speed of the holder based on the ammo state, not the gun state...

the ballflag sorta summons the Balllauncher...

What else?

Oh, yeah: the bombing run gametype itself. i basically extended the default br gametype, then I copied all the functions that had 'xbombflag' in them and renamed them to the extended xballflag object that I had made...




man, i feel like the chef of a successful matador... always dealing with balls...

Posted: Mon Nov 27, 2006 10:43 am
by lord_kungai
Ok, so that didn't work...




I've reconstructed the bombing run gametype, this time from scratch... kinda

I basically copied the xBombingRun uc file and renamed all the custom variables and objects...


Let's see if this works...





Oh, BTW: CUT doesn't seem to be compatible with my custom classes... :?

Posted: Mon Nov 27, 2006 11:24 am
by lord_kungai
A little more succesful...


Im going to replicate/extend all the 'xbomb...' classes and see what happens...

Posted: Mon Nov 27, 2006 11:45 am
by lord_kungai
And that didn't work either...



Right now, i have 6 classes from the bombing run gametype, all simply renamed copies of the original BR uc files; with some modifications...


Furget this... I'll be back tomorrow...

Posted: Mon Nov 27, 2006 4:47 pm
by jb
Hehe,

welcome to my world. So how far did you get? Did you get melee weapons in the BR game you made?

If so thats step one. Once we have that working we can add the balllauncher and xbomb (if that is needed) that you did. Again hit me up in real time for better help!

Posted: Mon Nov 27, 2006 5:12 pm
by lord_kungai
Hmmm... hitting you in real time would be difficult, considering that you live halfway around the planet. Its easier to hit someone who lives fully around the planet :D


I reckon that I have to create a totally new version of BR, not just a couple of extended classes. Melee weapons are far away, as of now. i'm working with the shield gun (just using shield gun arena mutator) as a substitute...

The balllauncher is where I started... I modified it to cause a temporary health drain (IE: the health drained is replaced when the ball is fired) and speed reduction while carrying the ball...

Then I realised that the a new xBomb was needed in order to 'give' the ball launcher to the player. Then I realised that to modify the xBomb, I would need to reconstruct all of BR...

Phew...

As of now, my partially reconstructed version of BR works, except for the fact that the ball is not spawning in the BR map... :(

Your world... is nightmarish... but fun!



Anyways, I need to sleep now (11:PM in India...)
I'll get back to this tomorrow, after school.

Posted: Wed Nov 29, 2006 1:33 pm
by lord_kungai
Great...



Just great...


Tunrs out that the entire angle I was going for - advanced BR - has already been made.


Deathball.

So all my work is kaput...

:cry: Sigh...



Anyways, at least it'll be fun playing... :)

Thanks for the help people, directly or indirectly!

Posted: Wed Nov 29, 2006 10:26 pm
by jb
lord_kungai,

sorry I was hoping we could have worked on this over the weekend as I am sure we could find some time then. But if you need more help let me know!

Posted: Thu Nov 30, 2006 11:50 am
by lord_kungai
np, yyar...



No, what I realised yesterday is that Deathball is basically what I was trying to code. but if it has already been done, then... well, I can start another project sometime :?

Posted: Thu Nov 30, 2006 1:47 pm
by jb
Ok no problem, still it would be a good learning project for you.. :)

Posted: Thu Nov 30, 2006 3:41 pm
by Romulus777
here's a thought, how about making a it a soccer (probably football in your area) gametype.
We can keep the melee weapons, and make a cool bicycle kick anamation. :D

Posted: Sat Dec 02, 2006 1:30 pm
by lord_kungai
Romulus777 wrote:here's a thought, how about making a it a soccer (probably football in your area) gametype.
We can keep the melee weapons, and make a cool bicycle kick anamation. :D
Already on it...

Kinda...




I'm making a pure-deflection-BR thingy (at least, I'm trying to), which is based on the shield gun vs. the ball only. Maybe I'll evn try to add the melee weapons to it...


but a little later though. I have my tests coming up. Next week, I'll actually start the coding...