Persistent Variables

From FreeSpace Wiki
Revision as of 11:07, 7 May 2006 by Shade (talk | contribs) (Brought into line with goober's spelling to avoid persecution)
Jump to: navigation, search

Variables have been a part of FRED since the Retail version, but are limited by only being available in the mission where they are defined. Persistent variables differ in this, as they are stored for later use instead of being lost for good when the mission ends. This allows mission designers to carry over specific information between missions and even campaigns.

There are two types of persistent variables:

Player-persistent

This type of persistent variable is stored in the pilot file. Further, they are stored immediately when they are created/changed from within a mission. This means that any change is going to be there regardless of the later outcome of the mission. Player-persistent variables can be accessed and changed from any campaign played with the same pilot.

Campaign-persistent

These persistent variables are stored in the campaign file, and are only stored when a campaign progresses to a new mission. So if the player is killed or quits during a mission, and changes made to a campaign-persistent variable are not stored.