Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: mjn.mixael on May 04, 2017, 05:16:09 pm

Title: New Error/Bug?
Post by: mjn.mixael on May 04, 2017, 05:16:09 pm
One of BtA's missions has the event "Is "Beta close" true?". As far as I know this was handled gracefully in 3.7.4.

3.8RC1 Errors and closes FSO. If this is an intentional change, sounds good. Might be worth pointing out the reason is probably because of the double quotes in the error and/or disallowing double quotes in event names.

However, it seems like a bug because FRED/FSO only started complaining about this after I used that event in a Departure Cue.

Upon further investigation.. it looks like the problem is more that FRED saved the following event..

Code: [Select]
is-event-true-delay
"is "beta close" true?"
7

as

Code: [Select]
is-event-true-delay
"is "
beta
close"
true?"
7
Title: Re: New Error/Bug?
Post by: AdmiralRalwood on May 05, 2017, 05:40:55 pm
I'm surprised it worked in 3.7.4; I don't recall the parser changing in any significant way since 3.7.4, either. If you edit it with notepad, does FSO read it properly? If so, this could be a mission saving error.
Title: Re: New Error/Bug?
Post by: mjn.mixael on May 05, 2017, 07:13:33 pm
Yes, FSO reads it properly. I'm guessing it is, indeed, a saving error.
Title: Re: New Error/Bug?
Post by: The E on May 06, 2017, 03:14:30 am
Okay, small question, how did you even create an event with that name? Did you use notepad to write that mission?

(Because "Is "Beta close" true?" cannot be entered in the event editor; If you try, FRED will change the event name to "Is $quoteBeta close$quote true?", at least in 3.8 and 3.7.4)

EDIT: Yep, confirmed. If I manually alter the mission file so that the $quote is replaced by ", I get errors.

I'm gonna classify this as working as intended. Double quotes are invalid characters in user-defined text in mission files (since stray ones confuse our parser), and erroring out is the correct response.
Title: Re: New Error/Bug?
Post by: mjn.mixael on May 06, 2017, 10:37:30 am
Well that could be it.... A very specific case. This mission was created near 4-5 years ago (before that check?). That event has always worked and with all the bug testing over the years the event name never got changed by FRED.

I opened the mission on 3.8 to make it ever so slightly easier and need wings to depart when that event triggers... So perhaps that event name has been grandfathered in for so long and that's how I just now ran into problems?
Title: Re: New Error/Bug?
Post by: The E on May 06, 2017, 10:46:42 am
Well that could be it.... A very specific case. This mission was created near 4-5 years ago (before that check?). That event has always worked and with all the bug testing over the years the event name never got changed by FRED.

I opened the mission on 3.8 to make it ever so slightly easier and need wings to depart when that event triggers... So perhaps that event name has been grandfathered in for so long and that's how I just now ran into problems?

Could be. I am not entirely sure how this could have worked at any point in time (seriously, the humble double quote is an enormously problematic character), but it's likely that some change we made to make the parser more robust messed this up for you.
Title: Re: New Error/Bug?
Post by: mjn.mixael on May 06, 2017, 10:49:54 am
Well I'm all for that. :)

And I'm throwing TBP Slasher under the bus... he's the one who created this particular mission.

I'm innocent, I swear!
Title: Re: New Error/Bug?
Post by: AdmiralRalwood on May 06, 2017, 11:22:08 am
it's likely that some change we made to make the parser more robust messed this up for you.
...Or it would be, if the parser didn't still handle it; it seems like the mission-saving code that is doing something different.
Title: Re: New Error/Bug?
Post by: The E on May 06, 2017, 11:27:51 am
it's likely that some change we made to make the parser more robust messed this up for you.
...Or it would be, if the parser didn't still handle it; it seems like the mission-saving code that is doing something different.

Then something is weird. The FRED parser straight up refuses to load the mission (since it sees too many arguments for is-event-true-delay), and the same should be true of FSO, shouldn't it?