I'm assuming that you can record commendation sets using totalKillsByRace: for each of the [units:] [race:] that exist.
For example it sounds like an Aquatoid Soldier & Aquatoid Medic both with their [units:] [race:] variable set to race: STR_AQUATOID would both yield +1 towards this commendation's STR_AQUATOID set when killed.
UFOpaedia Site: Ruleset Reference Nightly (https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Soldier_Commendations)
(https://openxcom.org/forum/index.php?action=dlattach;topic=10259.0;attach=55302) (https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Soldier_Commendations)
I was also looking through the code for Solarius Scorch's 'The X-Com Files (https://openxcom.org/forum/index.php/board,21.0.html)' mod and saw this:
- type: STR_MEDAL_RACE_KILLS_NAME #KOs by faction
description: STR_MEDAL_RACE_KILLS_UFOPEDIA
soldierBonusTypes: [STR_MEDAL_RACE_KILLS_1, STR_MEDAL_RACE_KILLS_2, STR_MEDAL_RACE_KILLS_3, STR_MEDAL_RACE_KILLS_4, STR_MEDAL_RACE_KILLS_5, STR_MEDAL_RACE_KILLS_6, STR_MEDAL_RACE_KILLS_7, STR_MEDAL_RACE_KILLS_8, STR_MEDAL_RACE_KILLS_9, STR_MEDAL_RACE_KILLS_10]
sprite: 3
criteria:
totalKillsByRace: [15, 25, 40, 60, 80, 100, 150, 200, 350, 500]
But I didn't see how you define soldierBonusTypes: for each individual type of race in the game using totalKillsByRace: as the criteria.
Is it that you need to define each as their own separate commendation?
For example something like this:
- type: STR_COMMENDATION_AQUATOID_RACE_KILLS
description: STR_COMMENDATION_AQUATOID_RACE_KILLS_UFOPEDIA
soldierBonusTypes: [STR_AQUATOID_RACE_KILLS_1, STR_AQUATOID_RACE_KILLS_2, STR_AQUATOID_RACE_KILLS_3, STR_AQUATOID_RACE_KILLS_4, STR_AQUATOID_RACE_KILLS_5, STR_AQUATOID_RACE_KILLS_6, STR_AQUATOID_RACE_KILLS_7, STR_AQUATOID_RACE_KILLS_8, STR_AQUATOID_RACE_KILLS_9, STR_AQUATOID_RACE_KILLS_10]
sprite: 3
criteria:
-
1: ["STR_AQUATOID_SOLDIER", "STATUS_DEAD"]
-
1: ["STR_AQUATOID_SQUAD_LEADER", "STATUS_DEAD"]
-
1: ["STR_AQUATOID_TECHNICIAN", "STATUS_DEAD"]
-
1: ["STR_AQUATOID_MEDIC", "STATUS_DEAD"]
-
1: ["STR_AQUATOID_NAVIGATOR", "STATUS_DEAD"]
-
1: ["STR_AQUATOID_COMMANDER", "STATUS_DEAD"]
- type: STR_COMMENDATION_TASOTH_RACE_KILLS
description: STR_COMMENDATION_TASOTH_RACE_KILLS_UFOPEDIA
soldierBonusTypes: [STR_TASOTH_RACE_KILLS_1, STR_TASOTH_RACE_KILLS_2, STR_TASOTH_RACE_KILLS_3, STR_TASOTH_RACE_KILLS_4, STR_TASOTH_RACE_KILLS_5, STR_TASOTH_RACE_KILLS_6, STR_TASOTH_RACE_KILLS_7, STR_TASOTH_RACE_KILLS_8, STR_TASOTH_RACE_KILLS_9, STR_TASOTH_RACE_KILLS_10]
sprite: 3
criteria:
-
1: ["STR_TASOTH_SOLDIER", "STATUS_DEAD"]
-
1: ["STR_TASOTH_SQUAD_LEADER", "STATUS_DEAD"]
Thank you that stopped the crash.
I placed the end bracket after the second set of brackets and OpenXcom now loads successfully.
(https://openxcom.org/forum/index.php?action=dlattach;topic=10259.0;attach=55317)
However the medal is not being awarded when Aquatoids are killed during combat so I'm still doing something incorrectly.
I double checked the unit name and it should be correct.
But when an Aquatoid (Soldier) on the enemy faction is killed no commendation is assigned to the soldier.
["STR_AQUATOID_SOLDIER", "FACTION_HOSTILE", "STATUS_DEAD"]
I also check the soldier's combat diary entry after the mission and it does display that they killed Aquatoids during the mission so it should have triggered the commendation.
UFOpaedia Site: Ruleset Reference Nightly (https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Soldier_Commendations)
(https://openxcom.org/forum/index.php?action=dlattach;topic=10259.0;attach=55319)
The only thing I think that I'm doing differently compared to the UFOpaedia Site (https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Soldier_Commendations)'s example is not adding the alien's [units:] [rank:] variable to the killCriteria: list.
I'll test it with the rank: variable added and post the result in a minute...
I just tried it again with each Aquatoid's rank added to the killCriteria: list and the medal was still not being awarded.
(https://openxcom.org/forum/index.php?action=dlattach;topic=10259.0;attach=55322)
(https://openxcom.org/forum/index.php?action=dlattach;topic=10259.0;attach=55324)
(https://openxcom.org/forum/index.php?action=dlattach;topic=10259.0;attach=55326)
I've attached the updated commendations.rul (https://openxcom.org/forum/index.php?action=dlattach;topic=10259.0;attach=55321) to this post.