Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Active Timer CBS V3.0.1

Status
Not open for further replies.
Active Timer CBS
Version: 2.0


Introduction

This script transforms the Group Turns Based Battle System (aka DBS) into a ATB Active Timer System. A description of how the system works can be found here.

Screenshots

See Screenshot section from here

Demo

http://www.rmxp.org/forums/downloads.php?do=file&id=351

Script

Sorry but the families shouldn't battle in this style.

Instructions

Okay I am going to make this as clear as possible

Initial Directions
  1. First Download the Demo via the Download Manager
  2. Get Winzip, Ultimatezip, or some other crazy program to open zip files, and install it.
  3. Find the downloaded file
  4. Right Click on the file and select Extract or Open your Unzipping program and Extract the files from the archive
  5. Open RPG Maker XP if you haven't already
  6. Open the Project File
  7. Copy Each Script from the demo or paste them all into one script and add that, I only have it in multiple script form for organization.
  8. Setup the Gradient Bars if you want
  9. Find the Setup Portion of the CTB Battle System Script
  10. Get yourself a snack
Setup and Customization

Now I am going to explain this a second time, the code in the setup is already commented once with the instructions, but I'm going to explain it again code by code
System Options
  1. Code:
      #--------------------------------------------------------------------------
      # * The Speed of the System in Frames
      #--------------------------------------------------------------------------
      Speed = 100
    The Speed of the system this affects how long it takes for the first person's bar to fill.
  2. Code:
      #--------------------------------------------------------------------------
      # * How the Speed is Based
      #     0: Current_Action.Speed 1: Agility
      #--------------------------------------------------------------------------
      Base_Speed = 0
    How the speed is based use 0 for speed (agi + rand(10 + agi / 4)) or 1 for agility
  3. Code:
      #--------------------------------------------------------------------------
      # * At Gain 
      #     0: Random 1: Steady
      #--------------------------------------------------------------------------
      At_Gain = 1
    How the bars fill use 0 for a random rate or 1 for a steady rate
  4. Code:
      #--------------------------------------------------------------------------
      # * At Max
      #--------------------------------------------------------------------------
      At_Max = 65536
    Don't worry about this, it has little effect on the execution of this script. but its the maximum at.
  5. Code:
      #--------------------------------------------------------------------------
      # * Full At Se
      #     syntax - RPG::AudioFile.new(filename, volume, pitch)
      #--------------------------------------------------------------------------
      Full_At_Se = RPG::AudioFile.new("033-Switch02")
    When the bar is filled this sound effect is played. if volume is not specified it is assumed at 100, and if pitch is not specified it is assumed at 100 as well.
Action Cost Setup
This section of the setup defines the cost, which is how much the bars go down after acting the values here are to be given as percentages (0-100)
  1. Code:
      #--------------------------------------------------------------------------
      # * Action Cost Attack for Actors 
      #     syntax - actor_id => cost
      #--------------------------------------------------------------------------
      Action_Attack_Actor = {}
    This is the cost to attack per actor if their weapon is not found in the Weapon Cost hash then it will get the value from here.
  2. Code:
      #--------------------------------------------------------------------------
      # * Action Cost Attack for Weapons 
      #     syntax - weapon_id => cost (Do not setup 0)
      #--------------------------------------------------------------------------
      Action_Attack_Weapon = {}
    This is the cost to attack per weapon. if the weapon id is not found here then it will look at the value defined per actor.
  3. Code:
      #--------------------------------------------------------------------------
      # * Action Cost Attack for Enemies
      #     syntax - enemy_id => cost
      #--------------------------------------------------------------------------
      Action_Attack_Enemy = {}
    This is the cost for enemies to attack.
  4. Code:
      #--------------------------------------------------------------------------
      # * Action Cost Defend (Percentage)
      #--------------------------------------------------------------------------
      Action_Defend = 50
    This is the cost to defend
  5. Code:
     #--------------------------------------------------------------------------
      # * Action Cost Escape (Percentage)
      #--------------------------------------------------------------------------
      Action_Escape = 75
    This is the cost to escape
  6. Code:
      #--------------------------------------------------------------------------
      # * Action Cost Wait (Percentage)
      #--------------------------------------------------------------------------
      Action_Wait = 25
    This is the cost to wait
  7. Code:
      #--------------------------------------------------------------------------
      # * Action Cost Per Skill 
      #     syntax - skill_id => cost
      #--------------------------------------------------------------------------
      Action_Skill = {}
    This is the cost to use a skill, if the value for a skill isn't defined the default is used (see below)
  8. Code:
      #--------------------------------------------------------------------------
      # * Action Cost Per Item
      #     syntax - item_id => cost
      #--------------------------------------------------------------------------
      Action_Item = {}
    This is the cost to use an item, if the value for an item isn't defined then the default is used (see below)
  9. Code:
      #--------------------------------------------------------------------------
      # * Default Action Cost
      #--------------------------------------------------------------------------
      Action_Default = 100
    This is the big default if a action is not attacking, defending, using a skill or item, waiting, or escaping then this value is used
  10. Code:
      #--------------------------------------------------------------------------
      # * Default Cost To Attack
      #--------------------------------------------------------------------------
      Action_Attack = 100
    This is another big default, If the value for Weapon and Actor is not defined for an actor or the Value for Enemy is not defined for an enemy then this value is used
  11. Code:
      #--------------------------------------------------------------------------
      # * Default Cost For Using A Skill
      #--------------------------------------------------------------------------
      Action_Skill.default = 100
    This is another default if the value for a skill is not defined then this value is used
  12. Code:
      #--------------------------------------------------------------------------
      # * Default Cost For Using An Item
      #--------------------------------------------------------------------------
      Action_Item.default = 100
    Yet another default if the value for an item is not defined then this value is used.
  13. Code:
      #--------------------------------------------------------------------------
      # * Do Not Touch Unless you know what you are doing
      #--------------------------------------------------------------------------
      Action_Attack_Actor.default = Action_Attack
      Action_Attack_Enemy.default = Action_Attack
    This is another one of those do not touch sections, This sets the defaults for the attack hashes.
Action Timer Setup
This section of the setup defines time to wait before the action is made. The values here are to be given in frames.

Its setup the same way as the Action_Costs the hashes work the same way except for different names refer to the corresponding entry in he Acton cost setup for more information
FAQ

Awaiting Question

Compatibility

SDK 2.x compliant
requires Method and Class Library V1.5 or greater
I am not promising compatibility with all other battle addons, but if there is then it is something minor, inform me and I'll create a patch (depends)

Credits and Thanks

All of the people who helped with the CTB Battle System

Author's Notes

Based on The CTB Battle System and the CTB+ATB Battle System
 

Mac

Member

*downloads*

Lets see what i can find since i last checked ^_^

UPDATE: Working fine and dandy, good work! But i couldn't help but notice the link you gave is for the conditional turn battle system lol

EDIT: Okay i got redirected wrongly lol, its normal now :\

ERROR: If you have a skills open or items and you get attacked normally by the enemy and then close the window, the help bar still stays but it doesn't do it when they use magics.
 
I'm getting a similar error to Mac's I think. I had the skills menu open to heal and the enemy hit me and the help menu stuck on and wouldn't go away until the help menu had to be up there again for a skill selection. I think if an action is performed while the menu is open it gets stuck on there for some reason.

EDIT:
Okay well it seems to happen when the help menu has the hp bars in it. Like for healing items. Otherwise it seems to go away fine.

There was a few instances that when the bar was full all the way for a couple differnt characters and you had to selection their actions before they performed them they performed them out of the order of the selection even if the bar filled up at the same time. Know what I mean? Like if Arshes, Gloria, and Basil had their bars filled in that order and orders given in that order but close enought where the orders had to all be given before the action was made they'd go out of order as in Arshes, Basil, then Gloria. I think it's almost going in the database order like it's reverting back to that for some reason.
 
I found another error.

http://i14.photobucket.com/albums/a319/ ... mError.png[/IMG]

They way I encountered it was by editing the actor's agility. I put them at high levels (700-999) and if you are quick enough, that comes up. It targets a dead enemy, but as soon as the system realizes that all enemies are dead, it goes back to normal.

Other than that, I haven't found any big bugs that haven't been mentioned.
 
@ Mac there was a problem with the link the actual text was the link to the correct version I fixed it days ago though

Ugh still problems with the help window

Thanks for the bug reports guys I'll get to it when I get the chance

Also to remove the wait for attacks replace the module Action_Timer in the script Setup with this one
Code:
module Action_Timer
  #--------------------------------------------------------------------------
  # * Timer Attack for Actors 
  #     syntax - actor_id => time (frames)
  #--------------------------------------------------------------------------
  Timer_Attack_Actor = {}
  #--------------------------------------------------------------------------
  # * Timer Attack for Weapons
  #     syntax - weapon_id => time (frames)
  #--------------------------------------------------------------------------
  Timer_Attack_Weapon = {}
  #--------------------------------------------------------------------------
  # * Timer Attack for Enemies
  #     syntax - enemy_id => time (frames)
  #--------------------------------------------------------------------------
  Timer_Attack_Enemy = {}
  #--------------------------------------------------------------------------
  # * Timer Defend
  #     syntax - time (frames)
  #--------------------------------------------------------------------------
  Timer_Defend = 0
  #--------------------------------------------------------------------------
  # * Timer Escape
  #     syntax - time (frames)
  #--------------------------------------------------------------------------
  Timer_Escape = 0
  #--------------------------------------------------------------------------
  # * Timer Wait
  #     syntax - time (frames)
  #--------------------------------------------------------------------------
  Timer_Wait = 0
  #--------------------------------------------------------------------------
  # * Timer Skill 
  #     syntax - skill_id => time (frames)
  #--------------------------------------------------------------------------
  Timer_Skill = {}
  #--------------------------------------------------------------------------
  # * Timer Item
  #     syntax - item_id => time (frames)
  #--------------------------------------------------------------------------
  Timer_Item = {}
  #--------------------------------------------------------------------------
  # * Timer for Other Types of Actions
  #     syntax - time (frames)
  #--------------------------------------------------------------------------
  Timer_Default = 0
  #--------------------------------------------------------------------------
  # * Default Attack Time in Frames
  #     syntax - time (frames)
  #--------------------------------------------------------------------------
  Timer_Attack_Default = 0
  #--------------------------------------------------------------------------
  # * Default timer For Using A Skill
  #     syntax - time (frames)
  #--------------------------------------------------------------------------
  Timer_Skill.default = 0
  #--------------------------------------------------------------------------
  # * Default timer For Using An Item
  #     syntax - time (frames)
  #--------------------------------------------------------------------------
  Timer_Item.default = 0
  #--------------------------------------------------------------------------
  # * Do Not Touch Unless you know what you are doing
  #--------------------------------------------------------------------------
  Timer_Attack_Actor.default = Timer_Attack_Default
  Timer_Attack_Enemy.default = Timer_Attack_Default
end
 
Help window doesn't dispose after being hit still.
Displays Ghost after selecting a target for a skill.
Displays the skill description when selecting a skill.
Shows the Hero's HP/MP in the help window if targetting self with a potion.
(I added an event to add potions.)

Dammmm......n
 
I have a bug?

Anyways, I have yet to test out this new version, but I'm sure I'll get around to it later on. I do know that I tried it with Sandgolem's command break scripts and I got an error in his script. I'll give you a more detailed report when I get home later on. Great work though.

EDIT:

Ok. I've tried your script with SG's Attack Break script and I get this error:

http://i14.photobucket.com/albums/a319/ ... /Error.png[/IMG]

The line is bolded:
Code:
  alias sandgolem_attackbreak_battle_ph3setcom phase3_setup_command_window
  def phase3_setup_command_window
    sandgolem_attackbreak_battle_ph3setcom
    [b]if @active_battler.state?(SG_AttackBreak_State)[/b]
      @actor_command_window.disable_item(0)
      @active_battler.sg_command_broken = true
    elsif !@active_battler.sg_command_broken
      @actor_command_window.refresh
    end
  end

Although it's an Attack Break error, I'm aiming to make your battlesystem compatible with as much as possible. I'll be on the lookout for more bugs.
 
No compatibility requests until I fix all of the bugs, but thanks for that (potential problem)

I swore I fixed that DerVVulfman :/ oh well another try wlll get it
 
Sorry Trick. I got 2 more bugs, I think.

This bug is a little wierd. I'll explain exactly what I did to encounter it.

  • I battled the middle ghost.
  • I waited a bit until the ghost paralyzed me.
  • While I was paralyzed, I tried choosing the escape option.
  • By the time I escaped, I had died, but the game still registered as the actor still being alive.
  • I then pressed F12 to restart the test playing, but now I tried to move around, and it doesn't.
I've encountered another, but this one is similar.

When you battle and don't choose any commands, and just let it sit, the battle exits after a little while. Also, it says that the actor is dead, but the game over screen doesn't show.

 
The First Bug is on Seph (FIX THAT PROBLEM SEPH)
The Second Bug was caused by me calling the judge method not knowing if it returns true then it calls start_phase5 I got it now

I will be uploading a new demo momentarily with these fixes
 
And Updated to Version V 1.0 (Due to the fact I'm running out of version numbers and all bugs reported have been fixed?)

More instruction with this version

You may notice that two new constants appeared
Code:
  #--------------------------------------------------------------------------
  # * Advanced Update Phase 3 Objects
  #     syntax - update_method => end_method
  #     ex (Ip Skills) - 'update_phase3_ip_select' => 'end_ip_select'
  #--------------------------------------------------------------------------
  Phase3_Objects = {}
  #--------------------------------------------------------------------------
  # * Advanced End Phase 3 Objects
  #     syntax - variable_name => end_method_name
  #     ex (Ip Skills) - '@ip_window' => 'end_ip_select'
  #--------------------------------------------------------------------------
  End_Phase3 = {}

If you are using scripts that add start_(something)_select update_phase3_(something)_select end_(something)_select and a new updatable object for phase 3 This is what this constant is for

The first autoaliases the methods included in the hash for changes this script makes to the update methods (ends the action if not inputable anymore, unlocks help window if exited)

The second ensures that the end_(something)_select method is called when the action is completed

And also something important The script "Scene_Battle Auto Aliaser" must be above main and below all custom scripts if not then you will get an undefined method error for one of the methods you added in the hash (this is because they have not been defined in the scripts yet)

Have fun and report bugs to me
 
Works fine on my end! Got a big thumbs up from me!

:nya: :funny02: @_@ ^_^ 8-) :eyebrows: :2thumb: :yes:
Families rejoice after the battle is won.
 
Found something out (while making a few demos :D )... Something that is inherit in any system that uses AT bars in fact.

Let's say you start battle and instead of actually fighting, you set the system to begin with some dialog. The AT bars continue to fill while the guys are talking. I would not have noticed if there was a [FIGHT/ESCAPE] bar at the start of the battle.

And with this system, the HERO's bars grow while the enemy bars(at points) apparently do not. Even if you wanted to set up an even match where each battler (actor or enemy) has an even chance to strike, the actors will have the advantage after long dialogs as their bars would be completely filled. It occurs in your Conditional Turns system. Didn't test your others.

Do you have a method for pausing the AT bar growth? This could be useful for setting up features like cutscenes, or enhanced 'skill effects' like summons and such.
 
DerVVulfman;167029 said:
Works fine on my end! Got a big thumbs up from me!

:nya: :funny02: @_@ ^_^ 8-) :eyebrows: :2thumb: :yes:
Families rejoice after the battle is won.

lol no the families can't use this script
on a note families = people with the illegal version

MasterMind5823;167289 said:
Works fine for me. Now I can begin the long ass haul of a conversion from RTAB to this. Thanks Trick.

Wait who said to switch from RTAB to this I'm not done yet ;)

DerVVulfman;167732 said:
Found something out (while making a few demos :D )... Something that is inherit in any system that uses AT bars in fact.

Let's say you start battle and instead of actually fighting, you set the system to begin with some dialog. The AT bars continue to fill while the guys are talking. I would not have noticed if there was a [FIGHT/ESCAPE] bar at the start of the battle.

Ok, I will fix this in the next update

And with this system, the HERO's bars grow while the enemy bars(at points) apparently do not. Even if you wanted to set up an even match where each battler (actor or enemy) has an even chance to strike, the actors will have the advantage after long dialogs as their bars would be completely filled. It occurs in your Conditional Turns system. Didn't test your others.

Are you sure about this?

Do you have a method for pausing the AT bar growth? This could be useful for setting up features like cutscenes, or enhanced 'skill effects' like summons and such.

Yes although I didn't say much about it in the first post

<game_battler>.at_multiplier = 0

That will stop the bars from moving

Hooray for hidden features that I don't even mention and the user will have to read my comments and code to find them :p

Also the bars do not appear in Animated Battlers to fix this find these lines 4x (they are in the Gradient Bar Sprite Classes in the initialize method)
Code:
    # Get Actor Viewport if in scene battle else nil
    viewport = $game_temp.in_battle ? $scene.spriteset.viewport2 : nil
    # Call Sprite_GradientBar#initialize
    super(x, y, width, height, 1, 1, 1, viewport)

and replace with this
Code:
    # Call Sprite_GradientBar#initialize
    super(x, y, width, height, 1, 1, 1)
 
Found a little bug, happened to me once til now, the command menu pops, but you can't select any of them, the cursor still updates but the selection buttons doesn't, it seems random to happen.

EDIT: NVM, it's not random, it happens when the enemy attacks you while the cmd menu pops
 
Ok Thanks for the bug report (I was getting worried here for a moment)

Also things people didn't catch (shame on you all)

The Actor Blinking should continue onto phase4
The Help Window Flashes a bit at random sometimes

Also note that the Speed option should not be set to low numbers. I may make it so that you can change this value midgame - $game_system.battle_speed :)

Expect an update momentarily (see if I can't isolate the bug very quickly)
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top