Jump to content


Photo

Theme: Power


  • Please log in to reply
31 replies to this topic

#1 ambershee

ambershee

    Nimbusfish Rawks

  • Hosted
  • 3,114 posts
  • Location:Derby, UK
  • Projects:Mutator Week & Unreal 3 Projects
  •  Mad Mod Boffin

Posted 18 April 2008 - 09:19 AM

It's time for week 4! This time the theme is 'Power'!

Because of the low turn-out, the week 3 theme 'Upgrade' is still open for entries until the end of 'Power'.

The deadline for 'Power' is a long way off - this is to allow for such nasties as final exams, and people working on MSUC projects - it's May 16th.

Best of luck people.

#2 xiongmao

xiongmao
  • Members
  • 175 posts
  • Location:Paris

Posted 18 April 2008 - 12:33 PM

Are you insane !!!? :p How can we find time to complete all objectives !!!
What about linking Mutator Week to Msuc ? Mutator Week could become intermediary deadlines. Power theme could be a way to work around the different weapons from Robot Factory

#3 ambershee

ambershee

    Nimbusfish Rawks

  • Hosted
  • 3,114 posts
  • Location:Derby, UK
  • Projects:Mutator Week & Unreal 3 Projects
  •  Mad Mod Boffin

Posted 18 April 2008 - 12:40 PM

Don't forget that Mutator Week is a completely separate entity to 5 week project and robot factory - it's a project for any part time contributor to take part in, get advice with, and shouldn't be restricted to our bigger projects. Whether contributors to bigger projects can find the time or not to write something for Mutator Week is another question entirely :p

#4 five damned dollarz

five damned dollarz
  • New Members
  • 3 posts
  • Location:Churchill, Victoria, Australia
  • Projects:Mindless
  •  Something or other...

Posted 19 April 2008 - 12:39 AM

Well, I've posted my mutator for 'Power' :p I think it qualifies...

#5 xiongmao

xiongmao
  • Members
  • 175 posts
  • Location:Paris

Posted 19 April 2008 - 09:31 AM

Hi, welcome onboard :p
I take a look at your mutator that's a nice one. It's so obvious that damage cause by a player should be health dependant.
Use Tick method with caution, as your mutator is working around health, you could create a GameRule and add the code of modifyPlayer in netDamage.
A bit more efficient ;)

#6 five damned dollarz

five damned dollarz
  • New Members
  • 3 posts
  • Location:Churchill, Victoria, Australia
  • Projects:Mindless
  •  Something or other...

Posted 19 April 2008 - 12:09 PM

Thanks, I'll have a look into that other method you mentioned... Always trying to optimize, aren't we? :p

#7 ambershee

ambershee

    Nimbusfish Rawks

  • Hosted
  • 3,114 posts
  • Location:Derby, UK
  • Projects:Mutator Week & Unreal 3 Projects
  •  Mad Mod Boffin

Posted 19 April 2008 - 03:27 PM

That's the idea. There's a tutorial on ModDB for game rules, as well as mutators which use game rules in previous weeks that can be looked at.

#8 jaguar

jaguar
  • Members
  • 19 posts

Posted 22 April 2008 - 10:49 PM

I've got an idea for a mutator based on the theme power, I shall be making part of it tonight. I would like your opinions please:

Each player has a power gauge for his armour, it shields him as well as increasing the damage done by weapons. It starts at 100, and when taking no damage, recharges quickly back to 100, Ammunition pickups boost it by 20 up to a maximum of 150.

It would be simialar to halo recharging shields with the additional problem of loss of firepower when low on shield. I could also add an option (set in config or set in realtime with a key) so that you can choose how effective each system is, so you can either have effective shields and reatively ineffective weapons, or ineffective shields and very effective weapons.

#9 xiongmao

xiongmao
  • Members
  • 175 posts
  • Location:Paris

Posted 23 April 2008 - 07:44 AM

Interesting :)
Indeed Config variables are usefud for balancing. You could add Shield Recharging Time Rate.
Good luck

#10 ambershee

ambershee

    Nimbusfish Rawks

  • Hosted
  • 3,114 posts
  • Location:Derby, UK
  • Projects:Mutator Week & Unreal 3 Projects
  •  Mad Mod Boffin

Posted 23 April 2008 - 09:35 AM

It could work. Best way to find out is to try :)

#11 jaguar

jaguar
  • Members
  • 19 posts

Posted 23 April 2008 - 12:46 PM

Couldnt figure out why it wasn't working, Americans and their "armor" *shakes head*
First version ready to test

#12 jaguar

jaguar
  • Members
  • 19 posts

Posted 23 April 2008 - 06:16 PM

Well it works, can't seem to stop it regenerating after you're hit, any suggestions?

#13 xiongmao

xiongmao
  • Members
  • 175 posts
  • Location:Paris

Posted 23 April 2008 - 07:18 PM

can you post your code ?

#14 jaguar

jaguar
  • Members
  • 19 posts

Posted 23 April 2008 - 09:09 PM

This is the item
class CH_PowerArmour_Item extends UTInventory;

var float TimeLastHit;
var byte DecimalHealth;

function GivenTo(Pawn NewOwner, bool bDoNotActivate)
{
	super.GivenTo(NewOwner, bDoNotActivate);

	SetTimer(0.1, true, 'Regenerate');
}

function ItemRemovedFromInvManager()
{
	ClearTimer();
}

simulated function Regenerate()
{
	if (UTPawn(Instigator) != None)
	{
		if ((WorldInfo.TimeSeconds - TimeLastHit) >= 5)
		{
		   if (UTPawn(Instigator).ShieldBeltArmor <= 90)
		   {
			  UTPawn(Instigator).ShieldBeltArmor += 1;
		   }
		   else
		   {
				if (UTPawn(Instigator).ShieldBeltArmor == 100)
				{
				   if (DecimalHealth > 9)
				   {
					  UTPawn(Instigator).GiveHealth(2,100);
					  DecimalHealth = 0;
				   }
				   else
				   {
					   DecimalHealth++;
				   }
				}
				else
				{
					UTPawn(Instigator).ShieldBeltArmor = 100;
				}
		   }
		}
	}
}

simulated function OwnerEvent(name EventName)
{
	if (EventName == 'TakeDamage')
	{
		TimeLastHit = WorldInfo.TimeSeconds;
	}
}

defaultproperties
{

	bReceiveOwnerEvents=True
}

The last bit which waits for 'takedamage' can't be receiving the event.
I know getting an event to happen every 0.1 secs will put more strain on a system than once every 2 secs, but it does look better :)

*Edit* Just went searching for information on what arguments `log takes, and found.... this forum, thanks guys, specificly those posting code in the light mutator :)

Edited by jaguar, 23 April 2008 - 09:31 PM.


#15 ambershee

ambershee

    Nimbusfish Rawks

  • Hosted
  • 3,114 posts
  • Location:Derby, UK
  • Projects:Mutator Week & Unreal 3 Projects
  •  Mad Mod Boffin

Posted 23 April 2008 - 09:19 PM

Why an inventory item?

#16 jaguar

jaguar
  • Members
  • 19 posts

Posted 23 April 2008 - 09:28 PM

Seemed the easiest way, is there a better way?

#17 jaguar

jaguar
  • Members
  • 19 posts

Posted 23 April 2008 - 09:57 PM

Now using gamerules, thanks ambershee

#18 jaguar

jaguar
  • Members
  • 19 posts

Posted 24 April 2008 - 12:20 AM

Extended GameRules, but i can't seem to get my armour to regenerate, anybody know why?
Nothing in the logs

class CH_PowerArmour_GameRules extends GameRules;

var float TimeLastHit;
var float TimeLastRegen;
var byte DecimalHealth;

simulated function tick()
{
	if (WorldInfo.TimeSeconds - TimeLastRegen > 0.1)
	{
	Regenerate();
	TimeLastRegen = WorldInfo.TimeSeconds;
	}
}

simulated function Regenerate()
{
	if (UTPawn(Instigator) != None)
	{
		if ((WorldInfo.TimeSeconds - TimeLastHit) >= 5)
		{
		   if (UTPawn(Instigator).ShieldBeltArmor <= 90)
		   {
			  UTPawn(Instigator).ShieldBeltArmor += 1;
		   }
		   else
		   {
				if (UTPawn(Instigator).ShieldBeltArmor == 100)
				{
				   if (DecimalHealth > 9)
				   {
					   UTPawn(Instigator).GiveHealth(2,100);
					   DecimalHealth = 0;
				   }
				   else
				   {
					   DecimalHealth++;
				   }
				}
				else
				{
					UTPawn(Instigator).ShieldBeltArmor = 100;
				}
		   }
		}
	}
}

simulated function OwnerEvent(name EventName)
{
	if (EventName == 'TakeDamage')
	{
		TimeLastHit = WorldInfo.TimeSeconds;
	}
}

function NetDamage( int OriginalDamage, out int Damage, pawn injured, Controller instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )
{
	if (UTPawn(Instigator) != none)
	{
	   Damage = OriginalDamage * (1 + UTPawn(Instigator).ShieldBeltArmor / 100);
	}
	if ( NextGameRules != None )
		NextGameRules.NetDamage( OriginalDamage,Damage,injured,instigatedBy,HitLocation,Momentum,DamageType );
}


defaultproperties
{
	TimeLastHit = 0;
	TimeLastRegen = 0;
	DecimalHealth = 0;
}


#19 xiongmao

xiongmao
  • Members
  • 175 posts
  • Location:Paris

Posted 24 April 2008 - 07:12 AM

Did you add your GameRules to your mutator ? (I think it's obvious)

If I'm not wrong, Mutator and GameRules run on Server, so you can't use instigator:
2 ways:
- You can use arguments' method to get what you need :
function NetDamage( int OriginalDamage, out int Damage, pawn injured, Controller instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )

- You can loop on pawn using foreach method

local UTPawn pawn //iterator
foreach WorldInfo.allPawn(class'UTPawn', pawn)
{
}


#20 jaguar

jaguar
  • Members
  • 19 posts

Posted 24 April 2008 - 12:04 PM

Unrecognised member allPawn in WorldInfo
Also do you mean i can delete (Instigator) from the damage function?

I'm enthusiastic, but don't have that much experience.

Edited by jaguar, 24 April 2008 - 12:10 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users