The International Simutrans Forum

 

Author Topic: Building names  (Read 3159 times)

0 Members and 1 Guest are viewing this topic.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9433
  • Languages: De,EN,JP
Building names
« 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.)

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Building names
« Reply #1 on: April 04, 2010, 07:16:08 PM »
By "replacer" you mean the code that allows "compatibility" when buildings are missing?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9433
  • Languages: De,EN,JP
Re: Building names
« Reply #2 on: April 04, 2010, 08:31:37 PM »
Exactly this one ...

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Building names
« Reply #3 on: April 12, 2010, 07:57:09 AM »
OK, so replacing everything to RES_[author]_xx_level would be OK?

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: Building names
« Reply #4 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.

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Building names
« Reply #5 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 :)

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: Building names
« Reply #6 on: April 22, 2010, 04:00:28 PM »
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.

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Building names
« Reply #7 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...

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Building names
« Reply #8 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)