View Full Version : [UT2004] Mutator Modifying Adrenaline

22nd Apr 2004, 08:23 AM
I am trying to randomly set the amount of points a pill gives you to a negative amount. Here is the code:

var() float chanceOfDowner;

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
local AdrenalinePickup P;
if( AdrenalinePickup(Other)!=NONE )
if( FRand() <= chanceOfDowner )
P = AdrenalinePickup(Other);
P.AdrenalineAmount = - P.AdrenalineAmount; //invert adrenaline amount
return false; //don't replace

chanceOfDowner = 0.5;

This refuses to change the AdrenalineAmount! I have tried doing it like this:

P.default.AdrenalineAmount = - P.default.AdrenalineAmount;

Still, no effect. I tried changing the pickup message, and this is the only one that worked:

P.default.PickupMessage = "Downer ";

However, this changes the pickup message for ALL pills in the level.

:( Anyone know what I am doing wrong?

22nd Apr 2004, 09:16 AM
Check the code:auto state Pickup
function Touch( actor Other )
local Pawn P;

if ( ValidTouch(Other) )
P = Pawn(Other);

Looks like the amount of adrenaline given by the pickup is hard-coded, despite the (misleading) presence of that variable. Bad luck. :hmm:

22nd Apr 2004, 11:29 AM
Bah. Thanks. I was working on that before I went to bed last night so it was bothering me this morning while I'm at school. Looks like I will have to replace the pickup with my own then. :)