logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Level up system (Read 108 times)
SFJake
Full Member
***
Offline


Oldunreal member

Posts: 248
Joined: Aug 15th, 2010
Gender: Male
Level up system
Feb 22nd, 2012 at 9:29pm
Print Post  
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
 
IP Logged
 
Bleeder91[NL]
Betatester
Offline


Personal Text:

Posts: 1018
Location: Location, Location, Location.
Joined: Oct 4th, 2009
Gender: Male
Re: Level up system
Reply #1 - Feb 23rd, 2012 at 9:50am
Print Post  
Can be done, next question.
  
Back to top
 
IP Logged
 
SFJake
Full Member
***
Offline


Oldunreal member

Posts: 248
Joined: Aug 15th, 2010
Gender: Male
Re: Level up system
Reply #2 - Feb 23rd, 2012 at 5:44pm
Print Post  
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]
Betatester
Offline


Personal Text:

Posts: 1018
Location: Location, Location, Location.
Joined: Oct 4th, 2009
Gender: Male
Re: Level up system
Reply #3 - Feb 24th, 2012 at 4:06pm
Print Post  
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
 
IP Logged
 
GreatEmerald
Oldunreal MasterPoster
*
Offline


The Great Emerald

Posts: 5361
Location: Vilnius, Lithuania
Joined: May 21st, 2007
Gender: Male
Re: Level up system
Reply #4 - Feb 24th, 2012 at 7:35pm
Print Post  
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
WWW  
IP Logged
 
[]KAOS[]Casey
Developer Team
Betatester
Offline


nedm

Posts: 3189
Joined: Aug 7th, 2011
Gender: Male
Re: Level up system
Reply #5 - Feb 25th, 2012 at 5:31pm
Print Post  
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: 248
Joined: Aug 15th, 2010
Gender: Male
Re: Level up system
Reply #6 - Aug 16th, 2012 at 6:53pm
Print Post  
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
Select All
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
Select All
//=============================================================================
// 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 ); 

« Last Edit: Aug 16th, 2012 at 8:34pm by SFJake »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo