Thanks to epic finally fixing their species code to work online, I've been able to create a funky emitter to attach to a custom player model. I've simply created a custom species, then use that to spawn and give an inventory item to my pawn. The inventory item then spawns an emitter and attaches it to a bone in the pawn. No problems, works like a charm.
Now I've hit a problem. Two problems in fact:
1: I'd like the emitter to die and be replaced by another, different, emitter when the player enters a water volume (to simulate bubbles underwater, instead of the effect I'm currently using). I've been playing around with PhysicsVolumeChange, but so far haven't been able to figure out a way to get the emitter to disable temporarily and be replaced by the second one.
2: I don't really want the emitter staying active while the player is in a vehicle that draws the 3rd person mesh. This is also giving me a headache, as I can't think of a way to kill the emitter when the player enters a vehicle and restart it when they exit the vehicle.
These are the 2 important classes (the emitter itself is just a basic emitter class with no extra code):
If anyone can give some pointers as to how I could achieve these two things, I'd be very much obliged
:up:
Now I've hit a problem. Two problems in fact:
1: I'd like the emitter to die and be replaced by another, different, emitter when the player enters a water volume (to simulate bubbles underwater, instead of the effect I'm currently using). I've been playing around with PhysicsVolumeChange, but so far haven't been able to figure out a way to get the emitter to disable temporarily and be replaced by the second one.
2: I don't really want the emitter staying active while the player is in a vehicle that draws the 3rd person mesh. This is also giving me a headache, as I can't think of a way to kill the emitter when the player enters a vehicle and restart it when they exit the vehicle.
These are the 2 important classes (the emitter itself is just a basic emitter class with no extra code):
Code:
//Spawned by the SPECIES class class ChairInventoryAttach extends Inventory; var ChairEffect ChairEmitter; var ChairWaterEffect ChairWaterEmitter; simulated function PostBeginPlay() { Super.PostBeginPlay(); CreateChairEmitter(); } function CreateChairEmitter() { ChairEmitter = Spawn( Class'ChairEffect', self,, Location, Rotation ); if ( ChairEmitter != None ) { ChairEmitter.SetBase(Self); } log("EmitterAttached: "$ChairEmitter); } function SetupEffect(xPawn P) { //attach the effect to the bone P.AttachToBone( ChairEmitter, 'EMITTERBone'); } function Destroyed() { if( ChairEmitter != None ) ChairEmitter.destroy(); if( ChairWaterEmitter != None ) ChairWaterEmitter.destroy(); Super.Destroyed(); } defaultproperties { }
Code:
//species class - player name changed to protect his identity ;) class SPECIES_Blah extends SPECIES_Human abstract; static function bool Setup(xPawn P, xUtil.PlayerRecord rec) { //Setup and attach the effect Super.Setup( P, rec); AttachEffect( P); return true; } static function AttachEffect(xPawn P) { local ChairInventoryAttach inv; inv=P.Spawn( Class'ChairInventoryAttach'); inv.SetupEffect( P); inv.GiveTo( P); } defaultproperties { SpeciesName="Blah" RaceNum=154 }
If anyone can give some pointers as to how I could achieve these two things, I'd be very much obliged

Comment