This is a continuing part of a stat point system tutorial. For this tutorial will will be changing the MinigunAmmoPickup file to increase the amount of ammo every time you get an ammo pickup for the minigun.
First we must add the appropriate variable:
variable() float StatPoints
Now we must add this code:
simulated function PostBeginPlay() { Super.PostBeginPlay(); ModeTick(var dt) { if (StatPoints > 0) AmmoAmount = (StatPoints / 5) + AmmoAmount; else AmmoAmount = 50; } }
This says the variable AmmoAmount, if StatPoints is over 0, is equal to the StatPoints divided by 5 + the old ammo amount. If the statpoints are 0, then the ammo amount for the pickup is 50.
Here is the final code:
class MinigunAmmoPickup extends UTAmmoPickup; var() float StatPoints simulated function PostBeginPlay() { Super.PostBeginPlay(); ModeTick(var dt) { if (StatPoints > 0) AmmoAmount = (StatPoints / 5) + AmmoAmount; else AmmoAmount = 50; } } defaultproperties { AmmoAmount=50 //Amount of ammo you get InventoryType=Class'XWeapons.MinigunAmmo' PickupMessage="You picked up (var AmmoAmount) bullets." //The message you get when picking up the bullets PickupSound=Sound'PickupSounds.MinigunAmmoPickup' PickupForce="MinigunAmmoPickup" DrawType=DT_StaticMesh StaticMesh=StaticMesh'WeaponStaticMesh.MinigunAmmoPickup' CollisionHeight=12.750000 }
As always any corrections or comments are appreciated
Vindexus:Does this work in UT2003/4? I think I got a mutator that used AmmoAmount+=1 or something and it didnt' work with UT2004
Comments
Related Topics
Stat Points System/Damage Modifier: Your next recommended step
Page Categories
Page Information
2022-11-20T20:25:43.440680Z
2004-03-26T00:32:34Z
Vindexus
Does this work with UT2k4?
https://wiki.beyondunreal.com/Legacy:Stat Points System/Ammo Pickup Modifier
Attribution-NonCommercial-ShareAlike 3.0