Worst-case scenario: the UEd Goblin wipes the map and burns down your house.
Difference between revisions of "UE2:IncrementalTrigger"
From Unreal Wiki, The Unreal Engine Documentation Site
m |
m (fixed infobox and categories) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
__TOC__ | __TOC__ | ||
==About== | ==About== | ||
− | This trigger is similar to the [[ | + | This trigger is similar to the [[UE2:Round Robin|Round Robin]] class but instead of triggering all of the events in its array when it itself is triggered, it will only fire the first event. When it is triggered again, it will fire the second. The third time it is triggered, it will fire the third, and so on and so fourth until the last event has been triggered. |
==Properties== | ==Properties== | ||
Line 22: | Line 19: | ||
{{Infobox class | {{Infobox class | ||
| class = IncrementalTrigger | | class = IncrementalTrigger | ||
− | | | + | | custom = yes |
− | + | ||
− | + | ||
− | + | ||
| parent1 = Actor | | parent1 = Actor | ||
}} | }} | ||
Line 78: | Line 72: | ||
==Related Topics== | ==Related Topics== | ||
− | *[[UE2: | + | *[[UE2:Round Robin|Round Robin]] |
Latest revision as of 06:21, 8 April 2008
About[edit]
This trigger is similar to the Round Robin class but instead of triggering all of the events in its array when it itself is triggered, it will only fire the first event. When it is triggered again, it will fire the second. The third time it is triggered, it will fire the third, and so on and so fourth until the last event has been triggered.
Properties[edit]
Visible[edit]
- name Targets[16]
- An array of names. These names will be used to trigger events.
Hidden[edit]
- int iCurrentArray
- The position in the array of names.
- bool bTriggered
- Set internally. True if this actor has been triggered.
- bool bDisabled
- True when the trigger has triggered all events.
Methods[edit]
- PostBeginPlay()
- Starts the timer.
- Timer()
- Controls array event triggering;
- Trigger(Actor Other, Pawn EventInstigator)
- Called when this actor has been triggered.
Source Code[edit]
Actor >> IncrementalTrigger (custom) |
class IncrementalTrigger extends Actor placeable; var() name Targets[16]; //The things you wish to trigger var int iCurrentArray< SEMI > //The position of the to-be triggered event in the array var bool bTriggered; //Internally Set Bool (Ignore It) var bool bDisabled; function PostBeginPlay() { SetTimer(1.0, True); } simulated function Timer() { if((bTriggered)) //If we've been triggered and... { if(!bDisabled) //If this isn't disabled... { TriggerEvent(Targets[iCurrentArray], self, None); //Triggering The First Item In The Array //if iCurrentArray number is smaller or equal to the arrays length.. if(iCurrentArray != (ArrayCount(Targets) - 1)) //then increase the CurrentArray count by 1 so it will trigger the next array item iCurrentArray++; else //if the CurrentArray count is bigger than the Array's length, Disable this actor. bDisabled=false; bTriggered=false; } } } simulated function Trigger( Actor Other, Pawn EventInstigator ) { bTriggered = true; } DefaultProperties { bHidden=true }