Author Topic: FS Picky About Variables  (Read 229 times)

0 Members and 1 Guest are viewing this topic.

Offline Trivial Psychic

  • 212
  • Snoop Junkie
FS Picky About Variables
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.
The Trivial Psychic Strikes Again!

 

Offline 0rph3u5

  • 211
  • Oceans rise. Empires fall.
Re: FS Picky About Variables
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>"
      )
« Last Edit: December 04, 2021, 11:23:51 am by 0rph3u5 »
"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

==================

"I am Curiosity, and I've always wondered what would become of you, here at the end of the world." - The Guide/The Curious Other, Othercide

"As you sought to steal a kingdom for yourself, so must you do again, a thousand times over. For a theft, a true theft, must be practiced to be earned." - The terms of Nyrissa's curse, Pathfinder: Kingmaker

"...because they are not Dragons."