Hard Light Productions Forums

General FreeSpace => FreeSpace & FreeSpace Open Support => Topic started by: Trivial Psychic on December 04, 2021, 02:22:31 am

Title: FS Picky About Variables
Post by: Trivial Psychic on December 04, 2021, 02:22:31 am
So I've been playing through various TBP campaigns, and have been thoroughly enjoying the Fortune Hunters.  I've been playing on latest Nightly builds, but when I get to the 4th mission in 2261 (the "0" mission doesn't count), I get a "Failed to Load" error.  I ran a debug build and got the following error, enhanced slightly from the better details provided by the error message FRED gave me:

Error in mission event "Explosions Random":Not a Number

Warning: Not a number.

In sexpression: ( every-time-argument
   ( random-multiple-of
      "exp04.eff"
      "exp06.eff"
      "exp20.eff"
      "exp05.eff"
      "P_moon4"
      "P_moon4"
      "P_moon4"
   )
   ( true )
   ( modify-variable
      @bank[0]
      ( rand-multiple 0 359 )
   )
   ( modify-variable
      @heading[0]
      ( rand-multiple 0 359 )
   )
   ( modify-variable
      @Pitch[0]
      ( rand-multiple 0 359 )
   )
   ( modify-variable
      @eff[<Default Value>]
      <argument>
   )
   ( modify-variable
      @Size[15]
      ( rand-multiple 8 26 )
[...]
(Error appears to be: <argument>)
File: missionparse.cpp
Line: 6117

From the looks of it, it doesn't like <argument> as a number.  I looked up the variable "@eff" and it's a string variable so it shouldn't be complaining anyway.  I did a check through earlier Nightlies and found that this bug (assuming it is) was introduced in time for the October 30th build.  The Oct. 28th build doesn't complain.
Title: Re: FS Picky About Variables
Post by: 0rph3u5 on December 04, 2021, 09:35:56 am
I think, that's an old FRED bug with the modify-variables SEXP saving the modification for string variables wrongly (it has been fixed) - the fix for a mission saved incorrectly like that, is to add quotation marks manually to the SEXP via text editor, and then the mission should work correctly again

EDIT: That's how modify-variable applied to string variable should look like
Code: [Select]
      ( modify-variable
         "@Loadout_G3S2[MX-50]"
         "<argument>"
      )