Main

Forums

Wiki

Downloads

Tutorials

Walkthrough

Unreal-netiquette

Links

Submit-News

Oldunreal's hosted:
UnrealReference

Usermaps

Real-CTF

Donate for Oldunreal:

Oldunreal Donation
Oldunreallogo
  Welcome, Guest. Please Login or Register
 
  HomeHelpSearchLoginRegister  
 
 
Emitter problem (Read 590 times)
Executor
YaBB Newbies
*
Offline


Oldunreal member

Posts: 3
Gender: male
Emitter problem
09/15/11 at 18:31:11
 
Hi, I recently tried to make a temporary effect for a mod using the BeamEmitter class. I made a death prevention ability for one of my player classes, so when the player dies, he disappears, an effect is spawned ( a beam shooting towards the sky ), and after 5 seconds the player respawns at the location he died. I tried to use the BeamEmitter for this ( I made a subclass called ReviveEffect with bNoDelete false so it can be spawned ), but whenever I spawn the emitter during gameplay ( the script spawns it ), the game crashes. Is this a bug, or are these emitters only for mapmaking? ( can't be spawned during gameplay )

This is the error I get: i52.tinypic.com/nqo29i.jpg

EDIT: I use the 227h patch
Back to top
« Last Edit: 09/15/11 at 18:36:10 by Executor »  
 
IP Logged
 
[]KAOS[]Casey
Oldunreal MasterPoster
******
Offline


nedm

Posts: 2892
Gender: male
Re: Emitter problem
Reply #1 - 09/15/11 at 19:19:40
 
I don't think we can do anything unless you show us the code you use in this case. Could you do that?
Back to top
 
 
IP Logged
 
Executor
YaBB Newbies
*
Offline


Oldunreal member

Posts: 3
Gender: male
Re: Emitter problem
Reply #2 - 09/16/11 at 16:24:48
 
This is the ReviveEffect class:

Code (C++):
//=============================================================================
// ReviveEffect.
//=============================================================================
class ReviveEffect2 expands BeamEmitter;

defaultproperties
{
  bNoDelete=false
  LifeSpan=7.0
  BoxVelocity=(Z=(Min=500,Max=500))
  ParticleTextures(0)=Texture'GenWarp.Sun128a'
}
 



This is the effect class that makes the player "fade out" smoothly and spawns the beam effect:

Code (C++):
//=============================================================================
// ReviveEffect.
//=============================================================================
class ReviveEffect expands Effects;

var ReviveEffect2 Effect;

simulated function PostBeginPlay()
{
  Super.PostBeginPlay();
 
  if(Owner == None)
  {
    Destroy();
    return;
  }

  Mesh = Owner.Mesh;
  //Animframe = Owner.Animframe;
  //Animsequence = Owner.Animsequence;
  Velocity = 900 * Normal(Owner.Velocity);
 
  Effect = Spawn(class'ReviveEffect2',,,self.Location,self.Rotation);

  if ( Level.bDropDetail )
  {
    LightType = LT_None;
    LifeSpan *= 0.7;
  }
}

auto state Explode
{
  simulated function Tick(float DeltaTime)
  {
    if ( Level.NetMode == NM_DedicatedServer )
    {
      Disable('Tick');
      return;
    }
   
    ScaleGlow = Lifespan;
    DrawScale = 0.1 + 0.2 * (Scaleglow);
    LightBrightness = (ScaleGlow) * 210.0;
    if ( LifeSpan < 0.3 )
      SetPhysics(PHYS_Projectile);
  }
}



defaultproperties
{
  LifeSpan=1.0
  bParticles=true
  DrawScale=0.6
  DrawType=DT_Mesh
  Style=STY_Translucent
  Texture=Texture'CustomTexture.Effects.ReviveEffect'
  LightBrightness=255
  LightHue=170
  LightSaturation=96
  LightEffect=LE_NonIncidence
  LightRadius=6
  LightType=LT_Pulse
} 



The error pops out as soon as the emitter class is spawned...
Back to top
 
 
IP Logged
 
[]KAOS[]Casey
Oldunreal MasterPoster
******
Offline


nedm

Posts: 2892
Gender: male
Re: Emitter problem
Reply #3 - 09/16/11 at 19:12:58
 
I do know "var ReviveEffect2 Effect;"

should be "var transient ReviveEffect2 Effect;"

but other than that.. dots?
Back to top
 
 
IP Logged
 
.:..:
Developer Team
Offline



Posts: 1239
Finland
Gender: male
Re: Emitter problem
Reply #4 - 09/16/11 at 19:19:39
 
Seams you are missing texture package load line, which may cause ParticleTexture to be None in game:
Code:
//=============================================================================
// ReviveEffect.
//=============================================================================
class ReviveEffect2 expands BeamEmitter;

#exec obj load file="GenWarp.utx"

defaultproperties
{
  bNoDelete=false
  LifeSpan=7.0
  BoxVelocity=(Z=(Min=500,Max=500))
  ParticleTextures(0)=Texture'GenWarp.Sun128a'
} 


On other regards I'd like to point out to easily make some nifty looking particle effects that's going to be used on mods. Simply:
- Create the particle effect in editor and when you are done:
- Select emitter actor and press Ctrl+C
- Bring up your UC file for the particle FX and paste text in defaultproperties block
- Remove Begin/End actor/map garbage aswell as Location/bDynamicLight lines which are not needed.
Back to top
« Last Edit: 09/16/11 at 19:29:33 by .:..: »  
.:..: 345236034 mhulden  
IP Logged
 
Executor
YaBB Newbies
*
Offline


Oldunreal member

Posts: 3
Gender: male
Re: Emitter problem
Reply #5 - 09/17/11 at 18:45:43
 
I added the "transient" modifier and loaded the texture package ( the texture was set to None, I can't believe I forgot to check that ). Thanks for the advice, it works fine now Smiley
Back to top
 
 
IP Logged
 
(Moderator: Smirftsch)