OpenXcom Forum
Modding => Work In Progress => Topic started by: prayuth01 on February 07, 2018, 11:19:55 am
-
As I found out, Gun Melee mod only works with standard weapons, but not with weapons added by mods. After some search and some help from #yaml@freenode.net I made a Perl script that makes a similar .rul file for every weapon of the types it knows. Currently it goes like this:
STR_PISTOLS
meleePower = 20;
tuMelee = 15;
accuracyMelee = 100;
STR_BOWS
meleePower = 20;
tuMelee = 15;
accuracyMelee = 100;
STR_SMGS
meleePower = 20;
tuMelee = 15;
accuracyMelee = 100;
STR_SHOTGUNS
meleePower = 50;
tuMelee = 40;
accuracyMelee = 100;
STR_RIFLES
meleePower = 50;
tuMelee = 40;
accuracyMelee = 100;
STR_SNIPER_RIFLES
meleePower = 50;
tuMelee = 40;
accuracyMelee = 100;
STR_CANNONS
meleePower = 65;
tuMelee = 50;
accuracyMelee = 100;
STR_MACHINE_GUNS
meleePower = 65;
tuMelee = 50;
accuracyMelee = 100;
STR_LAUNCHERS
meleePower = 80;
tuMelee = 80;
accuracyMelee = 100;
So far I have processed only items_XCOMFILES.rul for "The X-COM Files". Should I add weapons from other mods? Should I create separate melee mods for other large projects?
One problem so far: hitting enemies doesn't stun them, but kills.
ufabet (https://www.ufa88.com/ufabet/)
Update: the script treated clips as weapons; fixed that.
-
Since you're using OXCE+, you can define the melee damage type directly:
items:
- type: STR_SOME_GUN
meleeType: 6 # stun damage
There's a lot you can do with gun melee attacks in OXCE+ - much of it is documented here (https://github.com/Yankes/OpenXcom/blob/OpenXcomExtended/Extended.txt).
However, you should be careful with this mod, as some guns already have a melee attack that could get overriden, such as the SKS's bayonet attack.