Disabling Input Buffering for Enhanced Input Actions?

Hello,

I’m trying to develop an FPS melee weapon system similar to Dark Messiah: Of Might And Magic.

I’m building the functionality to charge an attack, and my main issue is I’m able to charge a new attack while doing a previous attack, which messes up both my charge and attack montages.

What I’m trying to do is get the Triggered Seconds here:
image

To only count up while my bool “ableToCharge” is true. As it is, it’s always going up, so even if I gate it, as soon as the gate is open, you have a fully charged attack ready to go.

How would I go about only having that variable increase based on my bool? Or is there some smarter way to go about it in the enhanced input system itself?

Thank you!

Hey @ttv_kain_marko

If you do not wish to charge a second attack then create a bool variable say isCharging.

Once you start charging an attack set the variable to true, then check with a branch node. If true dont allow new charging. If false start new charging.

Release the isCharging bool to false on completion of the attack.

Hope i understood you correctly

Stewart

That doesn’t work, as soon as the isCharging bool is true, it sets the variable to the elapsed seconds as it will have been counting up the whole time regardless. That’s what I’ve tried to do, but without getting at the elapsed seconds itself I’m not sure how to.

ie it will still be counting “elapsed seconds” on false of isCharging, and when isCharging is true, if elapsed seconds has been 2 seconds, it will immediately set an attack as fully charged.

Surely using a compare on elapsed seconds when it reaches the correct value fire the ability and reset the charging bool

logic (in my head that is)

on started check is charging, if false then set true
on completed set false

on the ongoing check the elapsed in a loop, when no seconds reached
exit loop and fires

Timeline could do something like this, timelines can do anything.

edit;

Something like this would let you scale the charge power, but idk how the ability works so maybe wouldn’t matter.

1 Like

Unfortunately this is being managed by a component, so no timelines allowed.

Nope; because I’m not trying to automatically fire an attack when it reaches a correct value, it fires only on released.

If it’s not charged enough, it aborts the attack entirely, and if it’s overly charged I have a curve that it pulls lower damage from.

This doesn’t get me any closer to being able to alter the triggered seconds value, which is what it feels like I need to be able to do. It needs to not increase while I am performing an attack, or charging an attack.

edit; sorry, that wouldn’t help you. I dunno how you could do it without a TL or a lot of weird subtraction.

i thought the idea was to get the elapsed time to find when the charge is complete? sorry if i misunderstood that.

Your problem is using the Triggered output, it repeats on hold down. I found this in my use. You need the start,ongoing,complete and maybe cancelled if that is relevant hooked up with elapsedseconds i believe.

Let me know if you are still stuck i will try recreating a similar graph and see .

1 Like

HAHA you beat me to it, at least i know in my head the logic was right, nice work!