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)

Well, I'm not getting script errors anymore.
It removes the character.......graphic, and I can still control the actor.
It is very weird
 
Aha!  I see what the problem is.  Sorry about not testing it before hand and bearing with me on it.  Look at the script I gave you.  If you look through it I try to delete the actor from the enemy thread. 

So, here is an updated script..
Code:
class Scene_Battle_TBS
  def remove_battler(id, anim = 0, type = "enemy")
    case type
    when "enemy"
      actor = nil
      for e in $game_system.tactics_enemies
        if e.id == id
          actor = e
          break
        end
      end
      if actor != nil
        if anim != 0
          actor.animation_id = anim
          wait_count = $data_animations[anim].frame_max rescue wait_count = 1
          loop do
            @spriteset.update
            $game_screen.update
            actor.update
            wait_count -= 1
            break if wait_count == 0
          end
        end
        $game_system.tactics_enemies.delete(actor)
        for sprite in @spriteset.battler_sprites
          if sprite.bat == actor
            sprite.dispose
            @spriteset.battler_sprites.delete(sprite)
          end
        end
      end
      
    when "neutrual"
      actor = nil
      for e in $game_system.tactics_neutral
        if e.id == id
          actor = e
          break
        end
      end
      if actor != nil
        if anim != 0
          actor.animation_id = anim
          wait_count = $data_animations[anim].frame_max rescue wait_count = 1
          loop do
            @spriteset.update
            $game_screen.update
            actor.update
            wait_count -= 1
            break if wait_count == 0
          end
        end
        $game_system.tactics_neutral.delete(actor)
        $game_system.tactics_actors.delete(actor)
        for sprite in @spriteset.battler_sprites
          if sprite.bat == actor
            sprite.dispose
            @spriteset.battler_sprites.delete(sprite)
          end
        end
      end
    when "actor"
      actor = nil
      for e in $game_system.tactics_actors
        if e.id == id
          actor = e
          break
        end
      end
      if actor != nil
        if anim != 0
          actor.animation_id = anim
          wait_count = $data_animations[anim].frame_max rescue wait_count = 1
          loop do
            @spriteset.update
            $game_screen.update
            actor.update
            wait_count -= 1
            break if wait_count == 0
          end
        end
        $game_system.tactics_actors.delete(actor)
        for sprite in @spriteset.battler_sprites
          if sprite.bat == actor
            sprite.dispose
            @spriteset.battler_sprites.delete(sprite)
          end
        end
      end
    end
  end
end

class Interpreter
  def kill_battler_at_xy(x,y)
    actor = $scene.occupied_by(x,y)
    if actor != nil
      if actor.is_a?(Game_Enemy)
        $scene.remove_battler(actor.id)
      else
        $scene.remove_battler(actor.id, 0, "actor")
      end
    end
  end
end
Just replace the old code I gave you.

Let me know if you run into any more trouble.
 
Hey man, this is great! I love it! I'm really good at it too. In the fight on the levels map, Hilda and the hunter lady died almost instantly, and I was left with Alexus and Estelle. I won, even after I accidentally healed the enemy ;).

Anyway, it's a bit laggy, but nothing else is of any consequence!
 
I found that the lag was being caused by the gradient bars that i implimented.  I will try to be replacing that with a new method for the next release.  I really like the way they look, but "cost" wise, its expensive to draw them. Glad you like it.
 

gannon

Member

Other than the ones i pointed out, not many bug i came across. Only big one was the gameover undefined which you fixed.
 
Gubid, can I make if one battler says somthing before attacking particular battler?

for example , aluxes tries to attack the boss ,

aluxes : stop this ! You can't do this !

and then attack..

is it able ?
 
hungery.. needs to have the '?' at the end of occupied_by.. 'occupied_by?' is what it should be. 
probpe.. at this time, no that is not possible.
 
none really, I have been working on VX.  Thats one of my next projects.

edit...
hmmm,  I dont see any compatibility problems with the UMS.  Seems to work fine.  Just need a method to making bubbles over characters.. during battle.

And for the equip skill, you just need the end battle to display gained ap... and well add it?
 
yes i only need to make UMS work during the battle and gain AP after battle !

but when i tried to add equipment skills script to gtbs an error occured..

everything will be prepared for my game project if these two are done TT

help me my hero gubid TT
 

gannon

Member

Ok ive tested id and i'd say vx tbs is clear for public release and further development. Let me just test nms3 with it. Edit ok works with neo message system but message shows over face instead of under when using neoface feature. Also you can only have normal bg but its nothing big.
 
Please release the VX one soon! I really want it. Strategy RPGs are my favorites of all time. I'd even be fine with a beta, as long as there are instructions on how to create an enemy AI.

-Shadow Lord
 
Ok, I have been messing around with the UMS, and I think I have it good enough.  perhaps you guys can tell me if it sucks. Anyway, here it is..
Add this script to its own section below both the UMS and the TBS.  And in your events you will need to specify \gtbsA[actor_id] or \gtbsE[enemy_id], for the event to be centered on the actor or enemy.  Let me know how it works and if you have any trouble.  This is my first look at the UMS code, so please dont be too harsh.  (*crosses my fingers*)
Code:
class Game_System
  attr_accessor  :gtbs_a_id
  attr_accessor  :gtbs_e_id
  
  alias gtbs_ums_system_init initialize
  def initialize
    @gtbs_a_id = -1
    @gtbs_e_id = -1
    gtbs_ums_system_init
  end
end

class Scene_Battle_TBS
  alias gtbs_sb_ums_update update
  def update
    $game_system.slave_windows.each_value { |window| window.update }
    $game_system.indy_windows.each_value { |window| window.update }
    gtbs_sb_ums_update
  end
end

class Window_Message < Window_Selectable
  alias gtbs_ums_gm_refresh refresh
  def refresh
    if $game_temp.message_text != nil
      text = $game_temp.message_text
      text.gsub!(/\\[Gg][Tt][Bb][Ss][Aa]\[([0-999]+)\]/) do
        $game_system.gtbs_a_id = $1.to_i
        ""
      end
      
      # GTBS Enemy Battle Event
      text.gsub!(/\\[Gg][Tt][Bb][Ss][Ee]\[([0-999]+)\]/) do
        $game_system.gtbs_e_id = $1.to_i
        ""
      end 
      $game_temp.message_text = text
    end
    gtbs_ums_gm_refresh
  end
  
  #--------------------------------------------------------------------------
  # * Set Window Position and Opacity Level
  #--------------------------------------------------------------------------
  def reset_window (change_opacity = true)
    # x-coordinate depends on justification
    if $game_system.message_event == -1 and $game_system.train_actor == -1
      if $game_system.window_justification == RIGHT
        self.x = 640 - $game_system.window_width
      elsif $game_system.window_justification == LEFT
        self.x = 0
      else # center
        self.x = (640 - self.width) / 2
      end
    elsif $game_system.train_actor >= 0
      if $game_system.train_actor == 0 or $game_system.train_actor > $game_party.actors.size - 1
        # center on player
        event_x = $game_player.screen_x
      else
        # center on train actor
        event_x = $game_train.actors[$game_system.train_actor - 1].screen_x
      end
      self.x = event_x - self.width / 2
      @comic.x = self.x + (self.width / 2) + 4
    else
      if $game_system.message_event == 0 or $game_map.events[$game_system.message_event] == nil
        # center on player
        event_x = $game_player.screen_x
      else
        # center on the event specified
        event_x = $game_map.events[$game_system.message_event].screen_x
      end
      self.x = event_x - self.width / 2
      @comic.x = self.x + (self.width / 2) + 4
    end
    
    if $game_temp.in_battle
      self.y = 16
    else
      if $game_system.message_event == -1 and $game_system.train_actor == -1
        case $game_system.message_position
          when 0  # up
            self.y = 16
          when 1  # middle
            self.y = (480 - $game_system.window_height) / 2
          when 2  # down
            self.y = 480 - $game_system.window_height - 24
        end
      elsif $game_system.train_actor >= 0
        if $game_system.train_actor == 0 or $game_system.train_actor > $game_party.actors.size - 1
          # center on player
          self.y = $game_player.screen_y - self.height - 48
        else
          # center on train actor
          self.y = $game_train.actors[$game_system.train_actor - 1].screen_y - self.height - 48
        end
        @comic.y = self.y + self.height - 2
        @comic.angle = 0
      else
        if $game_system.message_event == 0 or $game_map.events[$game_system.message_event] == nil
          # above player
          self.y = $game_player.screen_y - self.height - 48
        else
          # above event specified
          self.y = $game_map.events[$game_system.message_event].screen_y - self.height - 48
        end
        @comic.y = self.y + self.height - 2
        @comic.angle = 0
      end
    end
    
    
    if self.y < 0 + ($game_system.name == "" ? 0 : 16)
      if $game_system.comic_enabled
        if $game_system.message_event == 0 or $game_map.events[$game_system.message_event] == nil
          self.y = $game_player.screen_y - 16
        else
          self.y = $game_map.events[$game_system.message_event].screen_y - 16
        end
        @comic.angle = 180
        @comic.y = self.y + 2
        @comic.x = self.x + (self.width / 2) - 4
      else
        self.y = 0 + ($game_system.name == "" ? 0 : 16)
      end
    elsif self.y > 480 - self.height 
      self.y = 480 - self.height
    end
    if self.x < 0 
      self.x = 0
    elsif self.x > 680 - self.width - 48
      self.x = 640 - self.width
    end
    
    if $game_temp.in_battle and $scene.is_a?(Scene_Battle_TBS)
      if $game_system.gtbs_a_id >= 0 and $game_system.gtbs_e_id == -1
        actor = nil
        for act in $game_system.tactics_actors + $game_system.tactics_neutral + $game_system.tactics_dead
          if act.id == $game_system.gtbs_a_id and act.is_a?(Game_Actor)
            actor = act
          end
        end
        if actor != nil
          event_x = actor.screen_x
          self.y = actor.screen_y-self.height-16
          self.x = event_x - self.width / 2
          @comic.angle = 180
          @comic.y = @comic.y = self.y + 2
          @comic.x = self.x + (self.width / 2) + 4
          @comic.visible = true
        end
      elsif $game_system.gtbs_a_id == -1 and $game_system.gtbs_e_id >= 0
        actor = nil
        for act in $game_system.tactics_enemies + $game_system.tactics_dead
          if act.id == $game_system.gtbs_e_id and act.is_a?(Game_Enemy)
            actor = act
          end
        end
        if actor != nil
          event_x = actor.screen_x
          self.y = actor.screen_y-self.height-16
          self.x = event_x - self.width / 2
          @comic.angle = 180
          @comic.y = @comic.y = self.y + 2
          @comic.x = self.x + (self.width / 2) + 4
          @comic.visible = true
        end
      elsif $game_system.gtbs_a_id == -1 && $game_system.gtbs_e_id == -1
        self.x = 320 - self.width/2
        self.y = 480-self.height-16
      end
      if (self.x+self.width) > 640
        self.x -= (self.x+self.width)-640
      elsif self.x < 0
        self.x = 0
      end
          
      if self.y + self.height > 480
        self.y -= (self.y+self.height)-480
      elsif self.y < 0
        self.y = 0
      end
      $game_system.comic_style = TALK1
      @comic.bitmap = RPG::Cache.windowskin("talk1.png")
    end
    
    if change_opacity
      if $game_system.message_frame == 0 and $game_temp.message_text != ""
        self.opacity = $game_system.opacity
      else
        self.opacity = 0
      end
      self.back_opacity = $game_system.back_opacity
    end
    
    # window back stuff
    if $game_system.window_image != nil
      @window_back.bitmap = RPG::Cache.windowskin($game_system.window_image)
      @window_back.x = self.x
      @window_back.y = self.y
    end
    
      # face stuff
      if $game_system.face_graphic != ""  
        # the player has chosen to show a face graphic
        if @done and $game_system.resting_face != ""
          @face.bitmap = RPG::Cache.picture($game_system.face_graphic + $game_system.resting_face)
          if @face_frame * $game_system.face_frame_width >= @face.bitmap.width
            @face_frame = 0
          end
        else
          @face.bitmap = RPG::Cache.picture($game_system.face_graphic)
        end
        
        # picture y-coordinate
        if $game_system.face_graphic_position == ABOVE
          @face.y = self.y - @face.bitmap.height
          @face_offset = 0
        elsif $game_system.face_graphic_position == CENTER
          delta = (@face.bitmap.height - self.height) / 2
          @face.y = self.y - delta
          if $game_system.animated_faces
            @face_offset = $game_system.face_frame_width + 16
          else
            @face_offset = @face.bitmap.width + 16
          end
        elsif $game_system.face_graphic_position == BOTTOM 
          @face.y = self.y + self.height - @face.bitmap.height
          if $game_system.animated_faces
            @face_offset = $game_system.face_frame_width + 16
          else
            @face_offset = @face.bitmap.width + 16
          end
        else # side
          delta = (@face.bitmap.height - self.height) / 2
          @face.y = self.y - delta
          @face_offset = 0
        end
        
        # picture x-coordinate
        if $game_system.face_graphic_justification == LEFT
          if $game_system.face_graphic_position == SIDE
            @face.x = self.x - @face.bitmap.width
          else
            @face.x = self.x + 10
          end
        else # right side
          if $game_system.animated_faces
            offset = @face.bitmap.width - $game_system.face_frame_width
          else
            offset = 0
          end
          if $game_system.face_graphic_position == SIDE
            @face.x = self.x + self.width + offset
          else
            @face.x = self.x + self.width - @face.bitmap.width - 10 + offset
            @face_offset = 0
          end
        end
        
        if $game_system.animated_faces
          @face.src_rect = Rect.new(@face_frame * $game_system.face_frame_width, 0, $game_system.face_frame_width, @face.bitmap.height)
          if @done and $game_system.resting_face != ""
            pause = $game_system.resting_animation_pause
          else
            pause = $game_system.animation_pause
          end
          if Graphics.frame_count % pause == 0
            @animate_face = true
          end
          if @animate_face
            if Graphics.frame_count % 3 == 0
              @face_frame += 1
              if @face_frame * $game_system.face_frame_width >= @face.bitmap.width
                @face_frame = 0
                @animate_face = false
              end
            end
          end
        end
      end
      
      # name window
      if $game_system.name != ""
        @name_window.x = self.x
        @name_window.y = self.y - 36
        @name_window.set_name($game_system.name)
      end
      
      # If choice
    if $game_temp.choice_max > 0
      @choice_window.set_choices($game_temp.choices)
      # determine x and y coords for choice window
      if $game_system.choice_justification == LEFT
        @choice_window.x = self.x
      else
        @choice_window.x = self.x + self.width - @choice_window.width
      end
      if $game_system.choice_position == ABOVE
        # check to make sure there is enough room above the textbox
        if self.y < @choice_window.height
          # not enough room above, place below
          @choice_window.y = self.y + self.height
        else
          # draw above
          @choice_window.y = self.y - @choice_window.height
        end
      elsif $game_system.choice_position == BOTTOM
        # check to make sure there is enough room below the textbox
        if (480 - self.y - self.height) < @choice_window.height
          # not enough room below, place above
          @choice_window.y = self.y - @choice_window.height
        else
          # draw below 
          @choice_window.y = self.y + self.height
        end
      else # side
        if $game_system.choice_justification == LEFT
          # check to make sure there's room on the left side
          if self.y < @choice_window.width
            # not enough room on the side, check to make sure there's room below
            if (480 - self.y - self.height) < @choice_window.height
              # not enough room below, place above
              @choice_window.y = self.y - @choice_window.height
            else
              # draw below 
              @choice_window.y = self.y + self.height
            end
          else
            # place on the left side
            @choice_window.y = self.y
            @choice_window.x = self.x - @choice_window.width
          end
        else # right
          # check to make sure there's room on the right side
          if (680 - (self.y + self.width)) < @choice_window.width
            # not enough room on the side, check to make sure there's room below
            if (480 - self.y - self.height) < @choice_window.height
              # not enough room below, place above
              @choice_window.y = self.y - @choice_window.height
            else
              # draw below 
              @choice_window.y = self.y + self.height
            end
          else
            # place on the left side
            @choice_window.y = self.y
            @choice_window.x = self.x + self.width
          end
        end
      end
    end
    
    # If number input
    if $game_temp.num_input_variable_id > 0
      if @input_number_window == nil
        digits_max = $game_temp.num_input_digits_max
        number = $game_variables[$game_temp.num_input_variable_id]
        @input_number_window = Window_InputNumber.new(digits_max)
        @input_number_window.number = number
      end
      # determine x and y coords for number input window
      if $game_system.choice_justification == LEFT
        @input_number_window.x = self.x
      else
        @input_number_window.x = self.x + self.width - @input_number_window.width
      end
      if $game_system.choice_position == ABOVE
        # check to make sure there is enough room above the textbox
        if self.y < @input_number_window.height
          # not enough room above, place below
          @input_number_window.y = self.y + self.height
        else
          # draw above
          @input_number_window.y = self.y - @choice_window.height
        end
      elsif $game_system.choice_position == BOTTOM
        # check to make sure there is enough room below the textbox
        if (480 - self.y - self.height) < @input_number_window.height
          # not enough room below, place above
          @input_number_window.y = self.y - @input_number_window.height
        else
          # draw below 
          @input_number_window.y = self.y + self.height
        end
      else # side
        if $game_system.choice_justification == LEFT
          # check to make sure there's room on the left side
          if self.y < @input_number_window.width
            # not enough room on the side, check to make sure there's room below
            if (480 - self.y - self.height) < @input_number_window.height
              # not enough room below, place above
              @input_number_window.y = self.y - @input_number_window.height
            else
              # draw below 
              @input_number_window.y = self.y + self.height
            end
          else
            # place on the left side
            @input_number_window.y = self.y
            @input_number_window.x = self.x - @choice_window.width
          end
        else # right
          # check to make sure there's room on the right side
          if (680 - (self.y + self.width)) < @input_number_window.width
            # not enough room on the side, check to make sure there's room below
            if (480 - self.y - self.height) < @input_number_window.height
              # not enough room below, place above
              @input_number_window.y = self.y - @input_number_window.height
            else
              # draw below 
              @input_number_window.y = self.y + self.height
            end
          else
            # place on the left side
            @input_number_window.y = self.y
            @input_number_window.x = self.x + self.width
          end
        end
      end
    end
  end
  
  alias gtbs_ums_terminate_message terminate_message
  def terminate_message
    gtbs_ums_terminate_message
    $game_system.gtbs_a_id = -1
    $game_system.gtbs_e_id = -1
    @comic.visible = false
  end
  
  alias gtbs_ums_update update
  def update
    gtbs_ums_update
    if @fadein
      if $scene.is_a?(Scene_Battle_TBS)
        if $game_system.comic_enabled
          @comic.opacity = self.opacity
          @comic.visible = self.visible
        end
      end
    end
  end
end
Oh yeah, you may also want to update something in the TBS so that if the message box is showing that the screen doesnt start scrolling. 
Add this to line 806
Code:
unless @message_window.visible 
It should now say "return if update_screen unless @message_window.visible"
 

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