Having a little trouble with some script I'm doing. I'm pretty much a newbie and have only done basic stuff - was hoping I could get some help here.
I have a class with only 3 int variables in it, all at 0 by default. Extending from that is a class with a mesh as default (this class spawns from another class - specifically when another mesh is destroyed), and a touch function that adds 1 to one of the ints in the parent class. Now, when I touch it, a destroy function destroys it and the int goes up by 1.
My problem is that if another one spawns, the int appears to reset. Is there a way to spawn more without resetting the int in the parent class? Essentially, in gameplay, the mesh class is a pickup. The intent is that the more of the pickup the player obtains, the more powerful their weapon gets. However, I can't increase the powerstage because everytime a new pickup spawns, the int resets. I figured I'd need to properly store the value in some way. I imagine I'm just being an idiot and not seeing the simple solution.
I also have the problem of not fully knowing when and when not to use class specifiers like abstract here, though I've tried this script both with and without it.
Parent class (PowerUp):
Extension class (PowerupLaser):
class PowerUp extends Actor
var int LaserPowerStage;
var int RocketPowerStage;
var int AcidPowerStage;
LaserPowerStage = 0
RocketPowerStage = 0
AcidPowerStage = 0
Any help at all would be appreciated, thanks.
class PowerupLaser extends PowerUp;
var EmitterSpawnable BoomEmitter;
function Touch ( Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal )
local Pawn P;
P = Pawn(Other);
if (P != none)
BoomEmitter = Spawn(class'EmitterSpawnable');
begin object class=StaticMeshComponent Name=StaticMeshComponent0
bCollideActors = true