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)

Vivere

Member

Gubid":31f9c5o7 said:
Vivere.. the script is not public and was make specifically for his game to my knowledge.  Here is the link to his project page if you are interested.  Link

Thanks GubiD. His battle system is not exactly like Live A Live's but it's definitely a lot closer, you're right :) I look forward to playing his game when it's done.
 
If you want to provide me the graphics(PM).. I can put them in the template for you.    I have a base template around here somewhere...
 
For my project I want to make certain skills with two effects like "Steal Time" which causes slow on one enemy and haste on the user.
I thought that the easiest way would be to create to separate skills and the use of the first one would trigger the other. I managed to do it with the regular battle system (yay!) but I've been looking through Scene_Battle_TBS and  I could figure out how should I do it...
Thanks in advance. Also, here is the little code I made for the regular battle system, (not that you need it) yet I felt like showing it.
Code:
module Second_Skill
  Second_Skill = { 3 => 537 }
end

class Scene_Battle < Scene_Base
  alias double_execute_action_skill execute_action_skill
  def execute_action_skill
    double_execute_action_skill 
    ssi = Second_Skill::Second_Skill[@active_battler.action.skill.id]
    unless ssi.nil?
      @active_battler.action.set_skill(ssi)
      double_execute_action_skill 
    end
  end
end
 
I having troubles trying to do an enemy/neutral to join the battle in the middle of the battle... how could I "make" an event (enemy9 or something like neutral3) when the "battlr_turn" reaches a specifc value?
 
use $scene.set_character(type,[x,y],dir,animation)
Look it up in the help file.

uresk.. you are going to need to modify tbs_phase_9 which is where all the actions take place.  You need to say if !ssi.nil? @step = 1; @targets = [@active_battler]; return; end or something close to that.. somewhere in there.
 
Thanks GubiD, this is how it turned out. Not many changes actually :)
Code:
module Second_Skill
  Second_Skill = { 3 => 539 }
end


class Scene_Battle_TBS < Scene_Base
  #alias def (just in case)
  alias old_tbs_phase_9 tbs_phase_9
  #----------------------------------------------------------------------------
  # Process Actions (Attack/Skill/Item)
  #----------------------------------------------------------------------------
  def tbs_phase_9
    case @step
    when 0
      return if update_screen
      @step = 1
    when 1
      animation = $data_animations[@animation2]
      if !animation.nil?
        @turnable = animation.name.downcase.include?("[turn]") 
      else
        @turnable = nil
      end
      
      #Turn to target location
      if @targets[0] != nil
        @active_battler.turn_to(@targets[0])
      else
        @active_battler.turn_to(@cursor)
      end
      @hit_count = 0
      #Play user Animations
      if @animation1 > 0
        @active_battler.animation_id = @animation1
        @wait_count = $data_animations[@animation1].frame_max rescue @wait = 1
        if [GTBS::ANIM_ATK,GTBS::ANIM_SPEC1,GTBS::ANIM_SPEC2,GTBS::ANIM_CAST,GTBS::ANIM_HEAL].include?(@animation1)
          @wait_count = 30
          @active_battler.reset_frame
        end
      end
      check_projectiles
      @step = 2
      @apply_all = nil
      if @active_battler.current_action.skill_id > 0
        @spell = $data_skills[@active_battler.current_action.skill_id]
        if [2,8,10].include?(@spell.scope)
          @apply_all = true
        end
        if @spell.dual?
          @targets += @targets
        end
      end
      @gained = @targets.clone
      if @targets.size == 1
        @melee = true
      end
      return
    when 2
      return if @active_battler.projectile_in_motion? unless @active_battler == nil
      #Play target animations/damage display
      if GTBS::POP_DAMAGE_IND
        if @apply_all
          anim = Anim_Miss.new(2, @animation2)
          anim.place(@cursor.x, @cursor.y)
          anim.start_anim
          @wait_count = [1,$data_animations[@animation2].frame_max].max rescue @wait_count = 1
          @target = @targets[0]
          @step = 3
          @apply_all = false
        elsif @apply_all == false
          @target = @targets[0]
          @step = 3
        elsif @apply_all == nil
          @target = @targets[0]
          @target.attacker_dir = @active_battler.direction if @turnable == true
          @target.animation_id = @animation2 unless @target.nil?
          unless $data_animations[@animation2] == nil
            @wait_count = [1,$data_animations[@animation2].frame_max].max rescue @wait_count = 1
          end
          @step = 3
        end
      else
        for target in @targets
          target.animation_id = @animation2
          @wait_count = [1,$data_animations[@animation2].frame_max].max rescue @wait_count = 1
        end
        return
      end
      
      if @targets.size == 0
        @enable_target_cursor = false
        if GTBS::is_summon?(@active_battler.current_action.skill_id) > 0 and $game_map.passable?(@cursor.x, @cursor.y, 0)
          #Crease Miss object, but play summon animation
          anim = Anim_Miss.new(1)
          anim.place(@cursor.x, @cursor.y)
          anim.start_anim
          @target = anim
          #Set character
          sumid = GTBS::is_summon?(@active_battler.current_action.skill_id)
          if @active_battler.is_a?(Game_Actor) and $game_system.tactics_actors.include?(@active_battler)
            set_character("actor", sumid, @cursor.x, @cursor.y)
            @targets.push($game_system.tactics_actors.last)
          elsif @active_battler.is_a?(Game_Actor) and $game_system.tactics_neutral.include?(@active_battler)
            set_character("neutral", sumid, @cursor.x, @cursor.y)
            @targets.push($game_system.tactics_neutral.last)
          elsif @active_battler.is_a?(Game_Enemy) and $game_system.tactics_enemies.include?(@active_battler)
            set_character("enemy", sumid, @cursor.x, @cursor.y)
            @targets.push($game_system.tactics_enemies.last)
          end
          sum = @targets.last
          sum.hp = sum.maxhp
          sum.mp = sum.maxmp
          @gained = @targets.clone
        else
          #Play Miss Animation
          @target = anim
          anim = Anim_Miss.new
          anim.place(@cursor.x, @cursor.y)
          anim.start_anim
        end
      else  
        if GTBS::is_summon?(@spell.id) > 0
          #Play Miss Animation - since a summon cannot occupy any location already occupied.
          anim = Anim_Miss.new
          anim.place(@cursor.x, @cursor.y)
          anim.start_anim
          @step = 5
        end
      end
    when 3 #performs action!
      @wait_count = 25
      if @target != nil
        if @target.is_a?(Anim_Miss)
          @step = 4
          return
        end
        case @active_battler.current_action.kind  
        when 0 #attack/defend/etc
          case @active_battler.current_action.basic
          when 0
            make_attack_result(@target, @active_battler)
            @hit_count += 1 if $data_skills[@active_battler.weapon_id].element_set.include?(GTBS::CHAIN_LIGHTNING_EFFECT_ID) rescue
            if @melee
              @counter = @target.counter_result(@active_battler) unless @target == @active_battler
            end
          when 1
            #defend
          when 2
            #escape
          end
        when 1 #skill
          make_skill_result(@target, @active_battler)
          @hit_count += 1 if $data_skills[@active_battler.current_action.skill_id].element_set.include?(GTBS::CHAIN_LIGHTNING_EFFECT_ID) rescue
          if @melee
            @counter = @target.counter_result(@active_battler) unless @target == @active_battler
          end
        when 2 #item
          if @active_battler.current_action.skill_id != 0
            make_itemskill_result(@target, @active_battler)
          else
            make_item_result(@target, @active_battler)
          end
        end
        if GTBS::USING_MULTISLOT and @active_battler.current_action.kind == 0 and
          @targets.size == 1 and !@active_battler.is_a?(Game_Enemy)
          @active_battler.attack_count += 1 
          # If all attacks have been made
          if @active_battler.attack_count == @active_battler.attacks.size or
            @active_battler.current_action.kind != 0 or 
            @active_battler.current_action.basic != 0
            # End of turn, and return attack count to 0
            @active_battler.attack_count = 0
          else
            # Return for extra attack
            @animation1 = @active_battler.animation1
            @animation2 = @active_battler.atk_animation_id
            @step = 1
            return
          end
        end
        check_knock_back
        @targets = clear_target  
        #@targets.delete(@target)
        if @targets.size != 0
          @step = 2 
          return
        end
      else
        for target in @targets
          case @active_battler.current_action.kind  
          when 0 #attack/defend/etc
            make_attack_result(target, @active_battler)
            if @melee
              @counter = @target.counter_result(@active_battler) unless target == @active_battler
            end
          when 1 #skill
            make_skill_result(target, @active_battler)
            if @melee
              @counter = @target.counter_result(@active_battler) unless target == @active_battler
            end
          when 2 #item
            if @active_battler.current_action.skill_id != 0
              make_itemskill_result(target, @active_battler)
            else
              make_item_result(target, @active_battler)
            end
          end
          check_knock_back
        end
        @targets.clear
      end
      ssi = Second_Skill::Second_Skill[@active_battler.current_action.skill_id]
      unless ssi.nil? #is there a second skill?
        @active_battler.current_action.set_skill(ssi)
        @targets = [@active_battler] 
        @animation2 = $data_skills[ssi].animation_id 
        @animation1 = 0
        @step = 1
        return
      end
      @step = 4
      return
    when 4 #gain_exp
      #----------------
      #Target now counters if they are set to do so
      #----------------
      @hit_count = 0
      if @targets.size == 0 and @counter != nil
        if @counter[0] and @counter[1] != @active_battler and !@counter[1].dead?  #if counter flag is true
          @active_bat_temp = @active_battler                #save current battler info so they can be restored when complete
          @active_battler = @counter[1]                     #return countering party of active_battler
          @active_battler.turn_to(@active_bat_temp)         #turn towards attacker
          @active_battler.clear_tbs_actions                 #reset actions for battler
          @active_battler.current_action.kind = 0           #set for physical action
          @active_battler.current_action.basic = 0          #set for attack
          @targets.push(@active_bat_temp)                   #set current battler as target
          @melee = false                                    #reset melee so there is no chance of counter happening over and over
          @counter = nil                                    #reset counter so it doesnt pull this again unless conditions meet.
          if @active_battler.animation1_id > 0              #if attack animation set
            @active_battler.animation_id = @active_battler.animation1_id #setup animation for battler
            @wait_count = $data_animations[@active_battler.animation1_id].frame_max rescue @wait = 1#sets wait to animation time
            #if animated battler
            if [GTBS::ANIM_ATK,GTBS::ANIM_SPEC1,GTBS::ANIM_SPEC2,GTBS::ANIM_CAST,GTBS::ANIM_HEAL].include?(@animation1) and GTBS::ANIM_BATTLER
              @wait_count = 30                              #sets wait to animation time
              @active_battler.reset_frame                   #resets animation to first frame
            end
          end
          @animation2 = @active_battler.animation2_id       #set attack target animation
          @step = 2                                         #set step back to 2 so it can redo attack and animations
          return
        end
      end
      #Clears counter info when ready
      if @active_bat_temp != nil 
        @active_battler = @active_bat_temp
        @active_bat_temp = nil
        @counter = nil
      end
      @exp_gained.push([3, @active_battler, @gained]) unless @active_battler.dead?
      @gain = nil
      @turnable = nil
      @targets = []
      @apply_all = nil
      @wait_count = 25
      @step = 5
      @active_battler.current_action.clear
      return
    when 5
      if !@common_event_id.nil?
        @common_event_q += @common_events[@common_event_id].list
        @common_event_id = nil
        return
      end
      if @return_phase == 1                                         #if return to battler phase, reset windows to open
        @windows["actor"].active = true                             #set actor menu to active, visible and refresh contents
        @windows["actor"].visible = true
        @windows["actor"].refresh(@active_battler)
        @tbs_phase = 1
        @step = 0
      elsif @return_phase == 7                                      #return to AI controlled phase
        @tbs_phase = 7
        @step = 0
      elsif @return_phase == 0                                      #if return phase 0 when wait skill, update wait skill info and return
        skill_cast = @use_spell[0][1]
        @use_spell.delete([@active_battler, skill_cast])
        @enable_target_cursor = false
        @tbs_phase = 0
        @step = 0
        @using_skill = false
      end
      if @active_battler.dead?                                      #if active battler died during transaction, reset wait functions and proceed with battle.
        if $game_system.cust_battle == "ATB"
          @wait = false
        end
        @active_battler.blink = false
        @active_battler.moved = false
        @active_battler.perf_action = false
        @active_battler = nil
        @cursor_active = true
        @tbs_phase = 0
        @freeze_scroll = false
        @enable_target_cursor = false
        @using_skill = false
        return
      elsif @return_phase == 0
        @active_battler = nil
      end
      clear_tr_sprites
      return
    end
  end
end

Also, during a battle, there's no help window for items or skills.
I've looked trough the code but have no idea whats causing it...
 
I was trying to add an script that actualy do the "in middle of battle spawn", but I dont have any results since i dont know the sintaxe of ruby... was doing something like this

Code:
class Battle_turn
  def new_enemy_neutral_troops(turn_actual, turn_of_deployment, switch, map_id)
    @turno = turno_actual
    @turno_e = turno_of_deployment
    @switch = switch
    @map_id = map_id
    if @map_id == 5
      if @turno == @turno_e
        $game_switches[@switch] == true  
        @turno_e = @turno_e - 1
      end
    end
  end
end

but the switch ive pointed in $game_switches[@switch] do not trigger and my battle event (the character deployment) do not happens... any idea? Ive also tried to transform the $game.temp_battle.turn in to a variable in the game_variables but ive got no success, I'm forgotting any returns or something like?

I tried to use the $scene.set_character(enemy,1,[13,4],4,0) (example) in place of the switch thing but the script crashed.
(my event is running on paralell process as an EXTRA, the switch I want to get spawns the new actors/neutrals/enemies in the field)
 
Here is a code snippet from the demo, which sets a enemy in the middle of battle using the troop tab in the database set for battle span at turn 3 -
Code:
$scene.set_character("enemy",1,15,14,0)
It would seem that I lied earlier by putting the x,y in []'s but had I actually reviewed my own code.. it is actually

$scene.set_character(TYPE,ID,X,Y,ANIM_ID)
 
Gubid, I have a question, I am working with woratana's NMS, it works perfectly fine but
http://i179.photobucket.com/albums/w320/ynlraey/bleh.png[/img]

This happens, am I missing something? It only happens in battle.
 
Probably because of this..
Code:
@message_window.z = 1000
Find the line and just comment it out.  See if that corrects it.  I adjusted during troubleshooting of the message window during battle, so I may have forgot to reset it.
 
I have a question. I'm using Kylock's light effects script, and Woratana's fogs script, both of which are a very prominent feature in my game.  I would REALLY love to use your system, and I've actually figured the whole thing out.. BUT, for some reason, when I start a battle, both fogs and light effects are removed.  I've tried using extras, but they don't work, and I've also tried using set_open_scene_event(), which again doesn't work.  Is there anything else that I need to do to make my fogs and light effects work?

Another thing, when I start a battle, for some reason the camera pans left, up, right, then back down before I can start the battle.  I've tried doing two separate battles, and the same issue comes up.  If you could help me, I'd be very thankful :)

Oh, and I love the system.  It's just what I was looking for :)
 
please provide me a demo (via pm) and i will see what i can do to resolve the issues.

ynlraey, glad to here it is working.  Did you get the spritesheet problem resolved?
 
uresk":1v3unvtz said:
Also, during a battle, there's no help window for items or skills.
I've looked trough the code but have no idea whats causing it...

I am having this problem, too. I've tried forcing it to be visible and some other stuff but to no avail. :< Great script overall, though! It's perfect for my project.
 
Gubid":qjnr0zy9 said:
please provide me a demo (via pm) and i will see what i can do to resolve the issues.

ynlraey, glad to here it is working.  Did you get the spritesheet problem resolved?
Hey man, can you get that done as quick as possible?  Sorry for the rush, it's just I can't make any progress on my game until this gets fixed, and I have a deadline that I need for my game.
 

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