CP’s Battle Engine v1.2b

What is it?
This is my own custom battle engine.  I wanted to change how battles looked and one thing led to another and the next thing I knew I had an entire battle system.  This battle system has 5 different view modes (which you can actually switch in game!) as well as several little tweaks and bugfixes (and by this I mean a few pretty major tweaks).  I’m also going to be creating add-ons for this which hopefully will make it fairly simple to use.

As mentioned, this script has 5 different view types that change how battle are displayed.  Here is a list of several of the other changes in no particular order:

  • Bugfix where monster turns were not calculated correctly.  Turn order now works properly.
  • Bugfix where monsters would not target each other properly.  They now target with a certain degree of AI.
  • Bugfix where animations set to “screen” would be played several overlayed at once.  Now only one will display, but it will affect all monsters.
  • Tweak adding an animation array all animations will display as soon as they are called and complete regardless of other animations playing.
  • Tweak to substitution where party members (actors and enemies) will not cover for attacks from their own party, including heals.
  • Tweak to counter attacks where the affected character will use their default attack skill to counter.  If the skill affects a party member, it will always target the user (ie, a heal or buff skill).  If the skill targets random enemies, every attack will strike the attacker.  If the skill hits the entire enemy party it will only affect the attacker.
  • Some window sizes and locations were changed in certain modes.
  • Added auto-battle, rush, and defend options to the party menu.  Auto battle allows each member to select their skills automatically, rush causes all members to use their normal attack on the first enemy (random target and all target skills work normally), and defend just causes all party members to defend.
  • Added party command to the party menu which allows the player to switch an active party member for a reserve party member.
  • Added a system to allow each party member or class to have unique commands.  See the next section to learn how to set these up.
  • Added casting animations for items and skills.
  • Changed the help window to allow it to be open during the entire selection sequence.  Subsequently added a hash that allows you to set the help text for submenus.
  • Numerous other bugfixes and tweaks.

How can I use it?
Place this script above main and below materials.  This script has a whole slew of settings to change it’s appearance and it’s use and to modify quite a few different aspects of battle.  Here I will just go over the notebox tags that can be used and will leave the config options to the header.

Monster Tags:

  • attack[x] – Sets the monster’s normal attack animation to animation “x” in the database.  If a skill is set to “normal attack” for it’s animation, this battle animation is used.
  • attack skill[x] – Sets the monster’s default attack skill to skill “x”.  This is in case the monster gets confused or berserked, etc.
  • defend skill[x] – Sets the monster’s default defend skill to skill “x”.  This is technically useless.

Actor/Class Tags – Note that actor tags take priority when both are present on an actor

  • battler[name] – Sets the actor’s battler image to file “name” from the Graphics/Battlers folder.  This only takes effect in mode 3.
  • attack skill[x] – Sets the actor’s attack skill to skill “x”.  Used when the player selects the attack command, when the character is berserk/confused, or when the player selects the “rush” command.
  • defend skill[x] – Pretty much the same as attack, only with the defend skill.
  • hide mp -and/or- hide tp – Allow the amount of MP or TP a character has to be hidden in battle.

Monster and Actor/Class Tags

  • <flying> – Causes the tagged entity’s sprite to bob up and down similar to how checking the “flying” option on monsters in RPG Maker 2k3 works.
  • <transparent> – Causes the tagged entity’s sprite to become partially transparent similar to how checking the “transparent” option on monster in RPG Maker 2k and 2k3 works.
  • <mirror> – Flips the tagged entity’s sprite horizontally.

Skill Tags

  • cast anim[x] – Sets the skills casting animation to animation “x”.  Takes priority over skill set casting animations.

Weapon Tags

  • attack skill[x] – Sets the basic attack skill of the actor equipped with the weapon to the skill with ID “x”.  This takes priority over Class and Actor tags.

These can be set up in the notebox and allow you to modify what command an actor has.  You do NOT NEED to set these up in order for actors to have commands as there is a portion of the script where you can set the default commands.  This system allows you to set skills as commands that can be used instantly rather than needing to select them from a submenu.  To do so, set up the notebox with something like the following pattern:

  • <commands>, </commands> – These tags specify the beginning and end points of the complete command list.  They are required for custom commands to work on a character or class.
  • :attack – The default attack skill.  Will use whatever skill is set to the character’s main attack.
  • :defend – The default defend skill.  Same as above.
  • :skill – The character’s skill submenus.  They all get added here in their normal order.
  • Name => 10 – A command skill.  You can set up as many of these as you like as long as they follow a similar format.  “Name” can be changed to the name you want the command to display.  “10” can be changed to the ID of any skill in the database.
  • :item – The item submenu.
  • :party – Adds a command that allows the actor to be switched with a reserve member in battle.

What does it look like?
Mode 1 is made to just look like the default battle system.
Posted Image

Mode 2 displays faces in a window at the bottom of the screen.  This uses many of the default windows.
Posted Image

Mode 3 is the reason I made this battle system.  It displays battlers for the characters.  This image also shows how the party command menu is moved.
Posted Image

Mode 4 is like mode 3 but uses the actor faces instead of battlers.
Posted Image

The actor command window displays over the currently selected actor in modes 3 and 4.  It also has a partially transparent menu back.  The opacity can be changed in the config.
Posted Image

The size of the enemy selection is also changed in this mode.  It displays up to 3 enemies across and will get taller if there are more enemies.
Posted Image

The actor selection dialogue, however, goes as high up as it can without covering other windows.  Also notice how the the battlers are highlighted in this and the last picture.
Posted Image

And as seen in this and the last picture, the size of the item and skill selection windows will change based on the number of items.  In modes 3 and 4 it will stop at 8, but in modes 1 and 2 it will fill the screen like normally if possible.
Posted Image

As of version 1.1, view mode 5 has been added.  This new view mode replicates the battle system of RPG Makers 2000 and VX.  This includes such things as using the bottom window to display battle info and opening skill and item windows in the bottom window.
Posted Image

A demonstration of quite a few different things.  This shows how the built in simple sideview mode works as well as showing transparent and mirrored sprites.  It also shows how hidden pools (mp/tp) are handled in respect to the default windows.

What does it work with?
Well obviously this will not work with other battle systems.  I can’t say for sure it will or won’t work with certain add-ons, though it’s most likely it won’t work with VISUAL add-ons.  Other add-ons should work fine.  I do plan to make add-ons for this to support different battle styles and I welcome any compatible add-ons.

House set compatible scripts:
Battle Pop-ups
Grade Victory Screen
Scan Enemy
Scrolling States

How can I get the script?
Version 1.2b (base script, 1.14.2013) is available from my pastebin account here.

I would like to use this script.
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
Permissions beyond the scope of this license may be available at https://cphouseset.wordpress.com/liscense-and-terms-of-use/.

Author’s Disclaimer:
I made this script originally because I had liked how battles were displayed in RPG Maker XP and wanted a similar system for Ace.  In the end I decided to add a few different visual styles to give the user some customization options.  I kept adding things to give more customization as well as upgrading things I felt like Ace could have done better.  I think the end result is pretty nicely put together and gives the user a lot more useful options to choose from.

As mentioned I will be creating add-ons for this script (I plan to add animated battlers, sideview, ATB, and charge turn add-ons at least).  If you have any battle add-ons that are compatible that you would like me to mention above, feel free to ask.  Credits go to Archeia and Penta for the battlers in the mode 3 screenshots.   As always, enjoy.

  1. When you use the show animation command on the map this error appears:

    Script ‘CP Battle Engine’ line 1091: NoMethodError occurred.

    undefined method ‘invis_anim’ for nil:NilClass

    • Perfect. I just had this error reported to me earlier today elsewhere but the person didn’t have the error message. This will take minutes to fix now that I know where the error lies. Thanks!

      EDIT: And, fixed it up. It was a one line fix as I guessed. Grab version 1.0a to fix it.

  2. i put the image with same name as character to folder graphic / battler.
    but it dint show up.

    i set default battle 3 to. how mistakes i do?

    • You need to place the tag “battler[name]” in the notebox for the character. So if your character’s name is “Ralph” you would use the tag “battler[Ralph]”.

  3. First, thanks for your work. Your battle script is very nice.

    I’m using Battle Mode 4. When a character die, his face disappear. If i use a Revive item, the character’s face won’t show until he perform an action.

    Is there a way to prevent this?

  4. Script version updated from 1.1 to 1.2.
    Update includes the following changes:

    Simple sideview mode has been added. This can be set up mostly from it’s own section of the config.
    Flying, transparent, and mirror tags have been added. Check the main post or the instructions sections to learn about these.
    Party switching options have been added. One has been added to the party command window that has the player select a character in the party and a character in reserve, and a second has been added to the actor command window that switches the current actor with an actor on reserve when the actor’s turn comes in battle.
    The animation queue has been changed to an animation array. This will allow several animations to play on an enemy at the same time rather than only a single animation.
    Changed how the animation to screen overlap bug was fixed.
    Added the ability to disable centering when the screen has been resized.
    Numerous other small changes and tweaks.

    • Found an error when using battle mode 3 or 4.
      Selecting the fight action for characters results in the following error:
      Script ” line 651: NoMethodError occurred.
      undefined method ‘height’ for nil:NilClass.

      Problem comes from visible_line_number (in Window_ActorCommand).

      On a side note, thanks for the fix for revive and faces.

  5. All is good now. Thanks!

  6. Found another issue when changing Battle Back before processing a battle.
    Enemies battlers are invisible if more than one battle in a row.

    • Sorry, I was taking some time off. I did fix this now, though. Update to version 1.2b (if you haven’t already) and this bug will be fixed. Sorry to take so long getting back to you.

      • I managed to find a quick fix so no worries.
        New version installed and running fine. Thanks again.

  7. Thanks for the amazing battle system, I’m looking forward to playing around with them all :D

    On that note (and I’m sorry if I’m being a pain) is it possible to change the position of the Name/HP/TP/MP Bars?

    I only ask because I’ve been playing around with the card battlers found at http://ccrgeek.wordpress.com/graphics/battler-cards/ and tried to use them in the Number 4 battle system (Like this: http://i1199.photobucket.com/albums/aa473/Aesorian/CardBattle_zps93d2f263.png).

  8. Hello there.
    I’m having an issue with YEA – Core Engine using this battle system (something about an error at line 1711).
    I’m guessing it is because the frame display?

    Thanks in advance.

  9. I was wondering if the charged-turn battle script was out somewhere.
    At Division-Heaven, they showed a sample bit of it in action.

  10. Whenever I finish my first turn i cannot attack the next turn but I can make actions but they do nothing.

  11. randolfcrk

    how to add character picture in mode 3 ? thanks before

    • I would also like to know this, I have been reading this script for ethernity, editing it here and there to make the picture show, but it just doesn’t. Please answer this.

    • Never mind my post before, I found solution. In script you can find this:
      battler[name]

      copy that as many times as you need and change the name with any name of characters you use. then put the picture you want to be used in grafic/battlers. then go to setting of your game and find actor of that name and put: battler[name] with his name into note. that worked for me, I hope it will work for you too.

  12. Kuro Waza

    I keep having a problem with “CP Battle engine line 1580: No Method Error occured.
    undefined method ‘for opponent?’ for nil:NilClass”
    It happens everytime a counter attack is used by the enemy. I’m also using mode 3 here as well.

  13. Jack of All Blades

    I’m using the 3rd battle style.. However, when i play in game the battler pic won’t shows up, what should i do..? I already put the battler at ‘graphic/battler’ with the same name as the character. Sorry, i am a noob at game script..

  14. Is there a way to make a character change their battler image (mode 3) using a skill? In my game there are shape-shifting characters and it would be awesome if you could change their battler mid battle.

  15. Umm… the links for the Add-Ons come up with ‘Page not Found’.

  16. Master of Seven Swords

    Hello

    Umm, CP can you look at counter attack script in you Battle Hud? (def invoke_counter_attack). When i used Tiger stance, and enemy attacked my character with counter attack buff, the game just crashes. Can you look at it?

  17. def invoke_counter_attack(target, item) ## Modified counter.
    @log_window.display_counter(target, item)
    attack_skill = $data_skills[target.attack_skill_id]
    attack_skill ||= $data_skills[1]
    if attack_skill.for_opponent? ## Gets the attack’s target.
    tgs = [@subject] * [attack_skill.number_of_targets, 1].max
    else
    tgs = [target] * [attack_skill.number_of_targets, 1].max
    end
    if attack_skill.animation_id < 0 ## Shows the attack anim.
    show_attack_animation(tgs, target)
    else
    show_normal_animation(tgs, attack_skill.animation_id)
    end ## Performs the counter attack.
    wait_for_animation
    tgs.each {|t| attack_skill.repeats.times{do_counter(target, attack_skill)} }
    end

    For those with the counterattack issues, replace the counter script with this.

  18. Michael Black

    Hello guys, and sorry for my bad english but i really need some helps.
    I’m using mode 3 CP’s Battle system (i love it), but when i’ll try to add heroes on a ongoing battle only hp/mp/tp and name appears. The battlers pics are not showing, i can attack or cast spell or defend with all my chars…it’s just not showing the battler’s image.
    Any help is much appreciated. (Ty CP for your effort)

  19. Hi there, just stumbled across this beautiful script reinvoking my love for RM all alone. Awesome, man! I just wondered if it is possible to change the maximum party size as well with a variable. Because I find it’s even more appealing when your hero starts alone and is trapped in the lower left corner of the battle screen. I also have to appologize, since english AND ruby are both not my native languages. Maybe anyone could give me a hint here?
    Thanks in advance and again: This work you did is totally rad.

  20. How do I centralize the group command window? It appears at the top left, I would like to put it at the top centered .. is it possible?

  21. is there any way to centralize battlers? for example, when there is only one character, it is in the center of the screen and not on the left?

  1. Pingback: Battle Engine Ace! « CP House Set

Leave a reply to CP Cancel reply