• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Roads ( SOLVED )

Deano1973

Resource contributor
Messages
384
Country
unitedkingdom
I've scoured the forum and tried numerous variations in code, but I can't crack this one despite having already used it successfully on another scenery. Everything works, but no AGN files are written to my folder. Simple AGN street light test, should be fine but no joy for some reason.

Can anybody save me from myself? :p
 

Attachments

  • Roads.jpg
    Roads.jpg
    239.7 KB · Views: 439
You need to use the step to create agn library objects, not xml library objects. The ones you create now need to be saved to bgl instead of agn.
 
OK, sorry to keep asking questions on this one but it's really difficult to understand why sometimes Sceneproc works, and yet with the precisely the same code on other data it will not. I've read the manual several times, and am selecting carefully from GIS attributes - this code works on one scenery just fine, but not on another. All files are read and written, yet the folder remains stubbornly empty afterward - this is on both FSX and P3D settings.

Usually I manage to solve these sorts of things with trial and error, but after 20 or so variations here ( AUTODETECT, offset changes, highway types, you name it ) I can't seem to get my files at the end. Any help much appreciated - it's a wonderful tool Arno, but so tricky to see through whatever errors I am making as none are reported.

Lights.jpg
 
Hi,

Did you check in a GIS tool if your data has all the attributes in the filter? For example does it have a highway attribute?

Also in this script you make the reverse mistake from the other post. When you use the CreateAgnLibObj step you need to use ExportAgn. If you use CreateXMLLibObject you need to use ExportBgl. You can't mix them otherways.
 
Hi,

Did you check in a GIS tool if your data has all the attributes in the filter? For example does it have a highway attribute?

Also in this script you make the reverse mistake from the other post. When you use the CreateAgnLibObj step you need to use ExportAgn. If you use CreateXMLLibObject you need to use ExportBgl. You can't mix them otherways.

Hi Arno, yes, I checked the attributes list and I also tried a number of export combinations. There are no errors, everything is processed, but the folder remains empty. I will check again now and see if I can find the fault - it's certainly something I'm doing wrong but for some reason I just can't seem to see it - must be my age o_O
 
OK, I got the AGN files to write by removing the highway definitions from the line and just going with FTYPE=LINE. 156 Autogen files written. Pop them in the sim, and nothing visible :rolleyes:

I'll have to figure that one out on my own I think, will try re-loading the scenery.
 
Is the guid you use a valid autogen class?
 
Is the guid you use a valid autogen class?

They show up in the annotator just fine but not in the sim. I'm using the AG_lightpole which is a library object. Just compiled again using XML/BGL script, no files written. Will keep at it.
 
Same problem as before Arno, files all written, folder updates correctly but is empty upon opening. It's really odd!

Latest.jpg
 
Hi,

Looking at the log file BGL files have been made. Btw, when making BGL files it's not needed to make one BGL file per autogen tile, so you can better use a bigger size in the SplitGrid command.
 
Thanks Arno, I'll alter the size of the SplitGrid command, and will post back here when I figure out a) Why the files aren't appearing and b) Where on Earth they're going!
 
They go to the folder you specify :)
 
OK, this problem was solved by downloading alternative GIS data and running the very same script - it all compiled normally. I can only assume that there must have been something corrupted in the original GIS data, which in visual appearance was otherwise identical, which prevented both AGN and BGL files compiling.
 
With alternative data do you mean from another source? If that's the case than the attributes in the data probably differ. If attributes are different you need to update the script to match your data.
 
With alternative data do you mean from another source? If that's the case than the attributes in the data probably differ. If attributes are different you need to update the script to match your data.

The data source was a new one. Although the file compiled this time around, no streetlights were visible in the sim, so I'm still getting something wrong. I use QGIS as advised in the manual, and I take it that the attributes in this data are those listed here as primary, secondary, tertiary etc as they can be selected as such. Still doesn't put lights down where I need them though. I will keep trying at this as it saves a billionty hours of work hand-placing things, but it's tough-going sometimes to identify errors I've made.

GIS_DATA.jpg
GIS_DATA.jpg
 
That screenshot shows the data has an attribute named type, while when using OSM files directly the attribute is named highway. So the example script from the manual has to be adjusted to match the attributes of the data.

The event log will help you when running the script. It will tell you if points were placed, library objects made, etc. That way you can see where things go wrong.
 
That screenshot shows the data has an attribute named type, while when using OSM files directly the attribute is named highway. So the example script from the manual has to be adjusted to match the attributes of the data.

The event log will help you when running the script. It will tell you if points were placed, library objects made, etc. That way you can see where things go wrong.

Mmmm, running back up the event log I can see that no point features are being created, and no XML objects created. That seems to be the problem and why it compiles all the BGL files but nothing appears in the target folder - there's nothing there at the end of the compile. So it must be my code, and yet I changed highway to "type" in the following manner;

<code>
IMPORTOGR|roads.shp|*|type|AUTODETECT
#
SPLITGRID|AGN|*|FROMFILE=roads.shp
#
PlacePointsAlongLine|FTYPE="LINE";type=primary|CONTINUOUS|50;50|5;5|0|type|light|hdg
#
CreateXMLLibObj|type="light"|{3f7a0c9c-11e0-0e99-3000-6bb2d8103067}|hdg|0|0
#
ExportBGL|FSX|Costa_lights|D:\Scenery\Test
</code>
 
OK, it worked - went back to your manual script, changed the data and now I have billions of streetlights! I think the entire issue might be down to the ag_lightpole rather than any of the scripts being used ( as per other threads here ). I will investigate further and report back in. Thanks for all your help Arno, especially on a weekend! :)
 
Back
Top