Recent Posts

Pages: 1 ... 8 9 [10]
91
Unreal Tournament 2004 / Re: Manta Run Assists
« Last post by Unaben on March 18, 2024, 16:00 »
Cool, here are my suggested changes:
Code: [Select]
//============================================================================
// $Id: Mia_FlagrunInfo.uc by Jrubzjeknf
//============================================================================
class Mia_FlagrunInfo extends ReplicationInfo;

//============================================================================
// Variables
//============================================================================
var TeamInfo EnemyTeamInfo;
var float EnemyTeamScore;

var float TimeCarryingFlag;
var float FlagTakenTime;
var int ScoreMethod;
var int MaxScore;
var int MaxAdren;

var PlayerReplicationInfo LastHolderPRI;

struct VehicleDriverPoints
{
var Controller Driver;
var float TimeDriven;
};

var array<VehicleDriverPoints> VehicleDriverPointsArray;


//============================================================================
// PostBeginPlay
//
// Initiates flag monitoring.
//============================================================================
function PostBeginPlay()
{
Super.PostBeginPlay();

SetTimer(1, true);
}


//============================================================================
// Timer
//
// Checks if the flag carrier is sitting on a Vehicle. Every second he's sitting
// on one, the Vehicle driver gets an assist second. This will be used for
// giving the Vehicle driver points and adrenaline for the Vehicle run.
//============================================================================
function Timer()
{
local pawn Driver;
local Controller C;

if(Owner !=  None)
{
if(Owner.IsInState('Held'))
{
if(CTFFlag(Owner).Holder != None) {
LastHolderPRI = PlayerReplicationInfo(CTFFlag(Owner).Holder);
}
}

if(FlagTakenTime != CTFFlag(Owner).TakenTime) //the flag has just been taken, check it the flag has been captured between seconds.
{
CheckCapture();
FlagTakenTime = CTFFlag(Owner).TakenTime;
}

if(!Owner.IsInState('Home')) //The flag is being carried or has been dropped.
{
TimeCarryingFlag += 1;

if(CTFFlag(Owner).Holder != None &&
CTFFlag(Owner).Holder.Base != None &&
Vehicle(CTFFlag(Owner).Holder.Base) != None &&
Vehicle(CTFFlag(Owner).Holder.Base).Driver != None) //The flag carrier is sitting on an occupied Vehicle.
{

Driver = Vehicle(CTFFlag(Owner).Holder.Base).Driver;

if(Driver.GetTeamNum() == CTFFlag(Owner).Holder.GetTeamNum() && Driver != CTFFlag(Owner).Holder){ //The Vehicle driver is friendly (and not self!).
if (Driver.DrivenVehicle != None && Driver.DrivenVehicle.Controller != None){
C = Driver.DrivenVehicle.Controller;
}
else{
C = Driver.Controller;
}
UpdateTimeDrivenFor(C); //Give the driver seconds.
}
}
}
else if(TimeCarryingFlag != 0) //The flag is home, but has been carried. Check if the flag has been captured.
CheckCapture();
}
}


//============================================================================
// CheckCapture
//
// Check is the flag has been captured.
//============================================================================
function CheckCapture()
{
local int i;
local float RelativeTimeDriven;
local float Points;
local float Adren;

if(EnemyTeamScore != EnemyTeamInfo.Score)
{
EnemyTeamScore = EnemyTeamInfo.Score;

for(i=0; i<VehicleDriverPointsArray.Length; i++)
if(VehicleDriverPointsArray[i].Driver != None)
{
if(LastHolderPRI == None ||
LastHolderPRI.PlayerID != VehicleDriverPointsArray[i].Driver.PlayerReplicationInfo.PlayerID)
{
if (ScoreMethod == 1){
RelativeTimeDriven = VehicleDriverPointsArray[i].TimeDriven/TimeCarryingFlag;
Points = RelativeTimeDriven*MaxScore;
Adren = RelativeTimeDriven*MaxAdren;
}
else{
Points = min(VehicleDriverPointsArray[i].TimeDriven, MaxScore);
Adren = min(VehicleDriverPointsArray[i].TimeDriven*2, MaxAdren);
}

if(PlayerController(VehicleDriverPointsArray[i].Driver) != None)
PlayerController(VehicleDriverPointsArray[i].Driver).ClientMessage("Flag Run Assist! Points:"@string(int(Points * 100) / 100)$", Adrenaline:"@string(int(Adren * 100) / 100));

VehicleDriverPointsArray[i].Driver.PlayerReplicationInfo.Score += Points; //Flag carrier gets MaxScore points on flawless cap.
VehicleDriverPointsArray[i].Driver.Adrenaline += Adren; //Flag carriers get MaxAdren adrenaline.
}
}
}

TimeCarryingFlag = 0;
LastHolderPRI = None;
VehicleDriverPointsArray.Length = 0;
}


//============================================================================
// UpdateTimeDrivenFor: give current driver seconds.
// GetIndexOf: gets array index of current driver.
// AddToArray: add current driver to array.
//============================================================================
function UpdateTimeDrivenFor(Controller Driver)
{
local int i;

i = GetIndexOf(Driver);

if(i != -1)
VehicleDriverPointsArray[i].TimeDriven += 1;
else
AddToArray(Driver);
}

function int GetIndexOf(Controller C)
{
local int i;

for(i=0; i<VehicleDriverPointsArray.Length; i++)
if(VehicleDriverPointsArray[i].Driver == C)
return i;

return -1;
}

function AddToArray(Controller C)
{
local int i;

i = VehicleDriverPointsArray.Length;

VehicleDriverPointsArray.Length = i + 1; //VehicleDriverPointsArray.Length++; would make it crash 0_o
VehicleDriverPointsArray[i].Driver = C;
VehicleDriverPointsArray[i].TimeDriven = 1;
}

defaultproperties
{
}



The code is here...on the second post of this thread....
92
Unreal Tournament 2004 / Re: Manta Run Assists
« Last post by Piglet on March 18, 2024, 14:23 »
The code is here...on the second post of this thread....
93
Unreal Tournament 2004 / Re: Manta Run Assists
« Last post by Unaben on March 18, 2024, 11:32 »
It would be a lot easier of you open source it and accept pull requests, since it's kinda unexpected to make changes on a code that you don't know/see without the ability to test it yourself at all.
It this case my suggestion would be a simple maximizing that a singe flag score can't exceed 15 points.

Well, as I always say (when the code is provided)...if someone wants to spend the time and effort making it better I'll consider any submissions.

The strange thing is....I can't remember anyone other than @Holyspam ever taking me up on the offer. Guess what? His code is running...
94
Unreal Tournament 2004 / Re: Manta Run Assists
« Last post by Piglet on March 18, 2024, 09:35 »
Well, as I always say (when the code is provided)...if someone wants to spend the time and effort making it better I'll consider any submissions.

The strange thing is....I can't remember anyone other than @Holyspam ever taking me up on the offer. Guess what? His code is running...
95
Unreal Tournament 2004 / Re: Manta Run Assists
« Last post by Unaben on March 16, 2024, 18:54 »
So technically you can get more than 15 points for the same flag run with the changes, which was my whole point of that beeing kinda unfair.

If your passenger gets knocked off, you don't have the flag as driver  O:-)

The code counts the time the flag runner was on the manta and also the time for the entire flag run. It gives each driver a proportion of the 15 points for the time they were assisting:  15 / (driver assist time / flag run time)
96
Unreal Tournament 2004 / Re: Manta Run Assists
« Last post by Piglet on March 16, 2024, 18:40 »
If your passenger gets knocked off, you don't have the flag as driver  O:-)

The code counts the time the flag runner was on the manta and also the time for the entire flag run. It gives each driver a proportion of the 15 points for the time they were assisting:  15 / (driver assist time / flag run time)
97
Unreal Tournament 2004 / Re: Manta Run Assists
« Last post by sup on March 16, 2024, 17:20 »
I really understand why you were banned
98
Unreal Tournament 2004 / Re: Manta Run Assists
« Last post by Unaben on March 15, 2024, 01:35 »
Well I figured the knocked off as dies due to cringe, auto-drops the flag because of health reached zero, then you exit your mantacopter on the left side then do a little fortnite dance emote while typing `lol` into chat before picking up the flag would be self explinatory. Because that's the only way you would score the flag as a manta driver and get double 15 point awarded for the same flagrun.

If your passenger gets knocked off, you don't have the flag as driver  O:-)
99
Unreal Tournament 2004 / Re: Manta Run Assists
« Last post by Right on March 14, 2024, 23:33 »
If your passenger gets knocked off, you don't have the flag as driver  O:-)
100
Unreal Tournament 2004 / Re: Manta Run Assists
« Last post by Unaben on March 14, 2024, 22:56 »
I'm not sure which part you don't understand...

So if your passanger gets knocked down and you score the flag as a manta runner you are awarded with doubled 30+ points, this doesn't really seems reasonable for me. Some ppl can't even get this score in a 20 minute game. Saw this happen a couple of times yesterday.

It isn't 30 points per cap lol! I believe Piglet reverted to the previous code which awards 15 for driver and 15 for wingman (those are the scores I saw today at least).
Pages: 1 ... 8 9 [10]