OpenXcom Forum

Modding => Work In Progress => Topic started by: tkzv on September 23, 2017, 03:06:34 am

Title: Gun Melee for mod weapons
Post by: tkzv on September 23, 2017, 03:06:34 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.

Update: the script treated clips as weapons; fixed that.

Update 2: version for X-COM Files 0.9.1.
Title: Re: Gun Melee for mod weapons
Post by: leekall on June 18, 2018, 08:06:13 am
sorry I am new where do I put this file
Title: Re: Gun Melee for mod weapons
Post by: tkzv on June 22, 2018, 10:25:53 pm
sorry I am new where do I put this file
Depends on your platform and how you run the game.

If you simply unpack the distribution package from The X-COM Files thread and run the OpenXcomExPlus.exe, then unpack this archive to user\mods directory. There should be 2 folders there: XComFiles and Guns_Melee_nonstandard

Then start the game, open the list of mods and enable both. I don't remember if it matters, but probably the weapons mod should go after the main mod.