Sign in to follow this  
Guest GerrishGray

Adding to Terrain.cfg

Recommended Posts

I'm experimenting with modifying existing texture entries in FS2004's terrian.cfg. I've replaced[Texture.1024] // stream lines / unknown / perennialType=1Size=4ExcludeAutogen=1MaskClassMap=3Textures=RiverSU.bmpoffset=-10with [Texture.1024] // stream lines / unknown / perennialType=1Size=4ExcludeAutogen=1MaskClassMap=3Textures=RiverSU.bmpoffset=flatwith success. However, I wish to add the second record instead of replacing the original. So I inserted the new record and changed the [Texture.1024] with various new numbers such as 4098, 5124 and even 1263 (the next number in the list). I also replaced the DefaultTextureCount=238 to 239 to account for the new record. But now FS exits without an error when loading the terrain. Leaving the count at 238 prevents the exit when the terrain loads, but the added texture is also ignored. Has anyone else been able to add texture records to terrain.cfg in FS9?ThanksLee Steffensen

Share this post


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

Hi LeeAdding texture records to terrain.cfg is no problem at all. I added a new record as Texture.1262 (the next free number - not 1263), placing it directly after 1261, and had no problems at all. Of course, you cannot expect your new texture to actually appear anywhere in the scenery unless you create some VTP polygons that actually use it ...Changing the offset (or some of the other settings) of an existing texture also works fine, as you have seen. CheersGerrish

Share this post


Link to post
Share on other sites

Thanks for your reply Gerrish.After further experimentation and your statement about using 1262, I found the problem.You can add new records to terrain.cfg with no problem. You can also skip numbers. But you must set the DefaultTextureCount item in the General section to the highest number - 1023. Here is how I came upon this... I first created a small BGLC assembler file to utilize my new terrain record - 1262. All of my test used this scenery file.1st Run: Using 1262 as my new record, and not changing DefaultTextureCount (leave at 238), FS exited without error while loading terrain.2nd Run: Using 1262 as my new record and modifing DefaultTextureCount = 239. FS loaded with my modified scenery with no problems.3rd Run: Changed the record number to 1263. FS loaded but the lines were missing. Due to the texture entry still pointed to 1262. Even though the DefaultTextureCount was incorrect, FS doesn't have a problem with it.4th Run: Modified the scenery to use texture 1263. FS exited without error while loading terrain. Now FS skips out! The scenery referencing the texture record with the incorrect DefaultTextureCount is what causes FS to exit while reading the terrain.5th Run: Set DefaultTextureCount = 240. FS ran fine with new scenery. Everything is set correctly. I skipped 1262 with no problems.6th Run: Set the new record number to an arbitrary number (1505). Set scenery to use it and set DefaultTextureCount = 482. Everything ran fine. The key point is that the DefaultTextureCount value is not the number of records, but the "highest number texture record value" - 1023. I don't know how high the record numbers can go, but at least we can skip records if needed.Lee Steffensen

Share this post


Link to post
Share on other sites

That seems logical. FS doubtless creates an internal lookup table or array of the required size, then uses the texture ID numbers as an index into the table. So the size must equate to the highest number used minus 1024 (texture ID's 0-1023 indicate default ground texture sets - see the FS2002 SDK's).CheersGerrish

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