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)

Unclesatan":2eljzcls said:
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 :)
I had some problems with enabling fogs myself. I usually use a script to enable the fog as I'm using the double fog script, but it wouldn't let me do that in battle for some reason.
The only way I could enable a fog in battle was to use an event "extra" with parallell process.
This is how I set up the event:

@>Wait: 1 frame(s)
@>Change Map settings:Fog = 'FogName', 0, 150, Normal, 200, 0, 0
@>Control Self Switch: A =ON
@>
 
Unclestan...
Code:
class Spriteset_Battle_GTBS
  alias les_spriteset_map_initalize initialize
  alias les_spriteset_map_dispose dispose
  alias les_spriteset_map_update update
  def initialize
    @light_effects = []
    setup_lights
    les_spriteset_map_initalize
    update
  end
  def dispose
    les_spriteset_map_dispose
    for effect in @light_effects
      effect.light.dispose
    end
    @light_effects = []
  end
  def update
    les_spriteset_map_update
    update_light_effects
  end
  def setup_lights
    for event in $game_map.events.values
      next if event.list == nil
      for i in 0...event.list.size
        if event.list[i].code == 108 and event.list[i].parameters == ["GROUND"]
          type = "CANDLE"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 2
          light_effects.light.zoom_y = 2
          light_effects.light.opacity = 100
          @light_effects.push(light_effects)
        end
        if event.list[i].code == 108 and event.list[i].parameters == ["FIRE"]
          type = "FIRE"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 300 / 100.0
          light_effects.light.zoom_y = 300 / 100.0
          light_effects.light.opacity = 100
          @light_effects.push(light_effects)
        end
        if event.list[i].code == 108 and event.list[i].parameters == ["LIGHT"]
          type = "LIGHT"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 1
          light_effects.light.zoom_y = 1
          light_effects.light.opacity = 150
          @light_effects.push(light_effects)
        end
        if event.list[i].code == 108 and event.list[i].parameters == ["LIGHT2"]
          type = "LIGHT2"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 6
          light_effects.light.zoom_y = 6
          light_effects.light.opacity = 150
          @light_effects.push(light_effects)
        end
        if event.list[i].code == 108 and event.list[i].parameters == ["TORCH"]
          type = "TORCH"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 6
          light_effects.light.zoom_y = 6
          light_effects.light.opacity = 150
          @light_effects.push(light_effects)
        end
        if event.list[i].code == 108 and event.list[i].parameters == ["BLUEGLOW"]
          type = "BLUEGLOW"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 1
          light_effects.light.zoom_y = 1
          light_effects.light.opacity = 180
          @light_effects.push(light_effects)
        end
      end
    end
    for effect in @light_effects
      case effect.type
      when "CANDLE"
        effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
        effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
        effect.light.blend_type = 1
      when "FIRE"
        effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3
        effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3
        effect.light.tone = Tone.new(255,-100,-255,   0)
        effect.light.blend_type = 1
      when "LIGHT"
        effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
        effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
        effect.light.blend_type = 1
      when "LIGHT2"
        effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
        effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
        effect.light.blend_type = 1
      when "TORCH"
        effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
        effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
        effect.light.tone = Tone.new(255,-100,-255,   0)
        effect.light.blend_type = 1
      when "BLUEGLOW"
        effect.light.x = (effect.event.real_x - -45 - $game_map.display_x) / 8 - 20
        effect.light.y = (effect.event.real_y - 100 - $game_map.display_y) / 8
        effect.light.tone = Tone.new(-90,-90,255,   0)
        effect.light.blend_type = 1
      end
    end
  end
  def update_light_effects
    if $game_switches[1]
      for effect in @light_effects
        next if effect.type == "FIRE" || effect.type == "TORCH"
        effect.light.visible = false
      end
    else
      for effect in @light_effects
        next if effect.type == "FIRE" || effect.type == "TORCH"
        effect.light.visible = true
      end
    end
    for effect in @light_effects
      case effect.type
      when "CANDLE"
        effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
        effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
        effect.light.opacity = rand(30+90) + 165
      when "FIRE"
        effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3
        effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3
        effect.light.opacity = rand(10) + 90
      when "LIGHT"
        effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
        effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
      when "LIGHT2"
        effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
        effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
      when "TORCH"
        effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 + rand(20) - 10
        effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8 + rand(20) - 10
        effect.light.opacity = rand(30) + 70
      when "BLUEGLOW"
        effect.light.x = (effect.event.real_x - -45 - $game_map.display_x) / 8 - 20
        effect.light.y = (effect.event.real_y - 100 - $game_map.display_y) / 8
        effect.light.opacity = rand(30+90) + 165
      end
    end
  end
end
Code:
class Spriteset_Battle_GTBS
  alias wora_mulfog_sprmap_crepal create_parallax
  alias wora_mulfog_sprmap_updpal update_parallax
  alias wora_mulfog_sprmap_dispal dispose_parallax
  
  def create_parallax
    @mulfog = []
    @mulfog_name = []
    @mulfog_hue = []
    wora_mulfog_sprmap_crepal
  end
  
  def update_parallax
    wora_mulfog_sprmap_updpal
    $game_map.mulfog_name.each_index do |i|
      next if $game_map.mulfog_name[i].nil?
      # If fog is different than current fog
      if @mulfog_name[i] != $game_map.mulfog_name[i] or @mulfog_hue[i] != $game_map.mulfog_hue[i]
        @mulfog_name[i] = $game_map.mulfog_name[i]
        @mulfog_hue[i] = $game_map.mulfog_hue[i]
        if @mulfog[i].nil?
          @mulfog[i] = Plane.new(@viewport1)
          @mulfog[i].z = 3000
        end
        if @mulfog[i].bitmap != nil
          @mulfog[i].bitmap.dispose
          @mulfog[i].bitmap = nil
        end
        if @mulfog_name[i] != ''
          @mulfog[i].bitmap = Cache.load_bitmap('', @mulfog_name[i], @mulfog_hue[i])
        end
        Graphics.frame_reset
      end
      next if @mulfog[i].bitmap.nil?
      # Update fog plane
      @mulfog[i].zoom_x = ($game_map.mulfog_zoom[i] / 100.0) if @mulfog[i].zoom_x != ($game_map.mulfog_zoom[i] / 100.0)
      @mulfog[i].zoom_y = ($game_map.mulfog_zoom[i] / 100.0) if @mulfog[i].zoom_y != ($game_map.mulfog_zoom[i] / 100.0)
      @mulfog[i].opacity = $game_map.mulfog_opacity[i] if @mulfog[i].opacity != $game_map.mulfog_opacity[i]
      @mulfog[i].blend_type = $game_map.mulfog_blend_type[i] if @mulfog[i].blend_type != $game_map.mulfog_blend_type[i]
      @mulfog[i].ox = ($game_map.display_x / 8.0 + $game_map.mulfog_ox[i]) if @mulfog[i].ox != ($game_map.display_x / 8.0 + $game_map.mulfog_ox[i])
      @mulfog[i].oy = ($game_map.display_y / 8.0 + $game_map.mulfog_oy[i]) if @mulfog[i].oy != ($game_map.display_y / 8.0 + $game_map.mulfog_oy[i])
      @mulfog[i].tone = $game_map.mulfog_tone[i] if @mulfog[i].tone != $game_map.mulfog_tone[i]
    end
  end
  
  def dispose_parallax
    @mulfog.each_index do |i|
      next if @mulfog[i].nil?
      @mulfog[i].bitmap.dispose if !@mulfog[i].bitmap.nil?
      @mulfog[i].dispose
    end
    wora_mulfog_sprmap_dispal
  end
end
As for the scrolling.. its because the cursor auto sets itself to the players position at the start of battle.  But if the players position is not where actor1 is, then it does that initial scroll thing.  I will correct that in a later update.

Help window will be corrected in the next update.
 
You put them in scene_battle, correct?  Well, I put in fogs, then when I put in the light effects, it worked fine until I started battle.

Then it said "Stack level too deep" for an error message.

Sorry for all the trouble >_<
 
Lucas Scoppio":3h1dsiv3 said:
maybe you should just add as a new script under the GTBS system, see if it works
I tried putting it in Light Effects, and one other.  Good idea though, I'll try to do that.

Edit: Nevermind, it gives me the same error message.
 
the stack problem is due to an "pre-load" of a variable that do exist but was not specifically set, or calls for a function that are not ready already... its not too easy to cover =\
 
Odd.  you should only need to insert them below the TBS.  Anyway, here is your updated scripts file that i already fixed.
LINK
Stack Level too deep, generally means that you are calling the currently executed method over within itself.  So in other words to finish update you have to run update.. but to finish update you have to run update.. etc.
 
Thank you very much Gubid :)

Wahhh, now it's coming up with something new, except it doesn't crash the game.

It says

"need scroll"
8

Whenever I'm in battle and it scrolls. :|
 
Lol.. oops, forgot to pull the debug lines.
Search "p 'need scroll', direction" and remove the 2 entries.  That should resolve it.
 

Kazil

Member

Link for VX's script is broken. or its just me?


EDIT: Nvm, worked now, i wonder why it didn't work in Mozilla but it did on IE.
 
Hum... soo... how you are doing with the script? its rolling? its stoped? you real life comes firts? EHheheheh

Sorry to bother, I just want to be up to date with the improvements (mouse/bigger monstas)
 
No real update.  Work has gotten really busy.  I havent had anytime to program.  Hopefully soon, but I cannot guarantee anything.
 
anyway, I've a question now, ive seen that when you put your target over a an impassable tile it just "jumps up" like it was a higher ground? there is or there is not any "elevation" feature in the isometric battle?
 
I have a question, is it possible to interact with objects on the battle and make them affect the enemy as well? Like for example, I'm standing on a cliff and there's a rock in front of me, at the bottom of the cliff there's an enemy, is it possible that I can roll the rock down at him and kill him with it?
 
Ynlraey, it is possible, but you might need to do a few things like:

The rock may be "dropped" using an animation, when it hit the "ground"(ends animation) you have to, in script, check if an enemy or player were in the "landing point", then aply any damage if it applies.... It's quickly explained in GTBS help in script... unfortunately I cant help you much more cus I know almost nothing about script RGSS.
 

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