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)

GubiD, now I've integrated the Multi-Slot + Multi-Attack script to GTBS, I can't make a "3-shot weapon" with it, instead, my character just fired twice, even though his other handgun's a 3-shot mode, while the other's a 1-shot.
 
Thanks Gubid, but there another one ^

Can i make like, if a character is attacked by ememy, there AP will decrease a bit..

Is it able ?
 
I will look into it DB.

Yes its possible.  Just update the Game Battler , def Attack Effect item.  You will have to figure how you want it to reduce their at.  Perhaps something to do with the total amount of damage
Code:
self.atb -= self.damage/self.maxhp.to_f *100
 
which line do I have to put that code ?

and also can U explain me about this code ?

self.atb -= self.damage/self.maxhp.to_f *100

what is the meaning of 100 ? what do i have to put ?
 
A friend of mine found a bug in TEAM mode.

What you do is, perform your first action. Then, before performing the second Action of the actor, press Esc. Then, select the same caracter. All the actions are there again, making you able of infinite move/atack.
 
probpe, you would put that in the game_battler edit in the section def attack_effect, near the bottom.  As you read down the def you should understand what it is doing somewhat.  At the end of it I check attacker direction.. somewhere after that is where you would want to place that.  Let me explain what it means..

self.damage/self.maxhp means to get the percentage of damage inflicted based on the maxhp. 
Then using that .to_f(fraction) multiply by 100.. because we dont want to minus .12 of speed from the defender, we want them to feel it. 
here is an example...
100/550.to_f * 100 = 18.18 which when minused from their AT is very trivial.. For example.. it cost 1000 AT points for it to be your turn.  So 18 is barely anything in retrospect.  Personally I would rather see it like 1000... so that would be 181.8, which when minus'd could really slow you down.  Almost another turn behind them.  But because we dont want it to set them behind too much, then maybe not.  Anyway, you see what I mean?

Arajabat,
lol, I set that for some quicker testing.  Guess I forgot to remove it.  Just remove line 4894 in the -Scene_Battle_TBS-, it should be    "@active_battler.clear_tbs_actions(true)"  just remove that line entirely and everything should work as expected.
 
Hey, just want to say, "Dude, I LOVE this system". Seriously, I have always been a fan of the 'Tactical Battle System' and to see it fleshed out so much is pure beauty. Anyway, I have to get back to my now meaningful life. Kudos!
 
Ok...
You should replace the existing method in Game_Battler with this... its around line 1154 of -Game_Battler-
Code:
  #Performs attack calculations
  def attack_effect(attacker, affected = 0)
    # Clear critical flag
    self.critical = false
    # First hit detection
    hit_result = (rand(100) < attacker.hit)
    # If hit occurs
    if hit_result == true
      # Calculate basic damage
      atk = [attacker.atk - self.pdef / 2, 0].max
      self.damage = atk * (20 + attacker.str) / 20
      # Element correction
      self.damage *= elements_correct(attacker.element_set)
      self.damage /= 100
      # If damage value is strictly positive
      if self.damage > 0
        # Critical correction
        if rand(100) < 4 * attacker.dex / self.agi
          self.damage *= 2
          self.critical = true
        end
        # Guard correction
        if self.guarding?
          self.damage /= 2
        end
        if self.from_back?(attacker)
          self.damage *= 1.3
        else 
          if self.from_front?(attacker)
            self.damage *= 0.8
          else
            self.damage *= 1.0
          end
        end
        # Remove decimals
        self.damage = self.damage.to_s.split(".")[0].to_i 
      end
      # Dispersion
      if self.damage.abs > 0
        amp = [self.damage.abs * 15 / 100, 1].max
        self.damage += rand(amp+1) + rand(amp+1) - amp
      end
      # Second hit detection
      eva = 8 * self.agi / attacker.dex + self.eva
      hit = self.damage < 0 ? 100 : 100 - eva
      hit = self.cant_evade? ? 100 : hit
      if self.from_back?(attacker)
        hit += 10
      elsif !self.from_front?(attacker)
        hit += 5 #from sides
      end
      hit = hit > 100 ? 100 : hit
      hit_result = (rand(100) < hit)
    end
    
    # If hit occurs
    if hit_result == true
      if affected > 0
        curve = GTBS::CHAIN_LIGHTNING_CURVE
        if !(affected >= curve.size)
          self.damage *= (curve[affected-1]/100.to_f)
        else
          self.damage *= (curve.last/100.to_f)
        end
        self.damage = self.damage.to_i
      end
      ###################THIS IS WHERE I ADDED IT#####################
      
      self.atb -= (self.damage/self.maxhp.to_f*500).to_i
      
      ################################################################
      # State Removed by Shock
      remove_states_shock
      # Substract damage from HP
      self.hp -= self.damage
      # State change
      @state_changed = false
      states_plus(attacker.plus_state_set)
      states_minus(attacker.minus_state_set)
    # When missing
    else
      # Set damage to "Miss"
      self.damage = "Miss"
      # Clear critical flag
      self.critical = false
    end
    if self.dead?
      self.animation_id = 108
    end
    if self.current_action.basic == 1
      self.current_action.basic = 0
    end
    # End Method
    return true
  end
 
Thanks gubid ! Now it works, and i have another questions..

1. cant we make battlers cant move while casting a magic ?

2. cant we hide the enemy's status except AT , or just hide it all..

3. cant we make when a special enemy dies , dies after saying somthing..

for example , when it is an animated battler , when he dies..

Enemy : oh.. im gonna die~~ => turns into the downset..

is this able ?

4. Cant we just make the battle event by just making the event in the map, just like ZTBS script.

This is all for now.. I love this script, it made me have fun making games.. Thanks again and ill wait for the reply !
 
#1 -
Code:
  def moved
    return true if self.casting?
    return @moved
  end
Add this somewhere in your -Game_Battler-... Just look at how the other DEF's are in there, and add this one like those.
#2 - I would recommend you disable the status window when its a Game_Enemy...
change this line from
Code:
        window.update(@selected) unless @windows["detail"].active == true
to
Code:
        window.update(@selected) unless @windows["detail"].active == true or @selected.is_a?(Game_Enemy)
That should handle it.

#3 - This is a little more complex.  We would have to find a way to add a flag to the character saying dont change.. UNTIL XYZ is set.  It could be switch or whatever based on the actor id or whatever... I will have to look into this, but I cannot promise anything.

#4 - Yes, just name the event "battle_event" and it will be looked at during battle.  If its parallel it will be processed like normal, and if its player_touch/event_touch, then it will process when you "wait" on that tile.  You can see a good example of that in the demo... Talk to the lancer on the iso map. 
 
1. Oh ! so if the events name is "battle_event" , everything works in the battle right?

2. and i have another question

how can i make any battler(actor or enemy whatever..) quit from a battle.? its not escaping from the battle ,

for example, the boss of enemy..

boss : Im not waisting time with you guys ..! Soldiers ! Kill the enemies! Ive got to go !

and then disappears from the battle map.. can I do this ?
 
Gubid ,thank you again and i have some questions .

Is there anyway to set a neutral or an enemy inactive (means not move ,not attack) for the entire battle or until an event occur in the battle ?
Or can i at least make them not move and just stay in one place from the beginning till the end of the battle ?

Is there anyway to set a neutral or enemy can't be attacked by any actors and enemies ?
 
Sure, you just need to modify the def damage section of RPG::Sprite. 
Something like...
Code:
class RPG::Sprite
  alias gtbs_crit_dmg_snd damage
  def damage(value, critical)
    if critical
      $game_system.se_play("SOUND EFFECT NAME")
    end
    gtbs_crit_dmg_snd(value, critical)
  end
end

probpe,
1. yes
2. You will need a script to do this.. I have created this and verified it works.
Code:
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_enemies.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_enemies.delete(actor)
        for sprite in @spriteset.battler_sprites
          if sprite.bat == actor
            sprite.dispose
            @spriteset.battler_sprites.delete(sprite)
          end
        end
      end
    end
  end
You will have to call this via event or troop_event.  You do it similar to adding characters to battle but slightly different.
$scene.remove_battler(Battler_ID, Animation_ID, Battler_Type)
where Battler_ID is the ID of the battler in the database.  You must be specific to exactly their id.  Including neutrals, they must be the 51 instead of 1.
Animation_ID is the animation you would like to play on the actor/neutral/enemy before they "disappear" from battle (they will litterally disappear, default is no animation)

Battler_Type is the type of battler. ("actor"/"neutral"/"enemy") (it defaults to enemy) that you want to remove. 

so $scene.remove_battler(1,1,"actor") would remove actor1(aluxes) from the battle, right after animation_id 1 is played.
This script MUST be added to scene_Battle_TBS somewhere before the very last end.  I put it right next to set_character, cause they kinda follow suit.

Dragnar, if they are going to be inactive for the entire battle, just create an event on the map that is in a location that is not passable, then set the graphic to this neutral character and call it "extra".. extra's will be processed during battle, but take no part in it.  See the demo for the frog on the stream.  There is no way to have them become unattackable without flipping a switch and removing the battler using the script I just provided to Probpe and causing a event to appear in its location with the battler... or something.

Thanks Alicix for trying to help, that method would work also.  battle_events with images cannot be passed through UNLESS they are set to THROUGH on the event screen.
 
GubiD, is there a way for me to make nearly every battler to have voices in the game? Kinda like "Mimi's Battlecry Script for RTAB"?

I need it because my game might be using several vocals and moans collected from different games, especially MMOs.
 
I couldnt imagine why not.  I would have to review their scripts and see what would need to change to make it compatible.  I will check it out.
 
Thanks gubid,

now im trying to make animated battlers and I tried to use the template that you gave it to us

but if we you give that by spoiler , the template is saved into too small size,

can you give that template by other 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