• 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.

FS2004 Placing multiple objects..

Messages
11
Country
netherlands
Hi,

I obtained a list of a lot of ship/vessel positions as a CSV.
Now, I would like to add ships on those locations.

Any hints on how I start from here ? :confused:

I have lat-lon's and would thus add a ship on that position, and compile it to one or more BGL's.

So the 64 million dollar question is: how to add multiple scenery objects, non moving, into a BGL from a list ?

Johan

PS: of course if I succeed with this, I will release it as freeware.
 
Last edited:
I've taken google earth placemarks from .kmls and parsed the coords into placement XMLs which placed a specific object at each location. I did this with Textpad macros which would be easy enough to do with a .csv, it'd be a five minute job.

Since you would likely want to use different ships at different locations I'm not sure if that really saves you any trouble though unless the desired object is also specified in the .csv (a GUID) for each set of coordinates?

Jim
 
No GUID given, but thats the next problem.
Can you show me how to set up the XML ?

If thats working I will assign GUID's to them at random.
 
This may be a situation where it's better to give the man a fish than teach him to fish for himself :) . If you post your .csv I can record a quick macro and return an XML placement script for you in a matter of minutes. It's not a difficult thing to do but if you've never used a macro in an advanced text editor you'd need to start with one much simpler I'd think to get your head around how they work.

Easy to do, difficult to explain, but I'll attempt to give you an idea what you're getting into: You basically record a series of keystroke actions and then play them back as many times as it takes to reach the end of the file. It would work something like this (simplified significantly):

You'd make an XML template containing a blank <SceneryObject/> entry for each item in your .csv

You'd get all the latitude values from the .csv into a column in another txt document and open it and the above XML in Textpad at the same time

You'd then start recording the macro - cut the first lat value from the text file, tab between documents and find the first occurrence of lat=" in the XML, paste the previously cut lat value into place in the XML and then tab between documents again. Stop the recording.

Then you could play back the macro through the end of the file and it would walk through the column of latitudes pasting them all into place in the XML. Repeat the above for the longitudes, headings, altitudes (and GUIDs) if applicable.

Jim
 
Hi,

I understand, but I need to see the XML template to learn to fish.
You now just told me there are fish in the ocean :-)

Can you show me that ?

I am not trying to learn sophisticated scenery design, but just for one time place a lot of objects. So any help is welcome.

Johan
 
Ah, found something:

Code:
<?xml version="1.0"?>
<FSData
version="9.0"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation="bglcomp.xsd" >
<SceneryObject
	lat="N47 25.89"
	lon="W122 18.42"
	alt="0"
	altitudeIsAgl="TRUE"
	pitch="0"
	bank="0"
	heading="0"
	imageComplexity="NORMAL">
	<LibraryObject
		name="4a5ceec84f2a9e27f12ee7a40f0c856c"
		scale="1.0"/>
</SceneryObject>
</FSData>

Will this be correct for placing one object ?
If so, then I think I can write a small program what will automate the list I got, compile it with BGLcomp.
Correct ?
 
Sorry I assumed you knew the XML routine and the problem was just in getting dozens of items from a .csv into the XML. Yes, that's what you need and yes just drop it on bglcomp when you have all the items in place.

Jim
 
Just one question Jim,

I do need to place every single object like this ?

Code:
<SceneryObject
	lat="N47 25.89"
	lon="W122 18.42"
	alt="0"
	altitudeIsAgl="TRUE"
	pitch="0"
	bank="0"
	heading="0"
	imageComplexity="NORMAL">
	<LibraryObject
		name="4a5ceec84f2a9e27f12ee7a40f0c856c"
		scale="1.0"/>
</SceneryObject>

Ad the next one the same, between the <FSData> ... </FSData> tags ?
 
Is there a way to detect land somehow ?
Of course some ships are placed on shore.. and I need to skip those.
I know FS9 makes the map from BGL's, but doing such thing is way over my head.
Any directions Jim ?
 
I wouldn't know Johan, I can't think of a way, maybe Arno would have an idea. The only thing I could think of would be to use Instant Scenery to open your finished bgl(s) and manually delete the ones that ended up on land (you could do that visually from within the sim). I saw your thread at flightsim.com, holy crap - 45000 placements!! Doing it manually with IS would certainly keep you busy for a while :) !

Jim
 
I wouldn't know a way to detect the fs water automatically. The only approach I can think of is to load some GIS data of water and use that to select the placements inside.
 
Hi,

Problem is I have a list from last week, for one day all moving ships in the world.
Lat's and longtitudes. I positioned them all, 45000+ and most of them are correctly placed.
However a lot are also on the shores, due to FS9 is not exactly correct.
I cannot manually remove them, then I need to recompile the huge list minus the offender. And there must be hundreds of them.
 
Hi,

Problem is I have a list from last week, for one day all moving ships in the world.
Lat's and longtitudes. I positioned them all, 45000+ and most of them are correctly placed.
However a lot are also on the shores, due to FS9 is not exactly correct.
I cannot manually remove them, then I need to recompile the huge list minus the offender. And there must be hundreds of them.

I don't have the CSV, so not sure what is in it, but is there any information about Ship X being in a port? If yes, you might be able to run through the CSV eliminating any ship that is listed as in port.

Sounds like a pretty cool project.
 
No, just lat's and lons, tonnage and beam.

Example:

latitude,longitude,grossTonnage,length,beam
40.745903,-74.012930,,62,12
40.501302,-74.014902,,,
6.900333,-51.284667,43075,228,40
40.638845,-74.161132,,19,6
40.789003,-73.918083,,93,15
26.182388,55.532792,77211,276,47
19.099383,-18.317150,357,40,8
47.016833,-49.997667,2259,72,16
54.050833,4.571500,1845,90,12
...

I did convert all the data for FS coordinates.
Also, I requested for a lat-lon, tonnage and heading file.
They are all moving vessels, otherwise it would be much worse.

It must be possible, since UT for example modifies/enhances terrain also.
Dont know how they did it tough..

Johan
 
Last edited:
Back
Top