Getting 'Cooldowns' or a simple Timer working for an ATB

Hey gang, 

     I'm just getting my feet wet with RGSS3 and looking to do what I believe is a simple(ish) battle system. Now I know what you're thinking: Noob + Battle System = No good. Well, I'm not asking anybody to write the thing for me (not unless you're interested and want some $$$), just to discuss some methods on how to get the desired effects, what parts of the Script Editor to be looking at and what parts of RPGmaker VX ACE as a whole, I should be aware of when looking to get this task done. So without further ado.

     My little team and I agreed upon an ATB of sorts. Something a little like what Child of Light, uses.

          To begin with I figured the core question would be how do you get a timer to run? And I've seen a few snippets here and there having to do with Graphics.framerate or something along those lines. The effect I'm wanting to ultimately have is battle that runs more or less in real time. Key components to this system would include:

- No pauses in combat: enemies are constantly attacking when able.

-No turn order: The player can freely move between party members and execute commands.

-No (or optional) command menu: Around 4 or 5 favorite skills are hot keyed and battle is played out something like:

         Hit F1-F4 to quickly select a party member, press a hotkey for the desired attack, confirm the target and continue. 


-"Balance/Recovery Time": This is the core concept and the #1 goal for getting implemented first. Essentially a hard timer gating any maneuver by the player or his enemies. Timers might vary between characters and their skills used but the idea is pretty simple. Let's say a warrior can do a basic sword slash every 2 seconds. <--- How do we get there? At some point we'd like to see some other variances such as windup or 'Delivery Time' on these skills. Something of a delay to make the fast paced combat a bit more strategic.

tl:dr   How can I get a timer running that gates attacks in a battle to once every few seconds? 
Maybe you can try to tinker with the below scripts -

YSA Battle System - Classical ATB:

http://www.rpgmakervxace.net/topic/865-ysa-battle-system-classical-atb/

DoubleX RMVXA Bug Fixes to YSA Battle System: Classical ATB:

http://forums.rpgmakerweb.com/index.php?/topic/22142-doublex-rmvxa-bug-fixes-to-ysa-battle-system-classical-atb/

Actor Personal Hotkeys

http://www.rpgmakervxace.net/topic/18331-actor-personal-hotkeys/

DoubleX RMVXA Compatibility Fixes to YSA Battle System: Classical ATB:

http://www.rpgmakervxace.net/topic/21113-doublex-rmvxa-compatibility-fixes-to-ysa-battle-system-classical-atb/

DoubleX RMVXA Cooldown Addon to YSA Battle System: Classical ATB:

http://forums.rpgmakerweb.com/index.php?/topic/22231-doublex-rmvxa-cooldown-addon-to-ysa-battle-system-classical-atb/

DoubleX RMVXA Wait Addon to YSA Battle System: Classical ATB

http://forums.rpgmakerweb.com/index.php?/topic/27695-doublex-rmvxa-wait-addon-to-ysa-battle-system-classical-atb/

Video🙁With Luna Engine as well)

https://www.youtube.com/watch?v=hf1MsDqozXI&index=23&list=PLp-0SJbFnYdw-laxpgITmo88EvluvBg2x

Party member hotkeys aren't implemented yet, however, although I'll try to do so now 🙂

Edit: Just finished building a simple party member hotkey addon:

http://www.rpgmakervxace.net/topic/30543-doublex-rmvxa-hotkey-addon-to-ysa-battle-system-classical-atb/
It's probably a lot more complicated than you're envisioning, because you're totally messing with the way that the default engine views the concept of "Turns".

The way I'd probably handle the timing and cooldowns would be to add a "recharge" attribute to each battler (to track their "can't take any actions for a moment" timer) and as well as an array of arrays that associates skill to cooldown (to track, on an actor-skill combination level, the "can't use this particular action for a little while" timer).  Every frame that goes by, you can deduct 1 or 0.01 or whatever from the recharge timer and each cooldown timer for the battler.

You'd also have to rework the skeleton of Scene_Battle (and perhaps the ensuing windows) to move cleanly between actors, decisions, etc., instead of using the linear pattern of actor command -> choice of action -> next actor that's defined in the default engine.

So that's the very high level as to how I'd go about it, but in practice, I think your best move right now, unless you want to spend considerably more time learning RGSS3, would be to check out some of the existing ATBs (DoubleX's system is one but there are several others out there too) or to commission one from scratch in the Classified - Requests section (which would probably run you somewhere between $300 and $500 if I had to guess).
I've written a post sharing my understanding on how to write an atb system:

http://forums.rpgmakerweb.com/index.php?/topic/39173-how-to-write-an-atb-system-script/

You might gain at least a bit of insight from that 🙂

Original thread: https://forums.rpgmakerweb.com/threads/getting-cooldowns-or-a-simple-timer-working-for-an-atb.37244/