Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is a persistent variable?

persistent
0
Posted

What is a persistent variable?

0

Standard variables can only be used in the mission they appear in. At the end of the mission FS2 cleans up by wiping the variable completely. Persistent variables on the other hand are recorded in the campaign file (or pilot file). As a result once you have declared a persistent variable you can use it in any later point in the campaign where it will remember the value it was set to earlier. There are actually two kinds of persistent variables. Campaign Specific and Player Specific depending on where they are saved. The way they work is subtly different. The player specific variable is actually the simpler one of the two. Suppose in mission 2 of a campaign I set a player specific variable to 5. On loading mission 7 of the campaign the variable will still equal 5. Suppose I now set the value to 10. Shortly after this (while still in mission 7) the player gets killed. This time when the mission starts the variable equals 10. In other words PS variables always equal whatever they were las

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123