![]() |
|
|
#1 |
|
[UT2004] Mutator Modifying Adrenaline
I am trying to randomly set the amount of points a pill gives you to a negative amount. Here is the code:
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
}
defaultproperties
{
chanceOfDowner = 0.5;
}
Code:
P.default.AdrenalineAmount = - P.default.AdrenalineAmount; Code:
P.default.PickupMessage = "Downer "; Anyone know what I am doing wrong?
__________________
![]() Code:
__ , _ __ ,
| | / \_/ \_|/ \_/ \_/ \_
\_/|/\__/ \/ |__/ \__/ \/
/| /|
\| \|
|
|
|
|
|
|
|
#2 |
|
Join Date: Oct. 3rd, 2001
Location: Frankfurt/Main, Germany
Posts: 3,829
|
Check the code:
Code:
auto state Pickup
{
function Touch( actor Other )
{
local Pawn P;
if ( ValidTouch(Other) )
{
P = Pawn(Other);
P.Controller.AwardAdrenaline(2);
AnnouncePickup(P);
SetRespawn();
}
}
}
|
|
|
|
|
|
#3 |
|
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.
__________________
![]() Code:
__ , _ __ ,
| | / \_/ \_|/ \_/ \_/ \_
\_/|/\__/ \/ |__/ \__/ \/
/| /|
\| \|
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|