PDA

View Full Version : Can't get this Mutator to work



Amornus
11-23-2007, 12:45 AM
Hey guys,

I tried doing one of the tutorials from the UnrealWiki but I am unable to get it working. The code compiles fine without any errors and even shows up correctly in the game under mutators but it won't apply any of the settings.

Heres my code so far:



class JumpBooster extends UTMutator;

var int MultiJumpCount, MultiJumpBoost, StartingHealth, MaximumHealth, SuperDuberMaximumHealth;

function ModifyPlayer(Pawn P)
{
local UTPawn x;
x = UTPawn(P);
if (x != None)
{
x.MaxMultiJump = MultiJumpCount;
x.MultiJumpBoost = MultiJumpBoost;
x.Health = StartingHealth;
x.HealthMax = MaximumHealth;
x.SuperHealthMax = SuperDuberMaximumHealth;
}
Super.ModifyPlayer(P);
}

defaultproperties
{

MultiJumpCount=10
MultiJumpBoost=50
StartingHealth=250
MaximumHealth=250
SuperDuberMaximumHealth=500
GroupNames(0)="Jump Booster"
Components(0)=Sprite
Name="Default__UTMutator_JumpBooster"
ObjectArchetype=UTMutator'UTGame.Default__UTMutato r'
}

Thanks in advance

Postal0311
11-23-2007, 01:33 AM
Default props are not imported, you need to make it call an INI file, and set those settings in the INI file.

KewlAzMe
11-23-2007, 11:59 AM
Also, why would you call it "JumpBooster" if you are also going to be modifying Health and stuff?

Hawkwise
11-23-2007, 02:59 PM
I think he was testing to see if he could make a mutator more than actually making one people want to use. So name is irrelevant.

VerteX
11-23-2007, 04:16 PM
it's from...if im' not wrong...unrealwiki

VerteX
11-23-2007, 04:17 PM
it's a port from unrealwiki, if it's what i think

KewlAzMe
11-23-2007, 04:32 PM
Just another reason why the wiki needs to be updated and separated for UT3

polymer
11-23-2007, 05:16 PM
Why do you create a local x? That seems kinda redundant...

KewlAzMe
11-23-2007, 07:50 PM
Why do you create a local x? That seems kinda redundant...

agreed. Keep it as small as possible

Lotus
11-24-2007, 08:52 PM
Everything I see there seems fine.

Try adding a logging statement in modifyplayer and make sure you're actually running the mutator. I think that more likely than not, the mutator just isn't running.

woooo
11-30-2007, 11:55 AM
try var config int ?

Geist
12-01-2007, 02:22 AM
Why do you create a local x? That seems kinda redundant...

Um... probably because those vars (e.g. MaxMultiJump, etc) are in UTPawn, not Pawn, so he can't use P alone -- without casting it to UTPawn.

Geist
12-01-2007, 02:59 AM
Hey Amornus, I just copy/pasted your script into a new dir and compiled, tested it, and it worked. You should definitely log something to the console to make sure you are really loading it.

P.ClientMessage("JumpBooster!!!");

Me, I tested it via Instant Action on an empty test map... I spawned with 250 health, could jump 10 times in the air, etc. And if you hit ESC and click Rules (at the bottom), you should see your mutator listed.