geehalel / msfsmissions

Microsoft Flight Simulator Missions
The Unlicense
11 stars 3 forks source link

Clarification on sbp/xml step in the process #1

Open LavaTiger99 opened 3 years ago

LavaTiger99 commented 3 years ago

Thank you so much, this guide should have been included in the SDK.

I followed you up to "Extract from an existing BushTrip .spb file the skeleton used for the mission .xml file. I won't detail that part here" So I downloaded the sbp2xml tool however I have the MS store edition, and it looks like the game files are encrypted and of a virtual partition that is inaccessible to me. Is there another way around this?

I notice you have a mission xml file in your example: master/BushtripStLaurent/PackageSources/stlaurent/stlaurent.xml Can I use that file and modify it? Do those "UniqueRefId" and "InstanceId" matter if they are the same as your example? Please help me finish my first bush trip mission!

LavaTiger99 commented 3 years ago

Also, is there an easier way to generate this .sbp through the API?

LavaTiger99 commented 3 years ago

And once you have the XML file in place, how do you convert your mission into a packaged mission? Thanks again!

geehalel commented 3 years ago

I updated MSFS yesterday and it seems the SPB file format has been changed, and spb2xml is now unable to parse new spb files correctly. So you may use the xml file found here as a starting point. I believe the refids should be unique in a running instance of MSFS, so if you use your missions locally, that should be ok. I've used the build button in the dev mode API to compile the package, it creates some json files automagically (these are mainly file lists if I remember). And also creates the spb file. But you may try to put directly the xml file in the package in place of the spb file, that should also work.

LavaTiger99 commented 3 years ago

Ok, thanks, that sort of worked. Created a mission but with no legs or descriptions or distances...

Also, this method doesn't end the mission automatically when you land at the next leg runway, does it?

geehalel commented 3 years ago

I just tested the mission and it does not end when you land at the leg runway, you're right. That was working before the MSFS updates as I had a SAVE file at the end of the first leg. If I remember, they enhance the LandingChallenge triggers and they surely also modify some BushTrip triggers. I did'nt try but that may perhaps be corrected from the ingame graph editor eventually looking at an official bushtrip. Or wait until they publish some docs about missions. I still don't have looked at the new SDK at the moment.

furiouscaulks commented 3 years ago

Why don't we try and wrap our heads around this and figure it out. First of all, I appreciate the effort you've put into creating this blueprint so we can get a look at the script editor. The first thing I noticed is your naming conventions for the file folders and xml files. From doing some work with scenery, it's essential to use the same name strings for everything. Your base folder is named "BushTripStLaurent", your xml in Package Definitions is "geehalel-bushtrip-stlaurent.xml", your xml in the base folder is "bushtripsstlaurent.xml" and the folders and files in Package Sources are all named "stlaurent" and one is named "stlaurent_edition". This needs to be cleaned up, first of all. Name the base folder with the same conventions that asobo uses "copmany name-title-info-info" then use that same convention for all folders and files, otherwise it's just confusing and may cause errors internally.

Secondly, the main bushtrip and mission and landing challenge files in the Official folder contain no XML files to open in the editor, which leads me to believe they're encrypted somewhere.

Thirdly, I'm not sure if you need to go through the process of doing all this legwork by hand with creating folders and xml files. I have created a simple mission folder from the sample simple scenery folder, and used the file and folder structure within. You can open that blank project up in the SDK and change all the parameters within, I'm trying to figure out how to get it set up right now, or if it even works.

I'm trying to figure how to use the scripts and triggers but the starting point is confusing. Do I need to create a pln and flt file first, because there are scripts available for flight planning within the script editor.? Anybody have any insights?

MrLiamTim commented 2 years ago

I used SPB2XML to extract the BushTrip template: BushTripTemplate.zip

You can find more information on missions and mission scripts on the FSDeveloper Wiki.