Mostly Harmless
Difference between revisions of "UE2:RandomTrigger"
From Unreal Wiki, The Unreal Engine Documentation Site
m (Open Source/RandomTrigger moved to UE2:RandomTrigger: Restructuring to remove the Open Source hub.) |
m (updated due to changes to class infobox) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
{{Infobox class | {{Infobox class | ||
| class = RandomTrigger | | class = RandomTrigger | ||
− | | | + | | custom = yes |
− | + | | parent1 = Triggers | |
− | + | | parent2 = Actor | |
− | + | ||
− | | parent1 = | + | |
− | | parent2 = | + | |
}} | }} | ||
Line 17: | Line 10: | ||
==Properties== | ==Properties== | ||
− | === | + | ===Main=== |
;array<name> EventList : A dynamic array of Events to trigger. | ;array<name> EventList : A dynamic array of Events to trigger. | ||
Line 48: | Line 41: | ||
==Related Topics== | ==Related Topics== | ||
− | |||
* [[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]] | ||
+ | * [[Legacy:Third-Party Components|Third-Party Components]] |
Latest revision as of 11:50, 9 May 2008
This custom trigger will cause random events to fire from a dynamic list of event names.
Properties[edit]
Main[edit]
- array<name> EventList
- A dynamic array of Events to trigger.
Source Code[edit]
//============================================================================= // 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[edit]
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.