Hot Potato Mutator

Search, find and discuss about Mutators!
Post Reply
moonliten
Average
Posts: 30
Joined: Wed Jun 06, 2012 1:54 am

Hot Potato Mutator

Post by moonliten »

I download this little mutator from a website, but it seems to be only compatible with the demo version. What do I need to do to get it working in 436?

Also as a quick question what is the max number of mutators that UT can list? I had to install infiltration and a few other mods into a different ut folder so I could keep adding mutators and have them show up in my list.

Thanks for any help.
Attachments
HotPotat2.zip
(5.3 KiB) Downloaded 181 times
User avatar
EvilGrins
Godlike
Posts: 9725
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: Hot Potato Mutator

Post by EvilGrins »

If i had to guess I'd say 32. That's the limit for number of models, and the limit for number of skins per model, UT uses.

32 is a very popular number with UT. Would love to know why.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
User avatar
Creavion
Godlike
Posts: 4497
Joined: Sun Feb 17, 2008 7:23 pm
Personal rank: About to be non-act.
Location: Germany, Lower Saxony

Re: Hot Potato Mutator

Post by Creavion »

It is prophized that once every 1000 a great potato will be grown
The legendary hot potato! Freeza is screwed.
Hey guys, let`s play hot potato!
Just pickup the freaking rocket launcher, the grenade launcher is already included!
Quickly search out the potato! Once you have it, you will gain frags at a rate of one every 2 seconds.
Oh yearh, play that in a freaking big jungle map 1on1: I tell you, the noob will win, by escaping only!
How to install it: Just extract this archive into your Tournament Demo directory, ...
Never thought somebody would modd for a demo! Weird!

Basically the U file has only two classes:

Code: Select all

====================================================
// HotPotato.
//
// Quite an odd little mod.  I whipped this one up in my spare time.
// Once the game is started, a potato will spawn on to the map somewhere.
// The person who finds the potato, and picks it up will score points.
// If you kill a person who has the potato, you will get five points.
//=============================================================================
class HotPotato expands Mutator;

var potato potato; //the potato

function PostBeginPlay() //called immediately after the game begins
{
	if(potato==None) //if there is no tater
		spawnpotato(); //make one
	Super.PostBeginPlay(); //register the mutator and all that
}

function SpawnPotato() //makes the tater
{
	local NavigationPoint actNavPt; //NavPT we found (I used them to find a rand location for the tater)
	local int iNav,iRand; //stuff we'll use

	iNav=0; //reset the counter
	foreach AllActors(class'NavigationPoint',actNavPt) //for every nav pt
		iNav++; //count it
	iRand=int(FRand()*iNav); //pick a random nav point
	iNav=0; //reset the counter
	foreach AllActors(class'NavigationPoint',actNavPt) { //check all navpts
		iNav++; //add 1 to the counter
		if(iNav==iRand) //if we got the #
			potato=spawn(class'potato',,,actNavPt.Location,actNavPt.Rotation); //spawn a potato at the location
	}
	potato.Master=self; //set its control mutie to ourselves
}

function ScoreKill(Pawn Killer, Pawn Other) //used for score stuff
{
	if(potato.owner==Killer) //if the guy who instigated this is the same guy who has the potato
		Killer.PlayerReplicationInfo.Score-=1; //he doesn't get a pt
	if(potato.Owner==Other) { //if the guy on the bidness end of the rocket was the one with our starchy freind
		if(potato.owner!=Killer) //if it wasn't suicide
			Killer.PlayerReplicationInfo.Score+=5; //add five to the guy who killed tater dude's score
	}
	if ( NextMutator != None ) //check next mutie
		NextMutator.ScoreKill(Killer, Other); //make the next mutie do its thing
}

Code: Select all

//=============================================================================
// Potato.
//=============================================================================
class Potato expands Actor;

var string ownersname; //the owner's name
var hotpotato Master; //our controller
var float boringness; //thing we'll need later
var int blabtime;

auto state pickup //auto state, waiting for player to pick us up
{
	function BeginState() //called @ start of state
	{
		SetOwner(None); //make our owner none
		SetBase(None); //ditto w/ the base
		boringness=0; //reset the counter
		DrawType=DT_Mesh; //reset the DT
		blabtime=0;
		LightBrightness=0;
	}
	
	function Tick(float deltatime) //called every time the game is refreshed
	{
		boringness+=deltatime; //add deltatime 2 the counter
		if(boringness>=50) //if the counter's up,
			Destroy(); //destroy us
	}
	
	event Touch(actor Other) //called when something invades our collision area
	{
		if(Other.IsA('Pawn')) { //if the thing that touched us was a pawn
			SetOwner(Other); //make it our owner
			SetBase(Other); //make it our base
			DrawType=DT_None; //reset the DT
			LightBrightness=255;
			GotoState('activated'); //we're now activated
		}
	}
}

state activated //called from prev state
{
	function BeginState() //called @ start of state
	{
		local pawn actFoundPawn; //stuff we need
		ownersname=Pawn(Owner).PlayerReplicationInfo.PlayerName; //store the owner's name
		foreach AllActors(class'Pawn',actFoundPawn) //check all pawns
			actFoundPawn.ClientMessage(ownersname$" picked up the potato!"); //and tell them who's got the potato
		SetTimer(2.0,True); //set the timer
	}
	
	function Tick(float deltatime) //called when world is refreshed
	{
		local pawn guy; //guy we'll need
		
		if(owner==None || Pawn(Owner).Health<=0) { //if our owner's gone or dead
			foreach AllActors(class'Pawn',guy) //check all actors
				guy.clientmessage(ownersname$" lost the potato!"); //and tell them the potato's on the floor
			GotoState('pickup'); //we can now be picked up
		}
	}
	
	function Timer() //called at a predefined interval
	{
		local pawn guy;
		
		Pawn(Owner).PlayerReplicationInfo.Score+=1; //add one to our owner's score
		if(DeathMatchPlus(Level.Game)!=None) { //if this is a UT DM game,
			if(Pawn(Owner).PlayerReplicationInfo.Score>=DeathMatchPlus(Level.Game).Fraglimit && DeathMatchPlus(Level.Game).Fraglimit>0) { //if the fraglimit is unlimited and our owner beat the limit
				Level.Game.EndGame("fraglimit"); //the game is over
				SetTimer(999999999999999999999,False); //makesure the timer doesn't go on again
			}
		}
		LightHue=byte(FRand()*255);
		blabtime++;
		if(blabtime>5) {
			foreach AllActors(class'Pawn',guy)
				guy.ClientMessage(ownersname$" has the Potato!");
			blabtime=0;
		}
	}
}

event destroyed() { //when we get destroyed
	Master.SpawnPotato(); //make another potato
}
About to be non-active
My very last UT map project: CTF-FacePalm (tropical CTF-Face remake)
Why do I leave? click here
What I want to do next: Joining an UDK team (uncertain however) and improve 3D modelling and texture editing skills
Thanks to those who visibly supported me until/at the end!
My reactivated account on indiedb.com.
User avatar
Sp0ngeb0b
Adept
Posts: 376
Joined: Wed Feb 13, 2008 9:16 pm
Location: Cologne
Contact:

Re: Hot Potato Mutator

Post by Sp0ngeb0b »

I've never tried running a demo only mutator on 436, what's the actual error message you get? Well I believe since it's dependent on the demo core files, a simply recompile with the UT standard files could be enough (?).

In theorie, UT can handle as many mutators as you want, since they are not saved in an array, but stored in a linked list (which isn't limited in size).
Website, Forum & UTStats

Image
******************************************************************************
Nexgen Server Controller || My plugins & mods on GitHub
******************************************************************************
moonliten
Average
Posts: 30
Joined: Wed Jun 06, 2012 1:54 am

Re: Hot Potato Mutator

Post by moonliten »

Spongebob, If that is the case why doesn't the list scroll forever like the UT map list? instead it only lists a limited # of mods in the folder.

So I opened the .u file in unrealed, recompiled and saved, and was the mod now seems to load, but the model appears to be invisible, because you can run around the map and randomly get the item, but you never see it laying around. Any ideas?
Torin
Posts: 1
Joined: Mon Jun 23, 2008 11:45 pm

Re: Hot Potato Mutator

Post by Torin »

After a bit of head scratching I managed to get it working. By exporting the scripts with UCC, the 'potato' actor's default properties became available. That was the final hurdle that UTPT couldn't pass. Thats what is missing from Creavion's posting of the source, too.

Thanks Sp0ngeb0b for the clue about the demo version dependency. It mentions it right there in the readme and Creavion's post, but I didn't clue in until you pointed it up.

Cheers,
Torin
Attachments
HotPotatoUT99Retail.7z
Hot Potato mutator for RETAIL UT99
(5.13 KiB) Downloaded 143 times
UT99.org

Re: Hot Potato Mutator

Post by UT99.org »

medor wrote:work fine :tu:

Is there a way to set it with just 1 frag or lengthening the time with the console or a ini ?
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Hot Potato Mutator

Post by JackGriffin »

Torin wrote: By exporting the scripts with UCC, the 'potato' actor's default properties became available.
There are better ways of doing this. PM me if you are interested.
So long, and thanks for all the fish
moonliten
Average
Posts: 30
Joined: Wed Jun 06, 2012 1:54 am

Re: Hot Potato Mutator

Post by moonliten »

Thanks for the help! I can't wait to get to place where I can check it out.
Post Reply