Author Topic: [DONE] [Suggestion] Soldier's nationality  (Read 22649 times)

Offline g5-freemen

  • Captain
  • ***
  • Posts: 75
    • View Profile
[DONE] [Suggestion] Soldier's nationality
« on: March 26, 2016, 12:27:52 pm »
How about national identification of soldiers? Maybe it possible to add in soldiers stats flag to show where from this soldier? Ivan - Russian for example and etc.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11515
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Soldier's nationality
« Reply #1 on: March 26, 2016, 08:42:14 pm »
Yeah, I'd like that too, but it's a UI problem - where should it be displayed?

Offline g5-freemen

  • Captain
  • ***
  • Posts: 75
    • View Profile
Re: Soldier's nationality
« Reply #2 on: March 27, 2016, 09:11:08 am »
Yeah, I'd like that too, but it's a UI problem - where should it be displayed?
Something like that i think

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8709
    • View Profile
Re: Soldier's nationality
« Reply #3 on: March 27, 2016, 10:51:47 am »
Yeah, if you're called John Smith, that would work... if you're called Charalampos Tsourakakis, the name would either be cropped or obstruct the flag.

Offline g5-freemen

  • Captain
  • ***
  • Posts: 75
    • View Profile
Re: Soldier's nationality
« Reply #4 on: March 27, 2016, 03:14:29 pm »
Yeah, if you're called John Smith, that would work... if you're called Charalampos Tsourakakis, the name would either be cropped or obstruct the flag.
If you call a soldier Hubert Blaine Wolfeschlegelsteinhausenbergerdorff or something like that it will also cropped, but it looks not normal to give soldiers so long names.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8709
    • View Profile
Re: Soldier's nationality
« Reply #5 on: March 27, 2016, 03:17:48 pm »
So, I added the flag support...

In the attachment, there is:
- a mod for xcom1 called "World Flags" with 33 flags corresponding to xcom1 name files (arabic=egypt flag, polynesian=new zealand flag)
- a mod for piratez called "Pirate Flags" with 1 flag... guess which one :)

And a few screenshots.

PS: you will need OXCE 2.9+ v2016-03-27 (or higher) for this to work.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: Soldier's nationality
« Reply #6 on: March 27, 2016, 03:20:29 pm »
So, I added the flag support...
<snip>
...you will need OXCE 2.9+ v2016-03-27 (or higher) for this to work.

Damn, impressive!  You never disappoint!

Offline Countdown

  • Colonel
  • ****
  • Posts: 246
    • View Profile
Re: Soldier's nationality
« Reply #7 on: March 27, 2016, 03:40:52 pm »
« Last Edit: March 27, 2016, 03:45:39 pm by Countdown3 »

Offline g5-freemen

  • Captain
  • ***
  • Posts: 75
    • View Profile
Re: Soldier's nationality
« Reply #8 on: March 27, 2016, 04:26:16 pm »
This mod is unsupported by OpenXCom as i understand ?

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: Soldier's nationality
« Reply #9 on: March 27, 2016, 04:34:53 pm »
This mod is unsupported by OpenXCom as i understand ?

Standard OpenXcom (Milestone 1.0 or Nightly) will not work for this mod.  This required custom code to be written and a Custom Executable.  Meridian wrote this code and added it to his build of OpenXcom Extended which is Yankes' custom executable.   Basically, for features beyond what is available within Rulesets (such as adding flags, wound indicators, etc.) you need custom builds of the executable.  Sometimes these features make it back into the main branch of OpenXcom and show up in a Nightly and somtimes they don't.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8709
    • View Profile
Re: Soldier's nationality
« Reply #10 on: March 27, 2016, 05:21:56 pm »
This mod is unsupported by OpenXCom as i understand ?

Just like you, I cannot commit anything into OpenXcom master.
(which is a good thing)

I can however commit into my own fork, and that's what I did. I even build and publish executables regularly. If that's not enough, there's always option for you to build your own executable based on whichever fork you want, including OpenXcom master.

If you wish, you can cherry-pick this change (https://github.com/MeridianOXC/OpenXcom/commit/7838c1a5ab5e6480e7aa1eb01455fc4e5d1cf3e8) into your local copy of OpenXcom master and build your own version that contains everything what a nightly OpenXcom build contains and this particular change on top.

Enjoy.

Offline g5-freemen

  • Captain
  • ***
  • Posts: 75
    • View Profile
Re: Soldier's nationality
« Reply #11 on: March 27, 2016, 08:20:25 pm »
If you wish, you can cherry-pick this change (https://github.com/MeridianOXC/OpenXcom/commit/7838c1a5ab5e6480e7aa1eb01455fc4e5d1cf3e8) into your local copy of OpenXcom master and build your own version that contains everything what a nightly OpenXcom build contains and this particular change on top.

Enjoy.
Sorry, but i'm not programmer and don't know how to compile something. Better i'll drink some beer and maybe try OpenXcom Extended :)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11515
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Soldier's nationality
« Reply #12 on: March 27, 2016, 10:46:17 pm »
Meridian, all my soldiers have the US flag. I can see the ruleset only contains sprites definitions, so everything else must be hardcoded, so I don't know what I could've done wrong.

EDIT: Nevermind, apparently it only works for new soldiers.

BTW do I need the Flags-orig folder?

Also: how do I add more flags? Because some of my men don't have one. What is the order?
« Last Edit: March 27, 2016, 10:50:50 pm by Solarius Scorch »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8709
    • View Profile
Re: Soldier's nationality
« Reply #13 on: March 27, 2016, 11:18:45 pm »
Meridian, all my soldiers have the US flag. I can see the ruleset only contains sprites definitions, so everything else must be hardcoded, so I don't know what I could've done wrong.

EDIT: Nevermind, apparently it only works for new soldiers.

Nationality is assigned when a new soldier is created.
Old soldiers will have nationality = 0.
You can change the nationality in the save file (attribute "nationality").

BTW do I need the Flags-orig folder?

No.
I just forgot it there when I was changing the palettes.

Also: how do I add more flags? Because some of my men don't have one. What is the order?

Flag codes are Flag0, Flag1, Flag2 and so on...

The number correspond to *.nam file alphabetical order, i.e.:
American = US flag = 0
Arabic = Egypt flag = 1
Belgium = 2
British = 3
Bulgarian = 4
...
...
Turkish = 32

If you have different *.nam files, your ordering will be different.

EDIT: new flags should have basescape palette, height max 20 (preferably equal to 20) and width max 40. I downloaded my flags from: https://flagpedia.net/
« Last Edit: March 27, 2016, 11:22:08 pm by Meridian »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11515
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Soldier's nationality
« Reply #14 on: March 29, 2016, 05:21:15 pm »
Thanks for the response.

I haven't modded the .nam files, so I'm unsure of what happened, but I'll check it more thoroughly.