More Complex Kismet
From RoboBlitz Editor Wiki
Now that you've finished the Kismet tutorial, you're ready to move on to some more complex uses of Kismet. You can pick right up where you left off with the Spotlight in the last tutorial or just start with my copy of the map: RBArenaKismet
Conditionals are Kismet elements which can direct the flow of impulse through different sequences. Many of the Conditionals are self explanatory (for example: Is NOED, checks to see if the target object is a NOED or not). A conditional usually accepts impulse input from an In tab and based on the values of parameter tabs (which connect to kismet variables) direct impulse out one of several output tabs.
Conditional Kismet Elements are available by right clicking in the Kismet window and selecting from the New Condition menu choice.
Compare Objects (Ints, Floats, and Bools)
You can place a Compare Objects Comparison by selecting New Condition->Comparison->Compare Objects.
You can use the Compare Objects element to test whether a two references to objects are actually references to the same object. A practical example of the Comapare Objects element is checking to see if a ball objects in inside a goal volume. An RTouch event will output the object which touched the volume as it's instigator. You can attach the instigator object to the A tab, and a static reference to the ball object (RDestructible_16 in the below picture). If the instigator is the ball, then impulse flows out of the A==B tab, otherwise it travels out of the A!=B tab.
Comparisons are also available for Bools, Floats and Ints. The work in the same fashion as Compare Objects, but operate on their respective Kismet datatypes.
If you'd like Kismet to wait a moment before impulse continues you can use a Delay. Select New Action->Misc->Delay to add a Delay. You can either set the length of the Delay in the kismet element properties by changing the Duration field or by connecting a variable to the Duration tab.
You can also connect to the Stop or Pause tabs to effect a running timer. When the delay is stopped impulse continues out of the abort tab. Whe the delay finishes normally impulse travels out of the Finished tab.
Kismet allows you to design custom elements through the use of Subsequences. You can create a blank sequence by right clicking in Kismet and selecting Create New Sequence. If you'd like to use Kismet that is already implimented, select the section of Kismet that you want to convert into a subsequence and right click and select Create New Sequence. Links to the selected Kismet will be broken and it will be folded into a new sequence.
To edit a sequence after it's been created you can double click it in the Sequence Explorer in the lower left corner of the Kismet window.
To add an In tab to a sequence add a Sequence Activated event. To add a variable tab (the tabs along the bottom) right click and select New Variable->External Variable. To add an output tab to a sequence right click ad select New Action->Misc->Finish Sequence; you can add multiple output or input tabs to make very complex sequences fit into a single element. Changing the Sequence Activated, External Variable or Finish Sequence elements's InputLabel will change the label on the sequence element.
You can copy and paste sequences to reuse them, or right click and select Import sequence <sequence name>
Begin Level fires at the begining of any map. It can be used to start matinees that should be on at the begining of the level. If an object does not exist at the begining of the level it may not be properly activated. Add a Delay to wait until the object is created.
Console Event (under New Event->Misc) can be set to fire when the user types "causeevent <ConsoleEventName>" into the console. In the event's properties make sure to uncheck bPlayerOnly and set ConsoleEventName to the name you'd like user to type into the console. EventDesc is a description of the event which is displayed when a user types causeevent with no arguement. For example, if my ConsoleEventName is MyEvent, the user would hit tab to open the console and type: causeevent MyEvent and impulse would travel out of the Console Event I setup.
Console Command has the same effect as typing the Command property into the console.
Kismet wasn't exactly designed to do math, but there's a few ways you can force it. Addition is simple enough, just connect to variables to a variable tab. If you want to add a value to a variable and store the result in that variable then you can use a Set Variable action. Here's an example of using a Set Float action to add the value of Score and Bumper Points and store it in the Score variable:
If you're adding numbers that don't change at runtime, you can make another variable that's the negative of the variable and add that. It is possible to write a Subtract element in Unrealscript.
Legends come down from our forefathers that during the Golden Age there were mythical Kismet designers who could create whole mini-games in Kismet. Surely this is the stuff of fantasy... but perhaps... it could be true.