In case it could help you, what I do when trying to add a new weapon
I got the example of Sniper Rifle :
- do not pay attention to values as they are modified in some obscure goal
- I work with many ruleset files as it is part of a global mod like the FMP ; you may use a unique file, beware never declare a section twice, also items: ... then items: ... will not work if in same file
Idea is just to warn you on which sections have to be completed to add a Sniper Rifle with two types of ammo (buy-able regular one + researched/manufactured Alien Alloy ammo ; warning : the research node on Alien Alloy Ammo is not included here)
File MyMod_Items.rul
items:
# Sniper Rifle
- type: STR_SNIPER_RIFLE
size: 0.2 #0.3
costBuy: 16000 #12000
costSell: 1600 #5500
weight: 25 #9
compatibleAmmo:
- STR_SNIPER_RIFLE_CLIP
minRange: 15
accuracySnap: 0 #80
tuSnap: 0 #33
accuracyAimed: 150 #160
tuAimed: 85 #50
aimRange: 50
battleType: 1
twoHanded: true
invWidth: 1
invHeight: 3
armor: 20
recoveryPoints: 2 #NEW
attraction: 1 #NEW
- type: STR_SNIPER_RIFLE_CLIP
size: 0.1
costBuy: 1600 #250
costSell: 160 #160
weight: 5 #2
power: 45 #35
damageType: 1
clipSize: 2 #10
battleType: 2
armor: 20
recoveryPoints: 1 #NEW
attraction: 1 #NEW
# Sniper Rifle
- type: STR_SNIPER_RIFLE
compatibleAmmo:
- STR_SNIPER_RIFLE_CLIP
- STR_SNIPER_RIFLE_AA_CLIP
- type: STR_SNIPER_RIFLE_AA_CLIP
size: 0.1
costSell: 320
weight: 4
power: 54
damageType: 1
clipSize: 2
battleType: 2
armor: 20
File MyMod_ExtraStrings.rul
extraStrings:
# Sniper Rifle
- type: en-US
strings:
STR_SNIPER_RIFLE: Sniper Rifle
STR_SNIPER_RIFLE_UFOPEDIA: "This 12.7-mm caliber sniper rifle is more powerful than a standard rifle and has excellent accuracy. However, it is harder to use and has a low rate of fire."
STR_SNIPER_RIFLE_CLIP: Sniper Rifle Clip
STR_SNIPER_RIFLE_CLIP_UFOPEDIA: "SNIPER RIFLE CLIP PROPERTIES{NEWLINE}{NEWLINE}> Weight: 5 > Ammo: 2{NEWLINE}{NEWLINE}{NEWLINE}SNIPER RIFLE GUN PROPERTIES{NEWLINE}{NEWLINE}> Weight: 25{NEWLINE}{NEWLINE}{NEWLINE}RANGE (FULL ACCURACY){NEWLINE}{NEWLINE}> Aimed Shot: 15-50m"
STR_SNIPER_RIFLE_AA_CLIP: Sniper Rifle Alloy Clip
STR_SNIPER_RIFLE_AA_CLIP_UFOPEDIA: "SNIPER RIFLE ALLOY CLIP PROPERTIES{NEWLINE}{NEWLINE}> Weight: 4 > Ammo: 2{NEWLINE}{NEWLINE}{NEWLINE}SNIPER RIFLE GUN PROPERTIES{NEWLINE}{NEWLINE}> Weight: 25{NEWLINE}{NEWLINE}{NEWLINE}RANGE (FULL ACCURACY){NEWLINE}{NEWLINE}> Aimed Shot: 15-50m"
- type: en-GB
strings:
STR_SNIPER_RIFLE: Sniper Rifle
STR_SNIPER_RIFLE_UFOPEDIA: "This 12.7-mm caliber sniper rifle is more powerful than a standard rifle and has excellent accuracy. However, it is harder to use and has a low rate of fire."
STR_SNIPER_RIFLE_CLIP: Sniper Rifle Clip
STR_SNIPER_RIFLE_CLIP_UFOPEDIA: "SNIPER RIFLE CLIP PROPERTIES{NEWLINE}{NEWLINE}> Weight: 5 > Ammo: 2{NEWLINE}{NEWLINE}{NEWLINE}SNIPER RIFLE GUN PROPERTIES{NEWLINE}{NEWLINE}> Weight: 25{NEWLINE}{NEWLINE}{NEWLINE}RANGE (FULL ACCURACY){NEWLINE}{NEWLINE}> Aimed Shot: 15-50m"
STR_SNIPER_RIFLE_AA_CLIP: Sniper Rifle Alloy Clip
STR_SNIPER_RIFLE_AA_CLIP_UFOPEDIA: "SNIPER RIFLE ALLOY CLIP PROPERTIES{NEWLINE}{NEWLINE}> Weight: 4 > Ammo: 2{NEWLINE}{NEWLINE}{NEWLINE}SNIPER RIFLE GUN PROPERTIES{NEWLINE}{NEWLINE}> Weight: 25{NEWLINE}{NEWLINE}{NEWLINE}RANGE (FULL ACCURACY){NEWLINE}{NEWLINE}> Aimed Shot: 15-50m"
- type: fr
strings:
STR_SNIPER_RIFLE: Fusil de Précision
STR_SNIPER_RIFLE_UFOPEDIA: "Ce fusil, de calibre 12.7 mm et équipé d'une lunette, est plus puissant qu'un fusil classique et dispose d'une précision exceptionnelle. Mais sa manipulation plus complexe pénalise sa cadence de tir."
STR_SNIPER_RIFLE_CLIP: Charg. de Fusil de Précision
STR_SNIPER_RIFLE_CLIP_UFOPEDIA: "PROPRIÉTÉS DU CHARGEUR DE FUSIL DE PRÉCISION{NEWLINE}{NEWLINE}> Poids : 5 > Munitions : 2{NEWLINE}{NEWLINE}{NEWLINE}PROPRIÉTÉS DU FUSIL DE PRÉCISION{NEWLINE}{NEWLINE}> Poids : 25{NEWLINE}{NEWLINE}{NEWLINE}PORTÉE (SANS PÉNALITÉ À LA PRÉCISION){NEWLINE}{NEWLINE}> Tir Précis : 15-50m"
STR_SNIPER_RIFLE_AA_CLIP: Charg. de Fusil de Précision AE
STR_SNIPER_RIFLE_AA_CLIP_UFOPEDIA: "PROPRIÉTÉS DU CHARGEUR DE FUSIL DE PRÉCISION AE{NEWLINE}{NEWLINE}> Poids : 4 > Munitions : 2{NEWLINE}{NEWLINE}{NEWLINE}PROPRIÉTÉS DU FUSIL DE PRÉCISION{NEWLINE}{NEWLINE}> Poids : 25{NEWLINE}{NEWLINE}{NEWLINE}PORTÉE (SANS PÉNALITÉ À LA PRÉCISION){NEWLINE}{NEWLINE}> Tir Précis : 15-50m"
File MyMod_ExtraSprites.rul
items:
# Sniper Rifle
- type: STR_SNIPER_RIFLE
bigSprite: 408
floorSprite: 1 #408
handSprite: 424 #IncOf8
bulletSprite: 2 #14 #14x35=490
fireSound: 408
- type: STR_SNIPER_RIFLE_CLIP
bigSprite: 409
floorSprite: 2 #409
hitSound: 22
hitAnimation: 26
# Sniper Rifle
- type: STR_SNIPER_RIFLE_AA_CLIP
bigSprite: 459
floorSprite: 2
hitSound: 22
hitAnimation: 26
extraSprites:
# Sniper Rifle
- type: BIGOBS.PCK
files:
408: Resources/HellMod/Weapons/Regular/SniperRifle_BIGOBS.PNG
409: Resources/HellMod/Weapons/Regular/SniperRifleClip_BIGOBS.PNG
#- type: FLOOROB.PCK
#files:
#408: Resources/HellMod/Weapons/Regular/SniperRifle_FLOOROB.PNG
#409: Resources/HellMod/Weapons/Regular/SniperRifleClip_FLOOROB.PNG
- type: HANDOB.PCK
width: 256
height: 40
subX: 32
subY: 40
files:
#IncOf8
424: Resources/HellMod/Weapons/Regular/SniperRifle_HANDOB.PNG
#- type: Projectiles
#height: 3
#width: 57
#subX: 3
#subY: 3
#files:
#IncOf35
#490: Resources/HellMod/Weapons/Regular/SniperRifle_BulletSprite.PNG
# Sniper Rifle
- type: BIGOBS.PCK
files:
459: Resources/HellMod/Weapons/Alloy/SniperRifleClip_AA_BIGOBS.PNG
extraSounds:
# Sniper Rifle
408: Resources/HellMod/Weapons/Regular/Sounds/SniperRifle_FireSound.WAV
File MyMod_Manufacture.rul
manufacture:
# Sniper Rifle
- name: STR_SNIPER_RIFLE_AA_CLIP
category: STR_AMMUNITION
requires:
- STR_ALLOY_AMMO
space: 2
time: 32
cost: 3200
requiredItems:
STR_ALIEN_ALLOYS: 1
File MyMod_Research.rul
research:
- name: STR_SNIPER_RIFLE_AA_CLIP
cost: 0
points: 0
dependencies:
- STR_ALLOY_AMMO
File MyMod_Ufopaedia.rul
ufopaedia:
# Sniper Rifle
- id: STR_SNIPER_RIFLE
type_id: 4
section: STR_WEAPONS_AND_EQUIPMENT
text: STR_SNIPER_RIFLE_UFOPEDIA
- id: STR_SNIPER_RIFLE_CLIP
type_id: 4
section: STR_WEAPONS_AND_EQUIPMENT
text: STR_SNIPER_RIFLE_CLIP_UFOPEDIA
- id: STR_SNIPER_RIFLE_AA_CLIP
type_id: 4
section: STR_WEAPONS_AND_EQUIPMENT
text: STR_SNIPER_RIFLE_AA_CLIP_UFOPEDIA
requires:
- STR_SNIPER_RIFLE_AA_CLIP
File MyMod_ZListOrders_Items
items:
- type: STR_SNIPER_RIFLE
listOrder: 2190
- type: STR_SNIPER_RIFLE_CLIP
listOrder: 2200
- type: STR_SNIPER_RIFLE_AA_CLIP
listOrder: 2210
File MyMod_ZListOrders_Manufacture
manufacture:
- name: STR_SNIPER_RIFLE_AA_CLIP
listOrder: 1950
File MyMod_ZListOrders_Ufopaedia
ufopaedia:
- id: STR_SNIPER_RIFLE
section: STR_WEAPONS_AND_EQUIPMENT
listOrder: 3280
- id: STR_SNIPER_RIFLE_CLIP
section: STR_WEAPONS_AND_EQUIPMENT
listOrder: 3281
- id: STR_SNIPER_RIFLE_AA_CLIP
section: STR_WEAPONS_AND_EQUIPMENT
listOrder: 3282
I wondered if you weren't asking me ... ;)
A few questions:
1- wouldn't you have to activate all those rules files, thus making it annoying in the OpenXCom mod page?
1) Sure, but it still in construction, also after have experienced different methods, it seemed to me better to work with separate files
At the end, I will make a unique one
For the moment, it's right I have a lot of rulesets... but I have a dedicated options.cfg so that I have nothing to activate, just copy the options file
For the moment it presents many advantages, as for example having listorders separately (in charge of redefining all listorder including vanilla, and so in any section)
- HellMod_AlienDeployments
- HellMod_AlienItemLevels
- HellMod_AlienMissions
- HellMod_AlienRaces
- HellMod_Armors
- HellMod_CraftWeapons
- HellMod_Crafts
- HellMod_ExtraStrings
- HellMod_Facilities
- HellMod_Invs
- HellMod_Items
- HellMod_ItemsExtra
- HellMod_Language
- HellMod_Manufacture
- HellMod_Regions
- HellMod_Research
- HellMod_Soldiers
- HellMod_Starting
- HellMod_TerrainsAlienDeployments
- HellMod_TerrainsCBase
- HellMod_TerrainsCult
- HellMod_TerrainsCulta
- HellMod_TerrainsDawnUrbanA
- HellMod_TerrainsDawnUrbanB
- HellMod_TerrainsIndustrialUrban
- HellMod_TerrainsMadUrban
- HellMod_TerrainsMBase
- HellMod_TerrainsNativeUrban
- HellMod_TerrainsPortUrban
- HellMod_TerrainsUBase
- HellMod_TerrainsUbase2
- HellMod_TerrainsUrban
- HellMod_TerrainsUrban2
- HellMod_TerrainsUrbanA
- HellMod_TerrainsUrbania
- HellMod_TerrainsUrbanNew
- HellMod_TerrainsXBase
- HellMod_UfoTrajectories
- HellMod_UfopaediaExtra
- HellMod_UfopaediaStep1
- HellMod_UfopaediaStep2
- HellMod_Ufos
- HellMod_Units
- HellMod_XCultist
- HellMod_XL83Ufos
- HellMod_XMIB
- HellMod_ZListOrders_Items
- HellMod_ZListOrders_Manufacture
- HellMod_ZListOrders_Research
- HellMod_ZListOrders_Ufopaedia
2- don't the 2nd definitions in the items file just overwrite the first? Why not just write everything at once? (ie just define ammo types and clips once)
2) Yes, and no
Right is that :
- if you have a unique file containing twice Items section, the first one will be ignored
- if you have two files containing Items section, the second one will overrule the first one
But in this case, I do not define same attributes
The second one is for extraSprites and Sounds purposes, so that I can focus just on it when dealing with sprite numbers
I also organized items by category, (Craft, CraftWeapons, Armors, Equipement, Regular Weapons, Alien Alloy W, Gauss W, Heat-Ray W, ...) and reserve a threshold to any category, to make maintenance easier
Craft : [100-150] ; CraftWeapons : [150-200] ; ...