Help creating custom arena mutator?

Discussions about Coding and Scripting
Post Reply
Coppyhop
Posts: 1
Joined: Wed Jul 20, 2016 8:45 pm

Re: Help creating custom arena mutator?

Post by Coppyhop »

I've been trying to make a custom Arena mutator, but to no avail. I have a class that extends Arena, which is then referenced in my int, however when you spawn you have no weapons! I see know way to actually define what weapon the arena mutator should use, where is it?

--Edit by UnrealGecko--

Well I've got it working, except you don't spawn with the weapon, it spawns on the ground below you!

Please avoid double posting, use the edit button to update your post
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Help creating custom arena mutator?

Post by sektor2111 »

1st - STOP Double posting in 24 hours, RTFM for this forum aka RULES.
2nd - Check "defaultproperties" example PulseGunArena or such - actually some of those have no code it's just a "defaultproperties" switching.
It takes a couple of minutes for doing an ArenaMutator based on default model (writing, compiling and testing).

Then we can speak about options a la 2016 against maps which are screwing up mutators with their "setup".
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Help creating custom arena mutator?

Post by MrLoathsome »

Arena mutator code is quick and easy.

As an example, here is the entire source for the Arena mutator I did for my Laser gun:

Code: Select all

//=============================================================================
// LoathsomeLaserArena.
// replaces all weapons and ammo with Loathsome Lasers and Laser Batteries.
//=============================================================================

class LLA expands Arena config(LaserArena_RC3);

var() config int LaDamage;
var() config int LaLength;
var() config bool bLaShowLen;

function bool AlwaysKeep(Actor Other)
{
	if ( Other.IsA(WeaponName) )
	{
		Weapon(Other).PickupAmmoCount = Weapon(Other).AmmoName.Default.MaxAmmo;
		LL(Other).LaserDamage = LaDamage;
		LL(Other).LaserLength = LaLength;
		LL(Other).bShowLen = bLaShowLen;
		return true;
	}
	if ( Other.IsA(AmmoName) )
	{
		Ammo(Other).AmmoAmount = Ammo(Other).MaxAmmo;
		return true;
	}

	if ( NextMutator != None )
		return ( NextMutator.AlwaysKeep(Other) );
	return false;
}

defaultproperties
{
     LaDamage=72.0
     LaLength=12
     bLaShowLen=0
     WeaponName=LL
     AmmoName=LAmmo
     WeaponString="LoathsomeLaser_RC3.LL"
     AmmoString="LoathsomeLaser_RC3.LAmmo"
     DefaultWeapon=Class'LoathsomeLaser_RC3.LL'
}
This also shows how to set 3 config variables for your weapon, if it supports any config variables.
blarg
Post Reply