The International Simutrans Forum

PakSets and Customization => Pak128.Britain => Topic started by: prissi on April 02, 2010, 08:53:43 PM

Title: Building names
Post by: prissi on April 02, 2010, 08:53:43 PM
I just looked at the britan128 source and found citybuildings with names like KG_RES_xx_yy

Every pakset maintainer, please avoid this!

Buildings must start with RES, IND, COM and end with the level number. Otherwise the building replacer (when buildings are left out or are added to a newer version of the pak) get thouroughly confused on load time.

(Not sure, if this is the right board, I admit.)
Title: Re: Building names
Post by: VS on April 04, 2010, 07:16:08 PM
By "replacer" you mean the code that allows "compatibility" when buildings are missing?
Title: Re: Building names
Post by: prissi on April 04, 2010, 08:31:37 PM
Exactly this one ...
Title: Re: Building names
Post by: The Hood on April 12, 2010, 07:57:09 AM
OK, so replacing everything to RES_[author]_xx_level would be OK?
Title: Re: Building names
Post by: neroden on April 22, 2010, 12:30:32 AM
I have a large patch for pak.Britain.experimental which should do most of this rename automatically -- replacing stuff like KG_RES_ with RES_KG_.  (It doesn't handle the issue of buildings which do not end with the level number, as I wasn't able to write a perl script to do that, and I wasn't sure which ones ended with the level number and which ones didn't. :) )  This is in citybuildings.diff

As a side-effect I generated an entire list of renames which can be added to compat.tab if the replacer is clever enough to accept that -- and it appears to be clever enough, based on testing; this is in building_replace.txt.

This will probably work for pakBritain standard too as the buildings are much the same.  A few cleanups will be needed for buildings which don't end with the level number or for stuff which is different in experimental, but that should be all.  This should be the worst of it done.
Title: Re: Building names
Post by: The Hood on April 22, 2010, 07:31:57 AM
Should have said I've actually already manually made the changes but not had any time in the last week to test and make the change on my working copy nor upload the changes to SVN, but thanks anyway.  If my attempt hopelessly fails, I will try yours :)
Title: Re: Building names
Post by: neroden on April 22, 2010, 04:00:28 PM
Quote from: The Hood on April 22, 2010, 07:31:57 AM
Should have said I've actually already manually made the changes but not had any time in the last week to test and make the change on my working copy nor upload the changes to SVN, but thanks anyway.  If my attempt hopelessly fails, I will try yours :)

OK.  :)  Mine was generated by fully automated methods so it didn't take that long to do.... and is verified to work.  :)  Yours, however, probably has the changes to make sure each name ends in _level.
Title: Re: Building names
Post by: The Hood on April 23, 2010, 07:29:39 AM
That's right.  I'll cross-check them when I get time, as I don't want to break any saves and there are a lot of name changes to get right...
Title: Re: Building names
Post by: The Hood on April 24, 2010, 10:38:45 AM
Should now be fixed in SVN, so please report any problems with existing saves or anything else related... (should be in next nightly, or build from source yourself)