|
|
|
Tutorial: Randomizing Trigger Actions in Red Alert 2
By Cannis Rabidus
« Page1
| Page 2
Step1 - Setting Up for the Random Nuke Strikes
First we're going to need to define where the Nuke strikes take place, so we'll need to place some waypoints first. We'll keep it simple and limit things to 3 possible locations, meaning we'll need to place 3 waypoints. Let's call them waypoints 10, 11 and 12.
Now can move on to making the triggers themselves. They fall into 2 categories: The Enabler trigger, and the Action triggers.
Step2 - Create the Enabler Trigger
This trigger is the one that gets the whole randomizing system rolling. It functions to enable all of the other triggers, and also disables itself.
TriggerName: nuke-enabler
House: <none>
Type: 2 (repeating)
Attached trigger: <none>
Disabled option: Unchecked
Easy/Medium/Hard options: All checked
Event0: #13 Elapsed Time; parameter=1 |
Note:
Don't worry about the Enabler trigger's actions right now, since none of the other triggers exist yet. We'll return to this trigger later.
Step3 - Create the Action Triggers
These triggers not only produce the desired action, they also produce the randomizing effect. You need a unique Action Trigger for each possible action. Since there will be 3 possible Nuke Strikes, we have to make 3 Action Triggers. What follows is the first one.
TriggerName: nuke-10
House: <none>
Type: 2 (repeating)
Attached Trigger: <none>
Disabled option: Checked
Easy/Medium/Hard options: All checked
Event0: #51 Random Delay, parameter=300 |
As mentioned in the overview, the delay used for this trigger directly affects just how random the result will be. The smaller the delay, the greater the chance for the earlier filter triggers to be favored. The delay value of 300 that we're using here is sufficiently large that we should have no worries about this. Now make 2 more triggers identical to the one you just made, except name them nuke-11 and nuke-12. As you may have guessed, they are named for the waypoints the nukes will target. Again, we'll leave the actions for these triggers for a later step. The 3 Action Triggers will differ where their actions are concerned; for now what you're making is 3 identical triggers with different names. At this point you should have 4 incomplete triggers created, all lacking their actions.
Step4 - Adding Actions to the Enabler Trigger
The Enabler trigger serves to enable all other triggers in the system so they can sort out their logic. There are 3 Action triggers here, so the Enabler trigger must therefore enable 3 triggers. It must also disable itself. Therefore it will need 4 actions total. Reopen the Enabler Trigger you already made in Step2 and add these actions:
TriggerName: nuke-enabler
Action0: #54 Disable Trigger, parameter=nuke-enabler
Action1: #53 Enable Trigger, parameter=nuke-10
Action2: #53 Enable Trigger, parameter=nuke-11
Action3: #53 Enable Trigger, parameter=nuke-12 |
The Enabler trigger is finished. Now to add actions to the Action triggers.
Step5 - Adding Actions to the Action Triggers
These are the triggers which will cause the Nuke strikes to happen. Each needs an action which does this at a unique waypoint (which we made in step1). To make sure only one Nuke strike happens, each needs to disable all Action triggers (including itself) - since there are 2 Action triggers, that's 3 more actions. Each also needs to enable the Enabler trigger so the cycle can repeat. That makes a total of 5 actions for each of the triggers in this example.
Take Note that the actions for the 3 triggers are identical, except for the waypoint parameter. Admittedly this a lot of repetitive stuff but it's all necessary to make the randomizing logic work properly.
TriggerName: nuke-10
Action0: #95 Nuke Strike, waypoint parameter=10
Action1: #54 Disable Trigger, parameter=nuke-10
Action2: #54 Disable Trigger, parameter=nuke-11
Action3: #54 Disable Trigger, parameter=nuke-12
Action4: #53 Enable Trigger, parameter=nuke-enabler |
TriggerName: nuke-11
Action0: #95 Nuke Strike, waypoint parameter=11
Action1: #54 Disable Trigger, parameter=nuke-10
Action2: #54 Disable Trigger, parameter=nuke-11
Action3: #54 Disable Trigger, parameter=nuke-12
Action4: #53 Enable Trigger, parameter=nuke-enabler |
TriggerName: nuke-12
Action0: #95 Nuke Strike, waypoint parameter=10
Action1: #54 Disable Trigger, parameter=nuke-10
Action2: #54 Disable Trigger, parameter=nuke-11
Action3: #54 Disable Trigger, parameter=nuke-12
Action4: #53 Enable Trigger, parameter=nuke-enabler |
That’s
it, you’re done. Where the next nuke will drop is unpredictable for
me, for you, and most importantly, for the player. Once you have the
above system example working in your own map, I recommend returning to
the earlier Overview section and re-reading it if you need to. With a
solid understanding of the logic used, you’ll be able to apply this
trigger system to many different situations without having to glance at
this tutorial at all.
Adding More Actions
As you can see, if you wanted to add more Nuke strike locations, you would need to add more Action triggers. This means that the Enabler trigger would need more actions (so it could enable these new triggers as well), and every Action trigger would need more actions (so they could disable the new triggers too). If you keep adding more and more actions, very soon you'll end up with a very long list of actions. If a long string of actions works for you, great. I have run into problems sometimes, with RA2 crashing when loading a map with a trigger which has a long action string, so if you start getting the dreaded Internal Error, this may be the reason.
To avoid this, you could break up your Action trigger groups into something manageable, like perhaps no more than 8-10 triggers per group. Or, you can add an additional "tier", making it a 3-step trigger process. This is the solution I used in City Fights Back. What happens in that map is, the Enabler trigger enables a group of Action triggers (one for each "AttackType"), each of which can enable a sub-group of Action triggers (one for each "AttackTarget").
Conclusion
Now you know how to make random Nuke strikes on your map. And guess what, so does everyone else who read this tutorial. I used Nuke strikes in this example because its simplicity made it suitable for a tutorial. There are a lot of other trigger actions that can be randomized too - figure out something fresh and original to use in your map. To be honest, neither I, nor others I know, really wants to see 100 maps suddenly appearing with random Nuke strikes in them, if you know what I mean. Credits:
- I'd like to thank subzero46 for his work on randomized weather storms, which inspired me to develop this randomizing trigger system.
- I would also like to thank RVMECH, Wildefire, and of course DeeZire, whose forum posts gave me much-needed insight into RA2 trigger logic.
-Cannis Rabidus [RADEN Map Staff]
Email
RADEN's in house map makers
RVMECH
for help!
|