SEXP Debugging

From FreeSpace Wiki
Revision as of 06:25, 30 May 2014 by Niffiwan (talk | contribs) (Option 2: Watch specific events: update based on MageKing17's use in HFH test mission)
Jump to: navigation, search

This is a quick intro to SEXP debugging, based on the event log feature added by karajorma (and the linked post).


Option 1: Snapshot all events

How to take a snapshot of the events in the game.

If you are having problems with a mission, rather than asking for a debug log, you may be asked for a snapshotted event log. You can get hold of it like this.

  1. If you are running a debug copy of FS2_Open, you can skip this step. Otherwise, enter the FS2_Open cheat code www.freespace2.com to activate cheat mode.
  2. Wait until the problem occurs and then press ~ (Above space on most keyboards) and Q at the same time.
  3. When you exit the game look in your Freespace2/Data folder for a file called event.log. If you are running a mod, you will find the file in Freespace2/Mod Name/Data instead. If you are running a game other than Freespace2 (Diaspora, TBP, etc) you will find the file in that game's data folder (e.g Diaspora/Data).
  4. Post here on HLP and attach the log to your post.

Option 2: Watch specific events

This needs to be configured ahead of time. It gives the FREDder another option to write a state change. If you tell FS2 to log whenever an event comes true, the event log will also write out the state of the event in the previous frame.

To configure this, add this to the end of a given event:

+Event Log Flags: ( "true" ) (or "false", or both)

This should be able to be set for the event using FRED.