Results 1 to 10 of 10

Thread: How to get the region_id?

  1. #1

    Default How to get the region_id?

    The condition IfRegionOneOf takes the parameter region_id:
    Code:
    IsRegionOneOf 77
    In most cases, I've seen that supplied as a number. Where do I find the number?

  2. #2
    Kiliç Alì's Avatar Domesticus
    Artifex

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Re: How to get the region_id?

    Surely in some files in the data folder, evem if I don't remember which ones. but you can also launch the game, put the console command
    show_cursorstat
    and it will show position of the mouse (x,y) AND the Id of the region you're on.

    Member of the Imperial House of Hader, proud client of The only and sole Ferrit

  3. #3

    Default Re: How to get the region_id?

    descr_regions.txt in the base folder, sorry mis-read.

    anyway to answer your question:

    It is to do with how the map is created (map.rvm), the map is created from left to right, top to bottom and then depends on where the actual settlement is located in that order.

    For example the settlement in the top left if it is the highest up, will be number 1, then the settlement bottom right if it is the lowest will be 199, or your max number of amount of regions!
    Last edited by danny X; October 15, 2011 at 07:33 PM.


  4. #4

    Icon1 Re: How to get the region_id?

    erasmus777: You can just use the region's name instead of its number with the ‘IsRegionOneOf’ condition. The advantage of using a region's name is that, if you add a region, you won't need to rewrite your script:
    Spoiler Alert, click show to read: 
    Code:
    and IsRegionOneOf London_Province
    Code:
    and IsRegionOneOf London_Province, Nottingham_Province

  5. #5

    Default Re: How to get the region_id?

    Quote Originally Posted by TNZ View Post
    erasmus777: You can just use the region's name instead of its number with the ‘IsRegionOneOf’ condition. The advantage of using a region's name is that, if you add a region, you won't need to rewrite your script:
    Spoiler Alert, click show to read: 
    Code:
    and IsRegionOneOf London_Province
    Code:
    and IsRegionOneOf London_Province, Nottingham_Province
    Thanks. That explains why I've been seeing both.

    @dannyxx30:
    Thanks for the file reference!

  6. #6
    Cobi Wan Kenobi's Avatar Centenarius
    Join Date
    Aug 2007
    Location
    Virgin Islands
    Posts
    885

    Default Re: How to get the region_id?

    I don't think the "IsRegionOneOf" works properly with the region name (London_Province).

  7. #7
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: How to get the region_id?

    Quote Originally Posted by Cobi Wan Kenobi View Post
    I don't think the "IsRegionOneOf" works properly with the region name (London_Province).
    Apparently not. While either the id or region name works in script, only the id works in export_descr_ancillaries.txt and export_descr_character_traits.txt. Using region name in those files silently fails: no log errors and the condition evaluates to false so the anc/trait is not acquired.

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: How to get the region_id?

    That's not cool. It would mean that you physically have to check the region's id in the game. And if you rearrange some borders or add a region everything is messed up.










  9. #9
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: How to get the region_id?

    Yup. The real trick for me will be remembering that I need to re-check all of my IsRegionOneOf conditions whenever I make map changes.

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,126
    Blog Entries
    35

    Default Re: How to get the region_id?

    Yup, that's the hard part.










Posting Permissions

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