I don't need to test my programs. I have an error-correcting modem.

Difference between revisions of "Legacy:VitalOverdose/SFXTriggering"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m
 
m (More custom emitter scipts)
 
Line 104: Line 104:
  
 
===More custom emitter scipts===
 
===More custom emitter scipts===
* [[Legacy:VitalOverdose/SFXPawnTeleporting | SFXPawnTeleporting]]
+
*[[Legacy:VitalOverdose/SFXVehicleTeleporting | SFXVehicleTeleporting]]
* [[Legacy:VitalOverdose/SFXVehicleTeleporting | SFXVehicleTeleporting]]
+
*[[Legacy:VitalOverdose/SFXPainful | SFXPainful]]
* [[Legacy:VitalOverdose/SFXPainful | SFXPainful]]
+
*[[Legacy:VitalOverdose/SFXBoosting | SFXBoosting]]
* [[Legacy:VitalOverdose/SFXTriggering | SFXTriggering]]
+
*[[Legacy:VitalOverdose/SFXEjecting | SFXEjecting]]
* [[Legacy:VitalOverdose/SFXBoosting | SFXBoosting]]
+
*[[Legacy:VitalOverdose/SFXMonsterSpawning | SFXMonsterSpawning]]
* [[Legacy:VitalOverdose/SFXEjecting | SFXEjecting]]
+
*[[Legacy:VitalOverdose/SFXHealing | SFXHealing]]
* [[Legacy:VitalOverdose/InventoryFlare | InventoryFlare]]
+
*[[Legacy:VitalOverdose/SFXSelfScaling | SFXSelfScaling]]
 +
*[[Legacy:VitalOverdose/SFXUltraLight | SFXUltraLight]]
 +
*[[Legacy:VitalOverdose/InventoryFlare |InventoryFlare]]
 +
*[[Legacy:VitalOverdose/ExampleFlares | ExampleFlares]]
  
 
==Discussion==
 
==Discussion==
  
 
[[Category:Legacy Custom Class (UT2004)|{{PAGENAME}}]]
 
[[Category:Legacy Custom Class (UT2004)|{{PAGENAME}}]]

Latest revision as of 07:05, 14 September 2011

UT2004 :: Actor >> Emitter >> SFXTriggering (Package: custom)

by VitalOverdose

Overview[edit]

This custom emitter script can tack a set amount of particles (20) from an emitter and trigger an event on collision with pawns. The event to trigger can be set by the mapper in unrealed.

PostBeginPlay()[edit]

(generic:called just after it enters gameplay)

here the max particle property is check to see if it is under 21 particles and then the timer function is activated using 'timer frequncy' to set the scan rate.

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()[edit]

Each time timer is called the live particles from this emitter will be located and then have their location scanned for a valid collision. We are able to list all visible colliding actors by using an iterator.

(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;-

Full Script[edit]

////////////////////////////////////////////////
//Class SFXTriggering for Unrealtournament 2004
//Single player only
//by VitalOverdose Jan 2006
//Http://vitaloverdose.zapme.to.org
///////////////////////////////////////////////
class SFXTriggering Extends Emitter
placeable;
 
Var            int                    TotalParticles;
Var ()         int                    ActiveEmitterNumb;
Var ()         int                    TimerFrequency;
Var ()         Float                  ScanSize;
 
Simulated function PostBeginPlay()
{
 Super.PostBeginPlay();
 
//active particles capped to max20 
 If ( (Emitters[ActiveEmitterNumb].MaxParticles > 20) || (TimerFrequency<0.1))           
     Destroyed();
 
// start the timer function and set it to repeat
 SetTimer( TimerFrequency , True );
}
 
Simulated Function Timer()
{
 Local Actor           FoundActor;
 Local Int             Counter;
 
//itterate through the any visible colliding actors withing 'scansize' radius of the particle location calling TriggerEvent() each time 
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 );
}
 
defaultproperties
{
bNoDelete=False
RemoteRole=ROLE_SimulatedProxy
}

Related Topcs[edit]

More custom emitter scipts[edit]

Discussion[edit]