Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel

Difference between revisions of "UE2:RandomTrigger"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m (fixed infobox and categories)
m (cleaning up)
Line 10: Line 10:
  
 
==Properties==
 
==Properties==
===Visible===
+
===Main===
 
;array<name> EventList : A dynamic array of Events to trigger.
 
;array<name> EventList : A dynamic array of Events to trigger.
  
Line 41: Line 41:
  
 
==Related Topics==
 
==Related Topics==
* [[Open Source]]
 
 
* [[Legacy:Trigger Systems|Trigger Systems]]
 
* [[Legacy:Trigger Systems|Trigger Systems]]
 
* [[Legacy:Dynamics|Dynamics]]
 
* [[Legacy:Dynamics|Dynamics]]
 
* [[Legacy:Event|Event]] and [[Legacy:Tag|Tag]]
 
* [[Legacy:Event|Event]] and [[Legacy:Tag|Tag]]
 
* [[Legacy:Dynamic Array|Dynamic Array]]
 
* [[Legacy:Dynamic Array|Dynamic Array]]

Revision as of 13:48, 1 May 2008

UE2 Triggers >> Actor >> RandomTrigger (custom)


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

Properties

Main

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