| Home Page | Recent Changes | Preferences

VitalOverdose/SFX Triggering

UT2004 :: Actor >> SVehicleFactory >> ASVehicleFactory >> SFX Triggering (Package: custom)
 

by VitalOverdose

Part of Vital'sPMT

Overview

function PostBeginPlay()

(generic:called just after it enters gameplay)

Simulated function PostBeginPlay()
{
 Super.PostBeginPlay();
  If ( Emitters[ActiveEmitterNumb].MaxParticles > 20)           //active particles capped to max20
    {
     Destroyed();
    }
  If (TimerFrequency<0.1)
    {
     TimerFrequency = 0.1;
    }
 SetTimer( TimerFrequency , True );
}

function Timer()

(generic:called to order)

Simulated Function Timer()
{
 Local Actor           FoundActor;
 Local Int             Counter;
 for ( Counter=0 ; Counter < Emitters[0].Particles.Length ; Counter++ )
     {
      foreach visiblecollidingActors(Class'Actor', FoundActor , ScanSize , Emitters[ActiveEmitterNumb].Particles[Counter].Location )
              {
               TriggerEvent( CollidedWith.Tag , Self , Instigator );
              }
     }
}

Here is the complete script;-

////////////////////////////////////////////////
//Class SFX_Trigger for Unrealtournament 2004
//by VitalOverdose Jan 2006
//Http://vitaloverdose.zapme.to.org
//This actor is also Part of Vitals Pro Mapping Tools.
//Http://ProMappingTools.zapto.org
///////////////////////////////////////////////
class SFx_Trigger Extends emitter
placeable;

Var            int                    TotalParticles;
Var ()         int                    ActiveEmitterNumb;
Var ()         int                    TimerFrequency;
Var ()         Float                  ScanSize;

Simulated function PostBeginPlay()
{
 Super.PostBeginPlay();
 
 If ( Emitters[ActiveEmitterNumb].MaxParticles > 20)           //active particles capped to max20
    {
     Destroyed();
    }
 
 If (TimerFrequency<0.1)
    {
     TimerFrequency = 0.1;
    }
 SetTimer( TimerFrequency , True );
}

Simulated Function Timer()
{
 Local Actor           FoundActor;
 Local Int             Counter;
 for ( Counter=0 ; Counter < Emitters[0].Particles.Length ; Counter++ )
     {
      foreach visiblecollidingActors(Class'Actor', FoundActor , ScanSize , Emitters[ActiveEmitterNumb].Particles[Counter].Location )
              {
               TriggerEvent( CollidedWith.Tag , Self , Instigator );
              }
     }
}

Related Topics

   

discusion


Category Custom Class

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In