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)

Lucas Scoppio":1nwe7t9h said:
maybe, but just maybe, you are playing with "team mode", if you are, well... team mode do changes the music at each turn, enemy turn has one music and players has another... ive turned it off in my game.

.. I know that. Phase music for the teams are not the same song as the map that calls it.
Like I said, the main problem is it randomly freezes within the first 3 turns of battle and there are NO events besides the ones reuqired to setup a battle.
It doesn't exactly 'freeze' but instead just exits the battle but with the battle screen still up. Like I said the BGM from the map that calls it begins to play but the battle screen is still up and the battle sprites are still moving in place.

GubiD, I'll PM you a quick demo to further explain my problem if you have the time to take a look at it.
Like I said, it worked before with the scripts I currently have on and have since then not added anything new in that area.
 
GUA!!!!! Fuck... "this" is the "movement bug"? I did exatly "this"
- select a character IN BATTLE
- option >> move
- move to desired location >> confirmation
- deselect the character by hitting either X or ESC
- reselect the same character
- the MOVE option is able to be selected/used and I CAN move him AGAIN.

Was that the bug you were talking about? >.<

A few comrades toldme about a "save bug"... that your save may be corrupted after from times to times...


Gubid, ive a request for you, i've tried this script to "jump" the title screen so I could make an special opening for my game, but it does conflict with the GTBS when it just "load" the game without loading the title...

It will take some time to put the game "on air" so I will present you the script right here!

Code:
class Scene_Title
# ------------------------------------
# Origem: Adam Smith / zeecha (RPG Maker)
# Modificação e apaotação para VX: Saulo de Souza
# ------------------------------------
  def main                          
      $data_actors        = load_data("Data/Actors.rvdata")
      $data_classes       = load_data("Data/Classes.rvdata")
      $data_skills        = load_data("Data/Skills.rvdata")
      $data_items         = load_data("Data/Items.rvdata")
      $data_weapons       = load_data("Data/Weapons.rvdata")
      $data_armors        = load_data("Data/Armors.rvdata")
      $data_enemies       = load_data("Data/Enemies.rvdata")
      $data_troops        = load_data("Data/Troops.rvdata")
      $data_states        = load_data("Data/States.rvdata")
      $data_animations    = load_data("Data/Animations.rvdata")
      $data_common_events = load_data("Data/CommonEvents.rvdata")
      $data_system        = load_data("Data/System.rvdata")
      $data_areas         = load_data("Data/Areas.rvdata")
      $game_system        = Game_System.new
      Graphics.frame_count = 0
      $game_temp          = Game_Temp.new
      $game_message       = Game_Message.new
      $game_system        = Game_System.new
      $game_switches      = Game_Switches.new
      $game_variables     = Game_Variables.new
      $game_self_switches = Game_SelfSwitches.new
      $game_actors        = Game_Actors.new
      $game_party         = Game_Party.new
      $game_troop         = Game_Troop.new
      $game_map           = Game_Map.new
      $game_player        = Game_Player.new
      $game_party.setup_starting_members
      $game_map.setup($data_system.start_map_id)
      $game_player.moveto($data_system.start_x, $data_system.start_y)
      $game_player.refresh
      $game_player.refresh
      $game_map.autoplay
      $game_map.update
      $scene = Scene_Map.new
  end
end

Ow, ive found something.. looks like that the "elevation" system in battle isnt working properly in VX, actually my char was able to go to a height of 8 from the height of 2 instead of going "one by one level".... do you understand what I mean???
 
Just a simple question: Is there a way to add sound effects to the "User Animation?" Say I want to add a "grunt" sound when a goblin swings his weapon before the "clang" sound when it connects with its target (target animation).
Since all units use the same ANIM ATTACK! animation, this really isn't possible.  Thanks!
Yes, you simply need to update the def animation1 method for enemies/actors to check their id or equipment id or something to trigger the desired animation id.  The thing is that VX doesnt have a built in animation id for 'actions' and everything will have to be scripted.  However it should be pretty easy.  I would recommend something like this..
Code:
  def animation1
    case @current_action.kind
    when 0 #physical attack
      case self.enemy_id
      when 1; return 1
      when 2; return 2
      when 3; return 3
      when 4; return 4
      else; return super
      end
    when 1 #skill
      return super
    when 2 #item
      return super
    end
  end
This would have to be something added to Game_Enemy.. and if you wanted to do the same thing for actors.. just change the self.enemy_id to self.id and it should work for the db id just like the enemies.

Kaleidx, I will take a look at the demo when I have a moment.
Lucas Scoppio, yeah thats a bug.  It has a extremely easy fix though.  Find the def set_active_battler section of Scene_Battle_TBS and remove or comment out the line that says: @active_battler.clear_tbs_actions(true) and it will resolve the problem.  I added that for testing and forgot to remove it. Sorry :)  As for you title screen thing.. its because you are not initializing the isometric stuff that I do in the title.  You need to place that title script above the TBS and it should work fine, but otherwise, you can manually copy what I do...
Code:
#==============================================================================
# â–  Scene_Title
#==============================================================================
class Scene_Title
  alias main_orig main
  #--------------------------------------------------------------------------
  # â—
 
so, and about the other issues? (walking from high ground to low ground, the probable save corrupting, etc...

Ow... and Thankyou, I didnt know how to use those lines (this script) you wrote here, but I did placed the script above the iso stuff and worked just fine, thank you Gubid, you are helping me much more than I expected you would help :)

you earn my respect (a long time ago, and still).

:)
 
You can have the system auto return a specific name for all dead actors/enemies if desired, you simply need to update the def character_name method for the game_actor and game_enemy with something like this..
return "cross_image" if dead?
.. for enemies
return "dead_#{self.enemy_id}" if dead?

for this, I understand what to do with the actors, but for the enemies how can I alter the script so that when 'enemy' events are killed they are just removed from the map (as if remove_dead was turned on, but only enemy specific?). Also, is there a way to make the walk-in-place thing stop when things are dead? Like during your demo the downed characters had the /'s through them, but they still walked which was a little.. out of place. Is there a way to stop that when something is dead?

2nd, is there a way to make a skill with the ability to teleport? Basically, you use the skill, you have a range you can choose and you choose a square, the script you call then transports the character from their starting position to the selected destination, much as teleport from FFT works (without the failure rate, because this skill will cost MP)

3rd, does your script work with scripts that allow for individual character inventories?

4th, Is there an option in the AI that you can set enemies to go for a specific tile, actor or event, (such as in FF3/6 when the sprites advance toward Bannon) or can the AI only have the goal of like 'killing all actors(player controlled people)'

5th i noticed you answer one question in that you need to remove something in the script called battler_clear(true) or something, I removed it only in the area you specified, but when I did a search of all the scripts, that same line of code appears in other places, do those need to be removed/commented out?

6th, is there a way(with your script) to add multiple commands/areas where skills can be? For example, instead of just 'skills' or whatever you rename it to, can you have Attack, white magic, black magic, defend, move, wait, status, etc?

7th, I haven't tested this myself, but is it possible to have more than one battle per map? What I'm trying to go for are dungeons that have enemies scattered in them, where if you bump into one it goes into a battle, similar to chrono trigger, except that the battles would obviously be strategy based, not rpg based. Or can you only do one battle per map?

8th, I'm still not entirely understanding how the enemy-sprite thing works. I understand how it FINDS the file, I'm just not getting how it... uses it. For example, when I try to use the 'slime' in your demo as a character in VX, it highlights different sprites within the slime template, instead of all the sprites (as is common in vx), or a single sprite in a certain directional facing (As in xp). So how does your script interpret which character sprite to use out of say, 'actor1', which has 4 or 6 different characters in it? Do you have to divide up actor1 into multiple different templates, or can you specify which section you want to use? The main reason I'm concerned with this is I plan to have a lot of human enemies, which will involve using like actor1, actor2, people1, etc.

9th, Is it possible to have non-fighting/turn taking events that have HP and take up space? In this case I'm thinking of something like a tree, a wall, a rock that would have HP, maybe even 'defense' and can be destroyable. This doesn't happen in FFT, but if you've ever played some of the Front Mission games, this would be a nice feature.

10th, Is it possible to have the AI do other things other than kill or going to a certain point, such as defending a certain point, targetting a certain actor; trying to destroy a certain event (similar to what I'm hoping for in question 9), etc. Or is the AI only capable of kill all enemy scenarios?

11th, if there is a spell that ends a battle, like Egress from Shining force, is there a function in your script to restore that particular battle to its defaults and then re-start it if the player enters the same area, or does whatever they did to initiate the battle in the first place?

12th, What things from the database do NOT transfer to battles? For example, does extra critical under the actor tab, dual strike or whatever under the weapons tab and absorb damage under the skills tab transfer over into your battle system like normal, or are extra steps needed to make one actor do more criticals, one weapon attack twice, or one skill absorb hp damage as hp healing for the user?

13th, When 'placing' your actors, is there a way to scroll through (like L1/R1 in FFT, to skip characters that you don't want to add?)

I can't remember the other questions I had, but these are a lot as it is.

One last thing:

I've changed the following things and it still shows up as a blank character whenever an actor dies, here are the areas I modified, tell me if I messed up somewhere, or if it must just be the template itself.

Code:
  def character_name
    return @character_name if !$game_temp.in_battle
    return "deadchar" if dead? and !animated? # beauner alteration
    return @character_name
  end

and from actor/enemy death

Code:
module GTBS
  #=============================================================#
  #               Character/Enemy Death Options                 #
  #=============================================================#  
  
  #------------------------------------------------------------
  # Check Death Action
  #------------------------------------------------------------
  # This section allows you to identify common events upon death for what map 
  # you are fighting on by the id of the actor/enemy
  def self.check_death_action(map_id, type = 0)
    case map_id
    when 1
      return {1=>6} if type == 0 #actors
      return {} #enemy death
    when 3
      return {1=>7} if type == 0 #actors
      return {36=>8}
    else
      return {} if type == 0 #actors
      return {} #enemies
    end
  end
  
  #-----------------------------------------------------------
  # DownSets by Nick - create a battlername_down file for each character to display
  # other than a downed soldier.
  #-----------------------------------------------------------
  # Downsets are only used if you are not using Animated Battlers or Remove Dead
  #-----------------------------------------------------------
  def self.down_graphic(type, battler_name = "")
    if FileTest.exist?("Graphics/Characters/#{battler_name}_down.png")
      return "#{battler_name}_down"
    else
      if type == "enemy" ; return "$Slime down"
      elsif type == "actor" 
        # This little code gets the downset from the prefix.
        pre = battler_name.split("-")[0].to_i
        if pre >= 1 and pre <= 16 ; return "$Slime down"
        elsif pre >= 17 and pre <= 32 ; return "$Slime down"
        elsif pre >= 33 and pre <= 48 ; return "$Slime down"
        else ; return "$Slime down"
        end
      end
    end
  end
  def self.down_x(id, type = "enemy")
    # The X of the downset here. To add enemy, add below "enemy", else add below "else"
    case type
    when "enemy"
      case id
      when 5 ; r = 1
      else ; r = 0
      end
    else
      case id
      when 1 ; r = 0
      when 2 ; r = 1
      when 4 ; r = 2
      when 5 ; r = 1
      when 6 ; r = 2
      when 8 ; r = 1
      else ; r = 0
      end
    end
    return r
  end
  def self.down_y(id, type = "enemy")
    list = []
    # The Y of the downset here. To add enemy, add below "enemy", else add below "else"
    case type
    when "enemy"
      case id
      when 0 ; r = 0
      else ; r = 0
      end
    else
      case id
      when 1 ; r = 0
      when 2 ; r = 2
      when 3 ; r = 3
      when 5 ; r = 1
      when 6 ; r = 1
      when 7 ; r = 3
      when 8 ; r = 1
      else ; r = 0
      end
    end
    return r
  end
  #-----------------------------------------------------------
  # End Downsets by Nick
  #-----------------------------------------------------------
end
 
GUBID!!!! How do I "make" the water in the isometric battle so I can use the "walk on water" status to walk over it?
And, do you know if the "weapon unleash" have some incompatibility with your system? (I'll need some kind of "vorpal strike" for my game, then Im looking for this script, but had not the time to test it yet)

2nd, is there a way to make a skill with the ability to teleport? Basically, you use the skill, you have a range you can choose and you choose a square, the script you call then transports the character from their starting position to the selected destination, much as teleport from FFT works (without the failure rate, because this skill will cost MP)

If 'im not wrong, there is this teleport skill in the demo... you just have to implement

3rd, does your script work with scripts that allow for individual character inventories?
Ive tried the "individual system" without success, maybe its just me, idk.

4th, Is there an option in the AI that you can set enemies to go for a specific tile, actor or event, (such as in FF3/6 when the sprites advance toward Bannon) or can the AI only have the goal of like 'killing all actors(player controlled people)'
actually the only option is for him to kill ya all. Maybe the Gubid may do something about it XD

5th i noticed you answer one question in that you need to remove something in the script called battler_clear(true) or something, I removed it only in the area you specified, but when I did a search of all the scripts, that same line of code appears in other places, do those need to be removed/commented out?

Only in the area he said it had to be comented/deleted, i was at first confused but when I comented this only line it worked just fine.

6th, is there a way(with your script) to add multiple commands/areas where skills can be? For example, instead of just 'skills' or whatever you rename it to, can you have Attack, white magic, black magic, defend, move, wait, status, etc?
You will need to do some work here, buz if im not wrong, the skills and others are some line of codes in the menu... soo it might not be so easy to work over... =\

7th, I haven't tested this myself, but is it possible to have more than one battle per map? What I'm trying to go for are dungeons that have enemies scattered in them, where if you bump into one it goes into a battle, similar to chrono trigger, except that the battles would obviously be strategy based, not rpg based. Or can you only do one battle per map?

there is in this topic an script that allows you to make different battlemaps for different areas in the map... its not the same thing (you will be teleported to a second map, depending on what area you are, this means, there are a lot of areas and each one will teleport you to a diferent battlemap, as I said... not the same thing...)

8th, I'm still not entirely understanding how the enemy-sprite thing works. I understand how it FINDS the file, I'm just not getting how it... uses it. For example, when I try to use the 'slime' in your demo as a character in VX, it highlights different sprites within the slime template, instead of all the sprites (as is common in vx), or a single sprite in a certain directional facing (As in xp). So how does your script interpret which character sprite to use out of say, 'actor1', which has 4 or 6 different characters in it? Do you have to divide up actor1 into multiple different templates, or can you specify which section you want to use? The main reason I'm concerned with this is I plan to have a lot of human enemies, which will involve using like actor1, actor2, people1, etc.

dont try to understand... just take THAT, the game will look into the sprites name, and will search in the battlers for a sprite with the SAME NAME, and when it dies, he will search for a sprite with the "same name_down". Just it, if you are facing any problem as when you select the sprite to be a character then you might be having a diferent problem, maybe forgot to place the $ in the front of the name, thing like that.


9th, Is it possible to have non-fighting/turn taking events that have HP and take up space? In this case I'm thinking of something like a tree, a wall, a rock that would have HP, maybe even 'defense' and can be destroyable. This doesn't happen in FFT, but if you've ever played some of the Front Mission games, this would be a nice feature.

There is a "condition" (status, idk) that is called DONT ACT, you may do a monster or a player/neutral that actually have this status "on", there is also the dont act and the walk on water feature...

11th, if there is a spell that ends a battle, like Egress from Shining force, is there a function in your script to restore that particular battle to its defaults and then re-start it if the player enters the same area, or does whatever they did to initiate the battle in the first place?

I dont think so... maybe you will need to do certain things like stop and save the current battle in another file then rescue it when entering in another battle... =\

12th, What things from the database do NOT transfer to battles? For example, does extra critical under the actor tab, dual strike or whatever under the weapons tab and absorb damage under the skills tab transfer over into your battle system like normal, or are extra steps needed to make one actor do more criticals, one weapon attack twice, or one skill absorb hp damage as hp healing for the user?

Hey, it even does work the Multiple weapon 777 XD, I think it might transports everything, until now all worked just fine. Lets wait for Gubid answer.

13th, When 'placing' your actors, is there a way to scroll through (like L1/R1 in FFT, to skip characters that you don't want to add?)
Its a good idea :), maybe Gubid can feature that for us XD
 
Quick question. In what section of your scripts is it drawing the movement tiles onto the screen based on a characters mov stat? Basically i have my own tactics system already set up with my own coding, but my movement system sucks. What scripts would i have to add in to my game and what kind of changes would i have to make so that when i select my mov option in my game i can call on your scripts to display the movement tiles around a character based on his mov stat?
 
yeah i kind of figured. I guess what i was wondering is how did he get those tiles to display and check against terrain? This sucks cuz im pretty newbish when it comes to scripting. Is there any way i can do what he did for his movement through event scripting instead of using ruby? I have a pretty much fuly functional tactics engine that i programmed through events and what not, but my movement system isn't all that and would love to do one like he did in his script with the tiles displaying. Is it possible to do it through events? How would you check against terrain and all that? Any kind of help is appreciated. I'm lost and will credit anyone who can really set me on the right track here.
 
you need to do a routine that do this "thing"
when you select a character he will see its X-Y position and the max range he can walk, then do a vector calc doing a sum of your actual position to all possible finals, then you have to "full" it up with a "check routine"... after that you need to check if the desired position is on the "matrix" you've done.
 
Ouch, so in other words there is no way a tile routine like that can be done without a ruby script, since i don't believe the event editor has any array options to make a matrix and no vector options.
 
well... you can do it using events, but not "ONLY", maybe just ONE routine with the array or matrix and getting the value and dropping it in a "temp_var" should do it for you... its nothing extemely dificult, I could help you if I knew something about Ruby language =\

Gubid, Ive a few Questions

Why is it commented?
Code:
class Game_Troop
  EXTRA_TROOPS = {
  1 => [1,1,1,1,1],
  34 => [1]
  }
  
  alias gmtroop_extra_troops_setup setup
  def setup(troop_id)
    reset
    if EXTRA_TROOPS.keys.include?(troop_id)
      for id in EXTRA_TROOPS[troop_id]
        $data_troops[troop_id].members.push(Member.new(troop_id, id))
        #$game_troop.members.push(Game_Enemy.new($data_troops[troop_id].members.size-1, id))
        #actor = $game_troop.members.last
        #if actor != nil
        #  actor.moveto(x, y)
        #  $game_system.tactics_enemies.push(actor)
        #  @spriteset.enemy_sprites.push(Sprite_Battler_GTBS.new(@spriteset.viewport1, actor))
        #end
        #actor.blink = false
      end
    end
    gmtroop_extra_troops_setup(troop_id)
  end
end

also... why is this option buggy?
Code:
 #-------------------------------------------------------------
  # Sets Damage Display during battle to POP individually or not
  # Default is TRUE = IT IS BUGGY, DO NOT CHANGE
  #-------------------------------------------------------------
  POP_DAMAGE_IND = true #TRUE, if I turn it to FALSE it will just "hit eternally" the target


And about the Summon, is there a WAY to just make MORE summon spells?

Ow, and those "area based battle-maps" you did some weeks ago were for XP or VX? i could not manage to find (too many pages) and I was thinking on adding something like it...
 
as an update of my earlier issue, I'm still having issues with the downed images. I tried using a template that is definitely good (the slime_down template) and the game doesn't freeze when the actor goes down, but the image is blank after the fact. Gubid, what could be the problem?

update: I've been looking into the script more while I wait, and I have solved the issue to a certain extent. The enemies that are killed show the cross grave as their down image, however the actors still show up as blank. Could it have something to do with the fact that I used 'place' as the titles of the events? If so, is there a way to alter this?

2nd update: No, it looks like even when I use 'actor1, actor2' in the events the dead still show up blank.. this is odd, because I've put all the references to deadsprites to the same template, which works fine for enemies.
 
I'm actually willing to pay anyone who can help get a movement system similar to what Gubid did working in my game. I was actually leaning more towards what they did in shining force. The movement tiles were displayed wherever you were allowed to walk, and then you were given automatic control of the character and you could walk anywhere within those boundaries. If i can somehow get the tiles to display properly depending on terrain and the characters movement stat than i should have no problem doing this.
 
Yes, you simply need to update the def animation1 method for enemies/actors to check their id or equipment id or something to trigger the desired animation id.  The thing is that VX doesnt have a built in animation id for 'actions' and everything will have to be scripted.  However it should be pretty easy.  I would recommend something like this..
Code:
  def animation1
    case @current_action.kind
    when 0 #physical attack
      case self.enemy_id
      when 1; return 1
      when 2; return 2
      when 3; return 3
      when 4; return 4
      else; return super
      end
    when 1 #skill
      return super
    when 2 #item
      return super
    end
  end


I'm using XP . . . Maybe I misunderstood, but the Anim ATTACK! is required for each sprite--enemy or actor--in order to perform their attack graphic in the template.  But you cannot add a sound effect to the Anim ATTACK! animation (it will be silent).  So . . . is it possible to retain the attack animation while adding a unique attacking sound effect, i.e. a goblin swinging a sword before a separate sound hitting the target (target anim).  Sorry if I misunderstood, and thanks for your help!
 
(VX version)
I combining the script with KGC day/night system, but when a battle starts, it resets to the regular Tone.
How can I change that?
 
uresk":21l5ldij said:
(VX version)
I combining the script with KGC day/night system, but when a battle starts, it resets to the regular Tone.
How can I change that?
just use an EXTRA and call the script to recall the last "daily situation"
 
lucas..
1. Not sure, never tested it.  Try it and let me know.  It fully depends on what they change in the default battle system on whether or not it will work.
2. There is a teleport skill, however it does have the failure rate stuff built in.  And is not used as a skill, but a 'State' for the actor.  If you have the state 'teleport' or 'teleport2' when you move, then the entire movable area will be highlighted.. you then must select an area and it will calculate failure rates and attempt movement.  You could setup a skill to do that for you as well, but as of now it would be a rather pain to do it.
3. I would guess not, but probably wouldnt be that hard to implement.
4. yeah.. You cannot set them to attack to a specific x,y or the like.  They will attack the closest target with the least health or least defense/health ratio.
5. Only delete the one I mentioned.  I know it exist in other places, but if you remove those, then you will have problems of never being able to take an action after 1 has been performed.
6. I am looking at changing the way the attack/skill menu's work so that they will pop a smaller window with your options in it.  Such as your 2 swords, or your sword or shield.  Also to use multiple skills.  This will be part of the GTmenu script that I will eventually release.
7. Yeah, its around page 6 or something.  Possible but in my opinion would be easier to make smaller maps.
9. My suggestion is to create a unit with its hp but dont give it any actions, then set its move in the system to 0.
11. Hmm.. interesting concept.  Is it something like a escape skill?  You can have it run a common event which will run a script to end the battle.  Other than that... no.  As for the restart battle, same as above..but you could encounter some problems.  I would say something like a $scene = Scene_Battle_TBS.new would do the trick.  However you would want to get back to the map first.. then go to back to the battle.  Otherwise then the return map may be messed up.
12. Yeah it will bring over everything.  It uses th default system in that respect.
13. Already does it, use L/R, which is usually Q/W or PgUp/PgDn

Ruben52..
That would be Sprite_Range, just give it a x,y and type to determine color/opacity
Thats about it.  You are free to use it if you would like.

Lucas.. it is and it isnt.  Most of the parts that are pulled into battle are, but in XP it is less so, because the system is not as modular.  I am however remaking the system almost entirely to make it more modular for the next release.
 
How would i call the sprite_range script from an event, and how do i assign terrain types different values that alters the different paths of the sprites range?
 
thanks gubid, based on the code I showed you before, do you know why it would be that actors are the only ones who aren't showing the right down image when they die? It just shows up as blank.
 

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