Always snap to grid

Difference between revisions of "UE2:RandomTrigger"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m (Moved Random Trigger)
 
m
Line 1: Line 1:
 +
[[Category:Custom_UT2004-specific_classes]]
 +
 
__TOC__
 
__TOC__
{{classbox| [[Legacy:UT2004|UT2004]] :: [[Legacy:Actor|Actor]] >> [[Legacy:Triggers|Triggers]] >> RandomTrigger (custom)}}
+
 
 +
{{Infobox class
 +
| class  = RandomTrigger
 +
| package =
 +
| within  =
 +
| game    = UT2004
 +
| engine  = UE2
 +
| parent1 = Actor
 +
| parent2 = Triggers
 +
}}
 +
 
  
 
This custom trigger will cause random events to fire from a dynamic list of event names.
 
This custom trigger will cause random events to fire from a dynamic list of event names.

Revision as of 05:06, 8 April 2008


UT2004 Triggers >> Actor >> RandomTrigger


This custom trigger will cause random events to fire from a dynamic list of event names.

Properties

Visible

array<name> EventList 
A dynamic array of Events to trigger.

Source Code

//=============================================================================
// RandomTrigger
// Uses a random value to select from a dynamic array of Events when triggered.
// by SuperApe -- Sept 2005
//=============================================================================
class RandomTrigger extends Triggers
	placeable;
 
var()	array<name>	EventList;
 
event Trigger( Actor Other, Pawn EventInstigator )
{
	Event = EventList[ FRand() * EventList.length ];
	TriggerEvent( Event, Other, EventInstigator );
}
 
//defaultproperties
//{
//     Texture=Texture'Engine.S_Trigger'
//}

Notes

If this actor is compiled inside the Unreal Editor, edit the default property Display -> Texture manually as indicated in the comment at the bottom of the code using the "editdefault class=RandomTrigger" Unreal Editor console command. If you are Compiling with UCC, simply un-comment the defaultProperties block.

Related Topics