| Home Page | Recent Changes

RandomTrigger

UT2004 :: Actor >> Triggers >> RandomTrigger (custom)

This Trigger will cause random Events from a dynamic list of event names.

Properties

This property is available to edit.

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'
//}

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

External Link

Related Topics

Discussion


Category Custom Class

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

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