.
Page 1 of 2 12 LastLast
Results 1 to 15 of 26

Thread: Brush up on region codes

  1. #1

    Default Brush up on region codes

    As I am fixing faulty assets, I frequently find a faulty region code that is the valid two-letter code given in the Trainz wiki for region codes. So somewhere along the way, those have become invalid codes, and I am trying to figure out what is valid now. If I use the number in the table for each country, that seems to be acceptable, but is that actually valid for that country, for example Great Britain = 12, Australia =14? The reason I asked is that several very different countries worldwide seem to have the same numbers but different letter codes. So I am posting to find out if there is a link to a correct table of codes? Here is the link I am using:

    https://en.wikibooks.org/wiki/Trainz...ory-region_tag

    I realize this has probably been asked before, but it doesn't Google, so I wanted to se if I could get the right codes.

    Thanks!

  2. #2
    Join Date
    Oct 2011
    Location
    New Caledonia
    Posts
    3,185
     

    Default

    Quote Originally Posted by Forester1 View Post
    As I am fixing faulty assets, I frequently find a faulty region code that is the valid two-letter code given in the Trainz wiki for region codes. So somewhere along the way, those have become invalid codes, and I am trying to figure out what is valid now.
    You should be looking at the Trainz Wiki, not Wikibooks. The codes are listed here:
    http://online.ts2009.com/mediaWiki/i...ategory_Region

    Numeric codes are not valid. What two character codes are being reported as invalid?

    A common fault is a blank character following the code.

  3. #3
    Join Date
    Nov 2006
    Location
    Newcastle NSW Australia
    Posts
    6,318
     

    Default

    Other common faults from the old days were USA instead of US and ALL which was eventually dealt with by the invention of 00 (zero zero) as a "universal" region.

    As far as I know, 00 is the only numeric region code, although I can't find it listed in the Wiki. Maybe that should be checked for validity.


    .
    Last edited by Dinorius_Redundicus; July 7th, 2019 at 12:06 AM.
    T:ANE SP4 build 105946 and TRS2019 SP1 build 105096
    Win 10, i7 5820K, 3.3 GHz, 32GB ram, GTX 980Ti, 2x512GB SSD

  4. #4
    Join Date
    Nov 2006
    Location
    Germany
    Posts
    2,135
     

    Default

    There are 2 different types of region tags. For all types of assets, except type map, the 2 character country codes are used. For type map the kuid of an asset of type region is required.

    Peter

  5. #5
    Join Date
    Nov 2006
    Location
    United Kingdom
    Posts
    3,474
     

    Default

    What is annoying, is having to search twice, because of the use of 'GB' & 'UK', when 'UK' would suffice & cover both.
    T:ane SP2 build 88364 + SnC & Duchess

  6. #6
    Join Date
    Nov 2006
    Location
    Newcastle NSW Australia
    Posts
    6,318
     

    Default

    Quote Originally Posted by BLACKWATCH View Post
    What is annoying, is having to search twice, because of the use of 'GB' & 'UK', when 'UK' would suffice & cover both.
    I agree, it's overly anglo-centric isn't it? I was reluctant to say anything for fear of igniting some kind of war but instead wrote myself a little script that AssetX can run to automatically remove GB from a whole bunch of open-for-edit assets.

    Here is the code if anyone wants to use it.

    Code:
    ;Removes the annoying GB;UK region and replaces it with UK.
    -If|category-region=GB;UK
     -Update|category-region|UK
    -Endif


    Just copy that text into Windows Notepad and save it as something descriptive like RemoveGB.axm. Note the file extension needs to be .axm, not .txt.

    Put that file in a folder where AssetX keeps its scripts. For me, it's; C:\Program Files (x86)\PEVSoft\AssetX\scripts\4_Cleanups\Category-Region but you could use a different sub-folder below ..\scripts.
    Last edited by Dinorius_Redundicus; July 7th, 2019 at 05:01 AM.
    T:ANE SP4 build 105946 and TRS2019 SP1 build 105096
    Win 10, i7 5820K, 3.3 GHz, 32GB ram, GTX 980Ti, 2x512GB SSD

  7. #7
    Join Date
    Nov 2008
    Location
    Crewe, Cheshire, UK
    Posts
    15,575
     

    Default

    Thanks very handy, shame though that we can't fix all the built-in / DLC stuff that's using GB UK.....

    As for 00 presumably still valid as it is listed in \Trainz Railroad Simulator 2019\resources\validation\category-region.txt, as are GB and UK.
    Time for a suggestion me thinks although not sure United is very appropriate now given the current mess we are in.
    Last edited by clam1952; July 7th, 2019 at 07:46 AM.
    Malc


  8. #8
    Join Date
    Nov 2006
    Location
    New Zealand
    Posts
    2,344
    Blog Entries
    7
     

    Default

    Validation - Category-Region.axm

    Note this also deals automatically to all pesky trailing spaces

    ;TARDIS
    ;VALIDATION
    ;as at 1 Jan 19
    ;
    -Info|START of VALIDATION - CATEGORY-REGION
    ;
    ;xxxxxx
    ;STATUS
    ;xxxxxx
    ;
    -Info|Approved
    ;
    ;
    ;xxxxxxxx
    ;CATEGORY - REGION
    ;xxxxxxxx
    ;
    ;xxxxxx
    ;RENAME - ORIGIN
    ;xxxxxx
    ;Note that some tag 'origin' use invalid codes. This next section corrects the known errors.
    ;
    -If|origin="AUS"
    -Update|origin|AU
    -Endif
    ;
    -If|origin="CAN"
    -Update|origin|CA
    -Endif
    ;
    -If|origin="DEU"
    -Update|origin|DE
    -Endif
    ;
    -If|origin="NLD"
    -Update|origin|NL
    -Endif
    ;
    -If|origin="SWE"
    -Update|origin|SE
    -Endif
    ;
    -If|origin="USA"
    -Update|origin|US
    -Endif
    ;
    -If|origin="South Africa"
    -Update|origin|ZA
    -Endif
    ;
    -If|origin="Third_Party_FRA"
    -Update|origin|FR
    -Endif
    ;
    -If|category-region="00"
    -Delete|category-region
    -Rename|origin|category-region
    -Endif
    ;
    ;xxxxxx
    ;origin
    ;xxxxxx
    ;
    -If|trainz-build>3.4
    ;
    -Delete|origin
    ;
    -Endif
    ;
    ;xxxxxxxxxxxxx
    ;UPDATE FORMAT from category-region-0 to category-region.
    ;xxxxxxxxxxxxx
    ;CAUTION
    ;This wipes out category-region if value is "all".
    ;
    -If|category-region="all"
    ;
    -Info|category-region invalid
    -Update|category-region|"00"
    -Category|category-keyword|_GLOBAL
    ;
    -Endif
    ;
    -UpdateCategoryRegion
    ;
    ;xxxxxx
    ;RENAME - INVALID CATEGORY-REGION
    ;xxxxxx
    ;
    ;Adds a region representing global application if no region stated or value is missing.
    ;
    -If|category-region="B;B;*"
    ;
    -Info|category-region invalid
    -Update|category-region|"00"
    -Category|category-keyword|_GLOBAL
    ;
    -Endif
    ;
    -If|category-region="AU "
    ;
    -Info|category-region invalid
    -Replace|category-region|"AU "|"AU"
    ;
    -Endif
    ;
    -If|category-region="CA "
    ;
    -Info|category-region invalid
    -Replace|category-region|"CA "|"CA"
    ;
    -Endif
    ;
    -If|category-region="ES "
    ;
    -Info|category-region invalid
    -Replace|category-region|"ES "|"ES"
    ;
    -Endif
    ;
    -If|category-region="painted_origin"
    ;
    -Info|category-region invalid
    -Replace|category-region|"painted_origin"|"00"
    ;
    -Endif
    ;
    -If|category-region="GB;UK"
    ;
    -Info|category-region consolidate
    -Replace|category-region|"GB"|"UK"
    ;
    -Endif
    ;
    -If|category-region="US "
    ;
    -Info|category-region invalid
    -Replace|category-region|"US "|"US"
    ;
    -Endif
    ;
    -If|category-region=0
    ;
    -Info|category-region invalid
    -Update|category-region|"00"
    -Category|category-keyword|_GLOBAL
    ;
    -Endif
    ;
    -If|category-region=" "
    ;
    -Info|category-region empty
    -Replace|category-region|" "|"00"
    -Category|category-keyword|_GLOBAL
    ;
    -Endif
    ;
    ;xxxxxxx
    ;WARNING
    ;xxxxxxx
    ;
    -If|category-region="NO"
    ;
    -Info|category-region may be invalid and not Norway
    -Category|category-keyword|CHECK_CAT-REGION_NO
    ;
    -Endif
    ;
    ;xxxxxxxxxxxxxxx
    ;Changes default TRS2004 region from "to" or "TO" to "00". Tonga has no railways.
    ;xxxxxxxxxxxxxxx
    ;
    -If|category-region="to"
    ;
    -Info|category-region "to" invalid
    -Delete|category-region
    ;
    -Endif
    ;
    -If|category-region="TO"
    ;
    -Info|category-region "TO" most likely invalid
    -Delete|category-region
    ;
    -Endif
    ;
    ;xxxxxxx
    ;MISSING
    ;xxxxxxx
    ;
    -IfNot|category-region@
    ;
    -Update|category-region|"00"
    ;
    -Info|GLOBAL - category-region set to "00". You may want to change this.
    -Category|category-keyword|_GLOBAL
    ;
    -Endif
    ;
    ;xxxxxx
    ;GLOBAL
    ;xxxxxx
    ;
    -IfNot|category-region="00"
    ;
    -Category|category-keyword||_GLOBAL
    ;
    -Endif
    ;
    ;xxxxxxxxxxxx
    ;WORLD-ORIGIN
    ;xxxxxxxxxxxx
    ;activate if you have this script. Covers all regions.
    ;
    -If|trainz-build>3.3
    ;
    ; -Callscript|TARDIS\MASTER\WORLD-ORIGIN MASTER.axm
    ;
    -Endif
    ;
    ;xxxxxxxxxxxxxxxxx
    ;EXPAND CONTAINERS
    ;xxxxxxxxxxxxxxxxx
    ;
    -Expand|bogeys
    ;
    -Expand|mesh-table
    ;
    -Expand|attached-track
    ;
    -Expand|track
    -Expand|track\track-lod-tree\
    ;
    -Expand|endcap-prev
    -Expand|endcap-prev\track-lod-tree\
    ;
    -Expand|endcap-next
    -Expand|endcap-next\track-lod-tree\
    ;
    -Expand|obsolete-table
    ;
    -Expand|extensions
    ;
    -Expand|region
    ;
    -Expand|smoke?
    ;
    -Expand|thumbnails
    ;
    -Expand|kuid-table
    ;
    ;xxxxxxxxxxx
    ;COMPLETION
    ;xxxxxxxxxxx
    ;
    ;completes repairs
    ;
    ;Saves the config file for consistency and ease in maintenance and creation. See AssetX\bin\SortOrder.txt.
    ;
    -Sort
    ;
    -Saveconfig
    ;
    -Info|END of VALIDATION - CATEGORY-REGION
    ;
    -EXIT
    ;
    ;xxxxxxxxxxx
    ;DEVELOPMENT
    ;xxxxxxxxxxx
    ;
    ;TBD
    ;
    -EXIT
    ;
    ;xxxx
    ;HELP
    ;xxxx
    ;For further information on tags and containers for each KIND refer to TrainzWiki.
    ;
    Last edited by ianwoodmore; July 7th, 2019 at 03:11 PM.
    N3V Beta Tester. Trainz Pioneer Council. TrainzDev Team.
    Asset X, PEVTools and TARDIS Beta Tester
    http://online.ts2009.com/mediaWiki/i...AssetX_Scripts

  9. #9

    Default

    Sailor Dan's link takes me to the same table as my link, so to clarify, that is for "category-region-0", not the "region" tag. So to be clear, this is for faulty "region" tags in T:ANE SP3. It appears to ONLY take numerics and it doesn't really seem to care what. For example:

    <kuid2:5562:20011:2> Rosworth Vale SP2 had faulty region tag "GB". I changed it to "12" and now it is OK.
    <kuid:131986:240943> SampleSchedules had faulty region tag "AU". I changed it to "14" and now it is OK
    region "14"
    A do note that this second one has a category-region-0 of "UK" and that appears to be OK.
    So the tag making the assets faulty is the "Region" tag. Not sure why it would need to have one of each...

  10. #10
    Join Date
    Oct 2011
    Location
    New Caledonia
    Posts
    3,185
     

    Default

    Quote Originally Posted by Forester1 View Post
    So the tag making the assets faulty is the "Region" tag. Not sure why it would need to have one of each...
    Both those assets are routes. Routes have a region, not a region code. The region is the KUID of a region asset. See:
    http://online.ts2009.com/mediaWiki/i...IND_Map#region
    http://online.ts2009.com/mediaWiki/i...hp/KIND_Region

    'category-region-0 is obsolete and should not be used. Use 'category-region instead. See:
    http://online.ts2009.com/mediaWiki/i...ategory-region

    The Wikibooks link that you have been using might be similar to the Trainz Wiki in this case, but in most cases it is likely to seriously mislead, as has happened here.

  11. #11
    Join Date
    Nov 2006
    Location
    Auran, SA, Adelaide
    Posts
    384
     

    Default

    Pretty sure the 'region' tag was the original and is long obsolete...
    Last edited by Rob; July 7th, 2019 at 08:36 PM.

  12. #12
    Join Date
    Oct 2011
    Location
    New Caledonia
    Posts
    3,185
     

    Default

    Quote Originally Posted by Rob View Post
    Pretty sure the 'region' tag was the original and is long obsolete
    No. For a route 'region' is current, and required.
    http://online.ts2009.com/mediaWiki/i...IND_Map#region

  13. #13
    Join Date
    Nov 2006
    Location
    Auran, SA, Adelaide
    Posts
    384
     

    Default

    Yes region is still valid for a route, specifying a kind region asset. It used to be allowed in other assets to specify a region code.
    Last edited by Rob; July 7th, 2019 at 08:37 PM.

  14. #14
    Join Date
    Nov 2006
    Location
    Auran, SA, Adelaide
    Posts
    384
     

    Default

    There was also 'origin'. So it's a bit confusing. Presumably the 'origin' and non route related 'region' became category-region.
    Last edited by Rob; July 7th, 2019 at 08:38 PM.

  15. #15
    Join Date
    Nov 2006
    Location
    Auran, SA, Adelaide
    Posts
    384
     

    Default

    Those "codes" e.g. '12' and '14' are probably kuids.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •