Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Shkval25 on October 23, 2024, 12:35:29 pm

Title: FRED2 Missions Fail to Load
Post by: Shkval25 on October 23, 2024, 12:35:29 pm
I apologize if this is in the wrong section. I'm not sure whether my problem is with FRED2, something I did in FRED2, or something with FSO/MVPs.

So I've been doing things with FRED2 for a while but the other day I started having problems with my missions not successfully starting from the mission simulator in Freespace Upgrade Media VPs. I had just created a new mission, plopped a few objects, and saved it for the first time. When I tried to run the mission for the first time it failed at the loading screen with an error message saying the mission had failed to load. Since this was my first attempt at a scramble mission I thought maybe that had something to do with the problem so I unchecked that box in FRED2, saved, and tried again. Same problem and message.

So I wrote that mission off and started a new one. The mission worked fine the first half a dozen times I playtested it but then I started having the same problem. The error checker in FRED2 doesn't report anything and I have verified file integrity through Knossos. I'm now out of ideas.

I'm running FSO 24.02, Freespace Upgrade 4.7.3, and FRED2_OPEN 24.02. I have enclosed the two missions.
Title: Re: FRED2 Missions Fail to Load
Post by: Shkval25 on October 23, 2024, 05:38:20 pm
While attempting to create a debug file with the mission load error I made the discovery that FRED2_OPEN actually (and always) points to MVP version 4.7.2 rather than 4.7.3. With some trial and error I have determined the following:

If I use the "Run FreeSpace" option from FRED2 then MVP 4.7.2 opens and the mission fails to load.
If I open MVP 4.7.2 via Knossos then the mission loads correctly.
If I open MVP 4.7.3 via Knossos and try load a copy of the mission I placed in that missions folder then it works.
If I use "Run FreeSpace" from FRED2 when the new copy is open, I get sent to MVP 4.7.2 rather than 4.7.3. The mission fails to load, as expected.

More strangely, the main hall displays the wrong MVP version if am using 4.7.3 so it's possible there's something wrong with my installation of 4.7.3 although that doesn't explain why the missions work only when the program is run directly from Knossos.
Title: Re: FRED2 Missions Fail to Load
Post by: 0rph3u5 on October 24, 2024, 07:21:37 pm
1. Which Launcher are you using?

FRED can get its command line arguments supplied by the launcher but its configuration can be overridden by a configuration saved in your personal folders, if you don't run it through a launcher.

2. Can you provide a debug log from a mission that launches correctly?

Just to confirm what it is actually loading and rule our any confounding factors. "Mission fails to load" is not a very specific error message and I don't see any issue in the mission files you provided yet.
Title: Re: FRED2 Missions Fail to Load
Post by: Goober5000 on October 24, 2024, 11:45:40 pm
:welcome:

Always good to see new people experimenting with FRED, so let's see what we can do to get things working for you.

As you've discovered, the main hall does not display the correct MVP version for 4.7.3.  I can only assume this was an oversight.  I've attached a file that will fix this.  Put it in your [Knossos dir]\FS2\MVPS-4.7.3\data\tables folder and you'll see 4.7.3 in the main hall.

I tested both of your missions, with both 24.0.2 and the latest nightly, in both 4.7.2 and 4.7.3.  In all eight combinations, the missions loaded successfully.  So there's something screwy going on here, but it's not the fault of either mission.

The best thing to do at this point is, as 0rph3u5 said, provide a debug log.  First, launch a debug build of FSO and try to load the mission.  Then upload the debug log.  In Knossos, you can do this by clicking on the Options button and selecting "Upload Debug Log", while in Knossos.NET, you can find the "Upload fs2_open.log" button in the Debug tab of the top navbar.
Title: Re: FRED2 Missions Fail to Load
Post by: Shkval25 on October 25, 2024, 12:24:35 pm
On my end the missions only fail when FSO is launched through FRED2. How do I get a debug log in that case?
Title: Re: FRED2 Missions Fail to Load
Post by: Goober5000 on October 25, 2024, 01:11:53 pm
(https://media1.tenor.com/m/UCBnVC7FlvUAAAAd/thats-the-neat-part-you-dont-invincible.gif)


It looks like FSO launched through FRED2 will only be the release version, not the debug version, which makes this a tough nut to crack. :blah:

I'll take a look at the code to see what might be happening there.  In the meantime, the only thing I can say is to use a different method of launching FSO.
Title: Re: FRED2 Missions Fail to Load
Post by: Goober5000 on October 25, 2024, 01:46:22 pm
Wait, there might be a way.  Try choosing a debug build of FRED as a custom build, and then launch it using the Play button (not the FRED2) button.  From there, choose Run FreeSpace from the menu.  That might work.
Title: Re: FRED2 Missions Fail to Load
Post by: Shkval25 on October 25, 2024, 05:23:31 pm

I'll take a look at the code to see what might be happening there.  In the meantime, the only thing I can say is to use a different method of launching FSO.
I mean the only real effect of this problem is that it takes a little longer to go editing in FRED to testing in game. I've adjusted my workflow and am carrying on. Thanks for the help.
Title: Re: FRED2 Missions Fail to Load
Post by: Shkval25 on October 25, 2024, 05:27:26 pm
Try choosing a debug build of FRED as a custom build
I'm not really sure what that means.
Title: Re: FRED2 Missions Fail to Load
Post by: Goober5000 on October 25, 2024, 08:49:41 pm
I mean the only real effect of this problem is that it takes a little longer to go editing in FRED to testing in game. I've adjusted my workflow and am carrying on. Thanks for the help.
You're welcome.  Glad to hear it's not blocking progress. :yes:

I messed around with the code and improved it in several spots.  Most notably, I updated it to launch FSO with the same command-line parameters that FRED was started with.  I think the most likely reason for the error is FSO not finding the mission due to a missing mod path, which is one of the things set by the command-line parameters.

Here's the PR.  This won't be merged until sometime after 24.2 is out.
https://github.com/scp-fs2open/fs2open.github.com/pull/6403


Try choosing a debug build of FRED as a custom build
I'm not really sure what that means.

In the Knossos options, you can select an .exe that will be used for the mod.  This can be one of the stable releases, or a nightly build, or a custom build.  The custom build is set by browsing to an .exe on your local computer.  You can select any .exe as the custom build, including a stable release if you like.  You can even select a Fred2 build as your custom "FSO" build.

The core problem here is that Knossos.NET has a button for launching Fred2, but no button for launching a debug version of Fred2.  So to launch Debug Fred2, you'd need to find a debug build of Fred2, then set it as the custom build.
Title: Re: FRED2 Missions Fail to Load
Post by: Shkval25 on October 25, 2024, 09:32:58 pm
The core problem here is that Knossos.NET has a button for launching Fred2, but no button for launching a debug version of Fred2.  So to launch Debug Fred2, you'd need to find a debug build of Fred2, then set it as the custom build.
I have an option to run FRED2_Debug, it just doesn't do me any good when trying to diagnose an error in FSO.
Title: Re: FRED2 Missions Fail to Load
Post by: Goober5000 on October 26, 2024, 12:03:42 pm
Oh, you're using old Knossos.  That does have an option to run Debug FRED2.  So, in that case, you can launch that, then click on Run FreeSpace, and then the version of FSO that launches should be a debug version.

Separately, I would recommend going to https://knossoslauncher.com and downloading Knossos.NET.  That has a few more fixes and features than old Knossos, although it is notably missing the "Run FRED2 Debug" option.  It uses the same configuration and mods as old Knossos, and can be installed and used simultaneously.
Title: Re: FRED2 Missions Fail to Load
Post by: Shkval25 on October 26, 2024, 02:29:58 pm
After doing that my most recently generated debug log is still from the the 23rd. I guess I'm supposed to upload the link (https://fsnebula.org/log/671d42bfaaca1c2bfa0010f3) it generated?
Title: Re: FRED2 Missions Fail to Load
Post by: Goober5000 on October 26, 2024, 10:26:11 pm
Yes, provide the link to whoever wants to look at it.  It looks like this log is from a run of FSO where everything worked as expected though.