Main

Forums

Wiki

Downloads

Tutorials

Walkthrough

Unreal-netiquette

Links

Submit-News

Oldunreal's hosted:
UnrealReference

Usermaps

Real-CTF

Donate for Oldunreal:

Oldunreal Donation
Oldunreallogo
  Welcome, Guest. Please Login or Register
 
  HomeHelpSearchLoginRegister  
 
 
Level up system (Read 663 times)
SFJake
Full Member
***
Offline


Oldunreal member

Posts: 213
Gender: male
Level up system
02/22/12 at 21:29:09
 
This is a long lost idea and I've been told its impossible. But I don't believe in impossible things.

What I want is simple: A way for the player to kill monsters and be rewarded with a choice, to boost certain characteristic of his.

I already have items that boost speed, damage, maximum health, and that persists through death and map travel with JCoopZ. That part is all well and done.

However, I have no way to distribute them. I'm looking for possible suggestions on how to do this.

The main idea I had in mind, that I -could- work with, is a specific section in a map (or even, a separate map one goes to between each coop map) with triggers that can exchange an item (that would be XP) for an upgrade item.

My problems with this idea are:

-I could not possibly have a clue how to make the exchange. Lets say XP were flares, and a trigger would take 10 Flares and give you an upgrade. How would this be done?

-The XP. Making an hidden item that can replace the flares above is easy: but how can a player acquire it? Ideally, killing a monster would automatically give the killer X amount of that item. But how? (and ideally, this needs to be doable in the default classes as well!)


This all has to be technically possible. However, I'd need quite a bit of guidance to make it happen. But before going any further, the main question is:

Can it be done? It doesn't have to be done in -this manner-, its just one idea.
Back to top
« Last Edit: 02/22/12 at 21:30:27 by SFJake »  
 
IP Logged
 
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 784
Location, Location, Location.
Gender: male
Re: Level up system
Reply #1 - 02/23/12 at 09:50:59
 
Can be done, next question.
Back to top
 
WWW WWW Bleeder91[NL]  
IP Logged
 
SFJake
Full Member
***
Offline


Oldunreal member

Posts: 213
Gender: male
Re: Level up system
Reply #2 - 02/23/12 at 17:44:41
 
Alright. I'll start with the part with which I haven't the slightest clue how to tackle it.

The XP: I need some way to reward players from their kills, beyond mere item dropping, and something that is different depending on their monsters.

I have little/no experience in mutators, if they could handle that. What should I do? Any game plan?
Back to top
 
 
IP Logged
 
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 784
Location, Location, Location.
Gender: male
Re: Level up system
Reply #3 - 02/24/12 at 16:06:58
 
Is it for JCoopZ only? Because you may need to ask someone like Zombie how JCoopZ handles mutators, since you probably would need the Killed() function in the gametype. There might be another way, which is by adding an item to the drop list (JCoopZ) that checks for the spawners total default health and give EXP according to that.
Back to top
 
WWW WWW Bleeder91[NL]  
IP Logged
 
GreatEmerald
Oldunreal MasterPoster
******
Offline


The Great Emerald

Posts: 5237
Vilnius, Lithuania
Gender: male
Re: Level up system
Reply #4 - 02/24/12 at 19:35:44
 
Yea, if it wasn't possible, then UT2004RPG wouldn't exist Wink But yes, you might need some more mutator functionality, provided by either custom co-op modes or 227.
Back to top
 

... - Unreal II Combat Assault Rifle
My own website (GreatEmerald's Domain)!
...
WWW WWW  
IP Logged
 
GenericHero
Oldunreal MasterPoster
******
Offline


nedm

Posts: 2912
Gender: male
Re: Level up system
Reply #5 - 02/25/12 at 17:31:16
 
Best way is to spawn a pawn that can't move or doesn't do anything thats a direct subclass of Pawn and intercept the Killed function there, or use something like xCoop/jgrass to make a MutatorPlus there
Back to top
 
 
IP Logged
 
SFJake
Full Member
***
Offline


Oldunreal member

Posts: 213
Gender: male
Re: Level up system
Reply #6 - 08/16/12 at 19:53:28
 
Alright, after a while, I decided to try this. Was easier than I expected, but I met a problem.

I have this actor (under pawn), and just having it in the level makes the players get XP for their kills. Great.

However, when a player died by certain shots, it crashed, saying it couldn't find "ParseKillMessage" in SFKillCheck. Okay, added that, it fixed it.

But now, when a player kills himself, it causes a General Protection Fault, be it on a projectile suicide or on using the suicide command, and the only error thats ever in common is:

Code:
Critical: UObject::ProcessEvent 



I'm at quite a loss. :/

EDIT: It crashes even on a map change (!) when the game tries to delete the player.

EDIT2: Well nevermind, I fixed that. Force the functions in Killed() to happen only when a Player is the killer -and- when the thing killed is not a player. Seems to work for now.
Code:
//=============================================================================
// SFKillCheck.
//=============================================================================
class SFKillCheck expands Pawn;

var int bSFXP;
var int bSFXPTotal;

function ScoreKill(Pawn Killer, Pawn Other)
{
	if(!Killer.bIsPlayer)
	{
		return;
	}
	if(Killer == none && (Other == none) )
	{
		return;
	}
	if(Killer != none && (Killer.bIsPlayer))
	{
			if(Other.AttitudeToPlayer >= 5)
			{
				BroadcastMessage(PlayerPawn(Killer).PlayerReplicationInfo.PlayerName @ "killed" @ Other.GetHumanName() $ "!");
			}
			else if(Other.IsA('Pawn'))
			{
				if ( Other.VolumeBrightness <= 0)
					bSFXP = bSFXPc(Other);
				else
					bSFXP = Other.VolumeBrightness;
				if (Other.VolumeFog > 0)
					bSFXP = bSFXP*Other.VolumeFog;
				if (bSFXP > 0)
				{
				GiveXP1(Killer, Class'SFXP', bSFXP);
				PlayerPawn(Killer).ClientMessage("+"@bSFXP@" XP, Total"@bSFXPTotal@" XP");
				}
			}
			else
			{
				PlayerPawn(Killer).ClientMessage("You killed" @ Other.GetHumanName());
			}
	}
}



function Killed(Pawn Killer, Pawn Other, name DamageType)
{
	if(Other == none)
	{
		ScoreKill(Killer, Other);
	}
	else
	{
		super(GameInfo).Killed(Killer, Other, DamageType);
	}
}

function GiveXP1(Pawn Other, class<Pickup> InventoryName, int bXPAmount)
{
	local Pickup A;

	while ( bXPAmount > 0 )
	{
		bXPAmount-=1;
		A = Pickup(Other.FindInventoryType(InventoryName));
		if ( A != None )
		{
			A.NumCopies++;
		}
		else
		{
			A = Spawn(InventoryName);
			Other.AddInventory(A);
			A.BecomeItem();
			A.GotoState('Idle2');
		}
	}
	bSFXPTotal=A.NumCopies+1;
}

Function int bSFXPc(Pawn Other)
{
	if(Other.IsA('Zombie'))
		return 1;
	else if(Other.IsA('LesserBrute'))
		return 40;
	else if(Other.IsA('Behemoth'))
		return 115;
	else if(Other.IsA('Brute'))
		return 75;
	else if(Other.IsA('Devilfish'))
		return 10;
	else if(Other.IsA('Fly'))
		return 5;
	else if(Other.IsA('GiantGasbag'))
		return 135;
	else if(Other.IsA('Gasbag'))
		return 45;
	else if(Other.IsA('KrallElite'))
		return 45;
	else if(Other.IsA('Krall'))
		return 40;
	else if(Other.IsA('GiantManta'))
		return 80;
	else if(Other.IsA('CaveManta'))
		return 12;
	else if(Other.IsA('Manta'))
		return 15;
	else if(Other.IsA('MercenaryElite'))
		return 60;
	else if(Other.IsA('Mercenary'))
		return 45;
	else if(Other.IsA('Predator'))
		return 20;
	else if(Other.IsA('Pupae'))
		return 15;
	else if(Other.IsA('Queen'))
		return 500;
	else if(Other.IsA('SkaarjGunner'))
		return 50;
	else if(Other.IsA('SkaarjInfantry'))
		return 45;
	else if(Other.IsA('SkaarjOfficer'))
		return 55;
	else if(Other.IsA('SkaarjSniper'))
		return 40;
	else if(Other.IsA('SkaarjTrooper'))
		return 40;
	else if(Other.IsA('IceSkaarj'))
		return 50;
	else if(Other.IsA('SkaarjAssassin'))
		return 55;
	else if(Other.IsA('SkaarjBerserker'))
		return 80;
	else if(Other.IsA('SkaarjLord'))
		return 80;
	else if(Other.IsA('SkaarjScout'))
		return 45;
	else if(Other.IsA('SkaarjWarrior'))
		return 50;
	else if(Other.IsA('Slith'))
		return 45;
	else if(Other.IsA('Spinner'))
		return 22;
	else if(Other.IsA('Squid'))
		return 30;
	else if(Other.IsA('Tentacle'))
		return 5;
	else if(Other.IsA('StoneTitan'))
		return 400;
	else if(Other.IsA('Titan'))
		return 400;
	else if(Other.IsA('WarLord'))
		return 275;
	else if(Other.IsA('Hawk'))
		return 20;
	else
		return 0;
}

function string ParseKillMessage( string KillerName, string VictimName, string WeaponName, string DeathMessage ); 

Back to top
« Last Edit: 08/16/12 at 21:34:08 by SFJake »  
 
IP Logged
 
(Moderators: Buster, pÍtßűll, DieHard SCWS)