Author Topic: Warning - String variables and their default values.  (Read 1039 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Warning - String variables and their default values.
Just thought I'd give a heads up to any FREDders who use string variables (Admittedly that's not many of us!) as my last commit has introduced a minor danger that wasn't present before.

In the past if you created a new string variable ShipName[NULL] and then tried to use it in an event like this

when
-is-destroyed-delay
-0
-ShipName[NULL]

FRED would complain or even display a warning. Basically FRED was checking if NULL was a ship named in the mission and then complaining cause it wasn't. This check has now been removed in my last commit and FRED basically assumes that the FREDder knows what he is doing when he uses a string variable in a SEXP. Since FRED didn't care if at t=0 you manually set the variable to NULL it seemed silly for it to be making a special case of the default value when it never cared about any other value.

The change obviously doesn't affect existing missions in the slightest. When making new missions though you should make sure that the value of your SEXP variable is valid as FRED will no longer tell you if it isn't.

On the other hand using string variables is now about 5% less annoying. :D
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]