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.

GTBS v1.5.1.4 - A FFT Styled Battle System (5/19/2010)

To get VX to give you a animated battler you must...
1. Assign the Character Graphic to be something including ANIM.
2. Create a Battler of the same name and place that in the battlers folder.  (If the name doesnt include a $, then you should make your animated sprite in the 4x2 layout that vx already follows, by which I mean that it would contain 7 other characters other than your own.)
That should do it!  Let me know if that doesnt make sense.
Arigatou. I didn't work because I haven't give the ANIM to the character graphic. It work now!

I have another question.
I think that we can use animated tile (by set  ANIM_TILES = true)
How can I create animated tiles for normal TBS (not the ISO)?
 
That part isnt fully there yet unfortunately.  The code regarding that piece was commented out because of problems that I ran into.  I havent had time to get it updated yet. 

Also, DB, I am making some progress on getting those other scripts compatible.  I will see what I will have by the end of the week.  Perhaps I will just release it as 1.4.1 or something.  I need to switch some stuff around in the xp code to make stuff much cleaner.  Anyway....
 
I'm using this battle system for my mecha game and I wanted to know if there is a way to do a system that lets the player select wich weapon want to use from 2 available.

For example:

An actor has equipped two weapons, a shotgun (for range attacks) and a knife (for melee attacks). So when the player selects the action command [attack], another window may appear to choose what weapon use to attack.

I hope you can understand me.
 
Not to be putting to much work on you but would it be possible to add a feature where certain characters gain a boost in stats when in a certain range to another character? (Like being 3 squares away from a friend would raise attack by 10 or so points, but when 4 or more squares away, the bonus doesn't take affect.
 
@Twilight: I'm actually working on something exactly like that right now, Gubid's walking me through it. I'll let you know when we come to a finished product.
 
YAHOO!!! The multi-weapon thing's well-needed in my game ^_^ (on my NGCS & Project HATSU!)

Now, I might be dealing with certain issues though like...

Animation & spriting aspects (this might call for Visual Equipment for GTBS, especially for weapon equips)
I would like to make my gunslinger characters use two guns at once
I would like to make my swordies use two swords at once
I would like to let my chara slash/stab/impale and shoot an enemy at once (and its inspired in Granado Espada)
 
Just so I can bring it to your attention, I'm making a skill where the user can cast a spell to escape from battle, and I got it to work, but the battle doesn't really end according to the TBS.. All that happens is it brings me back to where the battle was initiated, keeps the battle music playing, and the menu of the last character's turn stays on the screen. Also, you can't re-enter battle, either.
 
psiclone.. are you using $scene.exit_battle or $scene.terminate ?  You should use $scene.exit_battle.

LIFEFLIES - the error is occurring because your database doesnt have enough skill animations in it.  When you set a skill or attack, the default animation to be assigned is 105.. and if it doesnt exist, then... Your error.
 
Gubid: No, I was using VX's default "Abort Battle" as a common event, lol. I'll try your suggestion.
EDIT: I get an error when I do that in Bitmap/Animobj: "NoMethodError, undefined method: 'spriteset' for #<Scene_Map"

Code:
  #alias anim_miss_update update
  def update
    super()
    if @played == true and !@sprite.animation?
      $scene.spriteset.event_sprites.delete(@sprite)  <--- that's the line it brings me to after the error
      $game_map.events.delete(self)
    end
  end

EDIT2: I got it to work, but the character's menu stays on the screen after the battle.
 
Ok DB, here are your results.  (All of these patches are written for GTBS XP 1.4 only, they may or may not work/crash if used in VX or other versions of GTBS)
Code:
class Scene_Battle_TBS
  def effect(event=1, effect='', lock='event', x=0, y=0)
    @spriteset.add_effect(event, effect, lock, x, y)
  end
end
class Spriteset_Battle_GTBS
  attr_reader :particles
  
  alias particle_ssm_init initialize
  alias particle_ssm_update update
  alias particle_ssm_dispose dispose
  #-----------------------------------------------------------------------------
  def initialize
    @particles = []
    particle_ssm_init
  end
  #-----------------------------------------------------------------------------
  def dispose
    @particles.each{ |d| d.dispose }
    particle_ssm_dispose
  end
  #-----------------------------------------------------------------------------
  def update
    @particles.each_with_index{ |p,i|
      @particles[i].update
      if p.opacity == 0
        p.dispose
        @particles.delete_at(i)
      end
      }
    particle_ssm_update
  end
  #-----------------------------------------------------------------------------
  def add_effect(event=1, effect='', lock='event', x=0, y=0)
    
    case event
    when -1
      object = $game_player
    else
      object = $game_map.events[event]
    end
    
    case effect
    # (sprite, acceleration[x,y], gravity[x,y], opacity[base,loss], blending)
    when 'blue'
      sprite='star_blue'
      add_particles(object, x, y, sprite, [1.00*(-15+rand(30))/10, 1.00*(-15+rand(30))/10], [0,0], [160,5+rand(15)], lock, 1)
    when 'red'
      sprite='star_red'
      add_particles(object, x, y, sprite, [1.00*(-15+rand(30))/10, 1.00*(-15+rand(30))/10], [0,0], [160,5+rand(15)], lock, 1)
    when 'green'
      sprite='star_green'
      add_particles(object, x, y, sprite, [1.00*(-15+rand(30))/10, 1.00*(-15+rand(30))/10], [0,0], [160,5+rand(15)], lock, 1)
    when 'yellow'
      sprite='star_yellow'
      add_particles(object, x, y, sprite, [1.00*(-15+rand(30))/10, 1.00*(-15+rand(30))/10], [0,0], [160,5+rand(15)], lock, 1)
    when 'smash'
      sprite='smash'
      add_particles(object, x, y, sprite, [1.00*(-15+rand(30))/10, 1.00*(-15+rand(30))/10], [0,0], [160,5+rand(15)], lock, 1)
    when 'fire'
      sprite='particle_yellow'
      add_particles(object, x, y, sprite, [(rand(7)-3)*0.2, 0], [0,0.15], [255,8+rand(5)], lock, 1)
    when 'fire2'
      sprite='particle_orange'
      add_particles(object, x, y, sprite, [(rand(7)-3)*0.2, 0], [0,0.15], [255,8+rand(5)], lock, 1)
    when 'sparks'
      sprite='particle_red'
      add_particles(object, x, y, sprite, [0.5*(-25+rand(50))/10, -4], [0,-0.5], [255,20], lock, 1)
    when 'smoke'
      sprite='smoke'
      add_particles(object, x, y, sprite, [0.1*(-25+rand(50))/10, 0], [0,0.13], [128,3], lock, 1)
    when 'cells'
      sprite='particle_red'
      dx = 1.00*(-100 + rand(200))/100
      dy = 1.00*(-100 + rand(200))/100
      add_particles(object, x, y, sprite, [5*dx, 5*dy], [0.3*dx,0.3*dy], [255,10], lock, 1)
    end

  end
  #-----------------------------------------------------------------------------
  def add_particles(object=$game_player, x=0, y=0, sprite='', acc=[0,0], grav=[0,0], opacity=[255,0], lock='event', blend=0)
    if lock=='event'
      @particles << Particle_Event.new(@viewport1, object, x, y, sprite, acc, grav, opacity, blend)
    elsif lock=='screen'
      @particles << Particle_Screen.new(@viewport1, object, x, y, sprite, acc, grav, opacity, blend)
    end
  end
end
This is a patch for the Enhance Weapons script with Guillaume777 code in it.  When the 'Enhance Weapon' is initialized it doesnt carry over multiattack info from the RPG::Weapon.  This is because of how Guillaume did the attack check and because of how the creator of the Enhanced Weapons created the weapon.  This patch will resolve the problem.. It may still have problems with number of hands and other "name specific" entries. This code patch is because the TBS correctly interpreted the data it was given, but it was the Enhanced Weapon script that caused the '3attacks'... etc to not work.
Code:
$enhanced_weapon_dups = load_data("Data/Weapons.rxdata").clone
class Enhanced_Weapon < RPG::Weapon
  def match_ref_info
    wep = $enhanced_weapon_dups[self.ref_id]
    @element_set = wep.element_set.clone
    self.set_nb_attacks    # set the number of attacks it can do
  end
  
  def nb_attacks
    return @nb_attacks if @matched == true
    @matched = true
    match_ref_info
    return @nb_attacks
  end
end
Code:
class Scene_Battle_TBS
  def check_projectiles
    flag = false
    target = @spriteset.cursor
    target = occupied_by? if occupied_by? != nil
    case @active_battler.current_action.kind
    when 0 #physical attack
      if @active_battler.is_a?(Game_Enemy)
        range = @active_battler.weapon_range    
        if range[5] #if marked as projectile
          if range[2] #is_bow? = true
            @active_battler.projectiles.push(Projectile.new(@active_battler,target,@active_battler,"arched"))
          else
            @active_battler.projectiles.push(Projectile.new(@active_battler,target,@active_battler))
          end
        end
        return
      end 
      action = $data_weapons[@active_battler.weapon_id]
      return if action.nil?
      if action.element_set.include?(GTBS::PROJ_NORM)
        @active_battler.projectiles.push(Projectile.new(@active_battler,target,@active_battler))
      end          
      if action.element_set.include?(GTBS::PROJ_ARCH)    
        @active_battler.projectiles.push(Projectile.new(@active_battler,target,@active_battler,"arched"))
      end
    when 1 #skill
      action = $data_skills[@active_battler.current_action.skill_id]
      return if action.nil?
      if action.element_set.include?(GTBS::PROJ_NORM)
        @active_battler.projectiles.push(Projectile.new(@active_battler,target,action))
      end          
      if action.element_set.include?(GTBS::PROJ_ARCH)    
        @active_battler.projectiles.push(Projectile.new(@active_battler,target,action,"arched"))
      end
    when 2 #item
      action = $data_skills[@active_battler.current_action.item_id]
      return if action.nil?
      if action.element_set.include?(GTBS::PROJ_NORM)
        @active_battler.projectiles.push(Projectile.new(@active_battler,target,action))
      end          
      if action.element_set.include?(GTBS::PROJ_ARCH)    
        @active_battler.projectiles.push(Projectile.new(@active_battler,target,action,"arched"))
      end
    end
  end
end
You must also move the Unarmed Actors script to be below the battle system, because of methods that are rewritten. 
Code:
class Game_Battler
  def skill_can_use?(skill_id)
    skill = $data_skills[skill_id]  
    if skill.sp_cost > self.sp
      return false
    end
    if dead?
      return false
    end
    return false if PASSIVE_SKILLS.include?(skill_id)
    occasion = $data_skills[skill_id].occasion
    if $game_temp.in_battle
      sum = GTBS::is_summon?(skill_id)
      if sum > 0
        name = $game_actors[sum].name.to_s
        is = false
        for bat in $game_system.tactics_actors + $game_system.tactics_enemies + $game_system.tactics_neutral
          if bat.name.to_s == name
            is = true
          end
        end
        return false if is
      end
      if [5, 6].include?(skill.scope) and $game_system.tactics_dead.size == 0
        return false
      end
      return (occasion == 0 or occasion == 1)
    else
      return (occasion == 0 or occasion == 2)
    end
    return true
  end
end

class Scene_Battle_TBS
  alias passive_skill_tbs_phase_1 tbs_phase_1
  def tbs_phase_1
    if Input.trigger?(Input::C) and @windows["skill"].active == true
      # Get currently selected data on the skill window
      @spell = @windows["skill"].skill

      # If it can't be used
      if @spell == nil or not @active_battler.skill_can_use?(@spell.id)
        @spell = nil
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Set action
      @active_battler.current_action.kind = 1 
      @active_battler.current_action.skill_id = @spell.id
      @step = 0
      # Make skill window invisible
      case @spell.scope
      when 1,2
        draw_ranges(@active_battler,6)
      when 0,3,4,5,6,7
        draw_ranges(@active_battler,7)
      end
      @enable_target_cursor = true
      @cursor_active = true
      @windows["skill"].visible = false
      @windows["skill"].active = false
      @tbs_phase = 3
      return
    end
    passive_skill_tbs_phase_1
  end
end
Keep in mind that all of these updates must be placed below the battle system and below the other scripts. 

Psiclone, its because in VX I accidentally forgot to dispose the windows at the end of the scene.  You can correct this by adding a window.dispose to the end battle routine where I pass the other window.* ... commands.  I will correct the abort battle problem in the next update.
 
Hey GubiD's I'm not sure if this is a bug or something i screwed up with. When i tried to setup a customized animation with 3 frames, 5cells/4height it gives excessive blinking. When using any anim_ at all, the blinking is excessive regardless if you move, act or not. It just keeps blinking!! D: It's driving me nuts trying to figure out what's wrong having search the entire context.

There is no white flash, just blinking. I've tried different time-wait, is there anyway to fix this for the animated battlers?

EDIT:

This is for VX

EDIT again:

There seems to be incorrect update of the help window during the battle scene. The window does not appear at all for VX if running the default resolution. If you change it to 800x618 then it displays near bottom with odd refresh when selecting a command or viewing an item.

Like say if the battle begins, you have all your options, to attack move etc... The help window does not show up if you hi-light lets say attack. It shows up after you cancel your menu to freely scroll around the map and back to your character to show the menu again.

For those that don't know what i'm talking about, If you have your selection on a certain command [just hilighted], lets say magic during a battle scene. Usually there should be a help box to display something along the lines of [magic] -> This performs the action of opening your spell list.

But in VX it does not show up unless you have a high based game-resolution.

Once again, i'm not sure if it's me messing up, i've tested the demo for this as well and the same result.

I'm messing with this system more and more on VX, i'll let you know of there are more oddities around XD.
 
Animations are based off 6 frames x 4 directions x 11 poses.  If you only have 3 frames, then when the script "cuts" the sprite up to display it, it will slice it in 6 pieces, the images will then be displayed as 1/6*width * current 'pattern' number. 

As for the help window, I will have to look into that.  At first I thought it was just the placement of the window Y wise, but reseting that isnt correcting it.  To be honest i didnt even notice it while I was porting it to VX, but hey, thats why I have all of you right?  Anyway, I will take a look and let you know later when I can devote a little more time.
 
Gubid":2zg1uqxc said:
Animations are based off 6 frames x 4 directions x 11 poses.  If you only have 3 frames, then when the script "cuts" the sprite up to display it, it will slice it in 6 pieces, the images will then be displayed as 1/6*width * current 'pattern' number. 

As for the help window, I will have to look into that.  At first I thought it was just the placement of the window Y wise, but reseting that isnt correcting it.  To be honest i didnt even notice it while I was porting it to VX, but hey, thats why I have all of you right?  Anyway, I will take a look and let you know later when I can devote a little more time.

Thanks, i fixed it by adjusting it to 6 and making it default, i just shorten the poses to 5 however. But now, the character won't glow white and fade, just the battler's stand still.

Anyways, i have a question regarding the exp system. How does it work exactly, in the current test game i have [note im using isometric mapping on VX], the tatical type exp is set off. I noticed i gain exp per kill as set in the database, which is nice but i think it chains it to all characters which i don't like.

How does the exp calculation work in the tatical? is it linked to the database? If each slime is worth lets say 100 exp. Is it by % of total damage? So if a char does 50% of the total HP he/she would get 50exp? Can you show me an example of it within your posted script or the location of the settings? I think mine is pretty screwy from my mass edits.

Also, the finish scene skips through too fast. Is there a way to make it or perhaps in future updates when you find time to have a button press to confirm before automatically ending the scene? It cuts off battle end-theme abruptly.

EDIT:

VX bug?

the open scene event doesn't seem to work for isometric maps regardless of the layer you use it on ISO or main main. [Yes i had the correct event # on call] it just doesn't call it O_O;; I tested the same on your demo with the default battle demo scene as well and placed it on the ISO. Doesn't work. TT Bug or is it something im doing wrong?
 
http://i217.photobucket.com/albums/cc276/ktbanh/sysbug.jpg[/img]

Bug: It doesn't update, although i have the view damage calculation info turned to false, it still shows up from time-to-time. Also the HP update is screwy if you noticed the numbers O_O;;

This is for VX

And that's the current isometric tileset i'm developing for VX. Still hard to coordinate the tiles using iso in VX.

And the update which you already took notice O_O;; there's no help menu for selections.

Hope that helps. There's still a few other bugs i forget O_O;; but pretty minor, nothing i haven't mentioned from the above post and this.

Great system. Hopefully you'll do more updates for VX XD.
 
Sorry to be a bother but the way music is setup now, its by map ID, I was wondering if it could be set by Actor ID as well.
Using the VX Version by the way
 

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