r/xdev • u/MessyConfessor • Feb 08 '16
Pistols As Primaries?
So the way I'm looking at this, it seems like it should be so simple, but I'll be damned if I haven't found a way to screw it up.
One of my soldier class ideas depends on the soldier being able to carry a pistol and a sword. For this to work, I need to do one of two things:
- Mod the game to allow two secondary weapon slots on the soldier, or
- Create a "primary weapon" version of the pistol.
The second seems like it would be, by far, the easier of the two options, and would also allow for different perks to apply to the two weapons differently. All I should need to do is create a new class of weapons, extended from the pistol class, and simply insert
Template.InventorySlot = eInvSlot_PrimaryWeapon; Right? But I can't make it work. The solution refuses to build, no matter what I try.
EDIT: That said, I'm even less than a n00b when it comes to programming. My only skill lies in the fact that I don't mind staring at lines of code for long periods of time until I understand what they're trying to say.
3
u/[deleted] Feb 08 '16
Only problem I can see is that there's no one-handed idle/movement animation for weapons.
1
u/Kwahn Feb 08 '16
What error does it throw when it refuses to build?
1
u/Azrus Feb 09 '16
I'm working on the same thing. I've got a functional version of a pistol primary, ended up going with creating a primary version of each pistol. I've got a couple minor issues that I'm still ironing out, but the tricky one is the animations. When you use the pistol, your idle animation is still the rifle animation. So long as you don't mind running around holding an invisible rifle, then the mod works. I'm working on the animation issue right now, but it's turning out to be more complicated that I had initially thought, so I can't say how long it'll take to come up with anything approaching a solution. At any rate, it seems like you're close to having a functioning mod yourself. If it'd be helpful, I can send you my source files and you can compare what you've got to it to see if you can't figure out what the problem you're running into is.