[Question] Country identifiers

Modding school: Learn it from the masters
Post Reply
User avatar
Davyddin
Moderator
Posts: 1655
Joined: 22 Jun 2017 22:00
Donation rank:
Location: Helsingfors, Nyland, Finland
Contact:

30 Sep 2017 21:27

What is the purpose of the numerical country identifiers set in the country definition files with the country_id attribute? Are these used to reference the country definitions or attributes in some way and if so, what way, or used for some other purpose, or not actually used at all?

The topmost instructions in (the vanilla) country.sii sounds to me like unit names are what's important and what's used as references, which is what I would have assumed anyway:

Code: Select all

# Warning: Even if the units are specified in more than one source file, they share the
# same namespace so suffixes or prefixes should be used to avoid conflicts.

@include "country/austria.sii"
...
The instructions about the numerical country identifier attribute further down country.sii are more ambiguous. It isn't clear to me what the practical purposes or implications are here:

Code: Select all

# Recommended country identifiers for currently unused countries. Using those indices
# is not required however it improves compatibility with future DLCs or with other
# mods utilizing indices from this table.

# **** EUROPE ****

# 14 Albania
# 15 Andorra
# 16 Belarus
...
What happens e.g. if two country_ids clash or if a mod overwrites a country_id with a different number?

Finally, just to make absolutely clear, this is the attribute in an actual country definition:

Code: Select all

country_data: country.data.austria
{
	country_id: 1		// THIS IS THE ATTRIBUTE IN QUESTION
	name: "@@austria@@"
	country_code: "A"
	pos: (14940, 0, 18780)
	fuel_price: 1.35
	lights_mandatory: false
	driving_tired_offence: true
}
Thanks in advance for answers!
ProMods moderator, translator, and tester. ATS and ETS2 player and modder. Author e.g. of the Profile Jumpstart mods. Fennoswede from the Finnish archipelago.

User avatar
ScuL
Founder
Posts: 10556
Joined: 31 Jul 2013 23:51
Location: Auckland, New Zealand

30 Sep 2017 23:28

Each country needs a unique id.
If they clash then you will run into problems.

It's best to follow the SCS definitions.
ProMods has defined some really high (>230) numbers for our custom "countries" such as Northern Ireland, Åland etc.
I am Image Dutch living in Image New Zealand and I speak Image EN Image DE Image SE Image FR
Image

User avatar
Davyddin
Moderator
Posts: 1655
Joined: 22 Jun 2017 22:00
Donation rank:
Location: Helsingfors, Nyland, Finland
Contact:

30 Sep 2017 23:30

I see. But why would countries need an additional unique numerical ID, when the unit names already need to be unique?
ProMods moderator, translator, and tester. ATS and ETS2 player and modder. Author e.g. of the Profile Jumpstart mods. Fennoswede from the Finnish archipelago.

User avatar
ScuL
Founder
Posts: 10556
Joined: 31 Jul 2013 23:51
Location: Auckland, New Zealand

30 Sep 2017 23:50

The numeric value is the unique identifier, the name variable doesn't have to be unique, it's just a text field (or rather, language file reference)
Country borders also use the numeric values.. (clashing node 8 vs 11 for instance if you have a border problem)
I am Image Dutch living in Image New Zealand and I speak Image EN Image DE Image SE Image FR
Image



Post Reply

Return to “ProMods Academy”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests