Troubleshooting Common FREDding Mistakes

One of the biggest problems new FREDders face, what to do when their mission just isn't working. Learning how to debug a mission is as important a skill as learning how to create missions in the first place. It is virtually impossible to create a mission without bugs. However with skillful debugging, you can remove them from your missions.

General debugging tips

  1. Check that the problem event is actually triggering - Quite often you'll have a problem where you've set up an event to make something happen in your mission (e.g you kill one ship and another one does something) but when you do the trigger action, nothing happens. There are two possible problems here, your trigger isn't correct, or your actions aren't. The first thing you should do is figure out which one. The easiest way to do that is to make the game signal to you that the event is triggering. Adding a message, for instance, tells you immediately whether the event is triggering. If you hear the message, you know it is.
  2. Build simple test missions - If you're not certain how a SEXP works, build a test mission and try it with a simple example. Yes you can read the docs or ask someone but building test missions is a great way to learn for yourself how things work.
  3. Write data to a variable - If you're comfortable using variables, this can be one of the best tools you have. You can use the modify-variable SEXP to set the value of a variable and then output its value in a message.
  4. Ask for help - The HLP FRED forum is a great place to ask for help if all else fails. Unlike many internet forums it is pretty friendly towards new posters who are genuinely stuck. Since the users are mostly FREDders themselves they tend to view questions as a challenge so rather than one answer you might get several suggestions on how to solve your problem.

Common bugs

Some bugs are very common. In order to help you, here are some of the bugs you might encounter along your way.

Directives don't appear at the right time

This one has stumped many FREDders over the years. Directives might appear either too early (generally right at the start of the mission) or very late (i.e after the directive is actually complete).

Too early

This one is usually because of a very simple mistake. FS2_Open is smart enough to not show directives that hinge on the destruction of a ship until the ship is actually present in the mission. Some FREDders make the mistake of assuming this means that FS2_Open can automatically predict the time to show other directives. Of course, it can't. If a Directive is showing up too early you should chain it to an event that comes true just before you want the directive to appear.

Too late

is-event-true-delay in directivesThis is more of an insidious problem. Take the event to the left. That should display a directive telling you to kill Heavy Raider 4. What happens though is that the directive only appears after the Raider is destroyed. Or it appears as failed if the Raider jumps out.

The cause of the problem is that the game uses is-event-true-delay to determine when the event is complete and when it should display the directive. There is a third optional argument for the SEXP that allows you to say "If this SEXP is being used in a directive, use is-event-true-delay to determine when to show the directive, rather than when it is complete."