Weapon Cooldown Option

James

Member
Hi, I'm looking to implement a weapon type with a cooldown rather than reloading...

Much like Star Wars Battlefront 2.. all weapons have cooldown rates when used in standard mode.

So as the player fires the gun the heat rises and there is a threshold to stop the firing.. Is that built in to UCC or is that a custom implementation?

thanks
 

DavidC

Active member
Haven't tried this, but this is what I would try:

On reload, set a custom state that changes reload from "manual" to automatic. This state should be something like "Energy Weapon"

Then on your energy weapon, set reload to "Single" instead of full. Turn off the animation events. Change the reload time to whatever the cooldown rate is per shot. Make sure your weapon set with this weapon has the "Energy Weapon" state name.

The only thing is, there's no way for you to "shoot" because reload has a higher priority. To get around this, you'd either need to program a special interrupt, or make a new "use" ability that has a higher priority than reload, but only works with energy weapons. I think you'd do that by setting a new (unused) action ID on both the weapon and the new "use" ability.
 

DavidC

Active member
hey David, thanks for the input, Ill read this a few times to get your idea. Thanks
If you don't understand state machines and event systems. I recommend reading up on them enough to understand them conceptually. Almost everything I mentioned can be done in the inspector window under opsive components.
 

James

Member
Hey David, sitting down here today reading your post, thanks again for responding.

The weapon should fire normally as any other standard auto rifle would do, however, after so many shots the gun would be too hot and stop the firing.

Example
Go to 4:44

The auto fire has a thermal build up then stops the gun from firing until it's cooled back down.

Will your solution above mimic this same result?

I've been working on adding a Thermal Weapon component to the shootable weapon but ran in to some minor issues and will have to modify the shootable weapon script.
 
Top