Any way to edit a melee weapon to add reach?

Started by ProFF7, September 01, 2016, 04:06:31 AM

Previous topic - Next topic

ProFF7

I was thinking to modify spears to give them more reach, so they would have potential for defensive group fighting (the thing spears are most useful at!). Spears have little use as they are now.
Perhaps create pikes that have even more reach and could be used in pike block formations.

The question is, is it possible to do that? add reach to a melee weapon?

O Negative

I played around with RimWorld code in the past. I tried doing exactly what you're talking about by creating a new "melee" verb with more range, but the game freaked. More than likely something I did wrong, but oh well :(

One thing that I know is absolutely possible: Giving a weapon more than one verb. You can make spears have a melee and ranged attack if you really wanted to. This is demonstrated in an old "throwing knives" mod.

ProFF7

#2
What did you try exactly and what was the problem?

just added <range>3</range> or something like that?

I tried that and the game identifies it as a ranged weapon (brawler was unhappy) but doesnt do any kind of ranged or melee attacks

Wonder if someone figured a way to make it work

ProFF7

Ok for now what Im gonna do is try to give a spear a basic melee attack, and a ranged one with extremely beefed accuracy... not the best solution, but its better than nothing..

Hope Tynan could add some way to add reach to melee weapons directly.

O Negative

Quote from: ProFF7 on September 01, 2016, 06:40:24 AM
What did you try exactly and what was the problem?

just added <range>3</range> or something like that?

I tried that and the game identifies it as a ranged weapon (brawler was unhappy) but doesnt do any kind of ranged or melee attacks

Wonder if someone figured a way to make it work

No, it wasn't in an xml file. I was working with a .dll mod. Basically, there's a bit of code in there that sets the range for the "melee" verb. I pretty much just copypasta'd the vanilla code into mine, and then changed the bit that determined the range: from adjacet -> nearby, essentially. This was back when I was trying to learn C#, and I had actually made a few decent mods with .dll code. Nothing special, but I did end up making a melee verb with its own hit/miss sounds. I also wrote a bit of code for larger pawns which spawned smaller pawns on death. You could think of them as those big headed guys from the Halo series, but not exactly the same hahaha.

What sucks about having a ranged verb instead of a melee verb with reach, is that the ranged verb is going to use your shooting skill and not your melee skill :( Maybe someone in the modding community will implement something like this in the future. Perhaps the author of the Combat Realism mod would be interested in doing this. Might want to PM them about it, if they haven't already added this little feature.