Author Topic: [DONE][SUGGESTION] "nationFrequency"  (Read 2082 times)

Offline Ostrich-Hungry

  • Sergeant
  • **
  • Posts: 21
    • View Profile
[DONE][SUGGESTION] "nationFrequency"
« on: September 05, 2022, 06:39:27 pm »
Hey! I'm making a mod about names, and I would love to have some control over what nationality do agents get.
Xenonauts had something like this: "<Nation MODMERGE="insert" MODMERGEATTRIBUTE="name" name="Hungarian" chance="10" flag="hungary" >"

"chance" is the probability that said agent belongs to that nation (In this case, Hungary).
It would help me to elaborate immersion, because in some games you rarely find soldiers from, say, countries like England, Russia, Germany, China or the United States. Countries that would contribute many more soldiers than the rest.
This work the same for nations that are islands or very small countries. It should be very rare to have soldiers from those countries.
« Last Edit: October 30, 2022, 11:39:08 am by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: [SUGGESTION] "nationFrequency"
« Reply #1 on: October 26, 2022, 09:17:12 pm »
How about a weight in the *.nam files:

Code: [Select]
globalWeight: 100    # 100 is the default; minimum is 1, maximum unlimited
maleFirst:
  - David
  - Samuel
  - Morgan
  - Bruce
femaleFirst:
  - Jessica
  - Sigourney
  - Halle
  - Whoopi
maleLast:
  - Copperfield
  - Jackson
  - Freeman
  - Willis
« Last Edit: October 26, 2022, 09:30:45 pm by Meridian »

Offline Ostrich-Hungry

  • Sergeant
  • **
  • Posts: 21
    • View Profile
Re: [SUGGESTION] "nationFrequency"
« Reply #2 on: October 28, 2022, 07:09:47 pm »
That's perfect! Does it works?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: [SUGGESTION] "nationFrequency"
« Reply #3 on: October 28, 2022, 07:29:50 pm »
Not yet, I just asked if this solution would be acceptable.

Offline Ostrich-Hungry

  • Sergeant
  • **
  • Posts: 21
    • View Profile
Re: [SUGGESTION] "nationFrequency"
« Reply #4 on: October 28, 2022, 11:15:42 pm »
yes! It would be perfect. Thank you for your consideration!!!

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: [DONE][SUGGESTION] "nationFrequency"
« Reply #5 on: October 30, 2022, 11:39:48 am »
Done.

Documentation here: https://openxcom.org/forum/index.php/topic,10845.0.html

Sample mod attached.