Conditional Turns CBS V4.0

Conditional Turns CBS
Version: 3.0


Introduction

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

Screenshots

Ok, create a new project. now goto the database and test play. It looks like that except there are gradient bars on the hp sp, the state has been removed in place for another one. There's your screenshot.

Demo

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

Script

:'(:'(:'( <- the families

Instructions

Okay I am going to make this as clear as possible

Initial Directions[INDENT]
  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
[/INDENT]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[INDENT]System Options
[/INDENT][INDENT]
  1.   #--------------------------------------------------------------------------
      # * The Speed of the System in Frames
      #--------------------------------------------------------------------------
      Speed = 100
    Expand to see the code.
    The Speed of the system this affects how long it takes for the first person's bar to fill.
  2.   #--------------------------------------------------------------------------
      # * How the Speed is Based
      #     0: Current_Action.Speed 1: Agility
      #--------------------------------------------------------------------------
      Base_Speed = 0
    Expand to see the code.
    How the speed is based use 0 for speed (agi + rand(10 + agi / 4)) or 1 for agility
  3.   #--------------------------------------------------------------------------
      # * At Gain
      #     0: Random 1: Steady
      #--------------------------------------------------------------------------
      At_Gain = 1
    Expand to see the code.
    How the bars fill use 0 for a random rate or 1 for a steady rate
  4.   #--------------------------------------------------------------------------
      # * At Max
      #--------------------------------------------------------------------------
      At_Max = 65536
    Expand to see the code.
    Don't worry about this, it has little effect on the execution of this script. but its the maximum at.
  5.   #--------------------------------------------------------------------------
      # * Full At Se
      #     syntax - RPG::AudioFile.new(filename, volume, pitch)
      #--------------------------------------------------------------------------
      Full_At_Se = RPG::AudioFile.new("033-Switch02")
    Expand to see the code.
    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.
[/INDENT][INDENT]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.   #--------------------------------------------------------------------------
      # * Action Cost Attack for Actors
      #     syntax - actor_id => cost
      #--------------------------------------------------------------------------
      Action_Attack_Actor = {}
    Expand to see the code.
    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.   #--------------------------------------------------------------------------
      # * Action Cost Attack for Weapons
      #     syntax - weapon_id => cost (Do not setup 0)
      #--------------------------------------------------------------------------
      Action_Attack_Weapon = {}
    Expand to see the code.
    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.   #--------------------------------------------------------------------------
      # * Action Cost Attack for Enemies
      #     syntax - enemy_id => cost
      #--------------------------------------------------------------------------
      Action_Attack_Enemy = {}
    Expand to see the code.
    This is the cost for enemies to attack.
  4.   #--------------------------------------------------------------------------
      # * Action Cost Defend (Percentage)
      #--------------------------------------------------------------------------
      Action_Defend = 50
    Expand to see the code.
    This is the cost to defend
  5. #--------------------------------------------------------------------------
      # * Action Cost Escape (Percentage)
      #--------------------------------------------------------------------------
      Action_Escape = 75
    Expand to see the code.
    This is the cost to escape
  6.   #--------------------------------------------------------------------------
      # * Action Cost Wait (Percentage)
      #--------------------------------------------------------------------------
      Action_Wait = 25
    Expand to see the code.
    This is the cost to wait
  7.   #--------------------------------------------------------------------------
      # * Action Cost Per Skill
      #     syntax - skill_id => cost
      #--------------------------------------------------------------------------
      Action_Skill = {}
    Expand to see the code.
    This is the cost to use a skill, if the value for a skill isn't defined the default is used (see below)
  8.   #--------------------------------------------------------------------------
      # * Action Cost Per Item
      #     syntax - item_id => cost
      #--------------------------------------------------------------------------
      Action_Item = {}
    Expand to see the code.
    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.   #--------------------------------------------------------------------------
      # * Default Action Cost
      #--------------------------------------------------------------------------
      Action_Default = 100
    Expand to see the code.
    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.   #--------------------------------------------------------------------------
      # * Default Cost To Attack
      #--------------------------------------------------------------------------
      Action_Attack = 100
    Expand to see the code.
    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.   #--------------------------------------------------------------------------
      # * Default Cost For Using A Skill
      #--------------------------------------------------------------------------
      Action_Skill.default = 100
    Expand to see the code.
    This is another default if the value for a skill is not defined then this value is used
  12.   #--------------------------------------------------------------------------
      # * Default Cost For Using An Item
      #--------------------------------------------------------------------------
      Action_Item.default = 100
    Expand to see the code.
    Yet another default if the value for an item is not defined then this value is used.
  13.   #--------------------------------------------------------------------------
      # * Do Not Touch Unless you know what you are doing
      #--------------------------------------------------------------------------
      Action_Attack_Actor.default = Action_Attack
      Action_Attack_Enemy.default = Action_Attack
    Expand to see the code.
    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
[/INDENT]FAQ

Awaiting Question

Compatibility

SDK 2.0 compliant
requires Method and Class Library V1.5 or greater
requires Animated Gradient Bars which requires Window Sprites

Credits and Thanks

Kurisu and Raziel for betatesting
Raziel for catching 1 bug
Mea for catching 2 bugs
Raven for catching 2 bugs
Skyla for indirectly requesting

Author's Notes

I have not been receiving bug reports yet I see people going oh saying oh that script has a bug. Stop destroying the little scripter-nonscripter communication system. this is one of my pet peeves now. When reporting bugs please tell the type of the error and whats on the line the error appeared on, or just the screenshot of the error. SO REPORT BUGS AND GET A COOKIE.

I am open to suggestions for future versions, if you have something you'd like to say then post and I'll consider it.
This is really cool. It's simple, yet very effective. It's very compatible as it stands. Great job.
Hey Trickster, :#

Five defends in a row =
'scene_battle' line 430: NoMethoodError occured.
undefined methood 'current_action' for nil:NilClass
Line: if @active_battler.current_action.is_a_attack?

Escape when not failed=
'scene_battle' line 430: NoMethoodError occured.
undefined methood 'current_action' for nil:NilClass
Line: if @active_battler.current_action.is_a_attack?

I noticed somtimes when the escape fails it allows the player to select a second time without taking away from the bar. Was there a cost to a failed escape?

Also I noticed the errors are the same... so maybe I'm give the commands too fast? That might also be a possiblity. I found some serious lag with the slanted bars. I didn't have too many programs open and my computer isn't taht old so maybe reconsider those bars. I think it's just because they're slanted. It lags enough so that it disrupts the game play a bit on mine. I'll double check to see if it does it with just that.

Nice script Trickster. I may use this one for my one battle system. :D Is there a possiblity you can make it work with turns lined up instead of with bars? Kind of like how FF10 does it?

Anyways hope that helps ya.
Heh, thanks. *Gets the whip out at Raziel for not catching these*, but hey alot less buggier than the ATB+CTB Battle System. Actually I'm splitting that script into three parts and here is part I of it.

as for your errors it seems as though the battle gets set to nil, I will look into this.

Escape costs 75% of their bar. I'll look into that as well

During my testing the bars did not lag for me at all, there is an opton to turn off the slanting its in the other setup (for the Gradient Bars), but I don't really see that lagging.

Hmm, well the Bar at the bottom has to stay, if you use any other bar then it will not update

Give me a mock up or more to go on and I'll script this for you (for all of the bugs you caught :))
Your demo isn't that interesting ;)
Also, this is pretty good :X
Besides the defend bug, I noticed that if you select an action (like attack), then before you select your target, if you try to backtrack by hitting "esc", the character completely loses their action.
heh perfect timing as I am fixing the bugs and revising the code as I type this, give me a few hours or so. I have already (fixed?) the bugs raven has mentioned

AND I'LL SHOW YOU AN INTERESTING DEMO FZ >:(
And Demo updated to Version 1.1 thanks to everyone that caught bugs in my system, and also Fz check out the demo now :p

EDIT and Updated to Version 1.2 cleaned up code and fixed a small glitch when using for instace the defend command (It really didn't defend), also this will be the last update for now.
Updated to Version 2.0

Fixes many of the bugs version 1.2 had (Thanks Mea :))

Updated to Version 2.1

Cleans up code a bit, Fixes the Bar Decreasing Bug (Thanks Mac :))
Updated to Version 2.2

Cleaned up code
Now SDK 2.1 Compliant

and Woo Most Popular file in the New DLM :)
Updated to V2.2.2

Updates the Gradient Bars script
Sweet system. Good job.
I'm having a really tough time trying to figure out what's the difference between your CT and ATB.

I downloaded and loaded both demos but they looked exactly the same to me.

I feel really silly for asking, but could you tell me the difference between your two scripts?
Thanks

@Shiro - http://en.wikipedia.org/wiki/Square_Enix_battle_systems

1) Look at the Bars while actions are made, they stop
2) In ATB you can choose your action while actions are being made
Perhaps its just me, but during the phase where im selecting an action, arent the bars supposed to stop filling up?... cause mine arent....

perhaps it is just me though...
ASK AND YOU SHALL RECIEVE

Updated to V2.3

Speed is changeable in game $game_system.battle_speed
When Selecting an acting all bars can stop (Changeable Option in Setup)

Updated to V2.3.1

Fixes a potential command window hanging bug
Here's another question for you.. .

Is there any way so that the action takes place immediatly after selecting it? It seems that there is a delay in between the selection of the action, and the action itself...
Read the first page, it is explained there
I really should read more often, it would keep the taste of shoe leather out of my mouth :)
This is probably the wrong place to ask this but what is the deal with "the families" comments. I see these comments alot and was wondering what this means. Sorry if this is a noob question or if I missed out on something. Thanks.

-The Wizard
It's an inside joke, what I am referring to I'll let you figure that out :p

(Add more to your post next time, I could have easily decided it is spam and delete it)
Updated to V2.3.2

Minor Bug fix involving inflicting states on the map (thanks tibuda)
Updated to Version 3.0 (Note: Last update for awhile unless a bug comes up)

Cleans up code (More for me than for you)

Cleaned up the Setup (everything is in one section)

You may now choose to use the hp/sp bars or not, but I have also included 14 new gradients to the gradients folder to use

You can use the simple escape command or have the attack/escape window (but it comes up at the start of battle and never again)
This doesn't seem to work with your Advanced Individual Battle Commands script(I'm using v.3.6). When the bar fills a blank box appears in the top left corner and when I hit enter I get an error that says:

Script 'Class Modifications' line 309: NoMethodError occurred.

undefined method `disabled' for nil:NilClass



P.S. Are you still re-writing LegACy's 1-Scene CMS?
I'll look into it when I get the chance
(7 exams in the next 10 days :-/)

and yes I am still rewriting just let me finish other big projects first
Okay, I found that they do work together but only if you put this battlesystem above the advanced individual battle commands. My mistake. Thanks anyway. If you're too busy to re-write LegACy's CMS, I don't absolutely have to have it. It's for a second project I'm working on, not my biggest one.
uh... never mind >.>
[QUOTE=heavyblues;197631]the link tot he demo is broken, because the forum's database is screwy... or something... could you post it on megaupload or something, so I can get at it... the script by itself confuses me to no end, as to where to put it.[/QUOTE]

You should probably read his sig before he gets pissed off o.o

Quote:
DOWNLOAD MIRROR TO ALL SCRIPTS (TEMPORARY) I swear if you post I can't download the demo I will delete your post and issue a warning/infraction (real threat) Also note that the demos may not work as I may edit the demos if you happen to find one PM me with the problem and error information. This also applies to any script if you can't get the demo then use the Lost Scripts topic I do not want to see multiple posts in a topic asking for a demo because it is spam. THIS ALSO GOES FOR PMs
[QUOTE=Shiro;197634]You should probably read his sig before he gets pissed off o.o[/QUOTE]

yeah, good point ^-^; thanks
[QUOTE=Trickster;176794]
1) Look at the Bars while actions are made, they stop
2) In ATB you can choose your action while actions are being made[/QUOTE]

:( Uhm, not quite. Most Square Enix games allow you to choose the "Wait" option for an ATB, allowing more inexperianced players to choose their options without fear of monster attacks or what have you.

A CT battle system is turned based - more like FFX.

Sorry, couldn't help myself :thumb:

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=14163