Tutorial: Randomizing Trigger Actions in Red Alert 2
By Cannis Rabidus

 

(This tutorial deals with advanced trigger-making techniques. If you are new at making triggers for Red Alert 2, then this is certainly not the tutorial to start with! If you are proficient in making and using so-called "basic" triggers, then read on).

In typical use, RA2 triggers are just scripted occurrences. A timer counts down or the player does something, and the trigger springs. Each time the player loads up a particular map with triggers, the same thing happens the same way every time.

How boring.

Suppose the player could load up the map 3 different times, and each time different things happen. How would you like to be able to replay single-player missions, not knowing what was going to happen, even though you played the mission before? How would you like to play a multiplayer map where whatever goofy effect the mapmaker laid in store for you was not predictable? Well you can, and it's not only possible, it's also practical. This tutorial will tell you how, by explaining how to set up a network of triggers as a randomizing system.

You may have already played maps that advertise "random Weather Storms" or similar, but in fact these maps actually spring their triggers in a repeating sequence. When something repeats a cycle it is predictable. The system described here yields results that are not predictable at all.

A rather involved application of this system is used in my map, City Fights Back, a map in my City Pack which you can get here. [ed note: link to maps_cannis.shtml] What we'll do here in this tutorial, step by step, is make a simple version of the system. The example we'll use is having Nuke strikes targeted randomly among pre-selected waypoints. You can apply this system to any action whatsoever, including the randomizing of single-player mission goals (how's that for replayability?). First some background on how and why the system works.


Overview of the Randomizing System

The randomizing triggers in this system work behind the scenes to generate random actions. What you're seeing here are true random actions. The way they work is this: A group of triggers which have identical random delays are enabled at the same time. Each of these triggers, if sprung, will disable all of its brethren. So, the trigger which is assigned the smallest delay by the game will fire first, and disable the others before they can fire too. The randomized delays are therefore translated into randomized actions.

You may ask what happens if 2 or more of these triggers happen to have identical delay values assigned to them by the game. If these delay values are the smallest of this group of enabled triggers, then you might think these 2 or more triggers would fire simultaneously. This doesn't happen, since from my tests, it seems certain that the game will never fire 2 triggers in the same game frame. If 2 triggers are set to fire at the same time, what actually happens is that they will fire sequentially - 1 game frame apart.

So which of these 2 triggers will fire first? The answer: the first trigger found in the map. Therefore there is a statistically greater tendency for earlier triggers to fire more often using this randomizing system. The smaller the value of the random delay the triggers use, the greater the odds that they will be assigned identical delays. This means they aren't *truly* random... so the bigger the delay value used, the more closely the results will mirror true randomness.

At this point you're probably scratching your head over all of the above, but don't worry about it. Just follow the tutorial and you'll see how the triggers "fit" together. Then come back and re-read this section and it should make a lot more sense. The logic is really straightforward enough that after you've made a couple of your own random trigger systems, you'll find that you'll be able to make them without referring to this tutorial at all.

-Continue with tutorial here...

Email RADEN's in house map makers RVMECH for help!

 

The tutorials on this section are copyright© RADEN - cncgames.com, and non of the tutorials on this section may be copied for use on other websites. RADEN is not affiliated with the Final Alert website. Questions? Email here.