Author Topic: Guys let's agree to standardize weapon/ammo naming for mods  (Read 3084 times)

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Guys let's agree to standardize weapon/ammo naming for mods
« on: February 09, 2015, 02:15:04 am »
I have bumped into this problem a few times where two (or more) modders make the same type of weapon with different stats using different clips.

For example just no I fixed MiB sniper rifle and Equal Terms sniper rifle. Both look differrent have different stats and use different clips. To be honest I don't mind the idea of having many types of same weapons with various looks and stats but the problem is same weapon using different clips and sometimes the other weapon is not even in the game due to similar naming.

I noticed if you have two mods using same string for example STR_SNIPE_RIFLE then only one of the sniper rifle is gonna be in the game.
Does anyone know which one ? I assume the one loaded last which is probably also the mod higher in the list.  In the above example Equal Terms sniper rifle is in the game but the other one is not. Also if you make ammo strings same name then all similarly named weapons will use one shared ammo.

I recommend making the weapon string like this

STR_<UNIQUE KEY/MOD NAME>_WEAPON_NAME

And for the clip make it like this

STR_WEAPON_NAME_CLIP

This will ensure your unique weapon will be in the game and will share a clip with a similarly named weapon.

STR_EQT_SNIPER_RIFLE
STR_SNIPER_RIFLE_CLIP

STR_MIB_SNIPER_RIFLE
STR_SNIPER_RIFLE_CLIP

since both weapons have their ammo as same string they will share the ammo (and the damage)


Alternatively if you wish to make unique clips for your weapon only usable by aliens then you can add an unique clip with same naming convention.

STR_MIB_SNIPER_RIFLE_CLIP

And add it to the compatible ammo for the weapon you want as well as add the following to the the clip's rulset

require: STR_ALIENS_ONLY
cost : 0

effectively removing it from the game for XCom.


Also last thing. If you want to give the weapon to aliens but not show up in the ufopedia at first but only when found

add this to the weapon

weapons:
  - type: STR_MIB_MACHINE_PISTOL
    cost: 0
...
    lookup: STR_MIB_MACHINE_PISTOL
    needItem: true

and add this to the weapon's ufopedia making the ufopedia (weapon) require itself which means this ufopedia is unlocked only if the weapon is found

ufopedia:
  - id: STR_MIB_MACHINE_PISTOL
...
    section: STR_WEAPONS_AND_EQUIPMENT
    requires:
      - STR_MIB_MACHINE_PISTOL


In equal terms default game weapons have been removed from the game by making ufopedia not available and weapons belonging to aliens. The problem is MIB early tech use default XCom weapons so you gonna see them in the game but unable to use them. I think is smarted to remove them by making the weapons require themselves that mans if you ever see them their ufopedia is auto unlocked and you will be able to use them unless you specifically want to make something XCom cannot use. You can make clips cost 0 so they cannot be bought in the game but you can add manufacture options for clips once their ufopedia has been unlocked ie you found on weapon so now you can make clips for it. Which is exactly what I did to make MIB and Equal Terms compatible.

There are a couple of laser rifles, sniper rifles, shotguns, machine pistols and many other weapons in various mods floating around. Would be nice to have them all use same ammo and have them unlock themselves if found if not available at start.

What do you think?
« Last Edit: February 09, 2015, 05:48:22 am by tollworkout »

Offline jackstraw2323

  • Colonel
  • ****
  • Posts: 206
    • View Profile
Re: Guys let's agree to standardize weapon/ammo naming for mods
« Reply #1 on: February 09, 2015, 05:33:50 am »
I'm doing something like this. It's a good idea. Also I'm namespacing the whole set of resources in a separate folder so that my version of something that I didn't namespace enough won't be in conflict with another modder's set.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: Guys let's agree to standardize weapon/ammo naming for mods
« Reply #2 on: February 10, 2015, 10:41:57 am »
I'm doing something like this. It's a good idea. Also I'm namespacing the whole set of resources in a separate folder so that my version of something that I didn't namespace enough won't be in conflict with another modder's set.

Can you link me to your project Im curious what you are making :)