Making a weapon that requires a keypress to cock after each shot, but still needs to reload after several shots.

Howdy!

I'm working on a bolt action rifle, and i want the user to need to manual cock the weapon after each shot with a keypress (think Receiver if you've seen that; pull trigger(click), cock hammer(hit H), pull trigger(click), cock hammer(hit H)), however i also want them to have like a 5 round clip and need to do a dedicated reload after shooting 5 times. I know that the UCC has support obviously for semi auto and manual reloading, however I'm not sure how to fit the extra step of "cannot shoot until recocked" into the existing system.

the first idea was just to make it a single shot then reload weapon, but of course that doesn't take into account the "reload after shoot-cocking 5 times" thing.

Some thoughts are; use a dedicated separate item ability "press C to cock, and R to reload" or something, use the item states or audio states to alternate the gun between "ready to shoot" and "can't shoot" until you hit that button, and then when it's actually empty use the inbuilt reload system. that SOUNDS Like ti might work but there's alot of fuzziness there. I'm cool with digging around to get it to work and doing some coding but i'd love a good jumping-off point.

if there's a smoother way to do that of course that'd be grand. The UCC prob wasn't built to account for this kinda thing (not many games use bolt action rifles with manual reloads i guess) but it seems like it's flexible enough to make it work?

edit: also yes i know that this is an annoying thing to make a player do, but the process being clunky is the point for the weapon.
 
Last edited:
I think you're on track with the way you described it. You could have a state, e.g. "BlockUse", that when active disabled the Use ability completely. (A state preset attached to an Item Ability can set its "Enabled" property to false.) You could then have this state get activated upon firing, and then have your custom weapon cock ability disable it.
 
Top