Sign in to follow this  
rhumbaflappy

Weird VTP texture problem

Recommended Posts

Hi guys,I'm trying to remake my home airfield background. I used SCM2XY2 to produce a VTP polygon from the SCASM file generated by FSSC. Everything works great except for one strange detail : In FS2002 my new polygon appears at the right place, but not with the right texture. Whatever texture I define in my ASM file, FS2002 displays it as "forest". I even tried to just remove any VTP polygon (Exclude set to 1 and NumTexturesInLayer set to 0)... It still displays my polygon as a forest !!!I checked that the BGL file is actually changed when I recompile using different parameters, and that when I completely remove that BGL, the scenery reverts to FS default (ie : I'm really compiling the file I modify, and FS really displays the BGL file I produce).Here is my ASM code :include TDFMacros.incinclude TDFHeaders.inc; VTP Method2 Roads 48.86719 1.875 BGLHeader 50, 47, 3, 0, TerrainHeaderStart, VTPHeaderVTPHeader label word VTPFileHeader 256, VTPIndexStart, TextureStart, VTPEndVTPStart label word datamark_v0 label word VTPDataArea 1, 1, 0, 0 VTPLayer 4, 1 VTPNumTexturesInLayer 1, 0 VTPTextureId 4, 0 VTPPolyCount 1, 0 VTPPolyMethod2 14, 0, 0 VTPPointXY2 7292, 5320 VTPPointXY2 7217, 5405 VTPPointXY2 7367, 5380 VTPPointXY2 7422, 5413 VTPPointXY2 7445, 5416 VTPPointXY2 7474, 5435 VTPPointXY2 7503, 5476 VTPPointXY2 7552, 5503 VTPPointXY2 7602, 5418 VTPPointXY2 7617, 5353 VTPPointXY2 7536, 5347 VTPPointXY2 7578, 5258 VTPPointXY2 7418, 5199 VTPPointXY2 7292, 5320 datamark_v1 label word; ---------------------------------------------------------------------------------------------------------Cellv_388_117 EQU VTPCellID 0, 388, 117; --------------------------------------------------------------------------------------------------------- VTPIndexStart label word VTPIndexHeader 1, VTPIndexData, VTPStart VTPIndexData label word VTPIndexEntry Cellv_388_117, VTPStart, datamark_v0, datamark_v1; ---------------------------------------------------------------------------------------------------------TextureStart label word VTPTextureListHeader 5, TextureIndexStart, TextureDataStart, TextureDataEndTextureIndexStart label word VTPTextureListEntry TextureDataStart, texturemark_0, texturemark_1 VTPTextureListEntry TextureDataStart, texturemark_1, texturemark_2 VTPTextureListEntry TextureDataStart, texturemark_2, texturemark_3 VTPTextureListEntry TextureDataStart, texturemark_3, texturemark_4 VTPTextureListEntry TextureDataStart, texturemark_4, texturemark_5TextureDataStart label word texturemark_0 label word VTPTextureName "1183" VTPTextureType 1, 0, 0, 4 texturemark_1 label word VTPTextureName "1183" VTPTextureType 1, 0, 0, 4 texturemark_2 label word VTPTextureName "1183" VTPTextureType 1, 0, 0, 4 texturemark_3 label word VTPTextureName "1183" VTPTextureType 1, 0, 0, 4 texturemark_4 label word VTPTextureName "1183" VTPTextureType 1, 0, 0, 4 texturemark_5 label wordTextureDataEnd label word; ---------------------------------------------------------------------------------------------------------VTPEnd label wordDo you have any ideas about what can be going wrong ?Thanks,Motik

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

You have loaded 5 times the texture "1183" witch is the airport background texture grass and you did not load any other textures. If you like to display other textures you should change some of the linesVTPTextureName "1183" so they are pointing to different textures. It is also neccessary to change the lineVTPTextureId 4, 0so that the first number points to the desired VTPTextureName. The texture numbers are found in the file Terraintextures.cfg, but if you use SCM2XY2 I think you should rather use landclass numbers.

Share this post


Link to post
Share on other sites

Thanks for your comments Falko. It's nice to have input from the very author of the program :)"1183" IS the texture I want to display (grass airport) ! I filled the list with it in an attempt to solve the problem. But even with that texture only in the list, FS displays "forest".Of course I tried at first to use the texture-list just as it came from your program, pointing to texture "0057" for grass. That's the first thing which failed to work. Taking any other texture from the default list (0024, 0050, 0005 or 0001) gives exactly the same result : forest !Any other idea about what I should try ?There's a detail which may be important, I don't know. As I'm modifying a default airport (LFPZ, near Paris) I'm putting my VTP polygon over part of the FS grass airport background. Maybe this is what it doesn't like ?Motik

Share this post


Link to post
Share on other sites

Hi Motik.This is a strange problem.The code compiles correctly, and displays grass on my machine.Where is this BGL placed? Try making a separate project folder, with a "scenery" sub-folder. Place the BGL into that folder, and activate it through the Scenery library.It is possible that an old SCASM poly is displaying that odd forest texture. Deactivate all addon scenery, and see if the poly now shows correctly. Some scenery creation programs automatically add BGLs to the sim ( I know FSSC does this ), and that can cause all kinds of problems.The problem is not with the code or the BGL, but with a conflicting scenery.Dick

Share this post


Link to post
Share on other sites

Dick,I tried everything you advised me to try, but to no avail...BUT it now works with exactly the same setup as before (same BGL, same addon sceneries, same directories), the only difference being that I renamed my BGLs. I had used "understandable" names, more than 8.3 long, with spaces. I replaced them by old-style 8.3 names like "LFPZ_VTP.BGL" and it started working !!!It's the first time I see that the BGL name can be a problem. I had used BGLs with long names without any problem until today.I hope it will go on working, and I know how I will name my files from now on... Anyway thanks Falko and Dick for your great programs and for your help :)Motik

Share this post


Link to post
Share on other sites

Hi Motik!The name of BGL should not have any influence on behaving in FS. But what Dick says is that You should try to remove Your SCASM BGL's which possibly show forest texture and on Your airport use ONLY BGL produced from Your ASM code. It is very likely that you have two polygons on the same place in Your FS: one from SCASM displaying forest texture and the second one from ASM displaying grass but since it has lower layer number it is not showing.So try to remove Your SCASM airport(s) and use only ASM ground.Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Hi Goran,I tried removing the SCASM scenery and nothing changed. Anyway the forest which appeared instead of grass was definitely a VTP texture and nothing from FSSC (and although I had some SCASM polygons in my airport I had never put any forest there... I don't usually plant trees on an airfield ;))The filename REALLY matters : by just changing it I can now make my BGL display forest, or hang FS (textures loading forever) or work perfectly with grass. It's perfectly reproductible !I think I read somewhere in the SDK that the BGL loading order is done by layer and, in the same layer, by alphabetical order. I can't remember exactly though.Now that this BGL works, I'm changing more terrain texture in Versailles palace just a few hundred meters away from my airfield. And guess what......... I can recreate the same kind of problem depending on how I name my BGLs !!!!!!!Maybe one of our gurus will come up with a good explanation :)Motik

Share this post


Link to post
Share on other sites

Hi Motik.I believe Goran and I have already given you the explanation.You are using Airport, or FSSC, or ASD to make a textured ground polygon. You then are translating that textured ground poly to VTP, and making a BGL.But somewhere in your process, your GUI program is making a BGL of the textured ground polygon, and activating it in the sim! I have FSSC, and it does this by default.The long name IS allowed with BGLs. What happens is your GUI is apparently making the ground poly BGL with a shortname. When both are activated, the short-named older-style textured poly is displayed over your VTP, and hides it. That's how it works... textured ground polys cover the ground.When you make a short-named BGL, now both BGLs have the same name, and the identically-named BGL with the highest priority in the Scenery Library, will display.. the other doesn't get used ( so the older style never gets displayed ).Using the short name, do a search of your computer, and you should see an instance if identically named BGLs... the VTP and the older-style textured poly ( in a folder you didn't suspect.. either Addonscenery or scenedbscenery or the main Scenry folder ).You need to deactivate the automatic BGL creation of your GUI program, or you'll keep getting the problem.Dick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this