OpenXcom Forum
Modding => Help => Topic started by: efrenespartano on March 15, 2019, 01:04:47 am
-
Hi all!
I am trying to understand how to apply the alienItemLevels to the soldiers that will accompany the player in new missions that I am working on. I understand how they work for aliens (after a lot of searching here in the forum and in the UFOpedia Ruleset Reference Page), but I do not really know how to apply it to civilians!
I share a bit of the code to illustrate them:
units:
- type: STR_BRITISH_RIFLEMAN_NPC
race: STR_HUMANS
rank: STR_LIVE_SOLDIER
stats:
tu: 50
stamina: 100
health: 35
bravery: 100
reactions: 40
firing: 65
throwing: 50
strength: 45
psiStrength: 35
psiSkill: 0
melee: 20
armor: STR_BRITISH_FIELD_UNIFORM
standHeight: 22
kneelHeight: 14
value: 10
deathSound: [44, 45, 46]
intelligence: 6
aggression: 0
builtInWeaponSets:
- STR_SMLE_MKIII
- STR_SMLE_MKIII_CLIP
- STR_SMLE_MKIII_CLIP
- STR_WEBLEY_REVOLVER
- STR_WEBLEY_REVOLVER_CLIP
- STR_MILLS_BOMB
-
- STR_SMLE_MKIII
- STR_SMLE_MKIII_CLIP
- STR_SMLE_MKIII_CLIP
- STR_BANDAGES
- STR_MILLS_BOMB
- STR_MILLS_BOMB
-
- STR_FARQHUAR_HILL
- STR_FARQHUAR_HILL_CLIP
- STR_FARQHUAR_HILL_CLIP
- STR_MILLS_BOMB
-
- STR_FARQHUAR_HILL
- STR_FARQHUAR_HILL_CLIP
- STR_FARQHUAR_HILL_CLIP
- STR_WEBLEY_REVOLVER
- STR_WEBLEY_REVOLVER_CLIP
- STR_MILLS_BOMB
The Farqhuar-Hill is an "experimental" rifle that the player needs to investigate to use it, so I want to define its use after a certain time so that the player does not find it in the hands of an NPC at the beginning of the game. A potential solution was this one that I wrote, the experimental rifle would start appearing after the third month:
alienItemLevels:
- [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
- [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
- [0, 0, 1, 1, 1, 2, 2, 2, 3, 3]
Where do I place the alienItemLevels section? Is there a problem if I put this in the ruleset where I define the allied civilians and their weapons and define another alienItemLevels in another ruleset, along with the alien weapons?
Thanks in advance!
-
You can't assign alienItemLevels to civilians, those are used with the items defined in alienDeployments.rul.
With builtInWeaponSets the game will simply pick a random set of items of those listed to equip the unit (if used it also overrides any sets defined through alienDeployments)
-
You can't assign alienItemLevels to civilians, those are used with the items defined in alienDeployments.rul.
With builtInWeaponSets the game will simply pick a random set of items of those listed to equip the unit (if used it also overrides any sets defined through alienDeployments)
Oh! I see.
Well, I think I should made different allied civillians to resemble each weapon Tier.
Thank you so much for the quick answer, Hobbes!
Enviado desde mi Blade A510 mediante Tapatalk
-
Item sets do not override alien deployments. Both lists are used.
-
Item sets do not override alien deployments. Both lists are used.
On Area 51 I have 3 races (Spacefarer, Phaser and Overlord) that use builtInWeaponSets. They always spawn only with their builtInWeaponSets, even though they use the vanilla alienDeployments that assign plasma weapons to all the non-terror aliens.
This is related to coding logic/sequence: if there are two different lists A and B, the code will first assign weapons according to A, but if list B is present, then it overrides and uses instead list B.
Otherwise, if both lists were used, then it would either assign both items on list A and B, or it would still have to choose between A or B. Considering that choosing between items on A is dependent on game progression (alienItemLevels) and B chooses completely randomly, you have two different criteria for choosing, and trying to use both is chaos.
I just asked Warboy on Discord to confirm this issue.
-
Hmm, but I clearly saw it happening. However, indeed it shouldn't work for weapons specifically - but generic items are okay.
-
I was incorrect in my latest post - the 3 races I mentioned use LivingWeapon, not builtItWeapons. But Meridian looked at the code and I'll quote his answer:
just after quick look, it does:
1/ built in weapons first
2/ livingWeapon OR deployment weapons second
if there are "conflicts", first come first served...
So yeah, like I said builtInWeapons override deployment weapons
-
Good to know!
I made a separate allied civilian with upgraded weapons in a different alienDeployment, to simulate the escalation in war and that soldiers receive new weapons as a result of this.
Thank you for helping me with this question, Hobbes & Solarius Scorch! ;D